diff --git a/.editorconfig b/.editorconfig index 404ff0701c..fc4ed3486f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,5 +5,5 @@ indent_size = 4 trim_trailing_whitespace = true insert_final_newline = true -[{*.json,*.yml,*.ts}] +[{*.json,*.yml,*.ts,*.tsx,*.md}] indent_style = space diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 94701801da..bff753c62a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -9,7 +9,8 @@ /types/absolute/ @AyaMorisawa /types/abstract-leveldown/ @MeirionHughes @danwbyrne /types/acc-wizard/ @cyrilschumacher -/types/accept-language-parser/ @kampfgnom +/types/accept/ @feinoujc +/types/accept-language-parser/ @kampfgnom @chatoo2412 /types/accepts/ @bomret @brikou /types/accounting/ @gerich-home @chrisleck /types/ace/ @Diullei @@ -18,7 +19,9 @@ /types/acorn/ @RReverser @e-cloud /types/actioncable/ @zhu1230 @szechyjs /types/actions-on-google/ @joelhegg +/types/active-win/ @BendingBender /types/activedirectory2/ @pasthelod +/types/activestorage/ @cbothner /types/activex-access/ @zspitz /types/activex-adodb/ @zspitz /types/activex-adox/ @zspitz @@ -45,13 +48,16 @@ /types/activex-word/ @zspitz /types/adal-angular/ @unindented @aciccarello /types/add-zero/ @Roaders +/types/adlib/ @Esri @MikeTschudi /types/adm-zip/ @jvilk @abner /types/adone/ @s0m3on3 @maxveres +/types/aes-js/ @federicobond /types/aframe/ @devpaul @bertoritger @twastvedt /types/agenda/ @meirgottlieb @princjef /types/agent-base/ @Shinigami92 /types/aggregate-error/ @BendingBender /types/agora-rtc-sdk/ @menthays +/types/airbnb-prop-types/ @milesj /types/ajv-errors/ @afshawnlotfi /types/ale-url-parser/ @msn0 /types/alertify/ @jjeffery @@ -61,9 +67,12 @@ /types/algoliasearch/ @cbaptiste @haroenv @aherve @samouss @keichinger /types/ali-app/ @taoqf /types/ali-oss/ @ptrdu +/types/all-keys/ @BendingBender +/types/all-property-names/ @BendingBender /types/allure-js-commons/ @zaqqaz /types/almost-equal/ @cmaddalozzo /types/alt/ @Shearerbeard +/types/amap-js-sdk/ @agasbzj /types/amazon-cognito-auth-js/ @scottescue /types/amazon-product-api/ @MattiLehtinen @alien35 /types/amcharts/ @ldrick @@ -154,12 +163,13 @@ /types/animejs/ @A-Babin /types/annyang/ @hisham @theluk /types/ansi/ @Gustavo6046 -/types/ansi-colors/ @rogierschouten +/types/ansi-colors/v1/ @rogierschouten +/types/ansi-colors/ @rogierschouten @BendingBender /types/ansi-escape-sequences/ @aomarks /types/ansi-escapes/ @jacobbubu -/types/ansi-regex/ @mvachhar +/types/ansi-regex/ @mvachhar @ffflorian /types/ansi-styles/ @brynbellomy @plylrnsdy -/types/ansicolors/ @rogierschouten +/types/ansicolors/ @balupton /types/antlr4/ @mcchatman8009 /types/antlr4-autosuggest/ @jonfreedman /types/any-db/ @rogierschouten @@ -175,6 +185,7 @@ /types/apollo-codegen/ @bradleyayers @kostspielig /types/apollo-upload-client/ @Slessi /types/apostrophe/ @afholderman +/types/app-module-path/ @darkwebdev /types/app-root-dir/ @chenyang-biu /types/app-root-path/ @shantmarouti /types/appdmg/ @unindented @@ -196,9 +207,11 @@ /types/argparse/ @arcticwaters @tlaziuk @eps1lon /types/args/ @Slessi /types/argv/ @hookclaw +/types/arr-diff/ @BendingBender /types/arr-union/ @mrmlnc /types/array-find-index/ @samverschueren /types/array-foreach/ @skysteve +/types/array-move/ @BendingBender /types/array-sort/ @DanielMSchmidt /types/array-uniq/ @DanielRosenwasser /types/array-unique/ @CSLTech @@ -212,13 +225,14 @@ /types/asenv/ @remisery /types/asn1js/ @microshine /types/aspnet-identity-pw/ @jt000 -/types/assert/ @nicoabie +/types/assert/ @nicoabie @LinusU /types/assert-equal-jsx/ @seryl /types/assert-plus/ @KostyaTretyak /types/assertsharp/ @brunolm /types/assets-webpack-plugin/ @kryops /types/astring/ @nkappler -/types/async/ @borisyankov @kern0 @Penryn @fenying @pascalmartin +/types/async/ @borisyankov @kern0 @Penryn @fenying @pascalmartin @Dmitri1337 +/types/async-busboy/ @hirochachacha /types/async-cache/ @BendingBender /types/async-lock/ @elisee @afharo @rhymmor /types/async-polling/ @Goldsmith42 @@ -231,6 +245,7 @@ /types/atlaskit__inline-edit/ @lstanden /types/atlaskit__layer/ @lstanden /types/atlaskit__single-select/ @lstanden +/types/atlaskit__tree/ @benhjames /types/atlassian-crowd-client/ @mtgto /types/atmosphere.js/ @toedter @Mory1879 @Scipion /types/atob/ @johngeorgewright @@ -240,7 +255,7 @@ /types/atpl/ @soywiz /types/audiosprite/ @Perlmint /types/auth-header/ @ForbesLindesay -/types/auth0/ @westy92 +/types/auth0/ @westy92 @ianhowe76 @dauledk /types/auth0-angular/ @homesar /types/auth0-js/v7/ @advancedrei /types/auth0-js/ @adrianchia @mdurrant @peterblazejewicz @@ -249,14 +264,15 @@ /types/auto-bind/ @sseppola /types/auto-launch/ @rhysd @unindented /types/auto-sni/ @janwo -/types/autobahn/ @darkl @valepu +/types/autobahn/ @darkl @a904guy @valepu @glenroy37 /types/autolinker/ @leonyu /types/autoprefixer/ @odnamrataizem @murt /types/autosize/ @kingdango @keika299 @NeekSandhu /types/autosuggest-highlight/ @senukartur +/types/await-timeout/ @szhu /types/awesomplete/ @webbiesdk @bmdixon @tbekolay @chrislopresto /types/aws-iot-device-sdk/ @niik @mlamp -/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase @repl-chris @aneilbaboo @jeznag @louislarry @dpapukchiev @ohookins @trevor-leach @jagregory +/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex @MichaelMarner @daniel-cottone @kostya-misura @coderbyheart @palmithor @daniloraisi @simonbuchan @Haydabase @repl-chris @aneilbaboo @jeznag @louislarry @dpapukchiev @ohookins @trevor-leach @jagregory @dalen /types/aws-serverless-express/ @threesquared @jcaffey @mattmeye @albertovasquez /types/aws4/ @ajcrites /types/axe-webdriverjs/ @JoshuaKGoldberg @@ -279,20 +295,19 @@ /types/babel__code-frame/ @mohsen1 @ForbesLindesay /types/babel__core/ @yortus @marvinhagemeister @mgroenhoff /types/babel__generator/ @yortus @johnnyestilles @mgroenhoff -/types/babel__parser/ @yortus @marvinhagemeister @mgroenhoff /types/babel__template/ @yortus @marvinhagemeister @mgroenhoff /types/babel__traverse/ @yortus @marvinhagemeister @rpetrich @mgroenhoff /types/babelify/ @TeamworkGuy2 @marvinhagemeister /types/babylon/ @yortus @marvinhagemeister /types/babylon-walk/ @czbuchi /types/babyparse/ @cdiddy77 -/types/backbone/ @borisyankov @nvivo @kenjiru +/types/backbone/ @borisyankov @nvivo @kenjiru @jjoekoullas /types/backbone-associations/ @craigbrett17 /types/backbone-fetch-cache/ @delphinus35 /types/backbone-relational/ @eirikhm /types/backbone.layoutmanager/ @hejiang2000 /types/backbone.localstorage/ @lgrignon -/types/backbone.marionette/ @zhamid @nvivo @sventschui @razorness @confususs +/types/backbone.marionette/ @zhamid @nvivo @sventschui @razorness @confususs @jjoekoullas /types/backbone.paginator/ @Nyamazing /types/backbone.radio/ @alphaleonis /types/backgrid/ @jlujan @@ -300,14 +315,19 @@ /types/backo2/ @Retsam /types/backoff/ @BendingBender /types/baconjs/ @alexander-matsievsky @gekkio +/types/badgen/ @m5d215 /types/bagpipes/ @micmro +/types/baidu-app/ @taoqf +/types/bandagedbd__bdapi/ @Acidic9 /types/barbellweights/ @evelijn /types/barcode/ @pvomhoff /types/bardjs/ @TepigMC /types/base-64/ @dolanmiu -/types/base-x/ @chrootsu +/types/base-x/v1/ @chrootsu +/types/base-x/ @chrootsu @BendingBender /types/base16/ @alechill /types/base64-arraybuffer/ @jbencook +/types/base64-async/ @BendingBender /types/base64-js/ @pe8ter /types/base64-url/ @urish /types/base64topdf/ @lucasriondel @@ -316,12 +336,14 @@ /types/basic-auth/ @moonpyk @vesse /types/basicauth-middleware/ @nchaulet /types/batch-stream/ @drudge +/types/battery-level/ @BendingBender /types/bazinga-translator/ @alexndlm /types/bcrypt/ @codeanimal @IOAyman @dstapleton92 /types/bcryptjs/ @RafaelKr @branoholy /types/bdfjs/ @jeremejevs /types/beats/ @urish /types/bech32/ @micksatana +/types/beeper/ @BendingBender /types/behavior3/ @carrrywu /types/bell/ @SimonSchick /types/bem-cn/ @selkinvitaly @@ -329,7 +351,7 @@ /types/better-curry/ @pocesar /types/better-queue/ @maozedong /types/better-scroll/ @stoneChen @cnjack -/types/better-sqlite3/ @Morfent @matrumz +/types/better-sqlite3/ @Morfent @matrumz @sant123 @loghorn /types/bezier-easing/ @ptlis /types/bezier-js/ @danmarshall @Epskampie /types/bgiframe/ @sumegizoltan @@ -340,7 +362,9 @@ /types/bignum/ @Patman64 /types/bigscreen/ @dduugg /types/bin-pack/ @orentrutner -/types/binary-parser/ @riggs @dolanmiu +/types/bin-version/ @BendingBender +/types/binary-parser/ @riggs @dolanmiu @yuhr +/types/binaryextensions/ @BendingBender /types/bind-ponyfill/ @skysteve /types/bindings/ @unindented /types/bintrees/ @CjS77 @@ -352,7 +376,7 @@ /types/bitcoinjs-lib/ @mhegazy @dlebrecht @rbuckton @micksatana @youssefgh @kento1218 /types/bitcore-lib/ @lautarodragan /types/bittorrent-protocol/ @feross @tlaziuk -/types/bitwise-xor/ @rogierschouten +/types/bitwise-xor/ @rogierschouten @BendingBender /types/bl/ @Bartvds @reconbot /types/blacklist/ @mhegazy /types/blazy/ @julienpa @@ -374,9 +398,10 @@ /types/bluebird-global/ @d-ph /types/bluebird-retry/ @pvomhoff /types/blueimp-md5/ @rmartone @mkohlmyr -/types/bn.js/ @LogvinovLeon @HenryNguyen5 +/types/bn.js/ @LogvinovLeon @HenryNguyen5 @Gilthoniel /types/body-parser/ @santialbo @vilic @dreampulse @blendsdk @tlaziuk @jwalton /types/body-parser-xml/ @tbounsiar +/types/body-scroll-lock/ @kimcoder /types/bonjour/ @quentin-ol @octo-sniffle /types/bookshelf/ @arcticwaters @vesse /types/boom/v3/ @rogatty @@ -407,6 +432,7 @@ /types/bootstrap3-dialog/ @nakupanda @cnboland /types/bounce.js/ @cherrry /types/box2d/ @jbaldwin +/types/boxen/ @BendingBender /types/bpmn-moddle/ @haydos89 /types/brace-expansion/ @BendingBender /types/braces/ @vemoo @@ -425,11 +451,15 @@ /types/browser-resolve/ @marionebl /types/browser-sync/ @joeskeen @aznnomness /types/browserify/ @AndrewGaspar @jvilk @leonard-thieu @LinusU -/types/bs58/ @chrootsu +/types/browserslist/ @davecardwell +/types/browserslist-useragent/ @nju33 +/types/bs58/v3/ @chrootsu +/types/bs58/ @chrootsu @BendingBender /types/bson/ @horiuchi @CaselIT /types/btoa/ @johngeorgewright /types/bucks/ @zaneli /types/buffer-compare/ @chrootsu +/types/buffer-crc32/ @BendingBender /types/buffer-equal/ @Bartvds /types/buffer-from/ @burnnat /types/buffer-reader/ @nrlquaker @@ -438,7 +468,7 @@ /types/bufferstream/ @Bartvds /types/builtin-modules/ @ajafff /types/bull/v2/ @bgrieder @JProgrammer -/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas @bondz @wuha-team @aleccool213 @danmana +/types/bull/ @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas @bondz @wuha-team @aleccool213 @danmana @kjellmorten @pc-jedi /types/bump-regex/ @silkentrance /types/bunnymq/ @cyrilschumacher /types/bunyan/ @amikhalev @@ -457,6 +487,8 @@ /types/bytewise/ @danwbyrne /types/c3/ @mcliment @gerinjacob @denyo @dmitryshindin @timn /types/cache-manager/ @GausSim +/types/cached-path-relative/ @TeamworkGuy2 +/types/cadesplugin/ @Delagen @kmvi /types/cal-heatmap/ @RetroChrisB /types/caller/ @ignocide /types/callsite/ @newclear @@ -468,6 +500,7 @@ /types/camo/ @lucasmciruzzi /types/cancan/ @Vincent-Pang /types/caniuse-api/ @davecardwell +/types/caniuse-lite/ @mutech /types/cannon/ @clark-stevenson @Gelio /types/canvas-confetti/ @matracey /types/canvas-gauges/ @Mikhus @@ -482,12 +515,15 @@ /types/cassandra-driver/ @Svjard @pc-jedi /types/catbox/v7/ @jasonswearingen @AJamesPhillips /types/catbox/ @jasonswearingen @AJamesPhillips @saboya +/types/catbox-memory/ @SimonSchick /types/catbox-redis/ @SimonSchick /types/cbor/ @pushplay /types/ccap/ @taoqf /types/cesium/ @Zuzon @hnipps @szechyjs @golyalpha +/types/cfn-response/ @ivoisbelongtous /types/chai/v2/ @Bartvds @AGBrown /types/chai/ @jedmao @Bartvds @AGBrown @olivr70 @mwistrand @joshuakgoldberg @shaunluttin @Naktibalda @micksatana @ErikSchierboom +/types/chai-almost/ @kclnn /types/chai-arrays/ @clementprevot /types/chai-as-promised/ @jt000 @Kuniwak @leonard-thieu @lazerwalker @mattbishop /types/chai-datetime/ @cliffburger @mattbishop @@ -507,6 +543,7 @@ /types/chai-uuid/ @harm-less /types/chai-webdriverio/ @sherlock1982 /types/chai-xml/ @jedigo +/types/chalk-animation/ @BendingBender /types/chance/ @cbowdon @brikou @cafesanu /types/change-emitter/ @iskandersierra /types/chardet/ @Gebatzens @@ -520,7 +557,7 @@ /types/check-types/ @idchlife /types/checkstyle-formatter/ @mhegazy /types/checksum/ @rogierschouten -/types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao @chennakrishna8 +/types/cheerio/ @blittle @wmaurer @umarniz @LiJinyao @chennakrishna8 @AzSiAz /types/chess.js/ @JacobFischer /types/chessboardjs/ @sliverb @davidmpaz /types/chmodr/ @BendingBender @@ -530,7 +567,7 @@ /types/chownr/ @BendingBender /types/chroma-js/v0/ @invliD /types/chroma-js/ @invliD @mpacholec -/types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 +/types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 @MatCarlson /types/chrome-apps/ @niikoo @AdamLay @pine613 @mzsm @RReverser @pyle @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 /types/chromecast-caf-receiver/ @craigrbruce /types/chromecast-caf-sender/ @samuelmaddock @@ -538,12 +575,17 @@ /types/circuit-breaker-js/ @DeTeam /types/circular-json/ @jpevarnek /types/ckeditor/v2/ @wittwert -/types/ckeditor/ @wittwert @stuartlong +/types/ckeditor/ @wittwert @stuartlong @viktorpegy +/types/ckeditor__ckeditor5-core/ @denisname +/types/ckeditor__ckeditor5-engine/ @denisname +/types/ckeditor__ckeditor5-utils/ @denisname /types/clamp-js/ @Hikariii /types/clamp-js-main/ @sinziananicolae /types/classnames/ @adidahiya @JKillian @seansfkelley @mradamczyk @marvinhagemeister /types/cldrjs/ @RamanBut-Husaim @gcastre -/types/clean-css/ @tkrotoff +/types/clean-css/v3/ @tkrotoff +/types/clean-css/ @tkrotoff @GolaWaya +/types/clean-regexp/ @BendingBender /types/clean-stack/ @BendingBender /types/clean-webpack-plugin/ @j-f1 /types/clear-require/ @dan-j @@ -552,10 +594,14 @@ /types/clearbladejs-server/ @ClearBlade /types/cleave.js/ @clentfort @jasongi-at-sportsbet @sashashakun /types/cli/ @kayahr +/types/cli-box/ @athasach +/types/cli-boxes/ @BendingBender /types/cli-color/ @ChaosinaCan +/types/cli-cursor/ @BendingBender /types/cli-interact/ @ffflorian /types/cli-progress/ @mhegazy /types/cli-spinner/ @janslow +/types/cli-spinners/ @BendingBender /types/cli-table/ @arylo /types/cli-table2/ @mgroenhoff /types/cli-truncate/ @danwbyrne @@ -573,16 +619,18 @@ /types/closure-compiler/ @mprobst /types/cloud-env/ @Morfent /types/cloudflare-apps/ @MartynasZilinskas +/types/clovelced-plugin-audiomanagement/ @marckassay /types/cls-hooked/ @aleung /types/clusterize.js/ @Pr1st0n /types/cmd-shim/ @cspotcode /types/co-body/ @geoffreak /types/co-views/ @devlee @geoffreak /types/code/ @prashaantt -/types/codemirror/ @mihailik @nrbernard @Pr1st0n @rileymiller +/types/codemirror/ @mihailik @nrbernard @Pr1st0n @rileymiller @toddself /types/codependency/ @morphatic /types/coffeeify/ @tkQubo /types/coinbase/ @rogierschouten +/types/coinlist/ @BendingBender /types/coinstring/ @mhegazy /types/collections/ @scarabedore /types/color/v0/ @LKay @@ -594,13 +642,15 @@ /types/color-namer/ @in19farkt /types/color-string/ @BendingBender @danmarshall /types/colorbrewer/ @mtraynham +/types/colornames/ @manuth /types/colresizable/ @gilleswaeber /types/com.darktalker.cordova.screenshot/ @akarienta /types/com.wikitude.phonegap.wikitudeplugin/ @zbarbuto /types/combine-source-map/ @TeamworkGuy2 -/types/combined-stream/ @felixge @tlaziuk +/types/combined-stream/ @felixge @tlaziuk @konpikwastaken /types/combokeys/ @iclanton /types/cometd/ @derekcicerone @unindented @alxHenry +/types/command-exists/ @BendingBender /types/command-line-args/v4/ @CzBuCHi @75lb /types/command-line-args/ @75lb /types/command-line-commands/ @CzBuCHi @@ -610,9 +660,10 @@ /types/commercetools__enzyme-extensions/ @screendriver /types/common-errors/ @icopp /types/common-prefix/ @seangenabe -/types/common-tags/ @zuzusik @tzupengwang +/types/common-tags/ @zuzusik @tzupengwang @BendingBender /types/commondir/ @leonard-thieu /types/commonmark/ @nicojs @leonard-thieu +/types/compare-func/ @fennibay /types/compare-version/ @jpevarnek /types/compare-versions/ @LogvinovLeon /types/complex/ @AyaMorisawa @pavasich @@ -620,12 +671,13 @@ /types/compose-function/ @denis-sokolov /types/compressible/ @BendingBender /types/compression/ @santialbo @rburgt -/types/compression-webpack-plugin/ @dublicator +/types/compression-webpack-plugin/ @dublicator @rhys-vdw /types/compute-quantile/ @mrmlnc /types/compute-stdev/ @mrmlnc /types/concat-stream/ @jmarianer /types/concaveman/ @DenisCarriere /types/conf/v0/ @SamVerschueren +/types/conf/v1/ @SamVerschueren @BendingBender /types/conf/ @SamVerschueren @BendingBender /types/confidence/ @jppellerin /types/config/ @RWander @forrestbice @jndonald3 @albertovasquez @@ -653,6 +705,7 @@ /types/console-ui/ @dfreeman /types/consolidate/ @soywiz @theosherry @nicolashenry /types/consul/ @chrootsu +/types/contains-path/ @BendingBender /types/content-disposition/ @bomret /types/content-type/ @horiuchi @BendingBender /types/contentful-resolve-response/ @antonkarsten @@ -662,21 +715,23 @@ /types/convert-layout/ @xeningem /types/convert-source-map/ @AndrewGaspar @mgroenhoff @TeamworkGuy2 /types/convict/ @Nemo157 @vesse @elyscape @vanthiyathevan -/types/cookie/ @pine613 +/types/cookie/ @pine /types/cookie-parser/ @santialbo @BendingBender /types/cookie-session/ @borislavjivkov /types/cookie-signature/ @lith-light-g /types/cookie_js/ @slawiko /types/cookiejar/ @paroxp /types/cookies/ @WangZishi @jkeylu @BendingBender +/types/copy/ @ffflorian /types/copy-paste/ @SrTobi /types/copy-text-to-clipboard/ @BendingBender /types/copy-webpack-plugin/ @flying-sheep +/types/copyfiles/ @ffflorian /types/cordova-ionic/ @hendrikmaus /types/cordova-plugin-app-version/ @Ritzlgrmft /types/cordova-plugin-background-mode/ @Lordnoname /types/cordova-plugin-badge/ @timbru31 -/types/cordova-plugin-ble-central/ @gjunge +/types/cordova-plugin-ble-central/ @gjunge @peitschie /types/cordova-plugin-bluetoothclassic-serial/ @tuvokki /types/cordova-plugin-canvascamera/ @lordazzi /types/cordova-plugin-device-name/ @larrybahr @@ -706,7 +761,9 @@ /types/countdown/ @gjuchault /types/counterpart/ @santiagodoldan /types/countries-and-timezones/ @zero51 -/types/country-list/ @iRoachie +/types/country-data/ @biltongza +/types/country-list/v1/ @iRoachie +/types/country-list/ @iRoachie @Kimahriman /types/country-select-js/ @humrochagf /types/countup.js/ @shermendev /types/coverup/ @bevalorous @@ -717,6 +774,9 @@ /types/cradle/ @panuhorsmalahti /types/crc/ @YuJianrong /types/create-error/ @tkrotoff +/types/create-hash/ @BendingBender +/types/create-hmac/ @BendingBender +/types/create-html-element/ @BendingBender /types/create-react-class/ @jgoz /types/create-subscription/ @Asana @vsiao /types/createjs/ @evilangelist @gyohk @@ -731,20 +791,25 @@ /types/crossfilter/ @schmuli @iebaker @nordfjord /types/crossroads/ @diullei /types/crpc/ @0xdeafcafe +/types/crumb/ @lenovouser @SimonSchick /types/cryptiles/ @awendland +/types/crypto-hash/ @BendingBender /types/crypto-js/ @misak113 /types/crypto-random-string/ @MrManny /types/cryptojs/ @giabao +/types/cryptr/ @rrogowski /types/cson/ @stpettersens +/types/cson-parser/ @lenovouser /types/csprng/ @winksaville /types/csrf/ @markis /types/css/ @ilich /types/css-font-loading-module/ @slikts /types/css-modules/ @NeekSandhu /types/css-to-style/ @bengry +/types/css-tree/ @erik-kallen /types/cssbeautify/ @rictic /types/cssnano/ @odnamrataizem -/types/csso/ @screendriver +/types/csso/ @screendriver @erik-kallen /types/csurf/ @horiuchi /types/csv-parse/ @davidm77 @obi-jan-kenobi /types/csv-stringify/ @rogierschouten @arjenvanderende @@ -757,11 +822,15 @@ /types/currency-formatter/ @mhegazy @davidmpaz /types/custom-error-generator/ @thmiceli /types/custom-functions-runtime/ @OfficeDev @Zlatkovsky @mscharlock +/types/cwd/ @BendingBender /types/cwise/ @taoqf /types/cwise-compiler/ @taoqf /types/cwise-parser/ @taoqf /types/cybozulabs-md5/ @pine613 +/types/cycled/ @BendingBender +/types/cypress-axe/ @wKovacs64 /types/cytoscape/ @phreed @wy193777 @ypconstante @janniclas @cerberuser +/types/d/ @BendingBender /types/d3/v3/ @gustavderdrache @borisyankov @MatthiasJobst /types/d3/v4/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3/ @tomwanzek @gustavderdrache @borisyankov @denisname @@ -777,9 +846,9 @@ /types/d3-delaunay/ @BTOdell /types/d3-dispatch/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-drag/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-dsv/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-dsv/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-ease/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-fetch/ @ledragon +/types/d3-fetch/ @ledragon @denisname /types/d3-force/ @tomwanzek @gustavderdrache @borisyankov /types/d3-format/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-geo/ @ledragon @tomwanzek @gustavderdrache @borisyankov @@ -796,18 +865,18 @@ /types/d3-request/ @Ledragon @gustavderdrache @borisyankov @tomwanzek @denisname /types/d3-sankey/ @tomwanzek @gustavderdrache /types/d3-scale/v1/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-scale/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-scale/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-scale-chromatic/ @Ledragon @gustavderdrache @borisyankov @henriquefm /types/d3-selection/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-selection-multi/ @gustavderdrache @borisyankov -/types/d3-shape/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-shape/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-time/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-time-format/ @tomwanzek @gustavderdrache @borisyankov /types/d3-timer/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3-tip/ @brspnnggrt /types/d3-transition/ @tomwanzek @gustavderdrache @borisyankov /types/d3-voronoi/ @tomwanzek @gustavderdrache @borisyankov @denisname -/types/d3-zoom/ @tomwanzek @gustavderdrache @borisyankov +/types/d3-zoom/ @tomwanzek @gustavderdrache @borisyankov @denisname /types/d3.slider/ @lk-chen /types/d3kit/ @morphatic /types/d3pie/ @mc-petry @@ -831,7 +900,8 @@ /types/datatables.net-select/ @szechyjs /types/date-arithmetic/ @HeeL /types/date.format.js/ @balrob -/types/dateformat/ @aicest +/types/dateformat/v1/ @aicest +/types/dateformat/ @aicest @BendingBender /types/datejs/ @rupertavery /types/daterangepicker/ @SirMartin @smasala @nertzy /types/dav/ @ToastHawaii @@ -843,10 +913,14 @@ /types/dd-trace/ @ColinBradley @alloy /types/deasync/ @Sicilica /types/debessmann/ @vkorehov -/types/debounce/ @denis-sokolov @joshuakgoldberg +/types/debounce/ @denis-sokolov @joshuakgoldberg @wcarson +/types/debounce-fn/ @BendingBender +/types/debounce-promise/ @whtsky /types/debug/ @swook @galtalmor @zamb3zi @brasten /types/decamelize/ @samverschueren /types/decay/ @enaeseth +/types/decode-entities/ @waspothegreat +/types/decode-uri-component/ @BendingBender /types/decompress/ @plantain-00 @jbethke /types/decompress-response/ @DanielRosenwasser /types/decorum/ @dflor003 @@ -858,6 +932,7 @@ /types/deep-freeze/ @Bartvds @aluanhaddad /types/deep-freeze-es6/ @mattbishop /types/deep-freeze-strict/ @mhegazy +/types/default-gateway/ @BendingBender /types/defaults/ @IbtihelCHNAB /types/defer-promise/ @niklasf /types/define-lazy-prop/ @BendingBender @@ -876,10 +951,13 @@ /types/depd/ @danny8002 @BendingBender /types/dependency-tree/ @joscha /types/deployjava/ @cyrilschumacher +/types/deprecate/ @Toilal +/types/deps-sort/ @TeamworkGuy2 /types/derhuerst__cli-on-key/ @jacobbubu /types/destroy/ @BendingBender /types/destroy-on-hwm/ @BendingBender -/types/detect-browser/ @rogierschouten +/types/detect-browser/ @rogierschouten @carusology +/types/detect-character-encoding/ @BendingBender /types/detect-hover/ @thomastilkema /types/detect-indent/v0/ @Bartvds /types/detect-indent/ @Bartvds @BendingBender @@ -901,17 +979,24 @@ /types/di-lite/ @dcrusader /types/diacritics/ @otociulis /types/dialogflow/ @dyladan +/types/dicer/ @GoupilRobin @BendingBender /types/diff/ @vvakame @szdc @moc-yuto /types/diff2html/ @rtfpessoa +/types/diffie-hellman/ @BendingBender /types/digibyte/ @lautarodragan @werewolfe +/types/dinero.js/ @BendingBender +/types/dir-glob/ @BendingBender /types/dir-resolve/ @andy-ms +/types/dirname-regex/ @BendingBender /types/discontinuous-range/ @OiCMudkips +/types/discord-rpc/ @jasonhaxstuff /types/discourse-sso/ @championswimmer /types/dispatchr/ @Ragg- /types/disposable-email-domains/ @geoffreak +/types/distributions/ @marcolanaro /types/dnssd/ @angelmerino @Maxr1998 /types/doccookies/ @jonegerton -/types/dockerode/ @seikho @nlaplante @isac322 @lazarusx @meisenzahl @thegecko +/types/dockerode/ @seikho @nlaplante @isac322 @lazarusx @meisenzahl @thegecko @CameronDiver @p4sca1 /types/docopt/ @giggio /types/doctrine/ @rictic /types/document-promises/ @NotWoods @@ -919,10 +1004,13 @@ /types/documentdb/ @NoelAbrahams @brettferdosi @ctstone @yifanwu /types/documentdb-server/ @lith-light-g /types/documentdb-session/ @DanielRosenwasser +/types/doge-seed/ @BendingBender /types/dojo/ @vansimke /types/dom-clipboard-api/ @43081j +/types/dom-helpers/ @mctep /types/dom-inputevent/ @diagramatics /types/dom-loaded/ @ltetzlaff +/types/dom-mediacapture-record/ @eliasmeire /types/dom-to-image/ @JipSterk /types/dom4/ @adidahiya @giladgray /types/domo/ @Steve-Fenton @@ -937,18 +1025,19 @@ /types/dotdir-regex/ @mrmlnc /types/dotdotdot/ @milanjaros /types/dotenv/v2/ @jussikinnula @borekb @enaeseth -/types/dotenv/ @jussikinnula @borekb @enaeseth +/types/dotenv/ @jussikinnula @borekb @enaeseth @maxbeatty +/types/dotenv-flow/ @vincentlanglet /types/dotenv-safe/ @krenor -/types/dotenv-webpack/ @karol-majewski +/types/dotenv-webpack/ @karol-majewski @davecardwell /types/dotfile-regex/ @mrmlnc /types/dottie/ @domarmstrong /types/double-ended-queue/ @dsagal /types/doublearray/ @mzsm /types/doubleclick-gpt/ @johngeorgewright @steven-joyce /types/download/ @nicojs -/types/downloadjs/ @cwmoo740 +/types/downloadjs/ @cwmoo740 @josuedevmark /types/dplayer/ @Guanyunhan -/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf @pablopunk +/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar @sulf @pablopunk @claudiopro /types/drag-timetable/ @chinkan /types/draggabilly/ @jaydubu /types/dragster/ @zskovacs @@ -967,11 +1056,11 @@ /types/dustjs-linkedin/ @mdezem /types/dvtng-jss/ @Ptival /types/dw-bxslider-4/ @namerci -/types/dwt/v12/ @yushulx /types/dwt/ @yushulx @jbh @lincoln2018 @Tom-Dynamsoft /types/dygraphs/ @danvk /types/dymo-label-framework/ @thijskuipers /types/dynatable/ @francoismassart +/types/dynatrace/ @alvaro450 /types/dynogels/ @SpartanLabs @ramondeklein @stephentuso /types/each/ @misak113 /types/earcut/ @NaridaL @@ -984,11 +1073,12 @@ /types/easy-xapi/ @DeadAlready /types/easy-xapi-utils/ @DeadAlready /types/ebongarde-root/ @Ebongarde -/types/echarts/ @xieisabug @AntiMoron @liveangela @Ovilia +/types/echarts/ @xieisabug @AntiMoron @liveangela @Ovilia @iRON5 /types/ecma-proposal-math-extensions/ @ksm2 /types/ecurve/ @mhegazy /types/ed25519/ @erikma /types/ed2curve/ @ffflorian +/types/ee-first/ @BendingBender /types/egg-mock/ @sheperdwind /types/egg.js/ @ToastHawaii /types/egjs__axes/ @naver @@ -1007,7 +1097,7 @@ /types/electron-load-devtool/ @prince0203 /types/electron-notifications/ @djpereira /types/electron-notify/ @djpereira -/types/electron-packager/ @SomaticIT @cortopy @jkleinsc @shiftkey +/types/electron-packager/ @SomaticIT @cortopy @jkleinsc @shiftkey @malept /types/electron-settings/v2/ @leonard-thieu /types/electron-settings/ @icopp @nrlquaker /types/electron-spellchecker/ @unindented @@ -1018,10 +1108,10 @@ /types/electron-winstaller/ @shiftkey @unindented /types/elegant-spinner/ @danwbyrne /types/element-ready/ @BendingBender -/types/element-resize-detector/ @saranshkataria +/types/element-resize-detector/ @saranshkataria @franklixuefei /types/element-resize-event/ @rogierschouten @plgregoire /types/elementtree/ @dwieeb -/types/elliptic/ @danwbyrne +/types/elliptic/ @danwbyrne @Gilthoniel /types/elm/ @thSoft /types/email-templates/ @cyrilschumacher @gurisko @blankstar85 /types/ember/v1/ @jedmao @@ -1035,7 +1125,7 @@ /types/ember-modal-dialog/v2/ @tansongyang @mike-north /types/ember-modal-dialog/ @tansongyang @mike-north /types/ember-qunit/v2/ @dwickern @mike-north -/types/ember-qunit/ @dwickern @mike-north +/types/ember-qunit/ @dwickern @mike-north @scalvert @dfreeman /types/ember-resolver/v4/ @dfreeman @mike-north /types/ember-resolver/ @dfreeman @mike-north /types/ember-test-helpers/v0/ @dwickern @mike-north @@ -1062,7 +1152,10 @@ /types/emoji-regex/ @iKBAHT /types/emojione/ @dbrgn /types/empower/ @vvakame +/types/empty-dir/ @BendingBender +/types/empty-trash/ @BendingBender /types/emscripten/ @zakki @periklis +/types/encodeurl/ @BendingBender /types/encoding-down/ @MeirionHughes @danwbyrne /types/end-of-stream/ @strax /types/engine.io/ @KentarouTakeda @@ -1070,8 +1163,12 @@ /types/enhanced-resolve/ @e-cloud @onigoetz @johnnyreilly /types/enigma.js/ @konne /types/enquire.js/ @screendriver +/types/ensure-error/ @BendingBender +/types/ensure-posix-path/ @BendingBender /types/ent/ @rogierschouten /types/entities/ @aliceklipper +/types/env-ci/ @BendingBender +/types/env-editor/ @BendingBender /types/env-paths/ @danwbyrne /types/env-to-object/ @MugeSo /types/envify/ @tkQubo @@ -1079,6 +1176,7 @@ /types/enzyme-adapter-react-15/ @tkrotoff /types/enzyme-adapter-react-15.4/ @nali /types/enzyme-adapter-react-16/ @tkrotoff +/types/enzyme-async-helpers/ @kimehrenpohl /types/enzyme-redux/ @knegusen /types/enzyme-to-json/ @joscha /types/eonasdan-bootstrap-datetimepicker/ @ToastHawaii @@ -1093,6 +1191,7 @@ /types/es6-promisify/ @harryshipton @bschlenk /types/es6-shim/ @rbuckton /types/es6-weak-map/ @pine +/types/escape-goat/ @BendingBender /types/escape-html/ @elisee /types/escape-latex/ @olsio /types/escape-regexp/ @jewbre @@ -1114,10 +1213,10 @@ /types/eth-lightwallet/ @LogvinovLeon /types/ethereum-protocol/ @LogvinovLeon /types/ethereumjs-abi/ @LogvinovLeon -/types/ethereumjs-tx/ @LogvinovLeon +/types/ethereumjs-tx/ @LogvinovLeon @dmihal /types/ethereumjs-util/ @cortopy /types/ethjs-signer/ @doppio -/types/eureka-js-client/ @Schnillz +/types/eureka-js-client/ @Schnillz @karl-run @tombarton /types/evaporate/ @kookster @chrisrhoden @ailrun /types/event-emitter/ @LKay /types/event-emitter-es6/ @ahstro @@ -1126,28 +1225,34 @@ /types/event-loop-lag/ @rogierschouten /types/event-stream/ @flcdrg /types/event-to-promise/ @flying-sheep -/types/events/ @yasupeke -/types/eventsource/ @scottleedavis @afroozeh +/types/events/ @yasupeke @weareoutman +/types/eventsource/ @scottleedavis @afroozeh @snakedrak /types/evernote/ @corps /types/ex-react-native-i18n/ @maplerichie /types/excel-style-dataformatter/ @SanderDeWaal1992 /types/exceljs/ @rogierschouten @alitaheri /types/execa/ @douglasduteil @BendingBender @borekb @mickdekkers +/types/execall/ @BendingBender /types/exenv/ @christianchown +/types/exif/ @ffflorian /types/exit/ @Bartvds /types/exit-hook/ @BendingBender /types/exorcist/ @TeamworkGuy2 +/types/expand-tilde/ @carnesen /types/expect/ @jmreidy @merrywhether /types/expect-puppeteer/ @JoshuaKGoldberg @tkrotoff /types/expect.js/ @teppeis /types/expectations/ @vvakame /types/expired-storage/ @intolerance +/types/expirymanager/ @DanielRose /types/expo/v23/ @KonstantinKai /types/expo/v24/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger /types/expo/v25/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov /types/expo/v26/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @tinaroh /types/expo/v27/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo -/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo +/types/expo/v30/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo +/types/expo/ @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo @levansuper @ihmpavel @burtek @jkillian +/types/expo-localization/ @burtek /types/expo__status-bar-height/ @dawnmist /types/expo__vector-icons/ @incleaf /types/express/ @borisyankov @@ -1170,6 +1275,7 @@ /types/express-formidable/ @tdolsen @evanshortiss /types/express-graphql/ @isman-usoh @nitintutlani @hubel @zya @mlamp @firede /types/express-handlebars/ @stpettersens @yhaskell +/types/express-http-proxy/ @ulrichb @Danscho /types/express-jsonschema/ @atd-schubert /types/express-jwt/ @wokim @kacepe @Sl1MBoy @milan-mimra /types/express-less/ @xieyubo @@ -1184,17 +1290,22 @@ /types/express-paginate/ @AmirTugi /types/express-partials/ @jt000 /types/express-promise-router/ @wanganjun -/types/express-rate-limit/ @cyrilschumacher @makepost +/types/express-rate-limit/v2/ @cyrilschumacher @makepost +/types/express-rate-limit/ @cyrilschumacher @makepost @jdforsythe /types/express-redis-cache/ @ajliv /types/express-route-fs/ @kripod /types/express-routemap/ @icopp +/types/express-routes-versioning/ @weffe /types/express-sanitized/ @cjbarth /types/express-serve-static-core/ @borisyankov @19majkel94 @kacepe @micksatana @samijaber /types/express-session/ @horiuchi @jacobbogers @builtinnya @ry7n /types/express-sitemap-xml/ @ffflorian +/types/express-slow-down/ @jdforsythe /types/express-socket.io-session/ @AylaJK /types/express-to-koa/ @xiaohanzhang /types/express-unless/ @wokim +/types/express-version-request/ @weffe +/types/express-version-route/ @weffe /types/express-wechat-access/ @simmons8616 /types/express-winston/ @bricka /types/express-ws/ @ajliv @@ -1226,17 +1337,20 @@ /types/fancy-log/ @pine /types/fancybox/ @borisyankov /types/farbtastic/ @EnableSoftware -/types/fast-diff/ @djrenren +/types/fast-json-stable-stringify/ @BendingBender /types/fast-levenshtein/ @mizunashi-mana /types/fast-list/ @BendingBender /types/fast-stats/ @rogierschouten +/types/fast64/ @rarmatei /types/fastclick/ @shinnn +/types/fastify-accepts/ @leomelzer /types/fastify-cors/ @jannikkeye +/types/fastify-favicon/ @tuelsch /types/fastify-jwt/ @jannikkeye /types/fastify-multipart/ @jannikkeye /types/fastify-static/ @leomelzer /types/favico.js/ @drowse314-dev-ymat -/types/favicons/ @mohsen1 +/types/favicons/ @mohsen1 @metsawyr /types/fb/ @JoshStrobl /types/fb-watchman/ @whtsky /types/fbemitter/ @kmxz @@ -1261,7 +1375,8 @@ /types/feedme/ @codeanimal /types/feedparser/ @cortopy /types/fetch-jsonp/ @tkrotoff -/types/fetch-mock/ @asvetliakov @tamird @merrywhether @chrissinclair @matttennison @quentinbouygues @mtsmfm +/types/fetch-mock/v6/ @asvetliakov @tamird @merrywhether @chrissinclair @matttennison @quentinbouygues @mtsmfm +/types/fetch-mock/ @asvetliakov @tamird @merrywhether @chrissinclair @matttennison @quentinbouygues @mtsmfm @captain-igloo @ChenNima /types/fetch.io/ @newraina /types/ffi/ @loyd @waitingsong /types/ffi-napi/ @keerthi16 @KiranNiranjan @@ -1277,21 +1392,29 @@ /types/file-type/ @tcaesvk @BendingBender /types/file-url/ @coderslagoon /types/filenamify/ @rokt33r -/types/filesize/ @GiedriusGrabauskas @renchap +/types/filenamify-url/ @cprecioso +/types/filesize/ @GiedriusGrabauskas @renchap @Ky6uk /types/fill-pdf/ @westy92 +/types/filter-console/ @BendingBender /types/filter-invalid-dom-props/ @icopp /types/finalhandler/ @chrootsu /types/finch/ @DavidSichau /types/find/ @andypyrope +/types/find-cache-dir/ @BendingBender +/types/find-java-home/ @sjx233 +/types/find-package-json/ @BendingBender /types/find-parent-dir/ @ikatyang /types/find-process/ @buaban /types/find-project-root/ @ikatyang /types/find-root/ @Alorel /types/find-up/ @BendingBender -/types/find-versions/ @LogvinovLeon -/types/findup-sync/ @Bartvds @ngbrown +/types/find-versions/ @LogvinovLeon @carnesen +/types/findup-sync/v0/ @Bartvds @ngbrown +/types/findup-sync/ @Bartvds @ngbrown @BendingBender +/types/fined/ @BendingBender /types/fingerprintjs/ @zaneli -/types/fingerprintjs2/ @curtstate +/types/fingerprintjs2/v1/ @curtstate +/types/fingerprintjs2/ @curtstate @BendingBender /types/firebase-client/ @fpsscarecrow /types/firebase-token-generator/ @dotdotcommadot /types/firebird/ @karak @@ -1299,9 +1422,13 @@ /types/firefox-webext-browser/ @jsmnbom /types/firmata/ @troywweber7 /types/first-mate/ @GlenCFL +/types/first-run/ @BendingBender /types/fixed-data-table/ @pepaar @stephenjelfs /types/fixed-data-table-2/ @ilivit +/types/fkill/ @BendingBender +/types/flagged-respawn/ @BendingBender /types/flat/ @chrootsu +/types/fleximap/ @DanielRose /types/flexslider/ @diullei /types/flickity/ @clmcgrath @wagich /types/flight/ @jonathanhedren @@ -1309,9 +1436,14 @@ /types/flipsnap/ @kubosho @gsino @mayuki /types/float-regex/ @wanganjun /types/flot/ @burlandm @Anticom @admiralsmaster +/types/flowdoc/ @animify /types/flowjs/ @ryan10132 +/types/fluent/ @huy-nguyen /types/fluent-ffmpeg/ @tcaesvk @DingWeizhe @mabidina +/types/fluent-langneg/ @huy-nguyen +/types/fluent-react/ @huy-nguyen /types/flush-write-stream/ @djcsdy +/types/flushable/ @pash90 /types/flux/ @stkb @GiedriusGrabauskas /types/fluxible/ @xbim /types/fluxible-addons-react/ @xbim @@ -1325,6 +1457,7 @@ /types/forever-agent/ @yavanosta /types/forever-monitor/ @shuntksh @wrboyce /types/forge-di/ @adamcarr +/types/forge-viewer/ @Autodesk-Forge /types/form-data/ @soywiz @leonyu @BendingBender /types/form-serialize/ @tyler-johnson /types/form-serializer/ @flqw @@ -1374,6 +1507,7 @@ /types/fusioncharts/ @rohitkr @shivarajkv /types/fuzzaldrin/ @mhegazy /types/fuzzaldrin-plus/ @jeancroy @jkillian @reyronald +/types/fuzzy-search/ @alex-deas @BendingBender /types/fuzzyset/ @lgrignon @narainsagar /types/fuzzyset.js/ @lgrignon @narainsagar /types/fxn/ @charrondev @@ -1514,7 +1648,7 @@ /types/gapi.client.youtubereporting/ @Bolisov /types/gapi.drive/ @baxtersa /types/gapi.pagespeedonline/ @sgtfrankieboy -/types/gapi.people/ @tkrotoff +/types/gapi.people/ @tkrotoff @joshuaobrien /types/gapi.plus/ @tkrotoff /types/gapi.translate/ @sgtfrankieboy /types/gapi.urlshortener/ @sgtfrankieboy @@ -1522,6 +1656,7 @@ /types/gapi.youtubeanalytics/ @sgtfrankieboy /types/gaussian/ @scttcper /types/gc-stats/ @vfernandestoptal +/types/gdal/ @andreidigori /types/geetest/ @plantain-00 /types/gen-readlines/ @CodeAnimal /types/generate-changelog/ @ffflorian @@ -1530,36 +1665,60 @@ /types/generic-pool/ @jerray @wrboyce /types/gently/ @bonnici /types/geodesy/ @DenisCarriere @HandyG52 @excelulous -/types/geojson/ @cobster @atd-schubert @JeffJacobson @icholy +/types/geojson/ @cobster @atd-schubert @JeffJacobson @icholy @danvk /types/geojson2osm/ @DenisCarriere /types/geokdbush/ @DenisCarriere +/types/geolite2/ @ffflorian /types/geometry-dom/ @nakakura /types/geopattern/ @Gaelan /types/gestalt/ @serranoarevalo /types/get-caller-file/ @ajafff +/types/get-certain/ @BendingBender +/types/get-emails/ @BendingBender +/types/get-emoji/ @BendingBender /types/get-folder-size/ @mszczepanczyk +/types/get-func-name/ @BendingBender /types/get-node-dimensions/ @vincekovacs +/types/get-port/ @plantain-00 @BendingBender +/types/get-range/ @BendingBender /types/get-stdin/ @DanielRosenwasser /types/get-stream/ @douglasduteil @BendingBender +/types/get-urls/ @BendingBender /types/get-value/ @DanielRosenwasser /types/getenv/ @impankratov /types/getopts/ @azasypkin /types/getos/ @BendingBender /types/gettext.js/ @jucrouzet +/types/gfc/ @BendingBender /types/gh-pages/ @DanielRosenwasser +/types/ghauth/ @Leko /types/gifffer/ @gatimus /types/gijgo/ @atatanasov /types/giraffe/ @darthapo /types/git/ @vvakame +/types/git-add-remote/ @BendingBender /types/git-branch/ @rynclark /types/git-config/ @stpettersens +/types/git-config-path/ @BendingBender /types/git-remote-origin-url/ @janslow +/types/git-repo-name/ @BendingBender /types/git-rev-sync/ @khoi-fish +/types/git-root-dir/ @ffflorian /types/git-url-parse/ @ajafff +/types/git-user-email/ @BendingBender +/types/git-user-name/ @BendingBender +/types/git-username/ @BendingBender +/types/gitconfiglocal/ @ffflorian /types/github-url-to-object/ @ajafff +/types/github-username/ @BendingBender /types/github-username-regex/ @BehindTheMath -/types/gitlab/ @yanqing6628780 @Arylo +/types/gl/ @sjx233 /types/gl-matrix/ @mattijskneppers @tatchx @nbabanov @auzmartist @surtr-isaz +/types/gl-react/ @jussikinnula +/types/gl-react-dom/ @jussikinnula +/types/gl-react-expo/ @jussikinnula +/types/gl-react-headless/ @jussikinnula +/types/gl-react-native/ @jussikinnula /types/gl-shader/ @MathiasPaumgarten /types/gl-texture2d/ @MathiasPaumgarten /types/gldatepicker/ @qcz @@ -1571,6 +1730,10 @@ /types/glob-parent/ @mrmlnc /types/glob-stream/ @Bartvds @mrmlnc /types/glob-to-regexp/ @whatasoda +/types/global-dirs/ @BendingBender +/types/global-modules/ @BendingBender +/types/global-paths/ @BendingBender +/types/global-prefix/ @BendingBender /types/global-tunnel-ng/ @BendingBender /types/globalize/ @gcastre @afromogli @bryanforbes /types/globalize-compiler/ @iclanton @@ -1584,13 +1747,14 @@ /types/google-apps-script/ @motemen @grant /types/google-apps-script-oauth2/ @dhayab /types/google-cloud__datastore/ @beaulac @ogawa0071 @ThomasdenH +/types/google-cloud__kms/ @ben-tbotlabs /types/google-cloud__pubsub/ @pheromonez @LunaPg @msiviero -/types/google-cloud__storage/ @blove @nbperry @welkie @ogawa0071 /types/google-earth/ @icholy /types/google-images/ @dolanmiu /types/google-libphonenumber/ @leonyu @winfinit /types/google-map-react/ @honzabrecka /types/google-maps/ @DeividasBakanas @GiedriusGrabauskas +/types/google-maps-react/ @gburgett @jpowell /types/google-protobuf/ @marcuslongmuir /types/google-translate-api/ @maple3142 /types/google.analytics/ @tyler-murphy @@ -1598,7 +1762,8 @@ /types/google.fonts/ @danmarshall /types/google.geolocation/ @vbortone /types/google.picker/ @grapswiz -/types/google.visualization/ @danludwig @gmoore-sjcorg @danmana @mlcheng @IvanBisultanov @glebm +/types/google.script.client-side/ @clomie +/types/google.visualization/ @danludwig @gmoore-sjcorg @danmana @mlcheng @IvanBisultanov @glebm @shrujalshah28 /types/google__maps/ @indrimuska /types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello @svenkreiss @bolatovumar @gauthierm /types/googlemaps.infobubble/ @Dashue @@ -1612,10 +1777,12 @@ /types/gramps__rest-helpers/ @claude /types/graphite-udp/ @EricByers /types/graphlib-dot/ @DomParfitt -/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher @clayne11 @JCMais +/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx @rportugal @tgriesser @dyst5422 @adnsio @divyenduz @bradzacher @clayne11 @JCMais @langpavel /types/graphql-date/ @enaeseth /types/graphql-deduplicator/ @lfades /types/graphql-depth-limit/ @eritikass +/types/graphql-errors/ @MatiasOlivera +/types/graphql-fields/ @feinoujc /types/graphql-iso-date/ @jwaldrip /types/graphql-list-fields/ @filipows /types/graphql-query-complexity/ @abhikmitra @@ -1637,6 +1804,7 @@ /types/grunt/ @jeffmay @basarat /types/gsap/ @codebelt @ProbablePrime @philipbulley @leomeloxp /types/gtin/ @RafaelKr +/types/guardian__prosemirror-invisibles/ @dddotsev /types/guid/ @maroy1986 /types/gulp/ @GiedriusGrabauskas /types/gulp-angular-templatecache/ @amanmahajan7 @@ -1678,6 +1846,7 @@ /types/gulp-jasmine/ @andypyrope /types/gulp-jasmine-browser/ @tkrotoff /types/gulp-json-editor/ @peterjuras +/types/gulp-json-validator/ @pe8ter /types/gulp-jsonmin/ @romain-faust /types/gulp-jsonminify/ @pine /types/gulp-jspm/ @peterjuras @@ -1717,25 +1886,32 @@ /types/gzip-js/ @rhysd /types/gzip-size/v3/ @plantain-00 /types/gzip-size/ @plantain-00 @jimivdw @andrewiggins -/types/h2o2/ @jasonswearingen @AJamesPhillips +/types/h2o2/ @jasonswearingen @AJamesPhillips @garthk /types/halfred/ @dherges /types/halogen/ @steller /types/hammerjs/ @milkisevil @codler /types/handlebars/ @borisyankov @evil-shrike +/types/handlebars-helpers/ @Toilal /types/hapi/v8/ @jasonswearingen /types/hapi/v12/ @jasonswearingen /types/hapi/v15/ @jasonswearingen /types/hapi/v16/ @jasonswearingen @AJamesPhillips -/types/hapi/ @rafaelsouzaf @jhsimms @SimonSchick +/types/hapi/v17/ @rafaelsouzaf @jhsimms @SimonSchick @saboya +/types/hapi/ @rafaelsouzaf @jhsimms @SimonSchick @saboya /types/hapi-auth-basic/ @AJamesPhillips @saboya +/types/hapi-auth-bearer-token/ @saboya +/types/hapi-auth-cookie/ @lenovouser @SimonSchick @Mutmatt /types/hapi-auth-jwt2/v7/ @warrenseymour /types/hapi-auth-jwt2/ @warrenseymour @SimonSchick /types/hapi-decorators/ @kenhowardpdx +/types/hapi-pino/ @saboya /types/har-format/ @micmro /types/hard-rejection/ @BendingBender /types/hard-source-webpack-plugin/ @woitechen /types/harmony-proxy/ @remojansen /types/has-ansi/ @BendingBender +/types/has-emoji/ @BendingBender +/types/has-yarn/ @BendgingBender /types/hash-file/ @HiromiShikata /types/hash-stream/ @BendingBender /types/hash-sum/ @DanielRosenwasser @@ -1743,6 +1919,7 @@ /types/hasher/ @flyfishMT /types/hashids/ @pocesar /types/hashmap/ @outring +/types/hashtag-regex/ @diogofcunha /types/hat/ @tup1tsa /types/haversine/ @screendriver /types/hbs/ @davidm77 @@ -1759,6 +1936,7 @@ /types/heredatalens/ @denyo /types/heremaps/ @Josh-ES @denyo @fx88 /types/heroku-logger/ @kylevogt +/types/hex-rgb/ @BendingBender /types/hex-rgba/ @r3nya /types/hexo-bunyan/ @segayuu /types/hexo-fs/ @segayuu @@ -1775,7 +1953,7 @@ /types/history.js/ @borisyankov @gjunge /types/historykana/ @h-shiratsuki /types/hjson/ @crunchie84 -/types/hls.js/ @jgainfort +/types/hls.js/ @jgainfort @brookback @adripanico /types/hoek/ @prashaantt /types/hoist-non-react-statics/ @JounQin /types/holderjs/ @renjfk @@ -1790,6 +1968,7 @@ /types/html-minifier/ @tkrotoff @rikuayanokozy /types/html-pdf/ @westy92 /types/html-tag-names/ @sandersn +/types/html-tags/ @BendingBender /types/html-to-text/ @erykwarren /types/html-void-elements/ @rhysd /types/html-webpack-plugin/ @deevus @bumbleblym @tlaziuk @@ -1798,7 +1977,7 @@ /types/htmlbars-inline-precompile/ @chriskrycho /types/htmlparser2/ @staticfunction @LinusU /types/htmltojsx/ @basarat -/types/http-assert/ @jkeylu +/types/http-assert/ @jkeylu @stripedpajamas /types/http-aws-es/ @marcogrcr /types/http-codes/ @mhegazy /types/http-context/ @mtraynham @@ -1818,9 +1997,11 @@ /types/humane/ @jmvrbanac /types/humanize-plus/ @DenisCarriere /types/humanize-string/ @ragnarok56 +/types/humanize-url/ @BendingBender /types/humanparser/ @MichalPodeszwa /types/humps/ @nikeee /types/hyco-ws/ @mrcabellom +/types/hyper-aws4/ @bambutz /types/hyperscript/ @spacejack @jmfirth /types/hypertext-application-language/ @maks3w /types/hystrixjs/ @igorsechyn @@ -1844,6 +2025,7 @@ /types/ibm_db/ @agov /types/icepick/ @ngbrown @tobico /types/icheck/ @qcz +/types/icon-gen/ @ffflorian /types/iconv/ @delphinus35 /types/idyll/ @iocat /types/idyll-ast/ @iocat @@ -1867,79 +2049,110 @@ /types/images/ @DingWeizhe /types/imagesloaded/ @coldacid @apexskier /types/imap/ @psnider -/types/imap-simple/ @pushplay +/types/imap-simple/ @pushplay @iaarnio /types/imgur-rest-api/ @lukewestby +/types/immediate/ @BendingBender /types/imperium/ @gaetansenn /types/impress/ @borisyankov /types/in-app-purchase/ @l-jonas @IchordeDionysos /types/in-range/ @DanielRosenwasser /types/inboxsdk/ @rdoursenaud @amiram /types/incremental-dom/ @basarat @lanthaler @vvakame -/types/indent-string/ @mhegazy +/types/indent-string/ @mhegazy @BendingBender /types/inert/v4/ @nycdotnet @AJamesPhillips /types/inert/ @nycdotnet @AJamesPhillips @lenovouser /types/inflected/ @dsci /types/inflection/ @shiwano /types/inherits/ @chrootsu -/types/ini/ @marcinporebski +/types/ini/ @marcinporebski @carnesen /types/iniparser/ @chrootsu /types/init-package-json/ @kfarnung +/types/ink/ @cprecioso /types/inline-css/ @philipisapain /types/inline-style-prefixer/ @ahz @dpetrezselyova @franklixuefei /types/inquirer/ @tkQubo @ppathan @jouderianjr @bang88 @bitjson @synarque @jrockwood @kwkelly @Ailrun /types/inquirer-npm-name/ @manuth +/types/insert-css/ @hvoecking /types/insert-module-globals/ @leonard-thieu /types/insight/ @vvakame +/types/instabug-reactnative/ @pengcao1 /types/integer/ @Morfent /types/intercom-client/ @jineshshah36 @peping /types/intercom-web/ @fongandrew @salbahra @onatm /types/intercomjs/ @spencerwi +/types/internal-ip/v2/ @BendingBender /types/internal-ip/ @BendingBender +/types/interpret/ @BendingBender /types/intl/ @RagibHasin /types/intl-locales-supported/ @Slessi /types/intl-messageformat/ @mhegazy /types/intl-relativeformat/ @mohsen1 -/types/intl-tel-input/ @fdnhkj @leonard-thieu +/types/intl-tel-input/v13/ @fdnhkj @leonard-thieu +/types/intl-tel-input/ @fdnhkj @leonard-thieu @molnarm /types/into-stream/ @BendingBender /types/intrinsic-scale/ @shalomdotnet /types/intro.js/ @anahkiasen /types/invariant/ @bennett000 /types/inversify-devtools/ @inversify +/types/iobroker/ @AlCalzone /types/ion-rangeslider/v1/ @dduugg @Karel-van-de-Plassche /types/ion-rangeslider/ @Karel-van-de-Plassche -/types/ioredis/v3/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor @palindrom615 @reconbot -/types/ioredis/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor @palindrom615 @reconbot @funthing @iamolegga +/types/iopipe__iopipe/ @javonharper +/types/ioredis/v3/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor @palindrom615 @reconbot @pettyalex +/types/ioredis/ @plantain-00 @chrisleck @aliarham11 @br8h @shaharmor @palindrom615 @reconbot @funthing @iamolegga @tingwai-to @pettyalex /types/iota.lib.js/ @fogsh -/types/ip/ @codeanimal +/types/ip/ @codeanimal @BendingBender /types/ip-address/ @icopp @danwbyrne -/types/ip-regex/ @unindented +/types/ip-regex/v2/ @unindented +/types/ip-regex/ @renarsvilnis /types/ipcheck/ @bengry +/types/ipify/ @BendingBender /types/irc/ @phillips1012 +/types/iri/ @BendingBender /types/iron/ @simonschick @rafaelsouzaf -/types/is/ @cabralRodrigo +/types/is/ @cabralRodrigo @gricey432 +/types/is-absolute/ @BendingBender /types/is-absolute-url/ @mhegazy /types/is-alphanumerical/ @vutran /types/is-archive/ @mhegazy /types/is-array/ @pine +/types/is-array-sorted/ @BendingBender /types/is-binary-path/ @DanielRosenwasser +/types/is-buffer/ @rokt33r /types/is-callable/ @nieltg +/types/is-charging/ @BendingBender /types/is-ci/ @atd-schubert /types/is-color/ @VitorLuizC /types/is-compressed/ @mhegazy /types/is-docker/ @YashdalfTheGray +/types/is-dotdir/ @BendingBender +/types/is-dotfile/ @BendingBender +/types/is-elevated/ @BendingBender /types/is-empty/ @termosa /types/is-finite/ @mhegazy +/types/is-fullwidth-code-point/ @BendingBender +/types/is-function/ @evangeloszotos +/types/is-git-url/ @BendingBender /types/is-glob/ @mrmlnc /types/is-hotkey/ @petester42 @kalley +/types/is-installed-globally/ @BendingBender /types/is-ip/ @coderslagoon /types/is-mobile/ @LogvinovLeon /types/is-my-json-valid/ @kruncher /types/is-negated-glob/ @ajafff /types/is-number/ @harryshipton +/types/is-obj/ @forivall /types/is-object/ @wbhob +/types/is-online/ @BendingBender /types/is-path-cwd/ @DanielRosenwasser /types/is-path-in-cwd/ @mhegazy +/types/is-plain-obj/ @BendingBender +/types/is-png/ @jameswilddev +/types/is-progressive/ @BendingBender /types/is-promise/ @DanielRosenwasser +/types/is-reachable/ @BendingBender +/types/is-regexp/ @forivall +/types/is-relative/ @BendingBender /types/is-relative-url/ @mhegazy /types/is-root/ @mhegazy /types/is-root-path/ @mhegazy @@ -1949,18 +2162,26 @@ /types/is-svg/ @BendingBender /types/is-text-path/ @mhegazy /types/is-touch-device/ @screendriver +/types/is-trademarked/ @BendingBender +/types/is-typedarray/ @BendingBender +/types/is-unc-path/ @BendingBender /types/is-url/ @RyotaMurohoshi /types/is-url-superb/ @kryops /types/is-uuid/ @tedre191 +/types/is-valid-glob/ @BendingBender +/types/is-valid-path/ @Goldsmith42 /types/is-windows/ @mizunashi-mana /types/isaac/ @mo /types/isbn-utils/ @elhaard /types/iscroll/ @csrakowski @devlato +/types/isexe/ @BendingBender /types/ismobilejs/ @Ty3uK /types/iso-3166-2/ @sicilica /types/iso8601-localizer/ @avielfedida /types/isomorphic-fetch/ @toddlucas /types/isotope-layout/ @avidenic @malinushj +/types/issue-parser/ @Leko +/types/issue-regex/ @BendingBender /types/istanbul/ @tkrotoff /types/istanbul-lib-coverage/ @jason0x43 /types/istanbul-lib-hook/ @jason0x43 @@ -1969,13 +2190,16 @@ /types/istanbul-lib-source-maps/ @jason0x43 /types/istanbul-middleware/ @hookclaw /types/istanbul-reports/ @jason0x43 +/types/istextorbinary/ @BendingBender /types/ityped/ @DanielRosenwasser /types/ix.js/ @Igorbek /types/jackrabbit/ @elvisvoer /types/jade/ @panuhorsmalahti /types/jalaali-js/ @alitaheri /types/japanese-holidays/ @syamatoo -/types/jasmine/ @borisyankov @theodorejb @davidparsson @gmoothart @lukas-zech-software @Engineer2B +/types/jasmine/v1/ @borisyankov +/types/jasmine/v2/ @borisyankov @theodorejb @davidparsson @gmoothart @lukas-zech-software @Engineer2B @cyungmann @devoto13 @fdim +/types/jasmine/ @borisyankov @theodorejb @davidparsson @gmoothart @lukas-zech-software @Engineer2B @cyungmann @Roaders @devoto13 @fdim @pe8ter /types/jasmine-ajax/ @lgrignon /types/jasmine-data-provider/ @tlaziuk /types/jasmine-data_driven_tests/ @AnthonyMacKinnon @@ -1991,7 +2215,7 @@ /types/jasminewd2/ @sjelin @gkalpak /types/java/ @jimlloyd @hrl7 @darti /types/java-applet/ @cyrilschumacher -/types/javascript-astar/ @ptlis +/types/javascript-astar/ @ptlis @lazerwalker /types/javascript-bignum/ @sandersn /types/javascript-obfuscator/ @sanex3339 /types/javascript-state-machine/ @borisyankov @mdocter @MrBigDog2U @samael65535 @taoqf @@ -2021,10 +2245,11 @@ /types/jexl/ @m-tomczyk /types/jfs/ @tlaziuk /types/jira-client/ @KOPTE3 @orta +/types/jju/ @ecraig12345 @rlidwka /types/jjv/ @Nemo157 /types/jjve/ @Nemo157 /types/jmespath/ @pushplay -/types/johnny-five/ @nakakura @ujvzolee @workshop2 +/types/johnny-five/ @nakakura @ujvzolee @workshop2 @xtrimsystems @marcinobiedz /types/joi/v6/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW /types/joi/v10/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @aconanlai /types/joi/v13/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku @dankraus @wanganjun @rafaelkallis @aconanlai @zaphoyd @thewillg @SimonSchick @@ -2032,6 +2257,7 @@ /types/joigoose/ @boothwhack /types/josa/ @vichyssoise /types/jotform-css.js/ @pandawood +/types/jpeg-autorotate/ @Slessi /types/jpeg-js/ @DanielRosenwasser /types/jpegtran-bin/ @hikoma /types/jpm/ @github-account-because-they-want-it @@ -2164,6 +2390,7 @@ /types/js-data-angular/ @reppners /types/js-fixtures/ @kazimanzurrashid /types/js-git/ @Bartvds +/types/js-levenshtein/ @Kallu609 @naftis /types/js-md5/ @mwmccarthy /types/js-money/ @kanatkubash /types/js-nacl/ @ethanfrey @@ -2173,7 +2400,8 @@ /types/js-sha512/ @nicojs /types/js-string-escape/ @viralpickaxe /types/js-to-java/ @skyitachi -/types/js-url/ @pine613 +/types/js-types/ @BendingBender +/types/js-url/ @pine /types/js-yaml/ @Bartvds @sclausen /types/js.spec/ @mattbishop /types/jsbn/ @Evgenus @al2xed @@ -2185,7 +2413,7 @@ /types/jsend/ @CaselIT /types/jsesc/ @Bartvds /types/jsfl/ @soywiz -/types/jsforce/ @dolanmiu @netes @amphro @tnoonan-salesforce @whiteabelincoln @borys-kupar +/types/jsforce/ @dolanmiu @netes @amphro @tnoonan-salesforce @whiteabelincoln @borys-kupar @catalandres /types/jsftp/ @xyleen /types/jsgraph/ @rosinbum /types/jshamcrest/ @dharkness @@ -2201,6 +2429,7 @@ /types/json-rpc-random-id/ @micahriggan /types/json-rpc-ws/ @npenin @mlamp /types/json-schema/ @bcherny @cyrilletuzi @lucianbuzzo @rolandjitsu +/types/json-server/ @jeremyben /types/json-socket/ @svi3c /types/json-stable-stringify/ @mhfrantz /types/json-stringify-safe/ @BendingBender @@ -2208,11 +2437,15 @@ /types/json2md/ @MartynasZilinskas /types/json3/ @NN--- /types/json5/ @Esemesek +/types/json_ml/ @pluma +/types/jsonabc/ @ffflorian +/types/jsonapi-serializer/ @chiangf /types/jsonata/ @nick121212 /types/jsoneditor/ @alejo90 @errietta /types/jsoneditor-for-react/ @joshuakgoldberg /types/jsoneditoronline/ @vbortone -/types/jsonfile/ @dbowring +/types/jsonfile/v4/ @dbowring +/types/jsonfile/ @dbowring @BendingBender /types/jsonic/ @jacobbubu /types/jsonminify/ @no23reason /types/jsonnet/ @hookclaw @@ -2225,7 +2458,7 @@ /types/jsonwebtoken/ @SomaticIT @danielheim @brikou @vpk @rlgod /types/jsonwebtoken-promisified/ @SomaticIT @danielheim @brikou @aneilbaboo /types/jspath/ @dex4er -/types/jspdf/ @amberjs +/types/jspdf/ @amberjs @lleios @jemerald /types/jsqrcode/ @lordazzi /types/jsrender/ @zakki /types/jsreport-core/ @taoqf @@ -2237,7 +2470,7 @@ /types/jsreport-xlsx/ @taoqf /types/jsrp/ @harryshipton /types/jss/ @appsforartists @kof @pelotom @eps1lon -/types/jssha/ @randombk @SrTobi +/types/jssha/ @randombk @SrTobi @cakoose /types/jstimezonedetect/ @olamothe /types/jstorage/ @dflor003 /types/jstree/ @adaskothebeast @@ -2251,10 +2484,12 @@ /types/jui/ @easylogic /types/jui-core/ @easylogic /types/jui-grid/ @easylogic +/types/junk/ @BendingBender /types/just-debounce-it/ @azizhk /types/just-extend/ @pe8ter +/types/just-pick/ @pe8ter /types/jweixin/ @taoqf @gomydodo -/types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw @bpdsw +/types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw @bpdsw @bebebebebe @djcsdy /types/jws/ @JustinBeckwith /types/jwt-client/ @timoteoponce /types/jwt-decode/v1/ @QuatroDevOfficial @@ -2268,17 +2503,19 @@ /types/karma/ @tkrotoff @43081j @devoto13 /types/karma-chai/ @JayAndCatchFire /types/karma-chai-sinon/ @vasek17 -/types/karma-coverage/ @tkrotoff +/types/karma-coverage/ @tkrotoff @devoto13 /types/karma-fixture/ @evictor @afshawnlotfi /types/karma-jasmine/ @michelsalib /types/karma-viewport/ @karak /types/karma-webpack/ @mtraynham -/types/katex/ @mrand01 +/types/katex/ @mrand01 @knguyen0125 /types/kcors/ @Xstoudi @izayoiko /types/kdbush/ @DenisCarriere @chrfrasco +/types/kdbxweb/ @Roang-zero1 /types/keen-tracking/ @rui-ferreira /types/kefir/ @AyaMorisawa @HitoriSensei /types/kendo-ui/ @telerik +/types/kerberos/ @velezsarain /types/keyboardjs/ @vbortone @piranha771 @teoxoy /types/keycloak-connect/ @gstamac /types/keygrip/ @jkeylu @@ -2287,16 +2524,21 @@ /types/keypress.js/ @rcchen /types/keysym/ @harryshipton /types/keytar/ @miniak @shiftkey @juturu -/types/keyv/ @Arylo +/types/keyv/ @Arylo @BendingBender +/types/keyv__mongo/ @BendingBender +/types/keyv__mysql/ @BendingBender +/types/keyv__postgres/ @BendingBender +/types/keyv__redis/ @BendingBender +/types/keyv__sqlite/ @BendingBender /types/kik-browser/ @joelday /types/klaw/v1/ @mceachen /types/klaw/ @mceachen /types/klaw-sync/ @shiftkey /types/kms-json/ @sunnyone -/types/knex/ @tkQubo @MeLlamoPablo @mastermatt @micksatana @shreyjain1994 +/types/knex/ @tkQubo @MeLlamoPablo @mastermatt @micksatana @shreyjain1994 @joelshepherd /types/knex-postgis/ @vesse /types/knockback/ @borisyankov -/types/knockout/ @borisyankov @Igorbek @moonpyk @EnableSoftware @BenjaminEckardt @ffMathy @ltlombardi +/types/knockout/ @borisyankov @Igorbek @moonpyk @EnableSoftware @BenjaminEckardt @ffMathy @ltlombardi @Retsam /types/knockout-amd-helpers/ @DavidSichau /types/knockout-secure-binding/ @pine613 /types/knockout-transformations/ @johnnyreilly @Nemo157 @@ -2312,12 +2554,14 @@ /types/knockout.validation/ @danludwig /types/knockout.viewmodel/ @oising /types/knockstrap/ @adaskothebeast +/types/known/ @BendingBender /types/knuddels-userapps-api/ @Knuddels /types/ko.plus/ @conficient /types/koa/ @DavidCai1993 @jkeylu @brikou /types/koa-basic-auth/ @Tobias4872 /types/koa-better-body/ @danwbyrne -/types/koa-bodyparser/ @hellopao @anup-2s +/types/koa-bodyparser/ @hellopao @anup-2s @hirochachacha +/types/koa-bouncer/ @maruware /types/koa-bunyan-logger/ @sjmcdowall /types/koa-cache-control/ @pe8ter /types/koa-compose/ @jkeylu @@ -2332,9 +2576,10 @@ /types/koa-hbs/ @jcbmln @mudkipme /types/koa-helmet/ @me /types/koa-html-minifier/ @romain-faust -/types/koa-joi-router/ @wingsbob @move-zig +/types/koa-joi-router/ @wingsbob @move-zig @hirochachacha /types/koa-json/ @brooklyndev /types/koa-json-error/ @mudkipme +/types/koa-log/ @havenchyk /types/koa-logger/ @geoffreak @tlaziuk /types/koa-logger-winston/ @stevehipwell /types/koa-morgan/ @vesse @@ -2343,14 +2588,16 @@ /types/koa-passport/ @horiuchi @tlaziuk @brendtumi /types/koa-pino-logger/ @khell /types/koa-pug/ @Xstoudi +/types/koa-qs/ @RemyJeancolas /types/koa-range/ @strax /types/koa-ratelimit/ @OutdatedVersion +/types/koa-ratelimit-lru/ @danwbyrne /types/koa-redis/ @nsimmons /types/koa-redis-cache/ @dimamukhin /types/koa-requestid/ @sjmcdowall /types/koa-response-time/ @thorsedeke @sjmcdowall /types/koa-route/ @migstopheles @jacogr -/types/koa-router/ @hellopao @schfkt @JounQin @romain-faust +/types/koa-router/ @hellopao @schfkt @JounQin @romain-faust @Guillaume-Mayer @falinor /types/koa-send/ @pe8ter @tlaziuk /types/koa-session/ @kerol2r20 @tlaziuk /types/koa-session-minimal/ @longztian @@ -2358,6 +2605,7 @@ /types/koa-static/ @hellopao @tlaziuk /types/koa-static-cache/ @JounQin /types/koa-static-server/ @wulunyi +/types/koa-useragent/ @rvboris /types/koa-views/ @brooklyndev /types/koa-webpack/ @malj @leebenson @miZyind @tlaziuk /types/koa-websocket/ @moimael @jacogr @zdila @Kroisse @@ -2380,6 +2628,8 @@ /types/lambda-tester/ @ivank @HajoAhoMantila /types/lasso/ @darkwebdev /types/later/ @jasond-s +/types/latest-semver/ @BendingBender +/types/latest-version/ @BendingBender /types/latinize/ @GiedriusGrabauskas /types/latlon-geohash/ @rimig /types/launchpad/ @rictic @@ -2387,6 +2637,7 @@ /types/lazy-value/ @ikatyang /types/lazy.js/ @Bartvds @miso440 /types/lazypipe/ @tomc974 +/types/ldap-filters/ @pluma /types/ldapjs/ @cvillemure @peterkooijmans /types/leadfoot/ @theintern /types/leaflet/v0/ @rgripper @@ -2417,6 +2668,7 @@ /types/leaflet.pm/ @tkleinke /types/leaflet.polylinemeasure/ @RiON69 /types/leakage/ @atd-schubert +/types/leap-year/ @BendingBender /types/leapmotionts/ @logotype /types/ledgerhq__hw-transport/ @danwbyrne /types/ledgerhq__hw-transport-node-hid/ @danwbyrne @@ -2441,18 +2693,28 @@ /types/libxmljs/ @fdecampredon @ComFreek /types/libxslt/ @alejo90 /types/license-checker/ @rogierschouten @unindented +/types/liftoff/ @BendingBender /types/lil-uuid/ @Pr1st0n /types/lime-js/ @arthur-xavier /types/line-by-line/ @etomsen +/types/line-column-path/ @BendingBender /types/line-reader/ @stpettersens /types/linear-gradient/ @Jack-Works /types/lingui__core/ @huan086 /types/lingui__macro/ @huan086 /types/lingui__react/ @huan086 +/types/linkify-issues/ @BendingBender /types/linkify-it/ @praxxis +/types/linkify-urls/ @BendingBender +/types/linkifyjs/ @szhu @ovidiubute +/types/list-git-remotes/ @BendingBender +/types/list-stream/ @IanStorm /types/listr/ @durad /types/lls/ @borislavjivkov +/types/load-google-maps-api/ @oBusk /types/load-json-file/ @SamVerschueren +/types/loadable__component/ @martynaskadisa +/types/loadable__server/ @martynaskadisa /types/loader-runner/ @e-cloud /types/loader-utils/ @Perlmint @TotooriaHyperion /types/loadjs/ @screendriver @@ -2463,6 +2725,7 @@ /types/localized-countries/ @coderslagoon /types/localizejs-library/ @salbahra /types/locate-path/ @me +/types/lock-system/ @BendingBender /types/lockfile/v0/ @Bartvds /types/lockfile/ @Bartvds @BendingBender /types/lockr/ @droritos @@ -2767,8 +3030,10 @@ /types/lokijs/ @TeamworkGuy2 @thomasconner /types/lolex/ @Nemo157 @joshuakgoldberg @rogierschouten /types/long/ @peterkooijmans +/types/looks-same/ @xcatliu /types/loopback/ @kattsushi @enko @sequoia @drmikecrowe @karimsa /types/loopback-boot/ @kattsushi +/types/loopbench/ @BendingBender /types/lorem-ipsum/ @durad /types/lory.js/ @kubosho @milkisevil /types/loud-rejection/ @BendingBender @@ -2778,34 +3043,38 @@ /types/lozad/ @plantain-00 /types/lru-cache/ @Bartvds @BendingBender /types/lscache/ @Chris-Martinezz -/types/ltx/ @PJakcson +/types/ltx/ @PJakcson @BendingBender /types/luaparse/ @stpettersens /types/lunr/v0/ @sebastian-lenz -/types/lunr/ @seantanly +/types/lunr/ @seantanly @hokiegeek /types/lusca/ @crutchcorn -/types/luxon/ @colbydehart @FourwingsY @jsiebern +/types/luxon/ @colbydehart @FourwingsY @jsiebern @mastermatt @pietrovismara /types/lwip/ @AyaMorisawa /types/lz-string/ @M0ns1gn0r /types/lzma-native/ @leshow +/types/macrotask/ @BendingBender /types/magic-number/ @stpettersens /types/magicsuggest/ @leonardochaia /types/magnet-uri/ @tlaziuk /types/mailcheck/ @pocesar /types/maildev/ @cyrilschumacher @zbarbuto /types/mailgen/ @vothanhkiet @jordanfarrer -/types/mailgun-js/ @sampsonjoliver +/types/mailgun-js/ @sampsonjoliver @andipaetzold /types/mailparser/ @psnider /types/main-bower-files/ @k-kagurazaka /types/make-dir/ @ikatyang @BendingBender /types/maker.js/ @danmarshall /types/makeup-expander/ @darkwebdev /types/makeup-floating-label/ @darkwebdev +/types/makeup-keyboard-trap/ @darkwebdev +/types/makeup-prevent-scroll-keys/ @darkwebdev /types/makeup-screenreader-trap/ @darkwebdev /types/mali-compose/ @danwbyrne /types/mali-onerror/ @danwbyrne /types/mandrill-api/ @pocesar +/types/mangopay2-nodejs-sdk/ @ifiokjr /types/map-obj/ @BendingBender -/types/mapbox/ @anahkiasen +/types/mapbox/ @anahkiasen @Fluccioni /types/mapbox-gl/ @dobrud @patrickr /types/mapbox-gl-leaflet/ @agorshkov23 /types/mapbox__geo-viewport/ @fnberta @@ -2815,14 +3084,15 @@ /types/mapnik/ @ipv4sec /types/mapsjs/ @davismj /types/mariasql/ @bennett000 -/types/mark.js/ @renjfk @RomanGotsiy +/types/mark.js/ @renjfk @RomanGotsiy @LucianBuzzo /types/markdown-it/ @rapropos /types/markdown-it-anchor/ @seryl /types/markdown-it-container/ @hronex /types/markdown-it-lazy-headers/ @knom /types/markdown-pdf/ @MonsieurMan /types/markdownlint/ @ark120202 -/types/marked/ @worr @BendingBender @CrossR +/types/marked/ @worr @BendingBender @CrossR @mwickett +/types/marked-terminal/ @bkendall /types/marker-animate-unobtrusive/ @viskin /types/markerclustererplus/ @enanox @mxl /types/markitup/ @drillbits @@ -2833,8 +3103,9 @@ /types/massive/v4/ @swissspidy @clarenceh @AmazingTurtle /types/massive/ @swissspidy @clarenceh @AmazingTurtle @mike-engel /types/match-media-mock/ @asvetliakov -/types/match-sorter/ @claasahl -/types/material-components-web/ @BrentDouglas @ckosti +/types/match-sorter/ @claasahl @chrisru +/types/matcher/ @BendingBender +/types/material-components-web/ @BrentDouglas @ckosti @agroupp /types/material-design-lite/ @bradzacher /types/material-ui/ @ngbrown @theigor @alitaheri @herrmanno @DaIgeb @allienna @schlesingermatthias @InsidersByte @artyomsv @dan-j @minodisk @samwalshnz @reggino /types/material-ui-datatables/ @coding2012 @@ -2844,13 +3115,15 @@ /types/material__checkbox/ @BrentDouglas @ckosti /types/material__chips/ @BrentDouglas @ckosti /types/material__dialog/ @BrentDouglas @ckosti -/types/material__drawer/ @BrentDouglas @ckosti +/types/material__dom/ @agroupp +/types/material__drawer/ @BrentDouglas @ckosti @agroupp /types/material__floating-label/ @BrentDouglas @ckosti /types/material__form-field/ @BrentDouglas @ckosti /types/material__grid-list/ @BrentDouglas @ckosti /types/material__icon-toggle/ @BrentDouglas @ckosti /types/material__line-ripple/ @BrentDouglas @ckosti /types/material__linear-progress/ @BrentDouglas @ckosti +/types/material__list/ @agroupp /types/material__menu/ @BrentDouglas @ckosti /types/material__notched-outline/ @BrentDouglas @ckosti /types/material__radio/ @BrentDouglas @ckosti @@ -2868,12 +3141,13 @@ /types/materialize-css/ @huww98 @MaximBalaganskiy @MonizDave @broccoliarchy /types/math3d/ @laszlojakab @jimsmart /types/mathjax/ @rolandzwaga -/types/mathjs/ @siavol @andnp @bradbesserman +/types/mathjs/ @siavol @andnp @bradbesserman @pawkrol /types/matter-js/ @piranha771 @hasparus -/types/maxmind/ @geoffreak +/types/mcrypt/ @pluma /types/mcustomscrollbar/ @flurg /types/md5/ @arcdev1 @jprogrammer /types/md5-file/ @BamButz +/types/mdast/ @lujun2 /types/mdns/ @reppners /types/mdurl/ @rokt33r /types/media-typer/ @BendingBender @@ -2885,13 +3159,18 @@ /types/memcached/ @KentarouTakeda /types/memdown/ @MeirionHughes @danwbyrne /types/memjs/ @leizongmin +/types/memoize-one/v3/ @karol-majewski @franklixuefei /types/memoize-one/ @karol-majewski @franklixuefei /types/memoizee/ @juanpicado /types/memory-cache/ @jedigo @thieman /types/memory-fs/ @e-cloud +/types/memory-pager/ @BendingBender +/types/memorystream/ @bangbang93 /types/memwatch-next/ @cyrilschumacher /types/meow/ @KnisterPeter @praxxis @bitjson /types/merge-descriptors/ @danny8002 +/types/merge-env/ @BendingBender +/types/merge-images/ @BendingBender /types/merge-stream/ @k-kagurazaka @tomxtobin @daniel-zazula @djcsdy /types/merge2/ @tkrotoff @smac89 /types/merkle/ @kerol2r20 @@ -2900,7 +3179,7 @@ /types/meshblu/ @fnipo /types/mess/ @Nemo157 /types/messenger/ @derekcicerone -/types/meteor/ @barbatus @fullflavedave @orefalo @dagatsoin @birkskyum @ardatan @stefanholzapfel @andrei-markeev @lmachens +/types/meteor/ @barbatus @fullflavedave @orefalo @dagatsoin @birkskyum @ardatan @stefanholzapfel @andrei-markeev @lmachens @gunn /types/meteor-accounts-phone/ @DAB0mB /types/meteor-astronomy/ @Deadly0 /types/meteor-collection-hooks/ @twastvedt @@ -2916,9 +3195,11 @@ /types/mfiles/ @avonwyss /types/micro/ @kaoDev /types/micro-cors/ @CallumDenby +/types/micro-events/ @AlexanderSychev /types/micromatch/v2/ @glen-84 /types/micromatch/ @glen-84 @vemoo /types/microrouter/ @mathieudutour +/types/microservice-utilities/ @runebaas /types/microsoft-ajax/ @pjmagee /types/microsoft-live-connect/ @jvilk /types/microsoft-sdk-soap/ @markusmauch @@ -2930,6 +3211,7 @@ /types/mime-db/ @AJamesPhillips /types/mime-types/ @Perlmint /types/mimos/ @AJamesPhillips +/types/min-indent/ @BendingBender /types/mina/ @lhk @mattanja @kant2002 /types/mini-css-extract-plugin/ @JounQin /types/minimal-bit-array/ @jeremejevs @@ -2943,14 +3225,16 @@ /types/mithril-global/ @spacejack @isiahmeadows /types/mitm/ @alejo90 /types/mixpanel/ @hjellek @Manduro +/types/mixpanel-browser/ @karlos1337 /types/mixto/ @vvakame /types/mjml/ @aahoughton @marpstar +/types/mjml-react/ @henrinormak /types/mkdirp/ @Bartvds @mrmlnc /types/mkdirp-promise/ @pluma /types/mkpath/ @optical /types/ml-levenberg-marquardt/ @m93a +/types/mnemonic-words/ @BendingBender /types/mobx-apollo/ @pselden -/types/mobx-cookie/ @t49tran /types/mobx-devtools-mst/ @pluma /types/mocha/ @kazimanzurrashid @otiai10 @jt000 @enlight @cspotcode @1999 /types/mocha-each/ @magnostherobot @@ -2964,8 +3248,10 @@ /types/mock-require/ @gDelgado14 /types/mockdate/ @brunolm /types/mockery/ @jt000 +/types/mockingoose/ @hirochachacha /types/modernizr/ @borisyankov @theodorejb @leonyu @lucax88x @nhardy /types/modesl/ @neeschit +/types/modular-scale/ @mikefowler /types/module-alias/ @KevinRamharak /types/module-deps/ @TeamworkGuy2 /types/moji/ @yasupeke @@ -2974,24 +3260,25 @@ /types/moment-duration-format/ @SwintDC @TwoStone @leonard-thieu @bendykowski /types/moment-holiday/ @rwdalpe /types/moment-jalaali/ @alitaheri -/types/moment-range/ @Burgov @wilgert @franjuan @MartynasZilinskas +/types/moment-range/ @Burgov @wilgert @franjuan @MartynasZilinskas @chemass /types/moment-round/ @jacobbaskin /types/moment-shortformat/ @whatasoda /types/moment-strftime2/ @dex4er -/types/moment-timezone/ @michelsalib @alanblins +/types/moment-timezone/ @michelsalib @alanblins @asermax /types/money-math/ @taoqf /types/mongo-sanitize/ @CedricCazin /types/mongodb/v2/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi -/types/mongodb/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian @denys-bushulyak @BastienAr @sindbach @geraldinelemeur @jishi @various89 @angela-1 @lirbank @hector7 @floric +/types/mongodb/ @CaselIT @alanmarcell @bitjson @dante-101 @mcortesi @EnricoPicci @AJCStriker @julien-c @daprahamian @denys-bushulyak @BastienAr @sindbach @geraldinelemeur @jishi @various89 @angela-1 @lirbank @hector7 @floric @erikc5000 /types/mongodb-memory-server/ @dmitryrogozhny /types/mongodb-uri/ @mernxl -/types/mongoose/v4/ @simonxca @horiuchi @sindrenm @lukasz-zak -/types/mongoose/ @horiuchi @sindrenm @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab @jussikinnula @ondratra @alfirin @idandrd @various89 @Fazendaaa @NormanPerrin @danmana @stablio +/types/mongoose/v4/ @simonxca @horiuchi @lukasz-zak +/types/mongoose/ @horiuchi @lukasz-zak @Alorel @jendrikw @ethanresnick @vologab @jussikinnula @ondratra @alfirin @idandrd @various89 @Fazendaaa @NormanPerrin @danmana @stablio @emmanuelgautier /types/mongoose-auto-increment/ @AyaMorisawa /types/mongoose-deep-populate/ @AyaMorisawa /types/mongoose-geojson-schema/ @bondz /types/mongoose-mock/ @jt000 /types/mongoose-paginate/ @linusbrolin @simonxca +/types/mongoose-paginate-v2/ @linusbrolin @simonxca @woutgg /types/mongoose-promise/ @simonxca /types/mongoose-seeder/ @Crevil /types/mongoose-sequence/ @linusbrolin @@ -2999,6 +3286,7 @@ /types/mongoose-unique-validator/ @stevehipwell /types/mongorito/ @pinguet62 /types/mongration/ @soulthreads +/types/month-days/ @BendingBender /types/moo/ @deltaidea @MofX /types/moonjs/ @DanielRosenwasser /types/morgan/ @staticfunction @pscanf @@ -3006,8 +3294,9 @@ /types/morris.js/ @mareek @sindilevich /types/mosca/ @GabrielGouv @jerray /types/motor-hat/ @muntyan -/types/mousetrap/ @qcz +/types/mousetrap/ @qcz @alanhchoi /types/move-concurrently/ @mgroenhoff +/types/move-file/ @BendingBender /types/moveto/ @shermendev /types/moviedb/ @basarat @0x6368656174 /types/moxios/ @itoasuka @@ -3028,8 +3317,9 @@ /types/multer-gridfs-storage/v2/ @devconcept /types/multer-gridfs-storage/ @devconcept /types/multer-s3/ @tcaesvk @galtalmor @terski +/types/multi-progress/ @DHBrett /types/multi-typeof/ @mhegazy -/types/multimatch/ @stephenlautier +/types/multimatch/ @stephenlautier @BendingBender /types/multiparty/ @kenfdev /types/multiplexjs/ @KamyarNazeri /types/multisort/ @CzBuCHi @@ -3040,6 +3330,7 @@ /types/murmurhash3js/ @dlee-nvisia /types/musicmetadata/ @Xstoudi /types/mustache/ @markashleybell @manuth +/types/mustache-express/ @BendingBender /types/mutexify/ @maistho /types/mv/ @nenadalm /types/mysql/ @wjohnsto @kacepe @kpping @jdmunro @@ -3062,33 +3353,42 @@ /types/navermaps/ @ckboyjiy /types/navigation/ @grahammendick /types/navigation-react/ @grahammendick +/types/navigator-permissions/ @vargavince91 @minddocdev /types/navigo/ @aersamkull @dancespiele @deini /types/nblas/ @erikgerrits -/types/nconf/ @jedigo @jmthibault +/types/nconf/ @jedigo @jmthibault @ew73 /types/ncp/ @bartvds /types/ndarray/ @pawsong @taoqf /types/nearley/ @deltaidea @BendingBender +/types/neat-csv/ @calamitizer /types/nedb/ @reppners @anthonynichols @afharo /types/nedb-logger/ @thisboyiscrazy /types/needle/v0/ @bigsan /types/needle/v1/ @bigsan @nikeee -/types/needle/ @bigsan @nikeee @sindilevich +/types/needle/ @bigsan @nikeee @sindilevich @bryanspears +/types/negative-array/ @BendingBender +/types/negative-zero/ @BendingBender /types/negotiator/ @BendingBender /types/neo4j/ @cyrilschumacher /types/nes/ @NoHomey @saboya /types/nested-error-stacks/ @woutervh- /types/net-keepalive/ @hertzg +/types/netease-captcha/ @norubidium +/types/netlify-identity-widget/ @nkprince007 /types/netmask/ @mhfrantz /types/network-interfaces/ @anderswestberg +/types/new-github-issue-url/ @BendingBender +/types/new-github-release-url/ @BendingBender /types/new-relic-browser/ @renehamburger @piotrkubisa /types/newline-remove/ @OpenByteDev /types/newman/ @LogvinovLeon @Graham42 -/types/newrelic/ @mastermatt @brookspatton +/types/newrelic/ @mastermatt @brookspatton @MichaelRBond /types/nexpect/ @vvakame /types/next/ @dru89 @brikou @jthegedus @resir014 @scottdj92 @joaovieira @ajliv /types/next-redux-saga/ @leocavalcante /types/next-redux-wrapper/ @stevegeek @Jungwoo-An /types/next-server/ @dru89 @brikou @jthegedus @resir014 @scottdj92 @joaovieira @ajliv +/types/next-tick/ @BendingBender /types/ng-command/ @stephenlautier /types/ng-cordova/ @ksachdeva /types/ng-dialog/ @stephenlautier @@ -3112,9 +3412,11 @@ /types/ngtoaster/ @btesser /types/ngwysiwyg/ @patrick-mackay /types/nightmare/ @horiuchi @samyang-au @Bleser92 -/types/nightwatch/ @rkavalap @schlesiger +/types/nightwatch/ @rkavalap @schlesiger @ClaytonAstrom +/types/nise/ @a-tarasyuk /types/nivo-slider/ @AndersonFriaca /types/noble/ @swook @shantanubhadoria @lukel99 @bioball @keton @thegecko +/types/noble-mac/ @swook @shantanubhadoria @lukel99 @bioball @keton @thegecko /types/nock/ @bonnici @horiuchi @afharo @mastermatt @damour @paambaati /types/nodal/ @charrondev /types/node/v0/ @Microsoft @DefinitelyTyped @@ -3123,7 +3425,7 @@ /types/node/v7/ @Microsoft @DefinitelyTyped @parambirs @tellnes @WilcoBakker @eps1lon @KSXGitHub @Archcry /types/node/v8/ @Microsoft @DefinitelyTyped @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e @brunoscheufler @KSXGitHub @islishude @r3nya /types/node/v9/ @Microsoft @DefinitelyTyped @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e @brunoscheufler @mohsen1 @KSXGitHub @a-tarasyuk @islishude @r3nya @eyqs -/types/node/ @Microsoft @DefinitelyTyped @jkomyno @a-tarasyuk @alvis @r3nya @brunoscheufler @smac89 @tellnes @DeividasBakanas @eyqs @Flarna @Hannes-Magnusson-CK @KSXGitHub @hoo29 @kjin @ajafff @islishude @mwiktorczyk @matthieusieben @mohsen1 @n-e @octo-sniffle @parambirs @eps1lon @SimonSchick @ThomasdenH @WilcoBakker @wwwy3y3 @ZaneHannanAU @jeremiergz +/types/node/ @Microsoft @DefinitelyTyped @jkomyno @a-tarasyuk @alvis @r3nya @brunoscheufler @smac89 @tellnes @DeividasBakanas @eyqs @Flarna @Hannes-Magnusson-CK @KSXGitHub @hoo29 @kjin @ajafff @islishude @mwiktorczyk @matthieusieben @mohsen1 @n-e @octo-sniffle @parambirs @eps1lon @SimonSchick @ThomasdenH @WilcoBakker @wwwy3y3 @ZaneHannanAU @jeremiergz @samuela /types/node-7z/ @erkie /types/node-array-ext/ @Beng89 /types/node-cache/ @chrootsu @dthunell @useltmann @@ -3134,13 +3436,14 @@ /types/node-dijkstra/ @nokutu /types/node-dir/ @panuhorsmalahti /types/node-dogstatsd/ @chrisbobo -/types/node-emoji/ @jonestristand @styu +/types/node-emoji/ @jonestristand @styu @rimiti /types/node-fetch/ @torstenwerner @nikcorg /types/node-fibers/ @caryhaynie -/types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 @beenotung @joeflateau +/types/node-forge/ @westy92 @flynetworks @a-k-g @rafal2228 @beenotung @joeflateau @Apologiz @timhwang21 @supaiku0 /types/node-gcm/ @horiuchi /types/node-geocoder/ @rosek86 /types/node-getopt/ @kcauchy +/types/node-gettext/ @sameercaresu /types/node-hid/ @mhegazy @ert78gb @thegecko /types/node-horseman/ @apratheek /types/node-hue-api/ @fjmorel @@ -3152,14 +3455,14 @@ /types/node-memwatch/ @Kroisse /types/node-mysql-wrapper/ @kataras /types/node-notifier/ @tkQubo -/types/node-polyglot/ @timjk +/types/node-polyglot/ @timjk @liamross /types/node-powershell/ @rodrigoff /types/node-pushnotifications/ @menushka /types/node-ral/ @ssddi456 /types/node-red/ @andersea @tbowmo /types/node-redis-pubsub/ @renekeijzer /types/node-resque/ @gordey4doronin -/types/node-rsa/ @alitaheri @xm +/types/node-rsa/ @alitaheri @xm @ffflorian /types/node-schedule/ @cyrilschumacher @flowpl /types/node-slack/ @tkQubo /types/node-snap7/ @heilingbrunner @@ -3172,6 +3475,7 @@ /types/node-validator/ @kengorab /types/node-vault/ @YuJianrong /types/node-wit/ @julienduf +/types/node-xlsx/ @cWatermelon /types/node-xmpp-client/ @PJakcson /types/node-xmpp-core/ @PJakcson /types/node-zookeeper-client/ @plantain-00 @jessezhang91 @@ -3195,6 +3499,7 @@ /types/nookies/ @andreasbergqvist /types/nopt/ @jbondc /types/normalize-package-data/ @jdxcode +/types/normalize-path/ @BendingBender /types/normalize-url/ @odin3 @BendingBender @mathieumg /types/notie/ @mateusdemboski /types/notify/ @hellochar @@ -3206,13 +3511,19 @@ /types/nouislider/ @bleuarg @lagaffe /types/novnc-core/ @smithkl42 @BendingBender /types/npm/ @SomaticIT +/types/npm-email/ @BendingBender +/types/npm-keyword/ @BendingBender +/types/npm-name/ @BendingBender /types/npm-package-arg/ @mgroenhoff @OiYouYeahYou /types/npm-packlist/ @ajafff +/types/npm-paths/ @BendingBender +/types/npm-run-path/ @BendingBender +/types/npm-user/ @BendingBender +/types/npm-user-packages/ @BendingBender /types/npmlog/ @DanielMSchmidt @littlepiggy03 /types/ns-api/ @Archcry /types/nslog/ @unindented /types/nsqjs/ @cezaryrk -/types/nuka-carousel/ @Romic @altaudio /types/number-is-nan/ @mhegazy /types/number-to-words/ @frederickfogerty /types/numeral/ @vbortone @BehindTheMath @klujanrosas @@ -3226,8 +3537,9 @@ /types/nwmatcher/ @woutervh- /types/o.js/ @IceOnFire @bradzacher @janhommes @jcchalte /types/oauth/ @nonAlgebraic @EduardoAC +/types/oauth-shim/ @BendingBender /types/oauth.js/ @nobuoka -/types/oauth2-server/ @vangorra @cirick @d-fischer +/types/oauth2-server/ @vangorra @cirick @d-fischer @rvitorsantos /types/oauth2orize/ @wokim @heycalmdown @stevehipwell /types/obelisk.js/ @bdrupieski /types/obj-file-parser/ @benc-uk @@ -3240,7 +3552,7 @@ /types/object-keys-mapping/ @newraina /types/object-map/ @wolfgang42 /types/object-merge/ @OpenByteDev -/types/object-path/ @pocesar +/types/object-path/ @pocesar @BendingBender /types/object-refs/ @3fd /types/object.getownpropertydescriptors/ @VitorLuizC /types/oblo-util/ @Oblosys @@ -3248,8 +3560,10 @@ /types/observe-js/ @herrmanno /types/oclazyload/ @rolandzwaga /types/odata/ @janhommes @jcchalte +/types/oembed-parser/ @BendingBender /types/ofe/ @Morfent /types/office-js/ @OfficeDev @LanceEA @Zlatkovsky @kbrandl @Rick-Kirkham @AlexJerabek @ElizabethSamuel-MSFT +/types/office-js-preview/ @OfficeDev @Zlatkovsky @kbrandl @Rick-Kirkham @AlexJerabek @ElizabethSamuel-MSFT /types/office-runtime/ @Zlatkovsky @mscharlock /types/offline-js/ @cgwrench /types/oibackoff/ @geoffreak @@ -3258,40 +3572,47 @@ /types/okta__okta-vue/ @innovation-team /types/ol/ @yairtawil /types/omggif/ @ffflorian +/types/on-change/ @BendingBender /types/on-finished/ @czechboy0 @BendingBender /types/on-headers/ @jjeffery @BendingBender /types/on-wake-up/ @ajafff /types/once/ @denis-sokolov @BendingBender +/types/one-time/ @BendingBender /types/onesignal-cordova-plugin/ @broder /types/onetime/ @BendingBender /types/oniguruma/ @smhxx /types/onoff/ @marcel-ernst @Kallu609 /types/ontime/ @Hirse /types/open/ @Bartvds +/types/open-editor/ @BendingBender +/types/openapi-factory/ @runebaas /types/opener/ @tikurahul /types/openfin/v17/ @chrisbarker /types/openfin/v29/ @chrisbarker @rdepena -/types/openfin/ @chrisbarker @rdepena @whyn07m3 +/types/openfin/v34/ @chrisbarker @rdepena @whyn07m3 +/types/openfin/ @chrisbarker @rdepena @whyn07m3 @licui3936 /types/openjscad/ @danmarshall /types/openlayers/v2/ @bolhovsky /types/openlayers/v3/ @osechet @matthiasdailey-ccri /types/openlayers/ @osechet @wb14123 @ailrun @mylen @iamthechad @danmana @yairtawil @pierremarc @hauke96 @gberaudo -/types/openpgp/ @errietta @damonpam +/types/openpgp/ @errietta @damonpam @po5i @ecamellini /types/openstack-wrapper/ @sanjaymadane /types/opentok/ @westy92 @CatGuardian /types/opentype.js/ @danmarshall @edzis /types/opn/ @shinnn @SomaticIT @tlent -/types/opossum/ @quinnlangille @lance +/types/opossum/ @quinnlangille @merufm @lance @mastermatt /types/optics-agent/ @crevil /types/optimist/ @soywiz @chbrown /types/optimize-css-assets-webpack-plugin/ @odnamrataizem /types/ora/v0/ @basarat @screendriver +/types/ora/v1/ @basarat @screendriver @BendingBender @azasypkin /types/ora/ @basarat @screendriver @BendingBender @azasypkin /types/oracle__oraclejet/ @nolakara @jingxwu /types/oracledb/ @Bigous /types/orchestrator/ @tkQubo @TeamworkGuy2 /types/orderedmap/ @bradleyayers /types/orientjs/ @saeedtabrizi +/types/original/ @wcarson /types/os-homedir/ @mhegazy /types/os-locale/v1/ @AyaMorisawa @BendingBender /types/os-locale/ @AyaMorisawa @BendingBender @@ -3301,6 +3622,7 @@ /types/osmtogeojson/ @tkqubo /types/osrm/ @DenisCarriere /types/otplib/ @renjfk +/types/overlayscrollbars/ @KingSora /types/overwatch-api/ @JoshuaHall /types/owasp-password-strength-test/ @stephtr /types/owl.carousel/ @igorissen @KennethanCeyer @@ -3310,11 +3632,13 @@ /types/p-cancelable/ @BendingBender /types/p-catch-if/ @LinusU /types/p-debounce/ @BendingBender -/types/p-defer/ @SamVerschueren +/types/p-defer/ @SamVerschueren @BendingBender /types/p-do-whilst/ @BendingBender /types/p-each-series/ @BendingBender /types/p-event/ @BendingBender /types/p-every/ @BendingBender +/types/p-forever/ @BendingBender +/types/p-is-promise/ @BendingBender /types/p-lazy/ @BendingBender /types/p-limit/ @BendingBender @LinusU /types/p-loading/ @renjfk @@ -3323,9 +3647,12 @@ /types/p-map/ @BendingBender /types/p-map-series/ @BendingBender /types/p-memoize/ @forabi +/types/p-min-delay/ @BendingBender /types/p-one/ @BendingBender +/types/p-pipe/ @BendingBender /types/p-progress/ @icopp /types/p-props/ @BendingBender +/types/p-queue/v2/ @BendingBender @evanshortiss /types/p-queue/ @BendingBender @evanshortiss /types/p-reduce/ @BendingBender /types/p-reflect/ @BendingBender @@ -3335,18 +3662,23 @@ /types/p-some/ @BendingBender /types/p-tap/ @BendingBender /types/p-throttle/ @BendingBender +/types/p-time/ @BendingBender /types/p-timeout/ @BendingBender +/types/p-times/ @BendingBender /types/p-try/ @BendingBender @LinusU +/types/p-wait-for/v1/ @BendingBender /types/p-wait-for/ @BendingBender +/types/p-waterfall/ @BendingBender /types/p-whilst/ @BendingBender /types/p2/ @clark-stevenson /types/p5/ @p5-types -/types/package-json/ @jinwoo +/types/package-json/ @jinwoo @BendingBender /types/packery/ @piraveen @hanssens /types/pad/ @mhegazy /types/page/ @43081j /types/paho-mqtt/ @amikhalev /types/pako/ @cappellin @calebegg +/types/palx/ @mikefowler /types/pangu/ @plantain-00 /types/papaparse/ @torpedro @rainshen49 @jfloff @johnnyreilly @albertorestifo @BehindTheMath @3af @jliuhtonen /types/paper/ @clark-stevenson @Xakaloz @sebaswebdev @rfried @@ -3355,17 +3687,25 @@ /types/parcel-bundler/ @pinage404 /types/parcel-env/ @fathyb /types/parent-package-json/ @sgmccli +/types/parents/ @TeamworkGuy2 /types/parity-pmd/ @leovujanic @jewbre /types/parity-pmr/ @leovujanic /types/parity-poe/ @leovujanic -/types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas -/types/parse-git-config/ @leonard-thieu @deltaidea +/types/park-miller/ @BendingBender +/types/parse/v1/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas +/types/parse/ @dpoetzsch @jaeggerr @flavionegrao @wesleygrimes @owsas @agoldis +/types/parse-columns/ @BendingBender +/types/parse-filepath/ @BendingBender +/types/parse-git-config/v2/ @leonard-thieu @deltaidea +/types/parse-git-config/ @leonard-thieu @deltaidea @BendingBender /types/parse-github-url/ @ajafff /types/parse-glob/ @glen-84 /types/parse-json/ @mrmlnc /types/parse-link-header/ @zelein /types/parse-mockdb/ @dpoetzsch /types/parse-ms/ @Roaders +/types/parse-numeric-range/ @eoin-obrien +/types/parse-passwd/ @BendingBender /types/parse-torrent/ @niieani @tlaziuk /types/parse-torrent-file/ @tlaziuk /types/parse-unit/ @Jack-Works @@ -3380,30 +3720,32 @@ /types/parsecurrency/ @cristianrgreco /types/parseurl/ @bomret /types/parsimmon/ @Bartvds @mizunashi-mana @bcherny @bvanreeven @leonard-thieu @MrJohz -/types/passport/ @horiuchi @enaeseth @theigor @tlaziuk @danielpa9708 +/types/passport/ @horiuchi @enaeseth @theigor @tlaziuk @danielpa9708 @kstiehl /types/passport-anonymous/ @0x6368656174 -/types/passport-auth0/ @johnbendi @iamvishnusankar +/types/passport-auth0/ @johnbendi @iamvishnusankar @duncanhall /types/passport-azure-ad/ @ShekharNain /types/passport-beam/ @AtlasDev +/types/passport-bnet/ @ivan94 /types/passport-cognito/ @mbutsykin /types/passport-discord/ @kzay /types/passport-facebook/ @staticfunction @lucasmacosta /types/passport-facebook-token/ @rmartone @mrand01 -/types/passport-github/ @yasupeke -/types/passport-github2/ @yasupeke @mthmulders @codepunkt +/types/passport-github/ @yasupeke @reggaepanda +/types/passport-github2/ @yasupeke @mthmulders @codepunkt @ivan94 /types/passport-google-oauth/ @staticfunction /types/passport-google-oauth2/ @bluehatbrit -/types/passport-http/ @krizalys @tlaziuk @cjbarth +/types/passport-http/ @krizalys @tlaziuk @cjbarth @jamesadarich /types/passport-http-bearer/ @isman-usoh /types/passport-jwt/ @jindev /types/passport-kakao/ @Park9eon @zerocho +/types/passport-linkedin-oauth2/ @andrewvetovitz /types/passport-local/ @SomaticIT /types/passport-local-mongoose/ @linusbrolin /types/passport-naver/ @Park9eon @zerocho -/types/passport-oauth2/ @pasieronen @WangZishi @EduardoAC +/types/passport-oauth2/ @pasieronen @WangZishi @EduardoAC @ivan94 /types/passport-oauth2-client-password/ @akaNightmare /types/passport-remember-me-extended/ @AylaJK -/types/passport-saml/ @cjbarth @dassennato +/types/passport-saml/ @cjbarth @dassennato @ksamborski /types/passport-steam/ @kzay /types/passport-strategy/ @liorm /types/passport-twitter/ @staticfunction @@ -3416,6 +3758,9 @@ /types/path-exists/ @shiwano @BendingBender /types/path-is-absolute/ @mhegazy /types/path-is-inside/ @aomarks +/types/path-key/ @BendingBender +/types/path-regex/ @BendingBender +/types/path-type/ @BendingBender /types/pathfinding/ @BNedry /types/pathjs/ @lokeshpeta /types/pathwatcher/ @GlenCFL @@ -3425,6 +3770,7 @@ /types/paypal-rest-sdk/ @trainerbill /types/pbf/ @cschwarz /types/pbkdf2/ @timonegk +/types/pdf2image/ @taoqf /types/pdfjs-dist/ @jbaldwin /types/pdfkit/ @erichillah /types/pdfmake/ @m1llen1um @radziksh @evolkmann @@ -3438,6 +3784,7 @@ /types/permit/ @jannikkeye /types/persona/ @Nycto /types/pet-finder-api/ @me +/types/petit-dom/ @JamesMessinger /types/pg/v6/ @pspeter3 /types/pg/ @pspeter3 /types/pg-ears/ @bradleyayers @@ -3465,15 +3812,16 @@ /types/pick-weight/ @rsxdalv /types/pickadate/ @theodorejb @leonard-thieu /types/picturefill/ @alaz +/types/pid-from-port/ @BendingBender /types/pidusage/ @cyrilschumacher @mx601595686 /types/pify/ @samverschueren @mad-mike @c7hm4r -/types/pigpio/ @manerfan +/types/pigpio/ @manerfan @erikma /types/pigpio-dht/ @erikma /types/pikaday/ @MidnightDesign @wake42 @mezoistvan /types/pikaday-time/ @Sayan751 /types/pinkyswear/ @chances /types/pino/v3/ @psnider -/types/pino/ @psnider @BendingBender @screendriver @paambaati @alferpal +/types/pino/ @psnider @BendingBender @screendriver @paambaati @alferpal @mortiy /types/pino-http/ @screendriver /types/pino-multi-stream/ @JakeGinnivan /types/pinterest-sdk/ @adamburmister @@ -3483,6 +3831,8 @@ /types/pixi.js/ @clark-stevenson /types/pkg-conf/ @jorgegonzalez /types/pkg-dir/ @NK-WEB-Git +/types/pkg-up/ @forivall +/types/pkg-versions/ @BendingBender /types/pkijs/ @microshine /types/platform/ @JakeH /types/playcanvas/ @Neoflash1979 @@ -3503,6 +3853,13 @@ /types/podcast/ @nikeee /types/podium/ @AJamesPhillips /types/point-in-polygon/ @dyst5422 @kogai +/types/pollyjs__adapter/ @feinoujc +/types/pollyjs__adapter-fetch/ @feinoujc +/types/pollyjs__adapter-node-http/ @jlmessenger +/types/pollyjs__core/ @feinoujc +/types/pollyjs__persister/ @feinoujc +/types/pollyjs__persister-fs/ @feinoujc +/types/pollyjs__utils/ @feinoujc /types/polyfill-service/ @Alorel /types/polylabel/ @DenisCarriere /types/polyline/ @Kern0 @@ -3510,10 +3867,15 @@ /types/polymer-ts/ @lgrignon /types/popcorn/ @grapswiz /types/portscanner/ @douglasduteil +/types/positive-zero/ @BendingBender /types/postal/ @lokeshpeta @myitcv /types/postcss-calc/ @huan086 /types/postcss-icss-values/ @huan086 +/types/postcss-modules-extract-imports/ @huan086 +/types/postcss-modules-local-by-default/ @huan086 /types/postcss-modules-resolve-imports/ @huan086 +/types/postcss-modules-scope/ @huan086 +/types/postcss-url/ @lenovouser /types/postman-collection/ @kbuzby /types/postmark/ @benbayard @jineshshah36 /types/pouch-redux-middleware/ @charrondev @@ -3545,7 +3907,10 @@ /types/pretty-bytes/v4/ @plantain-00 /types/pretty-bytes/ @plantain-00 @danielasy /types/pretty-format/ @ikatyang -/types/pretty-ms/ @BendingBender @ocboogie +/types/pretty-hrtime/ @BendingBender +/types/pretty-ms/v3/ @BendingBender @ocboogie +/types/pretty-ms/ @BendingBender @ocboogie @silh +/types/preval.macro/ @huan086 /types/printf/ @AluisioASG /types/priorityqueuejs/ @geoffreak /types/prismic-dom/ @nickw444 @sbilstein @@ -3555,7 +3920,7 @@ /types/progress/ @sebastian-lenz /types/progressbar/ @atd-schubert /types/progressjs/ @zaneli -/types/proj4/ @DenisCarriere +/types/proj4/ @DenisCarriere @BendingBender /types/proj4leaflet/ @BendingBender /types/project-oxford/ @scsouthw /types/prometheus-gc-stats/ @danwbyrne @@ -3563,21 +3928,23 @@ /types/promise-ftp/ @coolreader18 /types/promise-ftp-common/ @coolreader18 /types/promise-map-limit/ @kohlmannj +/types/promise-memoize/ @forivall /types/promise-pg/ @coldacid -/types/promise-polyfill/ @skysteve +/types/promise-polyfill/ @skysteve @djcsdy /types/promise-pool/ @vilic /types/promise-queue/ @LachlanStuart /types/promise-retry/ @shirakaba /types/promise-sftp/ @coolreader18 /types/promise-timeout/ @Aankhen /types/promise.prototype.finally/ @slavik57 @BendingBender +/types/promised-ldap/ @pluma /types/promised-temp/ @rokadias /types/promisify-node/ @borekb /types/promisify-supertest/ @aleung /types/prompt-sync/ @MugeSo /types/prompt-sync-history/ @MugeSo /types/promptly/ @danrspencer -/types/prompts/ @Berkays +/types/prompts/ @Berkays @danielpa9708 @kamontat /types/prop-types/ @DovydasNavickas @ferdaber /types/proper-lockfile/ @qlonik /types/properties-reader/ @Goldsmith42 @@ -3606,16 +3973,20 @@ /types/proxy-lists/ @BehindTheMath /types/proxy-verifier/ @BehindTheMath /types/proxyquire/ @jt000 +/types/ps-list/ @BendingBender /types/ps-tree/ @alessiopcc +/types/pseudo-audio-param/ @kirbysayshi +/types/psl/ @BendingBender /types/ptomasroos__react-native-multi-slider/ @Slessi /types/pty.js/ @enlight /types/public-ip/ @BendingBender -/types/pubnub/ @bitbankinc @rollymaduk @vitosamson +/types/pubnub/ @bitbankinc @rollymaduk @vitosamson @FlorianDr @danduh /types/pubsub-js/ @borisyankov /types/pug/ @TonyPythoneer @19majkel94 /types/pulltorefreshjs/ @DanielRosenwasser @humpedli /types/pump/ @tlaziuk /types/pumpify/ @JustinBeckwith @aoberoi +/types/punycode/ @yavanosta /types/pupa/ @nju33 /types/puppeteer/v0/ @marvinhagemeister @cdeutsch /types/puppeteer/ @marvinhagemeister @cdeutsch @ksm2 @SimonSchick @@ -3630,7 +4001,7 @@ /types/q-io/ @Bartvds /types/q-retry/ @vilic /types/qhistory/ @Kovensky -/types/qiniu-js/ @taoqf +/types/qiniu-js/ @taoqf @qiqizjl /types/qlik/ @RubenSlabbert @AginicX /types/qlik-engineapi/ @konne @richardison /types/qlik-visualizationextensions/ @konne @@ -3639,8 +4010,9 @@ /types/qrcode.react/ @mleko /types/qs/ @RWander @leonyu @tehbelinda @zyml @artursvonda @CarlosBonetti /types/qtip2/ @Seltzer @leonard-thieu -/types/query-string/ @SamVerschueren @tkrotoff @huhuanming @MadaraUchiha @shssoichiro +/types/query-string/ @SamVerschueren @tkrotoff @huhuanming @MadaraUchiha @shssoichiro @jarrku /types/querystringify/ @ilich +/types/quick-lru/v1/ @BendingBender /types/quick-lru/ @BendingBender /types/quill/ @sumitkm @guillaume-ro-fr @43081j @AnielloFalcone @mhamri /types/quixote/ @greybax @@ -3651,13 +4023,24 @@ /types/qwest/ @lindsayevans /types/r-script/ @NaridaL /types/rabbit.js/ @wokim +/types/rabbitmq-schema/ @rulezzz1987 /types/radium/ @alexgorbatchev @nupplaphil @asvetliakov /types/radius/ @codeanimal -/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @CaptJakk @deftomat @deptno @blimusiek @biern @rayhaneh @rgm @drewwyatt +/types/radix64/ @huan086 +/types/raf/ @BenLorantfy +/types/ramda/ @donnut @tycho01 @mdekrey @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @samsonkeung @angeloocana @raynerd @googol @moshensky @ethanresnick @leighman @CaptJakk @deftomat @deptno @blimusiek @biern @rayhaneh @rgm @drewwyatt @jottenlips @minitesh +/types/random-boolean/ @BendingBender +/types/random-float/ @BendingBender +/types/random-int/ @BendingBender +/types/random-item/ @BendingBender /types/random-js/ @pistacchio /types/random-number/ @OpenByteDev +/types/random-obj-key/ @BendingBender +/types/random-obj-prop/ @BendingBender /types/random-seed/ @endel /types/random-string/ @stpettersens +/types/randoma/ @BendingBender +/types/randombytes/ @BendingBender /types/randomcolor/ @feitzi @BradyLiles /types/range-parser/ @tlaziuk /types/rangyinputs/ @ersimont @@ -3680,10 +4063,13 @@ /types/raygun/ @UberMouse /types/raygun4js/ @xt0rted @BenjaminHarding @UberMouse /types/rbac-a/ @tlaziuk -/types/rc/ @DanielRosenwasser +/types/rc/ @DanielRosenwasser @BendingBender +/types/rc-progress/ @jussikinnula /types/rc-select/ @DenisTirilis /types/rc-slider/ @mantasmarcinkus @mattoni @paustint @j-fro @Deanna2 +/types/rc-switch/ @karol-majewski /types/rc-time-picker/ @Hoff97 +/types/rc-tooltip/ @rhysd @ahstro @vsaarinen /types/rc-tree/ @johnnyreilly @Methuselah96 /types/rcloader/ @panuhorsmalahti /types/rdf-data-model/ @rubensworks @@ -3692,7 +4078,7 @@ /types/re-base/ @jordandrako /types/reach__router/ @kingdaro /types/react/v15/ @bbenezech @pzavolinsky @digiguru @ericanderson @tkrotoff @DovydasNavickas @onigoetz -/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @hotell @franklixuefei +/types/react/ @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @tkrotoff @DovydasNavickas @onigoetz @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @hotell @franklixuefei @Kovensky @pshrmn /types/react-adal/ @dkorolev1 /types/react-albus/ @sseppola @conradreuter @kuirak /types/react-alert/v2/ @ssyrell @@ -3701,25 +4087,27 @@ /types/react-amplitude/ @rayzor65 /types/react-animate-on-scroll/ @ralbuque /types/react-app/ @prakarshpandey -/types/react-aria-menubutton/ @forabi @crohlfs +/types/react-aria-menubutton/ @forabi @crohlfs @karmats /types/react-aria-modal/ @forabi /types/react-autocomplete/ @lstanden /types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne @cdeutsch @rosskevin /types/react-avatar-editor/ @diogocorrea @gabsprates -/types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint @marknelissen +/types/react-beautiful-dnd/ @varHarrie @bradleyayers @paustint @marknelissen @enricoboccadifuoco @lonyele /types/react-better-password/ @mhuynh1 -/types/react-big-calendar/ @piotrwitek @paustint @pikpok @eps1lon @strongpauly +/types/react-big-calendar/ @piotrwitek @paustint @pikpok @eps1lon @strongpauly @janb87 +/types/react-blessed/ @me /types/react-body-classname/ @mhegazy /types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall @jrakotoharisoa @r3nya @t49tran /types/react-bootstrap-date-picker/ @LKay @ssi-hu-antal-bodnar /types/react-bootstrap-daterangepicker/ @ianks /types/react-bootstrap-table/v2/ @flaub @alelode @UJosue10 /types/react-bootstrap-table/ @flaub @alelode @UJosue10 @dawnmist @Ogglas -/types/react-bootstrap-typeahead/ @Guymestef @radziksh @PaitoAnderson +/types/react-bootstrap-typeahead/ @Guymestef @radziksh @PaitoAnderson @arichter83 /types/react-breadcrumbs/ @guoyunhe /types/react-breadcrumbs-dynamic/ @mitsuruog /types/react-broadcast/ @kandros /types/react-burger-menu/ @radziksh +/types/react-cache/ @skovy /types/react-calendar-heatmap/ @9renpoto /types/react-calendar-timeline/ @radziksh @acemac /types/react-cartographer/ @trevonmckay @@ -3730,14 +4118,15 @@ /types/react-coinhive/ @sktbcbbs /types/react-collapse/ @Kimahriman /types/react-collapsible/ @knegusen -/types/react-color/ @LKay @markspolakovs @mntdn -/types/react-confirm/ @santiagodoldan +/types/react-color/ @LKay @markspolakovs @mntdn @nkgrnkgr +/types/react-confirm/ @santiagodoldan @marknelissen /types/react-content-loader/ @alaatm @samwalshnz /types/react-copy-to-clipboard/ @mabels @BernabeFelix /types/react-copy-write/ @samhh @davej /types/react-countup/ @danielbrodin /types/react-credit-cards/ @vstrimaitis @olefrank /types/react-cropper/ @stepancar +/types/react-css-collapse/ @dford07 /types/react-css-modules/ @KostyaEsmukov @skirsdeda /types/react-css-transition-replace/ @LKay /types/react-currency-formatter/ @pastushenkoy @Jeka-Vasiliev @@ -3748,7 +4137,7 @@ /types/react-data-grid/ @SupernaviX @KieranPeat @martinnov92 @baso53 /types/react-datagrid/ @stephenjelfs /types/react-date-range/ @Junbong -/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue @KoalaHuman @seansfkelley +/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue @KoalaHuman @seansfkelley @justingrant @jakeboone02 /types/react-daterange-picker/ @uncovertruth @MartynasZilinskas @donaldtf @vladflorescu94 /types/react-dates/ @ArturAmpilogov @NathanNZ /types/react-daum-postcode/ @Sa-ryong @@ -3759,7 +4148,8 @@ /types/react-dom/v15/ @MartynasZilinskas /types/react-dom/ @MartynasZilinskas @theruther4d /types/react-dom-factories/ @jgoz -/types/react-draft-wysiwyg/ @imechZhangLY +/types/react-dotdotdot/ @jczyzewski +/types/react-draft-wysiwyg/ @imechZhangLY @brunoMaurice /types/react-dragtastic/ @nscarcella /types/react-dropzone/v2/ @matdube @LynxEyes @goblindegook @benbayard /types/react-dropzone/v3/ @matdube @LynxEyes @goblindegook @benbayard @LKay @@ -3773,30 +4163,34 @@ /types/react-faux-dom/ @alitaheri @cleverguy25 @deviousm @hanai /types/react-file-input/ @dmitryrogozhny /types/react-file-reader-input/ @dmitryrogozhny @alitaheri +/types/react-filepond/ @zposten /types/react-flag-icon-css/ @jonfreedman /types/react-flags-select/ @senukartur -/types/react-flatpickr/ @begincalendar +/types/react-flatpickr/ @begincalendar @snaveevans /types/react-flex/ @pushplay /types/react-flexr/ @pushplay /types/react-fontawesome/ @timurrustamov @dublicator @vincaslt @gavingregory /types/react-form/v1/ @cameron-mcateer /types/react-form/ @cameron-mcateer @TiuSh /types/react-foundation/ @danielearwicker +/types/react-frontload/ @rockon404 /types/react-gateway/ @jsonunger /types/react-geosuggest/ @brmenchl /types/react-global-configuration/ @ryokik /types/react-google-login-component/ @koss-lebedev /types/react-google-maps-loader/ @vasilysn /types/react-google-places-suggest/ @vasilysn -/types/react-google-recaptcha/ @KoalaHuman +/types/react-google-recaptcha/ @KoalaHuman @tomsturge /types/react-gravatar/ @invliD /types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong @andrewhathaway /types/react-hamburger-menu/ @grzesie2k /types/react-hammerjs/v0/ @jsonunger /types/react-hammerjs/ @jsonunger @cecchi +/types/react-headroom/ @zerocho /types/react-helmet/v4/ @evanbb @isman-usoh /types/react-helmet/ @evanbb @isman-usoh @lith-light-g @sammkj @yuit /types/react-helmet-async/ @forabi +/types/react-highcharts/ @j1r1k /types/react-highlight/ @joshuakgoldberg /types/react-highlight-words/ @mhegazy @diogodca @kellyrmilligan /types/react-highlighter/ @oizie @@ -3805,7 +4199,7 @@ /types/react-hyperscript/ @tock203 /types/react-icon-base/ @apare @LKay /types/react-icons/ @apare @johnnyreilly @LKay -/types/react-image-crop/ @danielasy +/types/react-image-crop/ @danielasy @chaaya /types/react-image-fallback/ @8enSmith /types/react-image-gallery/ @adamwpc /types/react-imageloader/ @stephenjelfs @@ -3814,19 +4208,20 @@ /types/react-infinite/ @rhysd /types/react-infinite-calendar/ @christianchown /types/react-infinite-scroll-component/ @sroy3 @burtek @davidkevork @JoshuaScript -/types/react-infinite-scroller/ @Lapanti @psrebniak @WrathZA +/types/react-infinite-scroller/ @Lapanti @psrebniak @WrathZA @daggerjames +/types/react-inlinesvg/ @MyCryptoHQ @nickmccurdy /types/react-input-autosize/ @jsonunger @franklixuefei /types/react-input-calendar/ @stepancar /types/react-input-mask/v1/ @apare /types/react-input-mask/ @apare @dima7a14 /types/react-instantsearch/ @gburgett @jpowell -/types/react-instantsearch-core/ @gburgett @jpowell +/types/react-instantsearch-core/ @gburgett @jpowell @davidfurlong /types/react-instantsearch-dom/ @gburgett @jpowell /types/react-instantsearch-native/ @gburgett @jpowell /types/react-intl/v1/ @bgrieder -/types/react-intl/ @bgrieder @cdroulers @gyzerok @tillwolff @LKay @bhouser @kristerkari @formatlos @lukyth +/types/react-intl/ @bgrieder @cdroulers @gyzerok @tillwolff @LKay @bhouser @kristerkari @formatlos @lukyth @obedm503 /types/react-intl-redux/ @LKay -/types/react-is/ @AviVahl @christianchown +/types/react-is/ @AviVahl @christianchown @eps1lon /types/react-is-deprecated/ @seansfkelley /types/react-joyride/ @kdy1 @kamranayub /types/react-js-pagination/ @netoisc @@ -3838,7 +4233,9 @@ /types/react-lazyload/ @m0a /types/react-lazylog/ @benjaminRomano /types/react-leaflet/ @danzel @davschne @yuit +/types/react-leaflet-markercluster/ @Kimahriman /types/react-lifecycle-component/ @pixelshaded +/types/react-lifecycles-compat/ @bySabi /types/react-list/ @buptyyf @tomshen /types/react-loadable/ @Kovensky @odensc @ianks @tlaziuk @iMobs /types/react-loader/ @artfuldev @@ -3849,32 +4246,34 @@ /types/react-mce/ @morphologue /types/react-mdl/ @bradzacher /types/react-measure/ @asvetliakov @marcfallows -/types/react-mentions/ @activescott +/types/react-mentions/ @activescott @efedorenko /types/react-mixin/ @tkqubo /types/react-modal/ @radziksh @drewnoakes @homburg @ttamminen @hallowatcher @peterblazejewicz @jpowell /types/react-motion/ @stepancar @asvetliakov @dimitarnestorov /types/react-motion-slider/ @asvetliakov /types/react-motion-ui-pack/ @jsonunger -/types/react-native/ @alloy @huhuanming @iRoachie @skn0tt @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff @a-tarasyuk @mvdam @esemesek @mrnickel +/types/react-native/ @alloy @huhuanming @iRoachie @skn0tt @timwangdev @kamal @nelyousfi @alexdunne @swissmanu @bm-software @tkrotoff @a-tarasyuk @mvdam @esemesek @mrnickel @souvik-ghosh /types/react-native-android-taskdescription/ @christianchown -/types/react-native-auth0/ @ascariandrea +/types/react-native-auth0/ @ascariandrea @marknelissen /types/react-native-autocomplete-input/ @ifiokjr /types/react-native-background-timer/ @chillkroeteTTS /types/react-native-bluetooth-serial/ @RodrigoAWeber /types/react-native-calendars/ @Tyler-Zhang @DavidNorena @FabianMeul /types/react-native-communications/ @huhuanming @PaitoAnderson /types/react-native-custom-tabs/ @philnova -/types/react-native-datepicker/ @jacobbaskin -/types/react-native-dialog/ @MrLuje +/types/react-native-datepicker/ @jacobbaskin @nossbigg +/types/react-native-dialog/ @MrLuje @stackbuilders @ibarrae /types/react-native-dialogflow/ @jasonmerino /types/react-native-doc-viewer/ @iRoachie /types/react-native-document-picker/ @plantain-00 +/types/react-native-draggable-flatlist/ @stackbuilders @ibarrae /types/react-native-drawer/ @jnbt @suniahk /types/react-native-drawer-layout/ @jmfirth /types/react-native-elevated-view/ @fhelwanger /types/react-native-fabric/ @josephroque /types/react-native-fbsdk/ @ifiokjr /types/react-native-fetch-blob/ @MNBuyskih +/types/react-native-flip-card/ @imjakechapman /types/react-native-fs/ @pocesar @josephroque /types/react-native-google-signin/ @j-fro @bm-software @christianchown @echentw /types/react-native-htmlview/ @ifiokjr @@ -3886,23 +4285,28 @@ /types/react-native-keychain/ @DavidFarinha /types/react-native-loading-spinner-overlay/ @fhelwanger /types/react-native-material-design-searchbar/ @iRoachie +/types/react-native-material-dropdown/ @jaydeep987 /types/react-native-material-kit/ @iRoachie @timwangdev /types/react-native-material-textfield/ @mindhivefi @iRoachie /types/react-native-material-ui/ @iRoachie /types/react-native-mauron85-background-geolocation/ @djereg /types/react-native-mixpanel/ @r3nya +/types/react-native-modal-dropdown/ @echoulen /types/react-native-modalbox/ @iRoachie /types/react-native-multi-slider/ @Slessi /types/react-native-navbar/ @ryokik /types/react-native-orientation/ @MoLow /types/react-native-permissions/ @vincentlanglet /types/react-native-photo-view/ @christianchown +/types/react-native-platform-touchable/ @tngranados /types/react-native-popup-dialog/ @PaitoAnderson @connectdotz @bm-software /types/react-native-push-notification/ @PaitoAnderson @tomSawkins /types/react-native-qrcode/ @plantain-00 +/types/react-native-read-more-text/ @solkaz /types/react-native-referrer/ @christianchown /types/react-native-restart/ @christianchown /types/react-native-safari-view/ @mrand01 +/types/react-native-safe-area/ @pvinis /types/react-native-scaled-image/ @Jaeger25 /types/react-native-scrollable-tab-view/ @CaiHuan @egorshulga /types/react-native-sensor-manager/ @SahinVardar @@ -3926,8 +4330,10 @@ /types/react-native-vector-icons/ @iRoachie @timwangdev /types/react-native-version-number/ @VincentLanglet /types/react-native-video/ @huhuanming +/types/react-native-zeroconf/ @mattapet /types/react-navigation/v1/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi -/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @Slessi @magrinj @TizioFittizio @stigi @LinusU @jshosomichi @jakebooyah @brunoro @DenisFrezzato @mickaelw @maxdavidson @jkillian +/types/react-navigation/v2/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @magrinj @TizioFittizio @stigi @LinusU @jshosomichi @jakebooyah @brunoro @DenisFrezzato @mickaelw @maxdavidson @alechill @builtbyproxy @jkillian @jeroenvervaeke @chagasaway +/types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @bang88 @svbutko @levito @YourGamesBeOver @ArmandoAssuncao @cliedeman @magrinj @TizioFittizio @stigi @LinusU @jshosomichi @jakebooyah @brunoro @DenisFrezzato @mickaelw @maxdavidson @alechill @builtbyproxy @jkillian @jeroenvervaeke @chagasaway @denissb @skovhus /types/react-navigation-material-bottom-tabs/ @iRoachie /types/react-no-ssr/ @rafalfilipek /types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar @@ -3938,12 +4344,16 @@ /types/react-onclickoutside/ @LKay @surgeboris /types/react-onsenui/ @salim7 @jemmyw @lirbank /types/react-outside-click-handler/ @zubivan -/types/react-overlays/ @aaronbeall @vitosamson +/types/react-overlays/ @aaronbeall @vitosamson @aarondancer /types/react-owl-carousel/ @tbounsiar @igorissen @KennethanCeyer /types/react-paginate/v4/ @deevus @wouterhardeman @pegel03 @archy-bold -/types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold @yasupeke -/types/react-places-autocomplete/ @guilhermehubner @r3nya +/types/react-paginate/v5/ @deevus @wouterhardeman @pegel03 @archy-bold @yasupeke +/types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold @yasupeke @sugarshin @SPWizard01 +/types/react-panelgroup/ @qgolsteyn +/types/react-places-autocomplete/v6/ @guilhermehubner @r3nya @ApeNox @azizhk +/types/react-places-autocomplete/ @guilhermehubner @r3nya @ApeNox @azizhk /types/react-plotly.js/ @jonfreedman +/types/react-plyr/ @baorv /types/react-pointable/ @istefo @mdibyo /types/react-popover/ @jacoporicare /types/react-portal/v3/ @shuntksh @@ -3952,10 +4362,12 @@ /types/react-props-decorators/ @tkqubo /types/react-qr-reader/ @davidkevork /types/react-radio-group/ @jsonunger +/types/react-rangeslider/ @RichieRock /types/react-recaptcha/ @mhegazy @zzanol /types/react-reconciler/ @Methuselah96 /types/react-redux/v5/ @tkqubo @thasner @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva -/types/react-redux/ @tkqubo @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva @kallikrein @val1984 @jrakotoharisoa @apapirovski +/types/react-redux/v6/ @tkqubo @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva @kallikrein @val1984 @jrakotoharisoa @apapirovski @surgeboris +/types/react-redux/ @tkqubo @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo @pdeva @kallikrein @val1984 @jrakotoharisoa @apapirovski @surgeboris @soerenbf /types/react-redux-epic/ @forabi /types/react-redux-i18n/ @clementdevos /types/react-redux-toastr/ @Smiche @artyomsv @kulmajaba @@ -3970,7 +4382,7 @@ /types/react-router/v3/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @ssorallen @gillchristian @nulladdict /types/react-router/ @sergey-buturlakin @mrk21 @vasek17 @ngbrown @awendland @KostyaEsmukov @johnnyreilly @LKay @DovydasNavickas @tkrotoff @huy-nguyen @grmiade @DaIgeb @egorshulga @neuoy @rraina @pret-a-porter @t49tran @8enSmith /types/react-router-bootstrap/ @vlesierse @LKay @olmobrutall -/types/react-router-config/ @lith-light-g @johnnyreilly +/types/react-router-config/ @lith-light-g @johnnyreilly @NullMDR /types/react-router-dom/ @tkrotoff @huy-nguyen @p-jackson @johnnyreilly /types/react-router-hash-link/ @zoompie /types/react-router-native/ @ezintz @fhelwanger @@ -3980,6 +4392,7 @@ /types/react-router-redux/v3/ @isman-usoh @noah79 @rosendi /types/react-router-redux/v4/ @isman-usoh @noah79 @rosendi @LKay @DovydasNavickas /types/react-router-redux/ @huy-nguyen @8398a7 @mykolas +/types/react-rte/ @jclyons52 /types/react-s-alert/ @mitsuruog /types/react-scroll/ @sudoplz @GiedriusGrabauskas /types/react-scrollbar/ @stephenjelfs @@ -3989,23 +4402,26 @@ /types/react-show-more/ @naortor /types/react-side-effect/ @remojansen @0xcaff /types/react-sidebar/ @jeroenvervaeke -/types/react-sketchapp/ @ricokahler @DomiR +/types/react-simple-maps/ @thepocp +/types/react-sketchapp/ @ricokahler @DomiR @saschazar21 /types/react-slick/ @andrewBalekha @GiedriusGrabauskas @r3nya /types/react-slider/ @jsonunger /types/react-smooth-scrollbar/ @asvetliakov /types/react-sortable-hoc/ @NoHomey @charlesrey /types/react-sortable-pane/ @rhysd /types/react-sortable-tree/ @wouterhardeman @jzoric @kevinsperrine @acemac @dolezel +/types/react-sortable-tree-theme-file-explorer/ @dolezel /types/react-sound/ @koss-lebedev /types/react-sparklines/ @henrinormak /types/react-spinkit/v1/ @tkqubo @mleko @pelotom /types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol +/types/react-splitter-layout/ @snaptags /types/react-star-rating-component/ @marpstar /types/react-sticky/ @curtisw0 @ajhyndman /types/react-sticky-box/ @koss-lebedev /types/react-sticky-el/ @jbraithwaite /types/react-stickynode/ @tstirrat -/types/react-stripe-elements/ @dan-j @santiagodoldan @sonnysangha @9y5 @thchia +/types/react-stripe-elements/ @dan-j @santiagodoldan @sonnysangha @9y5 @thchia @yhnavein @virzak /types/react-svg-inline/ @kiyopikko /types/react-svg-pan-zoom/ @huy-nguyen /types/react-swf/ @stepancar @@ -4013,7 +4429,7 @@ /types/react-swipeable/ @GiedriusGrabauskas @mctep @horiuchi /types/react-swipeable-views/ @mxl @DeividasBakanas /types/react-syntax-highlighter/ @NoHomey @ajgamble-milner -/types/react-table/ @royxue @psakalo @Havret @andys8 +/types/react-table/ @royxue @psakalo @Havret @andys8 @Gelio /types/react-table-filter/ @gjsln /types/react-tabs/ @danez @Equationist /types/react-tag-autocomplete/ @jlismore @@ -4032,7 +4448,7 @@ /types/react-toastr/ @shssoichiro @DanRegazzi /types/react-toggle/v2/ @LKay @jsonunger /types/react-toggle/ @LKay -/types/react-tooltip/ @DeividasBakanas +/types/react-tooltip/ @DeividasBakanas @Vijayasingam /types/react-touch/ @grzesie2k /types/react-tracking/ @alloy /types/react-transition-group/v1/ @LKay @@ -4043,48 +4459,52 @@ /types/react-user-tour/ @ccancellieri /types/react-vertical-timeline-component/ @stephane-monnot /types/react-virtual-keyboard/ @bsurai -/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @kraenhansen @Stevearzh @mgoszcz2 @brandonhall +/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx @Stevearzh @mgoszcz2 @brandonhall @sbusch /types/react-virtualized-select/ @seansfkelley -/types/react-visibility-sensor/ @JRasmusBm +/types/react-visibility-sensor/ @JRasmusBm @gcangussu /types/react-webcam/ @squat /types/react-weui/ @tairan -/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya @MBillemaz @georg94 +/types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 @r3nya @MBillemaz @georg94 @tzarger /types/react-widgets-moment/ @dawnmist /types/react-window/ @martynaskadisa /types/react-window-size/ @jakejrichards -/types/react-youtube/ @kgtkr +/types/react-wow/ @mikepthomas +/types/react-youtube/ @kgtkr @salguerooo /types/react-youtube-embed/ @charles-salmon /types/reactable/ @spielc /types/reactcss/ @chrisgervang @LKay /types/reactstrap/v4/ @alihammad @mfal @danilobjr @fabiopaiva -/types/reactstrap/ @alihammad @mfal @danilobjr @FaithForHumans @timc13 @patrickrgaffney @prabodht +/types/reactstrap/ @alihammad @mfal @danilobjr @FaithForHumans @timc13 @patrickrgaffney @prabodht @georg94 /types/read/ @timjk /types/read-chunk/ @crispybee /types/read-package-tree/ @mgroenhoff /types/read-pkg/ @jdxcode /types/read-pkg-up/ @dudeofawesome @jdxcode +/types/readable-stream/ @TeamworkGuy2 /types/readdir-enhanced/ @mrmlnc /types/readdir-stream/ @Bartvds /types/readline-sync/ @jonestristand /types/readline-transform/ @dex4er /types/reapop/ @Barrokgl -/types/rebass/ @ryee-dev +/types/rebass/ @ryee-dev @jamesmckenzie /types/rebass__grid/ @antonvasin @vittorio @lhache @lavoaster /types/recaptcha2/ @l-jonas /types/recase/ @18steps -/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan @pkeuter @jrsaunde @paulmelnikow @crusectrl @apalugniok +/types/recharts/ @mthmulders @rapmue @royxue @ZheyangSong @richbai90 @caspeco-dan @pkeuter @jrsaunde @paulmelnikow @crusectrl @apalugniok @RobertStigsson /types/recharts-scale/ @johnnyreilly +/types/rechoir/ @BendingBender /types/recluster/ @dex4er -/types/recompose/ @iskandersierra @mrapogee @clayne11 @Pajn @lucasterra @brian-lives-outdoors +/types/recompose/ @iskandersierra @clayne11 @Pajn @lucasterra @brian-lives-outdoors @TiuSh /types/reconnect-core/ @thw0rted /types/reconnectingwebsocket/ @nguarracino /types/recorder-js/ @higuri /types/recursive-readdir/v1/ @elisee /types/recursive-readdir/ @elisee @MicahZoltu -/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski @1pete +/types/redent/ @BendingBender +/types/redis/ @soywiz @CodeAnimal @MugeSo @UppaJung @Rokt33r @43081j @barnski @1pete @blablapolicja @ferrantejake /types/redis-errors/ @43081j /types/redis-mock/ @BendingBender -/types/redis-rate-limiter/ @westy92 +/types/redis-rate-limiter/ @westy92 @nodify-at /types/redis-scripto/ @westy92 /types/redlock/v2/ @chrootsu /types/redlock/ @chrootsu @BendingBender @@ -4102,16 +4522,16 @@ /types/redux-devtools-dock-monitor/ @mc-petry /types/redux-devtools-log-monitor/ @mc-petry /types/redux-doghouse/ @BendingBender -/types/redux-first-router/ @Valbrand @viggyfresh @janb87 @corydeppen @jscinoz @surgeboris +/types/redux-first-router/ @Valbrand @viggyfresh @janb87 @corydeppen @jscinoz @surgeboris @geirsagberg /types/redux-first-router-link/ @janb87 /types/redux-first-router-restore-scroll/ @icopp /types/redux-first-routing/ @tlaziuk /types/redux-form/v4/ @aikoven -/types/redux-form/v6/ @carsonf @aikoven @LKay @bancek -/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @ethanresnick @reggino @maddijoyce @smifun +/types/redux-form/v6/ @carsonf @aikoven @LKay @bancek @mshaaban088 +/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola @tehbi4 @huwmartin @ethanresnick @reggino @maddijoyce @smifun @mshaaban088 /types/redux-immutable/v3/ @oizie @sebald @gavingregory /types/redux-immutable/ @oizie @sebald @gavingregory @lukyth -/types/redux-immutable-state-invariant/ @remojansen @highflying +/types/redux-immutable-state-invariant/ @remojansen @highflying @mihai-dinculescu /types/redux-infinite-scroll/ @silkyfray /types/redux-injectable-store/ @unindented /types/redux-localstorage/ @LKay @@ -4129,7 +4549,8 @@ /types/redux-promise-middleware/ @ianks /types/redux-recycle/ @LKay /types/redux-router/ @stepancar -/types/redux-saga-tester/ @BenLorantfy +/types/redux-saga-tester/ @BenLorantfy @lawsumisu +/types/redux-sentry-middleware/ @dolezel /types/redux-shortcuts/ @tstirrat /types/redux-socket.io/ @snakeego /types/redux-storage/ @asvetliakov @@ -4149,15 +4570,18 @@ /types/reflux/v0/ @mauricedb /types/reflux/ @mauricedb @LiangZugeng /types/registry-auth-token/ @mauricedb @LiangZugeng +/types/regression/ @MattiasMartens /types/relateurl/ @tkrotoff /types/relaxed-json/ @18steps /types/relay-runtime/ @voxmatt @alloy /types/rellax/ @shermendev -/types/remarkable/ @makepost +/types/remarkable/ @makepost @chigix +/types/remote-origin-url/ @BendingBender /types/remote-redux-devtools/ @ColinEberhardt @unindented @mamodom @colindekker /types/remove-markdown/ @RagibHasin /types/rename/ @Aankhen /types/replace-ext/ @DeividasBakanas +/types/replace-string/ @BendingBender /types/replacestream/ @dex4er /types/req-cwd/ @Alorel /types/request/ @soywiz @bonnici @Bartvds @joeskeen @ccurrens @lookfirst @mastermatt @josecolella @murbanowicz @@ -4165,6 +4589,7 @@ /types/request-ip/ @mrhen /types/request-promise/ @cglantschnig @joeskeen @AyaMorisawa @mastermatt /types/request-promise-native/ @gustavohenke @mastermatt +/types/request-stats/ @BendingBender /types/requestidlecallback/ @hax /types/requestretry/ @EricByers @trainerbill /types/require-dir/ @weekens @@ -4173,11 +4598,16 @@ /types/require-relative/ @MattiasBuelens /types/requirejs/ @jbaldwin /types/requirejs-domready/ @lefb766 +/types/requires-port/ @BendingBender /types/resemblejs/ @pimterry /types/reservoir/ @danvk /types/resize-img/ @higuri /types/resolve/ @marionebl @ajafff -/types/resolve-from/ @unional +/types/resolve-cwd/ @BendingBender +/types/resolve-from/v2/ @unional +/types/resolve-from/ @unional @BendingBender +/types/resolve-global/ @BendingBender +/types/resolve-pkg/ @mabels @BendingBender /types/resourcejs/ @shaunluttin /types/response-time/ @urossmolnik @TonyPythoneer @danmana /types/rest/ @Nemo157 @@ -4192,9 +4622,10 @@ /types/restify-plugins/ @KostyaTretyak /types/restler/ @cyrilschumacher /types/restling/ @loghorn +/types/restore-cursor/ @BendingBender /types/resumablejs/ @DanielMcAssey /types/rethinkdb/ @alexgorbatchev @AdrianFarmadin @kondi @hoishin -/types/retry/ @krenor +/types/retry/ @krenor @BendingBender /types/retry-as-promised/ @Raigen /types/rev-hash/ @ikatyang /types/revalidate/ @alex3165 @@ -4202,8 +4633,9 @@ /types/reveal/ @robertop87 @Nava2 /types/rewire/ @borislavjivkov @CaselIT /types/rfc2047/ @mugifly +/types/rgb-hex/ @BendingBender /types/rgrove__parse-xml/ @petejohanson -/types/rheostat/ @SashaBayan @kourge +/types/rheostat/ @SashaBayan @kourge @StefanWerW /types/rickshaw/ @niemyjski /types/rimraf/ @soywiz @e-cloud @bash /types/riot/ @Stubb0rn @@ -4212,17 +4644,24 @@ /types/riot-route/ @karak /types/riotcontrol/ @chrootsu /types/riotjs/ @vvakame +/types/ripemd160/ @BendingBender /types/rison/ @impworks /types/rivets/ @TrevorDev @matjanos +/types/rmc-drawer/ @Hoff97 /types/rmfr/ @pluma +/types/rn-fetch-blob/ @pengcao1 /types/roads/ @dancespiele /types/roads-server/ @dancespiele /types/rocksdb/ @MeirionHughes @danwbyrne /types/roll/ @icopp /types/rolling-rate-limiter/ @l-jonas +/types/rollup-plugin-commonjs/ @eoin-obrien /types/rollup-plugin-json/ @asmockler @hotell +/types/rollup-plugin-node-resolve/ @eoin-obrien +/types/rollup-plugin-sourcemaps/ @eoin-obrien +/types/roman-numerals/ @pluma /types/ronomon__crypto-async/ @BendingBender -/types/rosie/ @abner @subvertallchris @abukurov +/types/rosie/ @abner @subvertallchris @abukurov @adam187 /types/roslib/ @Pro @skycoop @dgorobopec /types/rot-js/ @atiaxi /types/round-to/ @seangenabe @@ -4278,12 +4717,28 @@ /types/sanitize-filename/ @Nemo157 /types/sanitize-html/ @rogierschouten @afshin @BehindTheMath @biermeester @WillGibson @sirMerr /types/sap__xsenv/ @mad-mike +/types/sarif/ @rscrivens +/types/sasl-anonymous/ @BendingBender +/types/sasl-digest-md5/ @BendingBender +/types/sasl-external/ @BendingBender +/types/sasl-plain/ @BendingBender +/types/sasl-scram-sha-1/ @BendingBender +/types/saslmechanisms/ @BendingBender +/types/saslprep/ @BendingBender +/types/sass/ @lenovouser @jleider /types/sass-graph/ @marvinhagemeister /types/sass-webpack-plugin/ @AepKill /types/sat/ @omni360 /types/satnav/ @DotNetNerd /types/saywhen/ @SeanSobey +/types/sc-auth/ @DanielRose +/types/sc-broker/ @DanielRose +/types/sc-broker-cluster/ @DanielRose +/types/sc-channel/ @DanielRose +/types/sc-framework-health-check/ @DanielRose +/types/sc-hot-reboot/ @DanielRose /types/scalike/ @ryoppy +/types/scc-broker-client/ @DanielRose /types/schedule/ @Methuselah96 /types/scheduler/ @Methuselah96 /types/schema-registry/ @bonzzy @@ -4301,9 +4756,10 @@ /types/scrypt-async/ @xStrom @stesix /types/scrypt-js/ @danwbyrne /types/scryptsy/ @micksatana +/types/sdbm/ @BendingBender /types/sdp-transform/ @loc /types/seamless/ @danmana -/types/seamless-immutable/ @alex3165 @xsburg @geirsagberg @RMHonor +/types/seamless-immutable/ @alex3165 @xsburg @geirsagberg @RMHonor @pheromonez /types/season/ @dex4er /types/secp256k1/ @anler /types/seed-random/ @l-jonas @@ -4316,7 +4772,7 @@ /types/selectize/ @adidahiya @naBausch /types/selenium-standalone/ @SanderDeWaal1992 /types/selenium-webdriver/v2/ @BillArmstrong @Kuniwak @cnishina -/types/selenium-webdriver/ @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn +/types/selenium-webdriver/ @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn @oddui /types/semantic-ui/ @leonard-thieu /types/semantic-ui-accordion/ @leonard-thieu /types/semantic-ui-api/ @leonard-thieu @@ -4342,12 +4798,14 @@ /types/semver/ @Bartvds @BendingBender @LucianBuzzo /types/semver-compare/ @vincekovacs /types/semver-diff/ @chrismbarr +/types/semver-regex/ @BendingBender /types/semver-sort/ @LogvinovLeon +/types/semver-truncate/ @BendingBender /types/sencha_touch/ @brian428 /types/send/ @MikeJerred /types/seneca/ @psnider @kevynb /types/sequelize/v3/ @samuelneff @codeanimal @drinchev @morpheusxaut @torhal -/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd @nrschultz @thomas-b @Antoine38660 +/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut @TitaneBoy @zjy01 @nidzov @Raigen @todd @nrschultz @thomas-b @Antoine38660 @smff /types/sequelize-cursor-pagination/ @pilagod /types/sequelize-fixtures/ @cschwarz /types/sequencify/ @npenin @@ -4367,47 +4825,58 @@ /types/session-file-store/ @blendsdk @rokt33r /types/set-cookie-parser/ @nickp10 /types/set-value/ @DanielRosenwasser +/types/setasap/ @djcsdy /types/settings/ @shreyjain1994 +/types/sha/ @oBusk +/types/sha.js/ @BendingBender /types/sha1/ @arcdev1 /types/sha256/ @nhardy /types/shallow-equals/ @rsolomon -/types/shallowequal/ @seansfkelley +/types/shallowequal/v0/ @seansfkelley +/types/shallowequal/ @seansfkelley @BendingBender /types/shapefile/ @DenisCarriere @Thw0rted /types/sharedb/ @soney /types/sharedworker/ @nakakura /types/sharepoint/ @gandjustas @andrei-markeev @baywet @teroarvola @dennispg -/types/sharp/ @lith-light-g @wooseopkim @BTOdell +/types/sharp/ @lith-light-g @wooseopkim @BTOdell @JamieWoodbury +/types/shasum/ @TeamworkGuy2 +/types/shebang-command/ @BendingBender +/types/shebang-regex/ @BendingBender /types/sheetify/ @toddself /types/shell-escape/ @nenadalm -/types/shell-quote/ @jason0x43 -/types/shelljs/ @nikeee @voy @gkalpak @pheromonez +/types/shell-quote/ @jason0x43 @CameronDiver +/types/shelljs/ @nikeee @voy @gkalpak @pheromonez @aldafu /types/shelljs-exec-proxy/ @qlonik /types/shimmer/ @kjin /types/shipit/ @cyrilschumacher /types/shipit-utils/ @cyrilschumacher /types/shopify-buy/ @openminder @straiforos @totemika +/types/shorten-repo-url/ @BendingBender /types/shortid/ @stpettersens @despairblue /types/shot/v3/ @AJamesPhillips @SimonSchick /types/shot/ @AJamesPhillips @SimonSchick /types/should-sinon/ @Arylo -/types/showdown/ @cbowdon @tan9 @arielsaldana +/types/showdown/ @hamedbaatour @cbowdon @tan9 @arielsaldana +/types/shpjs/ @littlebtc /types/shrink-ray/ @forabi /types/shuffle-seed/ @LeartS /types/siema/ @Irmiz @0x6368656174 @samnau /types/siesta/ @bquarmby /types/sigmajs/ @qinfchen /types/sigmund/ @BendingBender +/types/signal-exit/ @BendingBender /types/signale/ @resir014 @kingdaro @rjoydip /types/signalr/ @borisyankov @keesey @GiedriusGrabauskas /types/signalr-no-jquery/ @gjoshevski /types/signals/ @diullei /types/signature_pad/ @AbubakerB @jrmihalick @leejaedus +/types/simpl-schema/ @arichter83 @Qkramer @deskoh /types/simple-assign/ @NoHomey /types/simple-cw-node/ @vvakame /types/simple-lru/ @NN--- /types/simple-mock/ @leonyu /types/simple-oauth2/v1/ @mad-mike @troy-lamerton @netux -/types/simple-oauth2/ @mad-mike @troy-lamerton @netux +/types/simple-oauth2/ @mad-mike @troy-lamerton @netux @LinusU /types/simple-peer/ @tlaziuk /types/simple-url-cache/ @a-lucas /types/simple-websocket/ @dex4er @@ -4417,10 +4886,16 @@ /types/simplemde/ @Scalesoft /types/simplesmtp/ @rogierschouten /types/simplestorage.js/ @axelcostaspena @mxl +/types/sindresorhus__class-names/ @BendingBender /types/sindresorhus__df/ @whatknight +/types/sindresorhus__djb2a/ @BendingBender +/types/sindresorhus__fnv1a/ @BendingBender +/types/sindresorhus__slugify/ @cprecioso +/types/sindresorhus__string-hash/ @BendingBender +/types/sindresorhus__to-milliseconds/ @BendingBender /types/single-line-log/ @ffflorian -/types/single-spa-react/ @Garrett-Smith-iq -/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg @gjednaszewski +/types/single-spa-react/ @Garrett-Smith-iq @chrisdopuch +/types/sinon/ @mrbigdog2u @rationull @lumaxis @nicojs @43081j @joshuakgoldberg @gjednaszewski @johnjesse @alecf @SimonSchick /types/sinon-as-promised/ @igrayson /types/sinon-chai/v2/ @kazimanzurrashid @jedmao /types/sinon-chai/ @kazimanzurrashid @jedmao @elpdpt @@ -4429,42 +4904,48 @@ /types/sinon-mongoose/ @stevehipwell /types/sinon-stub-promise/ @vintem @tstackhouse /types/sinon-test/ @mummybot -/types/sip.js/ @decyrus /types/sipml/ @chookies /types/sitemap2/ @shundy /types/six-runtime/ @493636333 /types/sizzle/ @leonard-thieu /types/sjcl/ @Evgenus /types/skatejs/ @Hotell +/types/sketchapp/ @manekinekko /types/ski/ @AyaMorisawa -/types/skyway/ @nakakura +/types/skin-tone/ @BendingBender +/types/skyway/ @nakakura @izmhr /types/slack-mock/ @kkalavantavanich /types/slack-node/ @geoffreak /types/slack-winston/ @BlueHatbRit /types/slackdown/ @nju33 /types/slackify-html/ @hypexr +/types/slash/ @BendingBender /types/slate/ @andykent @majelbstoat @JanLoebel @YangusKhan @kalley @Kornil @isubasti @sgreav /types/slate-base64-serializer/ @YangusKhan /types/slate-html-serializer/ @YangusKhan /types/slate-irc/ @elisee /types/slate-plain-serializer/ @YangusKhan @mkiefel -/types/slate-react/ @andykent @majelbstoat @JanLoebel @PatrickSachs @YangusKhan @isubasti @sgreav +/types/slate-react/ @andykent @majelbstoat @JanLoebel @PatrickSachs @YangusKhan @isubasti @sgreav @Kornil /types/sleep/ @rajarz +/types/slice-ansi/ @dwieeb /types/slickgrid/ @jbaldwin /types/slideout/ @ToastHawaii /types/slimerjs/ @alexwall /types/slocket/ @BendingBender /types/slug/ @mhegazy /types/smart-fox-server/ @ChanceM +/types/smart-truncate/ @oyalhi +/types/smooth-scroll/ @andreiho /types/smoothscroll-polyfill/ @kryops /types/smtp-server/v1/ @markisme @Taisiias /types/smtp-server/ @markisme @Taisiias @dex4er /types/smtpapi/ @a-morales +/types/snakecase-keys/ @BendingBender /types/snappy/ @reconbot -/types/snapsvg/ @lhk @mattanja @kant2002 +/types/snapsvg/ @lhk @mattanja @kant2002 @terrymun /types/snazzy-info-window/ @milosd92 /types/snekfetch/ @ANekoIsFineToo @ShayBox @Dev-Yukine -/types/snoowrap/ @vitosamson @TheAppleFreak +/types/snoowrap/ @vitosamson @TheAppleFreak @willwull /types/snowball-stemmers/ @ryanvolum /types/snowboy/ @dolanmiu /types/socket.io/v1/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi @BrainMaestro @@ -4474,6 +4955,9 @@ /types/socket.io-parser/ @plantain-00 /types/socket.io-redis/ @nupplaphil @seeLuck /types/socket.io.users/ @kataras +/types/socketcluster/ @DanielRose +/types/socketcluster-client/ @DanielRose +/types/socketcluster-server/ @DanielRose /types/socketio-jwt/ @ehallander9591 /types/socketio-jwt-auth/ @codeanimal /types/socketio-wildcard/ @BendingBender @@ -4485,6 +4969,7 @@ /types/solution-center-communicator/ @dami-gg /types/sonic-boom/ @alferpal /types/sort-array/ @mrmlnc +/types/sort-object-keys/ @forivall /types/sortablejs/ @Maw-Fox @maartenstaa /types/soundmanager2/ @elton2048 /types/soupbintcp/ @jewbre @@ -4496,13 +4981,14 @@ /types/sparkpost/v1/ @geoffreak /types/sparkpost/ @geoffreak @bondz @vvu /types/sparqljs/ @AlexeyMz +/types/sparse-bitfield/ @BendingBender /types/spatialite/ @atd-schubert /types/spdx-correct/ @jinwoo /types/spdx-satisfies/ @jinwoo /types/spdy/ @tony19 /types/speakeasy/ @legendecas @mrOlorin @xeoneux /types/speakingurl/ @Goldsmith42 -/types/spectacle/ @zmaybury +/types/spected/ @benneq /types/spectrum/ @M-Zuber @Ailrun /types/split/ @marcinporebski /types/split.js/ @icholy @@ -4514,15 +5000,17 @@ /types/sprintf/ @soywiz @BendingBender /types/sprintf-js/ @jasonswearingen @BendingBender @cdagli /types/sql-bricks/ @adn05 @paleo +/types/sql-template/ @q42jaap /types/sql.js/ @Hozuki /types/sqlanywhere/ @pkeuter /types/sqlite3/ @nmalaguti @dpyro @BehindTheMath /types/sqlstring/ @marvinhagemeister /types/squirejs/ @bradleyayers +/types/srcset/ @BendingBender /types/srp/ @Patman64 /types/ssh-key-decrypt/ @BendingBender -/types/ssh2/ @tkQubo @rbuckton @wrboyce -/types/ssh2-sftp-client/ @igrayson @ascariandrea @kartik2406 +/types/ssh2/ @tkQubo @rbuckton @wrboyce @lucasmotta +/types/ssh2-sftp-client/ @igrayson @ascariandrea @kartik2406 @viamuli /types/ssh2-streams/ @rbuckton /types/sshpk/ @mabels /types/stack-mapper/ @rogierschouten @@ -4547,30 +5035,33 @@ /types/steam-totp/ @phenomax /types/steamid/ @Slessi /types/steed/ @Paul-Isache -/types/stellar-sdk/ @carl-foster @tristonj @pselden @maxbause @charlie-wasp +/types/stellar-base/ @carl-foster @tristonj @pselden @maxbause @charlie-wasp @Akuukis +/types/stellar-sdk/ @carl-foster @tristonj @pselden @maxbause @charlie-wasp @Akuukis /types/stemmer/ @will-ockmore /types/sticky-cluster/ @paustint /types/stompit/ @DanielRose /types/stompjs/ @jimic @Dr4k4n -/types/stoppable/ @EricByers +/types/stoppable/ @EricByers @jplusje /types/storage-helper/ @ajafff -/types/store/ @vbortone @harry0000 @Ky6uk +/types/store/ @vbortone @harry0000 @Ky6uk @igl00 /types/storybook-addon-jsx/ @jameslnewell /types/storybook-readme/ @lonyele /types/storybook__addon-a11y/ @hyunseob /types/storybook__addon-actions/ @joscha @jicjjang -/types/storybook__addon-backgrounds/ @hyunseob +/types/storybook__addon-backgrounds/ @hyunseob @adhrinae /types/storybook__addon-centered/ @kiyopikko /types/storybook__addon-info/ @mkornblum @fyrkant /types/storybook__addon-jest/ @halfmatthalfcat -/types/storybook__addon-knobs/ @joscha @martynaskadisa @amacleay +/types/storybook__addon-knobs/ @joscha @martynaskadisa @amacleay @MLoughry /types/storybook__addon-links/ @joscha @jessepinho -/types/storybook__addon-notes/ @joscha @amacleay -/types/storybook__addon-options/ @joscha @simonhn @amacleay +/types/storybook__addon-notes/ @joscha @amacleay @MLoughry +/types/storybook__addon-options/ @joscha @simonhn @amacleay @gaetanmaisse @adam187 /types/storybook__addon-storyshots/ @bradleyayers -/types/storybook__react/ @joscha @wapgear -/types/storybook__react-native/ @joscha @wapgear @alechill @iRoachie +/types/storybook__addon-viewport/ @Vinnl +/types/storybook__react/ @joscha @wapgear @dandean +/types/storybook__react-native/ @joscha @wapgear @alechill @iRoachie @ceyhuno /types/storybook__vue/ @pntgupta +/types/strange/ @wanganjun /types/stream-array/ @Tyler-Murphy /types/stream-buffers/ @Jason3S /types/stream-chain/ @uhop @@ -4584,6 +5075,7 @@ /types/stream-to-array/v0/ @Bartvds /types/stream-to-array/ @Bartvds @BendingBender /types/stream-to-promise/ @Alorel +/types/stream-to-string/ @BendingBender /types/streaming-json-stringify/ @BendingBender /types/streamjs/ @erosb /types/streamtest/ @lummish @@ -4593,20 +5085,25 @@ /types/string-argv/ @vladimir-tikhonov /types/string-format/ @lal12 /types/string-hash/ @ethanrubio +/types/string-length/ @BendingBender /types/string-replace-webpack-plugin/ @pd4d10 -/types/string-similarity/ @ragtime +/types/string-similarity/v1/ @ragtime +/types/string-similarity/ @ragtime @BendingBender /types/string-template/ @TonyPythoneer /types/string-width/ @jacobbubu /types/string_score/ @marcinporebski +/types/stringify-attributes/ @BendingBender /types/stringify-object/ @khoomeister /types/strip-ansi/ @mhegazy /types/strip-bom/ @mhegazy +/types/strip-color/ @BendingBender +/types/strip-indent/ @BendingBender /types/strip-json-comments/ @dmoonfire -/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun @galtalmor @htunnicliff @squirly @tzarger @ifiokjr +/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun @galtalmor @htunnicliff @squirly @tzarger @ifiokjr @SimonSchick @yultyyev @cpsoinos /types/stripe-checkout/ @cgwrench /types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak -/types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak -/types/stripejs/ @RobinvanTienhoven +/types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak @slangeder +/types/stripejs/ @RobinvanTienhoven @mattferderer /types/strong-cluster-control/ @shuntksh /types/strong-error-handler/ @blankstar85 /types/strong-log-transformer/ @azasypkin @@ -4614,10 +5111,10 @@ /types/strophe.js/ @DavidKDeutsch /types/structured-source/ @azu /types/styled-components/v3/ @Igorbek @Igmat -/types/styled-components/ @Igorbek @Igmat @lavoaster +/types/styled-components/ @Igorbek @Igmat @lavoaster @Kovensky /types/styled-jsx/ @R1ZZU /types/styled-react-modal/ @Lavoaster -/types/styled-system/ @maxdeviant @phobon @zephraph @damassi @alloy @maoueh @lavoaster @jschuler +/types/styled-system/ @maxdeviant @phobon @zephraph @damassi @alloy @maoueh @lavoaster @jschuler @adam187 /types/styled-theming/ @ArjanJ /types/stylelint/v7/ @alan-agius4 /types/stylelint/ @alan-agius4 @filipsalpe @@ -4625,6 +5122,7 @@ /types/stylenames/ @bengry /types/stylus/ @SomaticIT /types/subscribe-ui-event/ @wangcheng678 +/types/subsume/v1/ @BendingBender /types/subsume/ @BendingBender /types/subtitle/ @jenglamlow /types/succinct/ @EnableSoftware @@ -4634,7 +5132,7 @@ /types/sumo-logger/ @forabi @clementallen /types/suncalc/ @horiuchi /types/superagent/v2/ @varju @NicoZelaya @mxl -/types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf @beeequeue +/types/superagent/ @NicoZelaya @mxl @paplorinc @shreyjain1994 @zopf @beeequeue @lukaselmer /types/superagent-bunyan/ @bricka /types/superagent-no-cache/ @mxl /types/superagent-prefix/ @mxl @@ -4658,7 +5156,7 @@ /types/sw-precache/ @JounQin /types/sw-precache-webpack-plugin/ @JounQin /types/swag/ @shiwano -/types/swagger-express-middleware/ @alexandreroba +/types/swagger-express-middleware/ @alexandreroba @tromgy /types/swagger-express-mw/ @micmro /types/swagger-express-validator/ @pinguet62 /types/swagger-hapi/ @micmro @@ -4679,28 +5177,32 @@ /types/swig-email-templates/ @mrhen @micksatana /types/swipe/ @kant2002 /types/swiper/v3/ @sgaliano @lucax88x -/types/swiper/ @sgaliano @lucax88x @ematseruk @odahcam @jmca +/types/swiper/ @sgaliano @lucax88x @ematseruk @odahcam @jmca @daem0ndev /types/swipeview/ @borisyankov /types/switchery/ @bgrieder @claylaut /types/swiz/ @jedigo /types/sylvester/ @StephaneAlie +/types/symlink-or-copy/ @BendingBender /types/synaptic/ @ToastHawaii @austincummings +/types/syntax-error/ @TeamworkGuy2 /types/systeminformation/ @PixelcrabAT /types/systemjs/ @ludohenin @NathanWalker @GiedriusGrabauskas @aluanhaddad /types/tabbable/ @mokkan /types/table/ @evanshortiss @mrmlnc /types/tableau/ @protip +/types/tableify/ @forivall /types/tabris-plugin-firebase/ @eclipsesource -/types/tabtab/ @vojtechhabarta +/types/tabtab/ @vojtechhabarta @kamontat /types/tabulator/ @euginio /types/tail/ @spacejack /types/tapable/v0/ @e-cloud /types/tapable/ @e-cloud @johnnyreilly -/types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty +/types/tape/ @Bartvds @sodatea @DennisSchwartz @mikehenrty @rostrowski /types/tar/ @SomaticIT @connor4312 /types/tar-fs/ @Umoxfo /types/tar-stream/ @glicht /types/task-graph-runner/ @mgroenhoff +/types/task-worklet/ @karol-majewski /types/tcp-ping/ @stegano /types/tcp-port-used/ @gautejohan /types/teddy/ @lannonbr @@ -4708,12 +5210,17 @@ /types/tedious-connection-pool/ @sandorfr /types/telebot/ @mariotsi /types/temp/ @DanielRosenwasser +/types/temp-dir/ @BendingBender /types/temp-write/ @BendingBender /types/tempfile/ @SamVerschueren @BendingBender /types/tempy/ @douglasduteil @maistho +/types/term-size/ @BendingBender +/types/terminal-image/ @BendingBender +/types/terminal-link/ @BendingBender /types/terminal-menu/ @aravindarun /types/tern/ @nkappler /types/terser/ @JordiAnderl +/types/terser-webpack-plugin/ @Danscho /types/test-console/ @roberto @guidoux @gbmoretti /types/test-listen/ @stephenmathieson /types/testingbot-api/ @timbru31 @@ -4721,10 +5228,11 @@ /types/tether-drop/ @adidahiya /types/tether-shepherd/ @mtgibbs /types/text-buffer/ @GlenCFL -/types/text-encoding/ @pine613 @mohsen1 @nwmqpa +/types/text-encoding/ @pine @mohsen1 @nwmqpa /types/text-encoding-utf-8/ @trxcllnt /types/text-table/ @saadq /types/textarea-caret/ @shiftkey +/types/textextensions/ @BendingBender /types/textract/ @lal12 /types/textversionjs/ @aaronosher /types/texzilla/ @m93a @@ -4732,7 +5240,8 @@ /types/theming/ @eps1lon /types/theo/ @petekp /types/thepiratebay/ @jsorrell -/types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner @PsychoSTS @dhritzkiv @apurvaojas @NotWoods @sethk @elk941 @Methuselah96 @Dukuo @JulianSSS @devilsparta +/types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner @PsychoSTS @dhritzkiv @apurvaojas @NotWoods @sethk @elk941 @Methuselah96 @Dukuo @JulianSSS @devilsparta @KonstantinLukaschenko @danyim +/types/three-tds-loader/ @KonstantinLukaschenko @sschoensee /types/thrift/ @kamek-pf @kevin-greene-ck @jessezhang91 /types/throng/ @cyrilschumacher @tatethurston /types/throttle/ @BendingBender @@ -4742,6 +5251,7 @@ /types/through2/ @Bartvds @jedmao @valotas @TeamworkGuy2 @Alorel /types/through2-concurrent/ @Alorel /types/through2-map/ @LucasHill +/types/tildify/ @BendingBender /types/tile-reduce/ @DenisCarriere /types/tilebelt/ @DenisCarriere /types/time-span/ @BendingBender @mdvorscak @@ -4749,6 +5259,8 @@ /types/timelinejs3/ @MikeMatusz /types/timer-machine/ @dolanmiu /types/timezone-js/ @bonnici +/types/timing-safe-equal/ @BendingBender +/types/timsort/ @Vunovati /types/tinajs__tina/ @Jimexist /types/tinajs__tina-redux/ @Jimexist /types/tinder/ @pingec @@ -4768,13 +5280,15 @@ /types/to-absolute-glob/ @ajafff /types/to-camel-case/ @j-f1 /types/to-markdown/ @SuperPaintman +/types/to-semver/ @BendingBender /types/to-snake-case/ @LogvinovLeon /types/to-title-case-gouch/ @stpettersens /types/toastr/ @borisyankov /types/tocktimer/ @evanshortiss /types/tokgen/ @l-jonas -/types/toobusy-js/ @atd-schubert +/types/toobusy-js/ @atd-schubert @BendingBender /types/tooltipster/ @stephenlautier @pjmagee @VorobeY1326 @leonard-thieu @janhi @joeskeen +/types/topo/ @BendingBender /types/topojson/ @ricardo-mello @chenzhutian @denisname /types/topojson-client/ @denisname @ricardo-mello /types/topojson-simplify/ @denisname @ricardo-mello @@ -4787,39 +5301,47 @@ /types/tough-cookie/ @leonard-thieu @LiJinyao @no2chem /types/tough-cookie-filestore/ @friedow /types/traceback/ @misak113 -/types/tracking/ @pimterry +/types/tracking/ @pimterry @bratter /types/transducers-js/ @colinkahn @dphilipson @NaridaL /types/transducers.js/ @dphilipson /types/transliteration/ @tony19 -/types/trash/ @matthew-matvei @hoishin +/types/trash/ @matthew-matvei @hoishin @BendingBender /types/traverse/ @newclear /types/traverson/ @marcinporebski /types/travis-fold/ @andy-ms /types/trayballoon/ @korve +/types/treeify/ @mike-north /types/tress/ @sindilevich +/types/trezor-connect/ @federicobond /types/trianglify/ @unindented +/types/trie-prefix-tree/ @jlismore /types/trim/ @skysteve /types/triple-beam/ @danwbyrne /types/triplesec/ @threesquared /types/trunk8/ @niemyjski +/types/trusted-types/ @vrana /types/tryer/ @bengry +/types/ts-nameof/ @dsherret /types/tspromise/ @soywiz /types/ttf2woff2/ @ThomasdenH /types/tunnel/ @BendingBender -/types/tus-js-client/ @kevhiggins +/types/tus-js-client/ @kevhiggins @Acconut /types/tv4/ @Bartvds @psnider /types/tween.js/ @Amos47 @sunetos @jzarnikov @alexburner /types/tweenjs/ @evilangelist @jcyuan /types/tweezer.js/ @praxxis -/types/twig/ @soywiz @enko +/types/twig/ @soywiz @enko @mtizziani /types/twilio/ @nickiannone @ashleybrener +/types/twilio-common/ @gatimus /types/twilio-video/ @minddocdev @darioblanco /types/twit/ @Volox @sapphiredev @abraham @siwalikm @plhery /types/twitch-ext/ @beheh -/types/twitter/ @chitoku-k +/types/twitter/ @BendingBender +/types/twitter-for-web/ @chitoku-k /types/twitter-stream-channels/ @adrianbardan /types/twitter-text/ @rhysd /types/twix/ @j3ko +/types/two.js/ @cprecioso /types/type-check/ @hansrwindhoff /types/type-detect/v0/ @Bartvds /types/type-detect/ @Bartvds @@ -4829,14 +5351,17 @@ /types/typedarray-pool/ @pawsong /types/typeof/ @OpenByteDev /types/typescript-deferred/ @DirtyHairy -/types/typography/ @boyeborg +/types/typography/ @boyeborg @krzysztofzuraw @dominicfallows +/types/typpy/ @BendingBender /types/tz-format/ @samverschueren /types/ua-parser-js/ @superduper @legendecas @MeLlamoPablo +/types/ua-string/ @BendingBender /types/uglify-es/ @alan-agius4 /types/uglify-js/v2/ @tkrotoff /types/uglify-js/ @alan-agius4 @tkrotoff @johnnyreilly /types/uglifycss/ @blendsdk /types/uglifyjs-webpack-plugin/ @vajkayrene +/types/ui-box/ @nettofarah /types/ui-grid/ @btesser @joeskeen @pbojanczyk /types/ui-router-extras/ @mputters @marcel-k @LaserUnicorns /types/ui-select/ @nkovacic @@ -4847,6 +5372,7 @@ /types/umbraco/ @DeCareSystemsIreland /types/umd/ @TeamworkGuy2 /types/umzug/ @drinchev @mlamp @trodi @emmanuelgautier +/types/unc-path-regex/ @BendingBender /types/underscore/ @borisyankov @jbaldwin @ccurrens @clottman @confususs /types/underscore-ko/ @MagicMau /types/underscore.string/ @rygine @@ -4857,11 +5383,13 @@ /types/uniqid/ @idchlife /types/unique-hash-stream/ @BendingBender /types/unique-random/ @Kuniwak -/types/unist/ @bizen241 +/types/unique-random-array/ @BendingBender +/types/unique-string/ @BendingBender +/types/unist/ @bizen241 @lujun2 @hrajchert @wooorm @rokt33r +/types/unist-util-is/ @rokt33r /types/unity-webapi/ @jmvrbanac /types/universal-analytics/ @Bartvds @DarkerTV /types/universal-cookie/ @tomi -/types/universal-router/ @jtmthf @tlaziuk @Lodin /types/unorm/ @chbrown /types/untildify/ @BendingBender /types/unused-filename/ @BendingBender @@ -4876,15 +5404,18 @@ /types/uri-templates/ @Bartvds @barnski /types/urijs/ @RodneyJT @xt0rted @petejohanson /types/uritemplate/ @teyc @rubensworks +/types/urix/ @BendingBender /types/url-assembler/ @wolfgang42 -/types/url-join/ @rogierschouten @devrelm +/types/url-join/v0/ @rogierschouten @devrelm +/types/url-join/ @rogierschouten @devrelm @BendingBender /types/url-metadata/ @mrkmg /types/url-params/ @danielsogl -/types/url-parse/ @ChernenkoPaul @harisiva @DimitryDushkin +/types/url-parse/ @ChernenkoPaul @harisiva @DimitryDushkin @davidgoli /types/url-regex/ @unindented @sosukesuzuki /types/url-safe-base64/ @johngeorgewright /types/url-search-params/ @nick121212 @nrathi /types/url-template/ @marcinporebski +/types/urlencode/ @kimcoder /types/urllib/ @sorayama /types/urlparser/ @OpenByteDev /types/urlrouter/ @soywiz @@ -4905,6 +5436,7 @@ /types/uuid-validate/ @HiromiShikata /types/uws/ @plantain-00 @orblazer /types/v-chart-plugin/ @natemara +/types/v8flags/ @BendingBender /types/valdr/ @ilbertz /types/valdr-message/ @ilbertz /types/valerie/ @conficient @@ -4912,24 +5444,25 @@ /types/valiant/ @whatasoda /types/valid-url/ @stevehipwell /types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno @builtinnya @qqilihq -/types/validatorjs/ @LKay @danmana +/types/validatorjs/ @LKay @danmana @MatiasOlivera /types/vanilla-modal/ @samnau /types/vanilla-tilt/ @BrunnerLivio /types/varint/ @dbrockman /types/vary/ @BendingBender -/types/vast-client/ @jgainfort +/types/vast-client/ @jgainfort @kobawan /types/vec3/ @xstoudi /types/vectorious/ @erikgerrits -/types/vega/ @pelotom /types/velocity-animate/ @smrq +/types/venn/ @marcwjj /types/verror/ @svi3c @max4t /types/vertx3-eventbus-client/ @oddeirik /types/vex-js/ @gdcohan /types/vexdb/ @MayorMonty /types/vexflow/ @rquiring @sebastianhaas @bohoffi @sschmidTU /types/vfile/ @bizen241 @rokt33r -/types/vfile-location/ @ikatyang -/types/victory/ @asvetliakov @snerks @Havret @alredyExist +/types/vfile-location/ @ikatyang @rokt33r +/types/vfile-message/ @rokt33r +/types/victory/ @asvetliakov @snerks @Havret @alredyExist @jlismore /types/video.js/ @vbortone @scleriot @SWBennett06 @IgelCampus @giofreitas @gjanblaszczyk @sroucheray @AkxeOne @meikidd /types/viewability-helper/ @lironzluf /types/viewerjs/ @lrh3321 @@ -4944,7 +5477,7 @@ /types/vinyl-paths/ @tkQubo /types/virtual-dom/ @chbrown /types/virtual-keyboard/ @bsurai -/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 @supercargo @takato1314 @alex-kachura @dcop @avrahamcool +/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 @supercargo @takato1314 @alex-kachura @dcop @avrahamcool @divideby /types/vision/v4/ @jasonswearingen @AJamesPhillips /types/vision/ @jasonswearingen @AJamesPhillips @lenovouser /types/vitalsigns/ @cyrilschumacher @@ -4963,17 +5496,21 @@ /types/vue-scrollto/ @vincekovacs /types/vue-select/ @silh /types/vue2-datepicker/ @ChristianStornowski -/types/vuex-i18n/ @jaeggerr @noamkfir +/types/vuelidate/ @janesser @jubairsaidi +/types/vuex-i18n/ @jaeggerr @noamkfir @barahliush /types/w2ui/ @Ptival +/types/w3c-css-typed-object-model-level-1/ @yavanosta /types/w3c-generic-sensor/ @kenchris /types/w3c-image-capture/ @cosium /types/w3c-permissions/ @jberube /types/w3c-screen-orientation/ @kenchris /types/w3c-web-usb/ @larsgk +/types/wait-for-localhost/ @BendingBender /types/waitme/ @totpero /types/wake_on_lan/ @SrTobi /types/walk/ @poppa /types/wallabyjs/ @andrewconnell +/types/wallop/ @leemcd56 /types/wallpaper/ @BendingBender /types/wampy/ @KSDaemon /types/warning/ @cvle @@ -4984,29 +5521,31 @@ /types/watson-developer-cloud/ @waldo000000 @Naktibalda /types/wavesurfer.js/ @higuri /types/waypoints/ @dominikbulaj @Koloto @evil-shrike +/types/wcag-contrast/ @plantain-00 /types/wcwidth/ @rokt33r /types/weak/ @int0h -/types/weapp-api/ @vargeek +/types/weapp-api/ @vargeek @pbestz /types/web-animations-js/ @kritollm /types/web-bluetooth/ @urish /types/web-push/ @paullessing -/types/web3/ @simon-jentzsch @nitzantomer @zurbo @yxliang01 @phra @naddison36 @icaroharry @linusnorton @jpeletier @anneau @matrushka @andrevmatos @levino @zlumer @archangel-irk @sogasg @donamk @dkent600 @nerddan +/types/web-resource-inliner/ @BendingBender +/types/web3/ @simon-jentzsch @nitzantomer @zurbo @yxliang01 @phra @naddison36 @icaroharry @linusnorton @jpeletier @anneau @matrushka @andrevmatos @levino @zlumer @archangel-irk @sogasg @donamk @dkent600 @nerddan @alexkvak /types/web3-eth-abi/ @LogvinovLeon /types/web3-provider-engine/ @LogvinovLeon /types/webappsec-credential-management/ @iainmcgin -/types/webassembly-js-api/ @periklis +/types/webassembly-js-api/ @periklis @chicoxyzzy /types/webassembly-web-api/ @jhenninger /types/webcl/ @NCARalph /types/webcomponents.js/ @adidahiya /types/webcrypto/ @iislucas -/types/webdriverio/ @nmalaguti @timbru31 @fsmedberg-tc @tanvirislam06 @daveparslow @phil-lgr +/types/webdriverio/ @nmalaguti @timbru31 @fsmedberg-tc @tanvirislam06 @daveparslow @phil-lgr @mroggy85 /types/webfontloader/ @doskallemaskin /types/webgl-ext/ @zenmumbler /types/webgl2/ @nkemnitz @karhu /types/webidl2/ @saschanaz /types/webmidi/ @lostfictions /types/webpack/v3/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @christophehurpeau @rwaskiewicz @kuehlein -/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau @ZSkycat @johnnyreilly @rwaskiewicz @kuehlein +/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @alan-agius4 @elliottsj @jason0x43 @dennispg @christophehurpeau @ZSkycat @johnnyreilly @rwaskiewicz @kuehlein @grgur /types/webpack-assets-manifest/ @FranklinWhale /types/webpack-bundle-analyzer/ @kryops /types/webpack-chain/ @eirikurn @psachs21 @@ -5056,11 +5595,14 @@ /types/whatwg-url/ @aomarks /types/wheel/ @BTOdell /types/when/ @derekcicerone @Nemo157 +/types/when-dom-ready/ @BendingBender /types/which/ @vvakame @cspotcode /types/which-pm/ @jorgegonzalez +/types/whitelist-object/ @BendingBender /types/wicg-mediasession/ @jucrouzet /types/wif/ @danwbyrne /types/wiiu/ @mzsm +/types/wikidata-sdk/ @kamontat /types/window-or-global/ @vvakame /types/window-size/ @pmkary /types/windows-1251/ @RomanGolovanov @@ -5084,6 +5626,8 @@ /types/wordcloud/ @joeskeen /types/words-to-numbers/ @James-Frowen /types/workbox-sw/ @wessberg +/types/workbox-webpack-plugin/ @kgroat +/types/worker-threads-pool/ @BendingBender /types/workerpool/ @Alorel /types/wpapi/ @guoyunhe /types/wrap-ansi/v2/ @kayahr @@ -5112,8 +5656,10 @@ /types/xmldoc/ @Xstoudi @ajsheehan @notlaforge /types/xmldom/ @tkqubo /types/xmlpoke/ @garthk +/types/xmlserializer/ @eoin-obrien /types/xmltojson/ @traviscrowe -/types/xmpp__jid/ @PJakcson +/types/xmpp__jid/ @PJakcson @BendingBender +/types/xmpp__xml/ @BendingBender /types/xregexp/ @Bartvds @jfahrenkrug @sigo /types/xrm/v7/ @daryllabar /types/xrm/v8/ @6ix4our @mattngan @markusmauch @daryllabar @clownwilleatme @mariusagur @@ -5123,13 +5669,13 @@ /types/xxhashjs/ @mDibyo /types/yallist/ @BendingBender /types/yaml/ @ikatyang @ColinBradley -/types/yandex-maps/ @Delagen +/types/yandex-maps/ @Delagen @gastwork13 /types/yandex-money-sdk/ @chrootsu /types/yar/ @SimonSchick /types/yargs/v8/ @poelstra @mizunashi-mana @pushplay @jeffkenney /types/yargs/v10/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC /types/yargs/v11/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC -/types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC @tkazec +/types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney @JimiC @steffenvv /types/yargs-interactive/ @szeck87 /types/yargs-parser/ @milesj /types/yauzl/ @ffflorian @@ -5137,19 +5683,22 @@ /types/yayson/ @Codesleuth /types/yazl/ @taoqf @seangenabe /types/ydn-db/ @yathit @gabrielmaldi -/types/yeoman-generator/ @armorik83 @janslow @ikatyang +/types/year-days/ @BendingBender +/types/yeoman-assert/ @Toilal +/types/yeoman-generator/ @armorik83 @janslow @ikatyang @tasadar2 /types/yeoman-test/ @ikatyang /types/yesql/ @Sumolari +/types/yn/ @BendingBender /types/yoctodelay/ @seangenabe /types/yog-bigpipe/ @ssddi456 /types/yog-log/ @ssddi456 /types/yog2-kernel/ @ssddi456 /types/yoga-layout/ @tnobody /types/yosay/ @armorik83 -/types/youtube/ @DazWilkin @JoshuaKGoldberg @eliotfallon213 @terrymun -/types/youtube-dl/ @bsurai +/types/youtube/ @DazWilkin @JoshuaKGoldberg @eliotfallon213 @terrymun @paulhobbel +/types/youtube-dl/ @bsurai @moshfeu /types/yui/ @giabao -/types/yup/ @dhardtke @vtserman @MoretonBayRC @sseppola @YashdalfTheGray +/types/yup/ @dhardtke @vtserman @MoretonBayRC @sseppola @YashdalfTheGray @vincentjames501 @robertbullen @sat0yu /types/z-schema/ @pgonzal /types/zapier-platform-core/ @bradleyayers /types/zeit__next-typescript/ @icopp @@ -5172,5 +5721,6 @@ /types/zmq/ @davemckeown /types/zookeeper/ @xialeistudio /types/zopflipng-bin/ @hikoma +/types/zrender/ @iRON5 /types/zui/ @yuanxu /types/zxcvbn/ @mtraynham diff --git a/README.md b/README.md index eba170c493..bbf2a6f16e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,23 @@ -# DefinitelyTyped [![Build Status](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped.svg?branch=master)](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped) - -[![Join the chat at https://gitter.im/borisyankov/DefinitelyTyped](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +# DefinitelyTyped > The repository for *high quality* TypeScript type definitions. Also see the [definitelytyped.org](http://definitelytyped.org) website, although information in this README is more up-to-date. -*You can also read this README in [Spanish](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md) and [Korean!](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md)* +*You can also read this README in [Spanish](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md), [Korean](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md), and [Russian](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ru.md)!* + +## Current status + +This section tracks the health of the repository and publishing process. +It may be helpful for contributors experiencing any issues with their PRs and packages. + +* All packages are type-checking/linting cleanly: [![Build Status](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped.svg?branch=master)](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped) +* All packages are being published to npm in under 10,000 seconds: [![Publish Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.types-publisher-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=13) +* [typescript-bot](https://github.com/typescript-bot) has been active on DefinitelyTyped [![Activity Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.typescript-bot-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=14) + +If anything here seems wrong, or any of the above are failing, please raise an issue in [the DefinitelyTyped Gitter channel](https://gitter.im/DefinitelyTyped/DefinitelyTyped). + +[![Join the chat at https://gitter.im/DefinitelyTyped/DefinitelyTyped](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/DefinitelyTyped/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ## What are declaration files? @@ -169,8 +180,14 @@ If a package was never on DefinitelyTyped, it does not need to be added to `notN #### Lint -To lint a package, just add a `tslint.json` to that package containing `{ "extends": "dtslint/dt.json" }`. All new packages must be linted. -If a `tslint.json` turns rules off, this is because that hasn't been fixed yet. For example: +All new packages must be linted. To lint a package, add a `tslint.json` to that package containing +```js +{ + "extends": "dtslint/dt.json" +} +``` + +This should be the only content in a finished project's `tslint.json` file. If a `tslint.json` turns rules off, this is because that hasn't been fixed yet. For example: ```js { @@ -238,17 +255,71 @@ Here are the [currently requested definitions](https://github.com/DefinitelyType If types are part of a web standard, they should be contributed to [TSJS-lib-generator](https://github.com/Microsoft/TSJS-lib-generator) so that they can become part of the default `lib.dom.d.ts`. +#### Should I add an empty namespace to a package that doesn't export a module to use ES6 style imports? + +Some packages, like [chai-http](https://github.com/chaijs/chai-http), export a function. + +Importing this module with an ES6 style import in the form `import * as foo from "foo";` leads to the error: + +> error TS2497: Module 'foo' resolves to a non-module entity and cannot be imported using this construct + +This error can be suppressed by merging the function declaration with an empty namespace of the same name, but this practice is discouraged. +This is a commonly cited [Stack Overflow answer](https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this) regarding this matter. + +It is more appropriate to import the module using the `import foo = require("foo");` syntax. +Nevertheless, if you want to use a default import like `import foo from "foo";` you have two options: +- you can use the [`--allowSyntheticDefaultImports` compiler option](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html#support-for-default-import-interop-with-systemjs) if your module runtime supports an interop scheme for non-ECMAScript modules, i.e. if default imports work in your environment (e.g. Webpack, SystemJS, esm). +- you can use the [`--esModuleInterop` compiler option](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-form-commonjs-modules-with---esmoduleinterop) if you want TypeScript to take care of non-ECMAScript interop (since Typescript 2.7). + #### A package uses `export =`, but I prefer to use default imports. Can I change `export =` to `export default`? -If you are using TypeScript 2.7 or later, use `--esModuleInterop` in your project. -Otherwise, if default imports work in your environment (e.g. Webpack, SystemJS, esm), consider turning on the [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) compiler option. +Like in the previous question, refer to using either the [`--allowSyntheticDefaultImports`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html#support-for-default-import-interop-with-systemjs) +or [`--esModuleInterop`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-form-commonjs-modules-with---esmoduleinterop) +compiler options. + Do not change the type definition if it is accurate. -For an NPM package, `export =` is accurate if `node -p 'require("foo")'` is the export, and `export default` is accurate if `node -p 'require("foo").default'` is the export. +For an NPM package, `export =` is accurate if `node -p 'require("foo")'` works to import a module, and `export default` is accurate if `node -p 'require("foo").default'` works to import a module. #### I want to use features from TypeScript 2.1 or above. Then you will have to add a comment to the last line of your definition header (after `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`): `// TypeScript Version: 2.1`. +#### I want to use features from TypeScript 3.1 or above. + +You can use the same `// TypeScript Version: 3.1` comment as above. +However, if your project needs to maintain types that are compatible with 3.1 and above *at the same time as* types that are compatible with 3.0 or below, you will need to use the `typesVersions` feature, which is available in TypeScript 3.1 and above. +You can find a detailed explanation of this feature in the [official TypeScript documentation](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html#version-selection-with-typesversions). + +Here's a short explanation to get you started: + +1. You'll have to add a `package.json` file to your package definition, with the following contents: + +```json +{ + "private": true, + "types": "index", + "typesVersions": { + ">=3.1.0-0": { "*": ["ts3.1/*"] } + } +} +``` + +2. Create the sub-directory mentioned in the `typesVersions` field inside your types directory (`ts3.1/` in this example) +and add the types and tests specific for the new TypeScript version. You don't need the typical definition header +in any of the files from the `ts3.1/` directory. + +3. Set the `baseUrl` and `typeRoots` options in `ts3.1/tsconfig.json` to the correct paths, they should look something like this: +```json +{ + "compilerOptions": { + "baseUrl": "../../", + "typeRoots": ["../../"] + } +} +``` + +You can look [here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/debounce-promise) and [here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/create-html-element) for examples. + #### I want to add a DOM API not present in TypeScript by default. This may belong in [TSJS-Lib-Generator](https://github.com/Microsoft/TSJS-lib-generator#readme). See the guidelines there. @@ -316,19 +387,6 @@ When `dts-gen` is used to scaffold a scoped package, the `paths` property has to GitHub doesn't [support](http://stackoverflow.com/questions/5646174/how-to-make-github-follow-directory-history-after-renames) file history for renamed files. Use [`git log --follow`](https://www.git-scm.com/docs/git-log) instead. -#### Should I add an empty namespace to a package that doesn't export a module to use ES6 style imports? - -Some packages, like [chai-http](https://github.com/chaijs/chai-http), export a function. - -Importing this module with an ES6 style import in the form `import * as foo from "foo";` leads to the error: - -> error TS2497: Module 'foo' resolves to a non-module entity and cannot be imported using this construct - -This error can be suppressed by merging the function declaration with an empty namespace of the same name, but this practice is discouraged. -This is a commonly cited [Stack Overflow answer](https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this) regarding this matter. - -It is more appropriate to import the module using the `import foo = require("foo");` syntax, or to use a default import like `import foo from "foo";` if using the `--allowSyntheticDefaultImports` flag if your module runtime supports an interop scheme for non-ECMAScript modules as such. - ## License This project is licensed under the MIT license. @@ -336,6 +394,3 @@ This project is licensed under the MIT license. Copyrights on the definition files are respective of each contributor listed at the beginning of each definition file. [![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon) - -[![Build Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.types-publisher-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=13) Are packages being published to npm in less than 10,000 seconds on average? -[![Build Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.typescript-bot-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=14) Has typescript-bot been active on DefinitelyTyped in the last two hours? diff --git a/README.ru.md b/README.ru.md new file mode 100644 index 0000000000..9186c2ddd5 --- /dev/null +++ b/README.ru.md @@ -0,0 +1,353 @@ + + +# DefinitelyTyped [![Build Status](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped.svg?branch=master)](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped) + +[![Join the chat at https://gitter.im/borisyankov/DefinitelyTyped](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +> Репозиторий для *высококачественных* определений типов TypeScript. + +Также посетите веб-сайт [definitelytyped.org](http://definitelytyped.org), хотя информация в этом README более свежая. + +*Вы также можете прочитать этот README на [английском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md), [испанском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md) и [корейском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md).* + +## Что такое файлы декларации (файлы описания/объявления типов)? + +Смотрите [руководство по TypeScript](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html). + +## Как их получить? + +### npm + +Это предпочтительный метод. Это доступно только для пользователей TypeScript 2.0+. Например: + +```sh +npm install --save-dev @types/node +``` + +Затем типы должны автоматически включаться компилятором. +Подробнее смотрите в [справочнике](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html). + +Для пакета NPM "foo", описания будут находиться в "@types/foo". +Если вы не можете найти свой пакет, ищите его в [TypeSearch](https://microsoft.github.io/TypeSearch/). + +Если вы все еще не можете найти его, проверьте [включает](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) ли пакет собственную типизацию. +Обычно это отражается в поле `"types"` или `"typings"` файла `package.json`, или просто ищите любые файлы ".d.ts" в пакете и вручную включайте их в `/// `. + + +### Другие методы + +Эти методы могут быть использованы TypeScript 1.0. + +* [Typings](https://github.com/typings/typings) +* ~~[NuGet](http://nuget.org/packages?q=DefinitelyTyped)~~ (используйте предпочтительные альтернативы, публикация типа nuget DT отключена) +* Вручную загрузите из ветки `master` этого репозитория + +Возможно, вам придется добавить ручные [ссылки](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). + + +## Как я могу внести свой вклад? + +DefinitelyTyped работает только благодаря вкладу таких пользователей, как вы! + +### Тестирование + +Прежде чем поделиться своим улучшением с миром, используйте его сами. + +#### Тестирование редактирования существующего пакета + +Для добавления новых функций вы можете использовать [разрешение модулей](http://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation). +Вы также можете напрямую редактировать типы в `node_modules/@types/foo/index.d.ts`, или скопировать их оттуда и выполнить следующие шаги. + + +#### Тестирование ногово пакета + +Добавьте к вашему `tsconfig.json`: + +```json +"baseUrl": "types", +"typeRoots": ["types"], +``` + +(Вы также можете использовать `src/types`.) +Создайте `types/foo/index.d.ts` содержащие объявления для модуля "foo". +Теперь вы сможете импортировать из `"foo"` в свой код, и он будет направлен к новому определению типа. +Затем запустите сборку (build) *и* запустите код, чтобы убедиться, что ваше определение типа действительно соответствует тому, что происходит во время выполнения. +После того как вы проверили свои определения с реальным кодом, создайте [Запрос на принятие изменений (PR)](#make-a-pull-request) +и следуйте инструкциям [чтобы отредактировать существующий](#edit-an-existing-package) или +[создать новый пакет](#create-a-new-package). + + +### Запрос на принятие изменений (PR) + +После того, как вы проверили ваш пакет, вы можете поделиться им с DefinitelyTyped. + +Во-первых, [разветвите](https://guides.github.com/activities/forking/) этот репозиторий, установите [node](https://nodejs.org/), и запустите `npm install`. + + +#### Изменение существующего пакета + +* `cd types/my-package-to-edit` +* Внесите изменения. Не забудьте отредактировать тесты. + Если вы вносите критические изменения, не забудьте [обновить основную версию](#i-want-to-update-a-package-to-a-new-major-version). +* Вы также можете добавить себя в раздел "Definitions by" заголовка пакета. + * Это приведет к тому, что вы будете уведомлены (через ваше имя пользователя GitHub) о том, что кто-то делает запрос на принятие изменений (PR) или проблему с пакетом. + * Сделайте это, добавив свое имя в конец строки, например `// Definitions by: Alice , Bob `. + * Или, если есть больше людей, это может быть многострочным + + ```typescript + // Definitions by: Alice + // Bob + // Steve + // John + ``` + +* Если есть `tslint.json`, запустите `npm run lint package-name`. В противном случае запустите `tsc` в директории пакета. + +Когда вы создаете PR для редактирования существующего пакета, `dt-bot` должен @-уведомить +предыдущих авторов. Если этого не произойдет, вы можете сделать это самостоятельно в комментарии, связанном с PR. + + +#### Созданое нового пакета + +Если вы являетесь автором библиотеки и ваш пакет написан на TypeScript, [свяжите автоматически сгенерированные файлы объявлений](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) в вашем пакете, а не публикуйте в DefinitelyTyped. + +Если вы добавляете типизацию для пакета NPM, создайте директорию с тем же именем. +Если пакет, для которого вы добавляете типизацию, отсутствует в NPM, убедитесь, что выбранное вами имя не конфликтует с именем пакета в NPM. +(Вы можете использовать `npm info foo` чтобы проверить наличие пакета `foo`.) + +Ваш пакет должен иметь такую ​​структуру: + +| Файл | Назначение | +| ------------- | ---------------------------------------------------------------------------------------------------- | +| index.d.ts | Содержит типизацию для пакета. | +| foo-tests.ts | Содержит пример кода, который проверяет типизацию. Этот код *не* запускается, но он проверен на тип. | +| tsconfig.json | Позволяет вам запускать `tsc` внутри пакета. | +| tslint.json | Включает linting. | + +Создайте их, запустив `npx dts-gen --dt --name my-package-name --template module` если у вас npm ≥ 5.2.0, `npm install -g dts-gen` и `dts-gen --dt --name my-package-name --template module` в противном случае. +Посмотреть все варианты на [dts-gen](https://github.com/Microsoft/dts-gen). + +Вы можете отредактировать `tsconfig.json` чтобы добавить новые файлы, добавить `"target": "es6"` (необходимо для асинхронных функций), добавить в `"lib"`, или добавить опцию компилятора `"jsx"`. + +Члены группы DefinitelyTyped регулярно следят за новыми PR, но имейте в виду, что количество других PR может замедлить ход событий. + +Хороший пример пакета смотрите [base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js). + + +#### Распространенные ошибки + +* Сначала следуйте советам из справочника [handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html). +* Форматирование: либо используйте все табы, либо всегда используйте 4 пробела. +* `function sum(nums: number[]): number`: используйте `ReadonlyArray` если функция не записывает свои параметры. +* `interface Foo { new(): Foo; }`: + Это определяет тип объектов, с методом `new`. Вы, вероятно, хотите объявить `declare class Foo { constructor(); }`. +* `const Class: { new(): IClass; }`: + Предпочитайте использовать объявление класса `class Class { constructor(); }` вместо `new`. +* `getMeAT(): T`: + Если параметр типа не отображается в типах каких-либо параметров, у вас нет универсальной функции, а просто замаскированное утверждение типа. + Предпочитайте использовать утверждение реального типа, например, `getMeAT() as number`. + Пример, где допустим параметр типа: `function id(value: T): T;`. + Пример, где это недопустимо: `function parseJson(json: string): T;`. + Исключение: `new Map()` все ОК. +* Использование типов `Function` and `Object` почти никогда не является хорошей идеей. В 99% случаев можно указать более конкретный тип. Примеры: `(x: number) => number` для [функций](http://www.typescriptlang.org/docs/handbook/functions.html#function-types) and `{ x: number, y: number }` для объектов. Если нет никакой уверенности в типе, [`any`](http://www.typescriptlang.org/docs/handbook/basic-types.html#any) является правильным выбором, а не `Object`. Если единственным известным фактом о типе является то, что это какой-то объект, используйте тип [`object`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#object-type), а не `Object` или `{ [key: string]: any }`. +* `var foo: string | any`: + когда `any` используется в типе объединения, результирующий тип все еще `any`. Таким образом, хотя `string` часть аннотации этого типа может _выглядеть_ полезной, на самом деле она не предлагает никакой дополнительной проверки типов по сравнению с простым использованием `any`. + В зависимости от намерения, приемлемыми альтернативами могут быть `any`, `string`, или `string | object`. + + +#### Удаление пакета + +Когда пакет [объединяет](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) свои собственные типы, типы должны быть удалены из DefinitelyTyped чтобы избежать путаницы. + +Вы можете удалить его, запустив `npm run not-needed -- typingsPackageName asOfVersion sourceRepoURL [libraryName]`. + +* `typingsPackageName`: название директории, который нужно удалить. +* `asOfVersion`: заглушка будет опубликована в `@types/foo` с этой версией. Должна быть выше, чем любая опубликованная на данный момент версия +* `sourceRepoURL`: Это должно указывать на репозиторий, который содержит типизации. +* `libraryName`: описательное имя библиотеки, например, "Angular 2" вместо "angular2". (Если опущено, будет идентично "typingsPackageName".) + +Любые другие пакеты в DefinitelyTyped которые ссылаются на удаленный пакет, должны быть обновлены для ссылки на связанные типы. Для этого добавьте в `package.json` ссыклу `"dependencies": { "foo": "x.y.z" }`. + +Если пакет никогда не был в DefinitelyTyped, его не нужно добавлять в `notNeededPackages.json`. + + +#### Lint + +Все новые пакеты должны быть проанализированы lint. Для этого добавьте `tslint.json` в этот пакет, содержащий + +```js +{ + "extends": "dtslint/dt.json" +} +``` + +Это должно быть единственным содержимым в файле `tslint.json` готового проекта. Если `tslint.json` отключает правила, это потому, что это еще не исправлено. Например: + +```js +{ + "extends": "dtslint/dt.json", + "rules": { + // This package uses the Function type, and it will take effort to fix. + "ban-types": false + } +} +``` + +(Чтобы указать, что правило lint действительно не применяется, используйте `// tslint:disable rule-name` или лучше, `//tslint:disable-next-line rule-name`.) + +Чтобы проверить, что выражение имеет заданный тип, используйте `$ExpectType`. Чтобы проверить, что выражение вызывает ошибку компиляции, используйте `$ExpectError`. + +```js +// $ExpectType void +f(1); + +// $ExpectError +f("one"); +``` + +Для получения дополнительной информации см. [dtslint](https://github.com/Microsoft/dtslint#write-tests) readme. + +Протестируйте, запустив `npm run lint package-name` где `package-name` - это имя вашего пакета. +Этот скрипт использует [dtslint](https://github.com/Microsoft/dtslint). + + +## Часто задаваемые вопросы + +#### Какая связь между этим репозиторием и пакетами `@types` в NPM? + +Ветвь `master` автоматически публикуется в область `@types` на NPM благодаря [types-publisher](https://github.com/Microsoft/types-publisher). + +#### Я отправил PR. Когда он сольется? + +Это зависит, но большинство запросов на получение данных будут объединены в течение недели. PR, утвержденные автором, указанным в заголовке определения, обычно объединяются быстрее; PR для новых определений займет больше времени, так как они требуют большего количества проверок от сопровождающих. Каждый PR проверяется членом команды TypeScript или DefinitelyTyped перед объединением, поэтому будьте терпеливы, так как человеческий фактор может вызвать задержки. Посмотрите на [PR Burndown Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen) чтобы увидеть, как сопровождающие работают через открытые PR. + +#### Мой PR слит; когда будет обновлен пакет `@types` NPM? + +Пакеты NPM должны обновиться в течение нескольких часов. Если прошло более 24 часов, пингуйте @RyanCavanaugh и @andy-ms в PR, чтобы расследовать. + +#### Я пишу определение, которое зависит от другого определения. Должен ли я использовать `` или import? + +Если модуль, на который вы ссылаетесь, является внешним модулем (использует `export`), используйте import. +Если модуль, на который вы ссылаетесь, является окружающим модулем (использует `declare module`, или просто объявляет глобальные переменные), используйте ``. + +#### Я заметил, что у некоторых пакетов есть `package.json`. + +Обычно вам это не нужно. При публикации пакета мы обычно автоматически создаем `package.json`. +`package.json` может быть включен для определения зависимостей. Вот [пример](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pikaday/package.json). +Мы не разрешаем определять другие поля, такие как "description", вручную. +Кроме того, если вам нужно сослаться на более старую версию типизаций, вы должны сделать это, добавив в `package.json` строки `"dependencies": { "@types/foo": "x.y.z" }`. + +#### В некоторых пакетах отсутствует `tslint.json`, а в некоторых `tsconfig.json` отсутствует `"noImplicitAny": true`, `"noImplicitThis": true`, или `"strictNullChecks": true`. + +Тогда они не правы. Вы можете помочь, отправив PR, чтобы исправить их. + +#### Могу ли я запросить определение? + +Вот [текущие запрошенные определения](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest). + +#### Как насчет определений типов для DOM? + +Если типы являются частью веб-стандарта, они должны быть добавлены в [TSJS-lib-generator](https://github.com/Microsoft/TSJS-lib-generator) чтобы они могли стать частью `lib.dom.d.ts` по умолчанию. + +#### Пакет использует export `export =`, но я предпочитаю использовать импорт по умолчанию. Могу ли я изменить `export =` на `export default`? + +Если вы используете TypeScript 2.7 или более позднюю версию, используйте `--esModuleInterop` в вашем проекте. +В противном случае, если импорт по умолчанию работает в вашей среде (например, Webpack, SystemJS, esm), рассмотрите возможность включения опции компилятора [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html). +Не меняйте определение типа, если оно точное. +Для пакета NPM, `export =` является точным, если `node -p 'require("foo")'` является экспортом, а `export default` является точным, если `node -p 'require("foo").default'` является экспортом. + +#### Я хочу использовать функции из TypeScript 2.1 или выше. + +В таком случае вам нужно будет добавить комментарий к последней строке заголовка вашего определения (после `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`): `// TypeScript Version: 2.1`. + +#### Я хочу добавить DOM API, отсутствующий в TypeScript по умолчанию. + +Это может принадлежать [TSJS-Lib-Generator](https://github.com/Microsoft/TSJS-lib-generator#readme). Смотрите инструкции там. +Если стандарт все еще является черновиком, добавляйте сюда. +Используйте имя, начинающееся с `dom-` и включите ссылку на стандарт в качестве ссылки "Project" в заголовке. +Когда он завершает черновой режим, мы можем удалить его из DefinitelyTyped и объявить устаревшим связанный пакет `@types`. + +#### Я хочу обновить пакет новой старшей версии + +Если вы намерены продолжить обновление старой версии пакета, вы можете создать новую подпапку с текущей версией, например, `v2` и скопируйте в него существующие файлы. Если это так, вам необходимо: + +1. Обновите относительные пути в `tsconfig.json` а также в `tslint.json`. +2. Добавьте правила сопоставления путей, чтобы убедиться, что тесты выполняются для предполагаемой версии. + +Например [history v2 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/history/v2/tsconfig.json) looks like: + +```json +{ + "compilerOptions": { + "baseUrl": "../../", + "typeRoots": ["../../"], + "paths": { + "history": [ "history/v2" ] + } + }, + "files": [ + "index.d.ts", + "history-tests.ts" + ] +} +``` + +Если в DefinitelyTyped есть другие пакеты, несовместимые с новой версией, вам нужно будет добавить сопоставления путей к старой версии. Вам также нужно будет сделать это для пакетов в зависимости от пакетов в зависимости от старой версии. + +Например, `react-router` зависит от `history@2`, поэтому [react-router `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/tsconfig.json) есть сопоставление пути с `"history": [ "history/v2" ]`; +транзитивно `react-router-bootstrap` (который зависит от `react-router`) также добавляет отображение пути в свой [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router-bootstrap/tsconfig.json). + +Также, `/// ` не будет работать с отображением пути, поэтому зависимости должны использовать `import`. + +#### Как мне написать определения для пакетов, которые могут использоваться и глобально и в качестве модуля? + +Руководство TypeScript содержит отличную [общую информацию о написании определений](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html), а также [этот пример файла определения](https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html) , в котором показано, как создать определение с использованием синтаксиса модуля в стиле ES6, а также указаны объекты, доступные для глобальной области. Этот метод демонстрируется практически в определении для [definition for big.js](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/big.js/index.d.ts), библиотекой, которую можно загружать глобально с помощью тега скрипта на веб-странице или импортировать с помощью импорта по требованию или в стиле ES6. + +Чтобы проверить, как ваше определение может использоваться как при глобальных ссылках, так и в качестве импортированного модуля, создайте тестовую папку `test`, и поместите туда два тестовых файла. Назовите один `YourLibraryName-global.test.ts` а другой `YourLibraryName-module.test.ts`. *Глобальный* тестовый файл должен использовать определение в соответствии с тем, как он будет использоваться в скрипте, загруженном на веб-страницу, где библиотека доступна в глобальной области видимости - в этом сценарии не следует указывать оператор импорта. Тестовый файл *модуля* должен использовать определение в соответствии с тем, как оно будет использоваться при импорте (включая оператор(ы) `import`). Если вы указали свойство `files` в файле `tsconfig.json`, обязательно включите оба тестовых файла. [Практический пример этого](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/big.js/test) также доступен в определении big.js. + +Обратите внимание, что не требуется полностью использовать определение в каждом тестовом файле - достаточно протестировать только глобально доступные элементы в глобальном тестовом файле и полностью выполнить определение в тестовом файле модуля, или наоборот. + +#### А как насчет областных пакетов? + +Типы для пакета с областью `@foo/bar` должны указываться в `types/foo__bar`. Обратите внимание на двойное подчеркивание. + +Когда `dts-gen` используется для компоновки пакета с областью действия, свойство `paths` должно быть вручную адаптировано в сгенерированном файле +`tsconfig.json` для правильной ссылки на пакет с областью действия: + +```json +{ + "paths":{ + "@foo/bar": ["foo__bar"] + } +} +``` + + +#### История файлов в GitHub выглядит неполной. + +GitHub не [поддерживает](http://stackoverflow.com/questions/5646174/how-to-make-github-follow-directory-history-after-renames) историю файлов для переименованных файлов. Вместо этого используйте [`git log --follow`](https://www.git-scm.com/docs/git-log). + +#### Должен ли я добавить пустой namespace в пакет, который не экспортирует модуль для использования импорта в стиле ES6? + +Некоторые пакеты, такие как [chai-http](https://github.com/chaijs/chai-http), экспортируют функцию. + +Импорт этого модуля с импортом в стиле ES6 в форме `import * as foo from "foo";` приводит к ошибке: + +> error TS2497: Module 'foo' resolves to a non-module entity and cannot be imported using this construct + +Эту ошибку можно устранить, объединив объявление функции с пустым namespace'ом с тем же именем, но это не рекомендуется. +Это часто цитируемый [ответ с Stack Overflow](https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this) по этому вопросу. + +Более целесообразно импортировать модуль, используя `import foo = require("foo");` синтаксис или использовать импорт по умолчанию, такой как `import foo from "foo";` при использовании флага `--allowSyntheticDefaultImports`, если среда выполнения вашего модуля поддерживает схему взаимодействия для модулей не-ECMAScript как таковых. + +## Лицензия + +Этот проект лицензирован по лицензии MIT. + +Авторские права на файлы определений принадлежат каждому участнику, указанному в начале каждого файла определения. + +[![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon) + +[![Build Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.types-publisher-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=13) В среднем пакеты публикуются на npm менее чем за 10000 секунд? + +[![Build Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.typescript-bot-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=14) Был ли typescript-bot активным на DefinitelyTyped в последние два часа? diff --git a/notNeededPackages.json b/notNeededPackages.json index c64738aa8d..2a645f9c93 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -684,6 +684,12 @@ "sourceRepoURL": "https://handsontable.com/", "asOfVersion": "0.35.0" }, + { + "libraryName": "hibp", + "typingsPackageName": "hibp", + "sourceRepoURL": "https://github.com/wKovacs64/hibp", + "asOfVersion": "7.3.0" + }, { "libraryName": "homeworks", "typingsPackageName": "homeworks", @@ -1062,6 +1068,12 @@ "sourceRepoURL": "https://github.com/paularmstrong/normalizr", "asOfVersion": "2.0.18" }, + { + "libraryName": "Nuka Carousel", + "typingsPackageName": "nuka-carousel", + "sourceRepoURL": "https://github.com/FormidableLabs/nuka-carousel/", + "asOfVersion": "4.4.6" + }, { "libraryName": "Numbro", "typingsPackageName": "numbro", @@ -1482,6 +1494,12 @@ "sourceRepoURL": "https://github.com/zeh/simplesignal", "asOfVersion": "1.0.0" }, + { + "libraryName": "sip.js", + "typingsPackageName": "sip.js", + "sourceRepoURL": "https://github.com/onsip/SIP.js", + "asOfVersion": "0.12.0" + }, { "libraryName": "smooth-scrollbar", "typingsPackageName": "smooth-scrollbar", @@ -1512,6 +1530,12 @@ "sourceRepoURL": "https://github.com/mozilla/source-map", "asOfVersion": "0.5.7" }, + { + "libraryName": "Spectacle", + "typingsPackageName": "spectacle", + "sourceRepoURL": "http://github.com/FormidableLabs/spectacle/", + "asOfVersion": "5.2.3" + }, { "libraryName": "Spin.js", "typingsPackageName": "spin.js", @@ -1638,6 +1662,12 @@ "sourceRepoURL": "https://github.com/dpa99c/phonegap-launch-navigator", "asOfVersion": "4.0.0" }, + { + "libraryName": "Universal Router", + "typingsPackageName": "universal-router", + "sourceRepoURL": "https://github.com/kriasoft/universal-router", + "asOfVersion": "8.0.0" + }, { "libraryName": "upper-case", "typingsPackageName": "upper-case", @@ -1698,6 +1728,12 @@ "sourceRepoURL": "https://github.com/tgdwyer/WebCola", "asOfVersion": "3.2.0" }, + { + "libraryName": "WebdriverIO", + "typingsPackageName": "webdriverio", + "sourceRepoURL": "git@github.com:webdriverio/webdriverio.git", + "asOfVersion": "5.0.0" + }, { "libraryName": "webgme", "typingsPackageName": "webgme", diff --git a/package.json b/package.json index caf101cbc6..7fc0358f27 100644 --- a/package.json +++ b/package.json @@ -23,5 +23,6 @@ "devDependencies": { "dtslint": "github:Microsoft/dtslint#production", "types-publisher": "github:Microsoft/types-publisher#production" - } + }, + "dependencies": {} } diff --git a/types/accept-language-parser/accept-language-parser-tests.ts b/types/accept-language-parser/accept-language-parser-tests.ts index 586a31cb93..6f308b5315 100644 --- a/types/accept-language-parser/accept-language-parser-tests.ts +++ b/types/accept-language-parser/accept-language-parser-tests.ts @@ -20,11 +20,17 @@ const l3: AcceptLanguageParser.Language = { quality: 0.9 }; +type Lang = "en-US" | "ko-KR"; +const enUs: Lang = "en-US"; +const koKr: Lang = "ko-KR"; + const parsed1: AcceptLanguageParser.Language[] = AcceptLanguageParser.parse(''); const pick1: string | null = AcceptLanguageParser.pick([''], ''); const pick2: string | null = AcceptLanguageParser.pick([''], [l1, l2, l3]); const pick3: string | null = AcceptLanguageParser.pick([''], '', {}); const pick4: string | null = AcceptLanguageParser.pick([''], '', { loose: true }); +const pick5: Lang | null = AcceptLanguageParser.pick([enUs, koKr], [l1, l2, l3]); +const pick6: Lang | null = AcceptLanguageParser.pick([enUs, koKr], [l1, l2, l3]); const pickOptions: AcceptLanguageParser.PickOptions = { loose: true diff --git a/types/accept-language-parser/index.d.ts b/types/accept-language-parser/index.d.ts index c47969c940..4bec11b89c 100644 --- a/types/accept-language-parser/index.d.ts +++ b/types/accept-language-parser/index.d.ts @@ -1,17 +1,18 @@ // Type definitions for accept-language-parser 1.5 // Project: https://github.com/opentable/accept-language-parser // Definitions by: Niklas Wulf +// Wooram Jun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -// https://github.com/opentable/accept-language-parser/blob/v1.4.1/index.js +// https://github.com/opentable/accept-language-parser/blob/v1.5.0/index.js export function parse(acceptLanguage: string): Language[]; -export function pick( - supportedLanguages: string[], +export function pick( + supportedLanguages: T[], acceptLanguage: string | Language[], options?: PickOptions -): string | null; +): T | null; export interface Language { code: string; diff --git a/types/accept/accept-tests.ts b/types/accept/accept-tests.ts index 011216ede4..659d05c174 100644 --- a/types/accept/accept-tests.ts +++ b/types/accept/accept-tests.ts @@ -14,6 +14,8 @@ accept.language("en;q=0.7, en-GB;q=0.8", ["en-gb"]); // language === "en-GB" const languages = accept.languages("da, en;q=0.7, en-GB;q=0.8"); // languages === ["da", "en-GB", "en"] languages.lastIndexOf(''); +accept.mediaType("text/plain, application/json;q=0.5, text/html, */*;q=0.1"); +accept.mediaType("text/plain, application/json;q=0.5, text/html, */*;q=0.1", ["application/json", "text/html"]); const mediaTypes = accept.mediaTypes("text/plain, application/json;q=0.5, text/html, */*;q=0.1"); // mediaTypes === ["text/plain", "text/html", "application/json", "*/*"] mediaTypes.lastIndexOf(''); diff --git a/types/accept/index.d.ts b/types/accept/index.d.ts index b067ea4306..886193a01e 100644 --- a/types/accept/index.d.ts +++ b/types/accept/index.d.ts @@ -10,6 +10,7 @@ export function encoding(encodingHeader?: string, preferences?: string[]): strin export function encodings(encodingHeader?: string): string[]; export function language(languageHeader?: string, preferences?: string[]): string; export function languages(languageHeader?: string): string[]; +export function mediaType(mediaTypeHeader?: string, preferences?: string[]): string; export function mediaTypes(mediaTypeHeader?: string): string[]; export function parseAll( headers: Record diff --git a/types/ace/index.d.ts b/types/ace/index.d.ts index 7faa5da4f8..2588539c0c 100644 --- a/types/ace/index.d.ts +++ b/types/ace/index.d.ts @@ -549,6 +549,16 @@ declare namespace AceAjax { getFoldsInRange(range: Range): any; highlight(text: string): void; + + + /** + * Highlight lines from `startRow` to `EndRow`. + * @param startRow Define the start line of the highlight + * @param endRow Define the end line of the highlight + * @param clazz Set the CSS class for the marker + * @param inFront Set to `true` to establish a front marker + **/ + highlightLines(startRow:number, endRow: number, clazz: string, inFront: boolean): Range; /** * Sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`. @@ -1223,7 +1233,7 @@ declare namespace AceAjax { /** * Returns `true` if the current `textInput` is in focus. **/ - isFocused(): void; + isFocused(): boolean; /** * Blurs the current `textInput`. diff --git a/types/acorn/index.d.ts b/types/acorn/index.d.ts index 5d02bd716c..e6a9291d1c 100644 --- a/types/acorn/index.d.ts +++ b/types/acorn/index.d.ts @@ -246,9 +246,7 @@ declare namespace acorn { let LooseParser: ILooseParserClass | undefined; let pluginsLoose: PluginsObject | undefined; - interface ILooseParserClass { - new (input: string, options?: Options): ILooseParser; - } + type ILooseParserClass = new (input: string, options?: Options) => ILooseParser; interface ILooseParser {} diff --git a/types/active-win/active-win-tests.ts b/types/active-win/active-win-tests.ts new file mode 100644 index 0000000000..034b03d85a --- /dev/null +++ b/types/active-win/active-win-tests.ts @@ -0,0 +1,17 @@ +import activeWin = require('active-win'); + +// $ExpectType Promise +activeWin(); +// $ExpectType Result +activeWin.sync(); + +let win = { + title: 'Unicorns - Google Search', + id: 5762, + owner: { + name: 'Google Chrome', + processId: 310, + }, +}; + +win = activeWin.sync(); diff --git a/types/active-win/index.d.ts b/types/active-win/index.d.ts new file mode 100644 index 0000000000..7ab1f1e123 --- /dev/null +++ b/types/active-win/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for active-win 4.0 +// Project: https://github.com/sindresorhus/active-win#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = activeWin; + +declare function activeWin(): Promise; + +declare namespace activeWin { + function sync(): Result; + + interface Result { + title: string; + id: number; + bounds?: { + x: number; + y: number; + width: number; + height: number; + }; + owner: { + name: string; + processId: number; + bundleId?: number; + path?: string; + }; + memoryUsage?: number; + } +} diff --git a/types/active-win/tsconfig.json b/types/active-win/tsconfig.json new file mode 100644 index 0000000000..fc292756af --- /dev/null +++ b/types/active-win/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "active-win-tests.ts" + ] +} diff --git a/types/hibp/tslint.json b/types/active-win/tslint.json similarity index 100% rename from types/hibp/tslint.json rename to types/active-win/tslint.json diff --git a/types/activestorage/activestorage-tests.ts b/types/activestorage/activestorage-tests.ts new file mode 100644 index 0000000000..ac9622e2d8 --- /dev/null +++ b/types/activestorage/activestorage-tests.ts @@ -0,0 +1,28 @@ +import * as ActiveStorage from 'activestorage'; + +ActiveStorage.start(); + +const delegate: ActiveStorage.DirectUploadDelegate = { + directUploadWillCreateBlobWithXHR(xhr) { + console.log(xhr.status); + }, + + directUploadWillStoreFileWithXHR(xhr) { + console.log(xhr.status); + }, +}; + +const d = new ActiveStorage.DirectUpload( + new File([], 'blank.txt'), + '/rails/active_storage/direct_uploads', + delegate +); + +d.create((error, blob) => { + if (error) { + console.log(error.message); + } else { + const { byte_size, checksum, content_type, filename, signed_id } = blob; + console.log({ byte_size, checksum, content_type, filename, signed_id }); + } +}); diff --git a/types/activestorage/index.d.ts b/types/activestorage/index.d.ts new file mode 100644 index 0000000000..2d749c84ec --- /dev/null +++ b/types/activestorage/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for ActiveStorage 5.2 +// Project: https://github.com/rails/rails/tree/master/activestorage/app/javascipt +// Definitions by: Cameron Bothner +// Definitions: https://github.com/cbothner/DefinitelyTyped +// TypeScript Version: 2.1 + +export as namespace ActiveStorage + +export function start(): void; + +export class DirectUpload { + id: number; + file: File; + url: string; + + constructor(file: File, url: string, delegate: DirectUploadDelegate) + + create(callback: (error: Error, blob: Blob) => void): void; +} + +export interface DirectUploadDelegate { + directUploadWillCreateBlobWithXHR?: (xhr: XMLHttpRequest) => void; + + directUploadWillStoreFileWithXHR?: (xhr: XMLHttpRequest) => void; +} + +export interface Blob { + byte_size: number; + checksum: string; + content_type: string; + filename: string; + signed_id: string; +} diff --git a/types/activestorage/tsconfig.json b/types/activestorage/tsconfig.json new file mode 100644 index 0000000000..326c2c7401 --- /dev/null +++ b/types/activestorage/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "activestorage-tests.ts"] +} diff --git a/types/activestorage/tslint.json b/types/activestorage/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/activestorage/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/adlib/adlib-tests.ts b/types/adlib/adlib-tests.ts new file mode 100644 index 0000000000..1f745d071a --- /dev/null +++ b/types/adlib/adlib-tests.ts @@ -0,0 +1,40 @@ +/* + | Copyright 2018 Esri + | + | Licensed under the Apache License, Version 2.0 (the "License"); + | you may not use this file except in compliance with the License. + | You may obtain a copy of the License at + | + | http://www.apache.org/licenses/LICENSE-2.0 + | + | Unless required by applicable law or agreed to in writing, software + | distributed under the License is distributed on an "AS IS" BASIS, + | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + | See the License for the specific language governing permissions and + | limitations under the License. + */ + +import * as adlib from "adlib"; + +const transform1: adlib.TransformFunction = + (key: string, value: any, settings: any, param?: any): any => { + return null; + }; + +const transformsList: adlib.TransformsList = { + firstXform: transform1 +}; + +const template = { + value: '{{ instance.color }}' +}; + +const settings = { + instance: { + color: 'red' + } +}; + +const interpolated = adlib.adlib(template, settings, transformsList); + +const list: string[] = adlib.listDependencies(template); diff --git a/types/adlib/index.d.ts b/types/adlib/index.d.ts new file mode 100644 index 0000000000..8866ab7809 --- /dev/null +++ b/types/adlib/index.d.ts @@ -0,0 +1,75 @@ +// Type definitions for adlib 3.0 +// Project: https://github.com/Esri/adlib +// Definitions by: Esri +// Mike Tschudi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/* + | Copyright 2018 Esri + | + | Licensed under the Apache License, Version 2.0 (the "License"); + | you may not use this file except in compliance with the License. + | You may obtain a copy of the License at + | + | http://www.apache.org/licenses/LICENSE-2.0 + | + | Unless required by applicable law or agreed to in writing, software + | distributed under the License is distributed on an "AS IS" BASIS, + | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + | See the License for the specific language governing permissions and + | limitations under the License. + */ + +/** + * Transform function to apply to interpolated value. + * + * @param key Path within a handlebar-style expression to attempt to replace; e.g., `s.animal.type` in + * https://github.com/Esri/adlib#transforms + * @param value Value to replace expression with + * @param settings Hash providing values to insert into template; see https://github.com/Esri/adlib#general-pattern + * @param param Parameter for transform function; e.g., the `optional` transform accepts a count of levels + * to delete if the value is not found (default is 0--just the current level); + * see https://github.com/Esri/adlib#optional-transform + */ +export interface TransformFunction { + ( + key: string, + value: any, + settings: any, + param?: any + ): any; +} + +/** + * Set of transformation functions keyed by the transform function's name. + */ +export interface TransformsList { + [ transformFnName: string ]: TransformFunction; +} + +/** + * A JavaScript library for interpolating property values in JSON Objects. + * + * @param template A template that possibly containing handlebar-style property values to replace; + * see https://github.com/Esri/adlib#general-pattern + * @param settings Hash providing values to insert into template; see https://github.com/Esri/adlib#general-pattern + * @param transforms Set of transformation functions + * @return Copy of template with replacements performed + */ +export function adlib( + template: any, + settings: any, + transforms?: TransformsList +): any; + +/** + * Reads a template and spits out unique handlebar-style property values. + * + * @param template A template that possibly containing handlebar-style property values to replace; + * see https://github.com/Esri/adlib#general-pattern + * @return List of unique property values in template + */ +export function listDependencies( + template: any +): string []; diff --git a/types/adlib/tsconfig.json b/types/adlib/tsconfig.json new file mode 100644 index 0000000000..570be96b8d --- /dev/null +++ b/types/adlib/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "adlib-tests.ts" + ] +} diff --git a/types/adlib/tslint.json b/types/adlib/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/adlib/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/aes-js/aes-js-tests.ts b/types/aes-js/aes-js-tests.ts new file mode 100644 index 0000000000..4f9d582630 --- /dev/null +++ b/types/aes-js/aes-js-tests.ts @@ -0,0 +1,10 @@ +import * as aesjs from 'aes-js'; + +const key = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; + +const data: Uint8Array = aesjs.utils.utf8.toBytes('hello world'); + +const ecb = new aesjs.ModeOfOperation.ecb(key); +ecb.decrypt(ecb.encrypt(data)); + +const hex: string = aesjs.utils.hex.fromBytes(data); diff --git a/types/aes-js/index.d.ts b/types/aes-js/index.d.ts new file mode 100644 index 0000000000..142e03f7d9 --- /dev/null +++ b/types/aes-js/index.d.ts @@ -0,0 +1,134 @@ +// Type definitions for aes-js 3.1 +// Project: https://github.com/ricmoo/aes-js +// Definitions by: Federico Bond +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export type ByteSource = ArrayBuffer | Uint8Array | number[]; + +export class AES { + /** + * Create a new AES block cipher. + * @param key The cipher key. + */ + constructor(key: ByteSource) + encrypt(v: ByteSource): ByteSource; +} + +/** + * Create a new Counter state for CTR cipher mode. + * @param initialValue The Counter initial value. + */ +export class Counter { + constructor(initialValue: number) + setValue(value: number): void; + setBytes(bytes: ByteSource): void; + increment(): void; +} + +export namespace ModeOfOperation { + class ModeOfOperationECB { + /** + * Create a new ECB stream cipher. + * @param key The cipher key. + */ + constructor(key: ByteSource) + encrypt(v: ByteSource): Uint8Array; + decrypt(v: ByteSource): Uint8Array; + } + + class ModeOfOperationCBC { + /** + * Create a new CBC stream cipher. + * @param key The cipher key. + * @param iv The cipher initialization vector. + */ + constructor(key: ByteSource, iv: ByteSource); + encrypt(v: ByteSource): Uint8Array; + decrypt(v: ByteSource): Uint8Array; + } + + class ModeOfOperationCFB { + /** + * Create a new CFB stream cipher. + * @param key The cipher key. + * @param iv The cipher initialization vector. + * @param segmentSize The cipher segment size. + */ + constructor(key: ByteSource, iv: ByteSource, segmentSize: number); + encrypt(v: ByteSource): Uint8Array; + decrypt(v: ByteSource): Uint8Array; + } + + class ModeOfOperationOFB { + /** + * Create a new OFB stream cipher. + * @param key The cipher key. + * @param iv The cipher initialization vector. + */ + constructor(key: ByteSource, iv: ByteSource); + encrypt(v: ByteSource): Uint8Array; + decrypt(v: ByteSource): Uint8Array; + } + + class ModeOfOperationCTR { + /** + * Create a new CTR stream cipher. + * @param key The cipher key. + * @param counter The cipher counter state. + */ + constructor(key: ByteSource, counter?: Counter) + encrypt(v: ByteSource): Uint8Array; + decrypt(v: ByteSource): Uint8Array; + } + + const ecb: typeof ModeOfOperationECB; + const cbc: typeof ModeOfOperationCBC; + const cfb: typeof ModeOfOperationCFB; + const ofb: typeof ModeOfOperationOFB; + const ctr: typeof ModeOfOperationCTR; +} + +export namespace utils { + namespace utf8 { + /** + * Convert a UTF8 encoded string to a Uint8Array. + * @param data The input string. + */ + function toBytes(data: string): Uint8Array; + + /** + * Convert an array-like object containing UTF8 data to a string. + * @param data The input data. + */ + function fromBytes(data: ByteSource): string; + } + namespace hex { + /** + * Convert a hexadecimal string to a Uint8Array. + * @param data The input string. + */ + function toBytes(data: string): Uint8Array; + + /** + * Convert an array-like object to a hexadecimal string. + * @param data The input data. + */ + function fromBytes(data: ByteSource): string; + } +} + +export namespace padding { + namespace pkcs7 { + /** + * Add standard PKCS7 padding to an array. + * @param data The input data. + */ + function pad(data: ByteSource): Uint8Array; + + /** + * Remove standard PKCS7 padding from an array. + * @param data The input data. + */ + function strip(data: ByteSource): Uint8Array; + } +} diff --git a/types/aes-js/tsconfig.json b/types/aes-js/tsconfig.json new file mode 100644 index 0000000000..10f3720c1e --- /dev/null +++ b/types/aes-js/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "aes-js-tests.ts" + ] +} diff --git a/types/aes-js/tslint.json b/types/aes-js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/aes-js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/aframe/index.d.ts b/types/aframe/index.d.ts index 075d063e5f..67257c6f65 100644 --- a/types/aframe/index.d.ts +++ b/types/aframe/index.d.ts @@ -319,6 +319,22 @@ export interface Utils { delimiter?: string ): void; }; + device: { + isWebXRAvailable: boolean; + getVRDisplay(): VRDisplay[]; + checkHeadsetConnected(): boolean; + checkHasPositionalTracking(): boolean; + isMobile(): boolean; + isTablet(): boolean; + isIOS(): boolean; + isGearVR(): boolean; + isOculusGo(): boolean; + isR7(): boolean; + isLandscape(): boolean; + isBrowserEnvironment(): boolean; + isNodeEnvironment(): boolean; + PolyfillControls(object3D: THREE.Object3D): void; + }; styleParser: { parse(value: string): object; stringify(data: object): string; @@ -342,7 +358,7 @@ export interface Utils { // Definitions // used as mixins to register functions to create classes (newable functions) in A-Frame -export type ComponentDefinition = T & Partial; +export type ComponentDefinition = T & Partial & ThisType; export type GeometryDefinition = T & Partial>; export type NodeDefinition = T & Partial; export interface PrimitiveDefinition { diff --git a/types/aframe/test/aframe-io-tests.ts b/types/aframe/test/aframe-io-tests.ts index 1120b50be8..a846976b80 100644 --- a/types/aframe/test/aframe-io-tests.ts +++ b/types/aframe/test/aframe-io-tests.ts @@ -30,7 +30,7 @@ AFRAME.registerComponent('set-image', { init: function() { var data = this.data; - var el = this.el!; + var el = this.el; this.setupFadeAnimation(); @@ -133,14 +133,14 @@ AFRAME.registerComponent('arrow-key-rotation', { if (!this.data.enabled) { return; } - var rotation = this.el!.getAttribute('rotation'); + var rotation = this.el.getAttribute('rotation'); if (!rotation) { return; } if (this.directionX || this.directionY) { rotation.x += this.data.dx * this.directionY; rotation.y += this.data.dy * this.directionX; - this.el!.setAttribute('rotation', rotation); + this.el.setAttribute('rotation', rotation); } } }); @@ -164,10 +164,10 @@ AFRAME.registerComponent('hide-once-playing', { } }, onPlaying: function() { - this.el!.setAttribute('visible', false); + this.el.setAttribute('visible', false); }, onPause: function() { - this.el!.setAttribute('visible', true); + this.el.setAttribute('visible', true); } }); @@ -178,10 +178,10 @@ AFRAME.registerComponent('play-on-vrdisplayactivate-or-enter-vr', { }, play: function() { window.addEventListener('vrdisplayactivate', this.playVideo); - this.el!.sceneEl!.addEventListener('enter-vr', this.playVideoNextTick); + this.el.sceneEl!.addEventListener('enter-vr', this.playVideoNextTick); }, pause: function() { - this.el!.sceneEl!.removeEventListener('enter-vr', this.playVideoNextTick); + this.el.sceneEl!.removeEventListener('enter-vr', this.playVideoNextTick); window.removeEventListener('vrdisplayactivate', this.playVideo); }, playVideoNextTick: function() { @@ -189,7 +189,7 @@ AFRAME.registerComponent('play-on-vrdisplayactivate-or-enter-vr', { }, playVideo: function() { // TODO improve type - var video = (this.el! as Entity).components.material.material.map.image; + var video = (this.el as Entity).components.material.material.map.image; if (!video) { return; } @@ -208,7 +208,7 @@ AFRAME.registerComponent('play-on-window-click', { window.removeEventListener('click', this.onClick); }, onClick: function() { - var video = (this.el! as Entity).components.material.material.map.image; + var video = (this.el as Entity).components.material.material.map.image; if (!video) { return; } @@ -227,7 +227,7 @@ AFRAME.registerComponent('toggle-play-on-window-click', { window.removeEventListener('click', this.onClick); }, onClick: function() { - var video = (this.el! as Entity).components.material.material.map.image; + var video = (this.el as Entity).components.material.material.map.image; if (!video) { return; } @@ -359,7 +359,7 @@ AFRAME.registerComponent('audioanalyser-levels-scale', { return; } - children = this.el!.children; + children = this.el.children; for (var i = 0; i < children.length; i++) { (children[i] as ANode).setAttribute('scale', { x: 1, @@ -382,7 +382,7 @@ AFRAME.registerComponent('audioanalyser-volume-bind', { tick: function() { var analyserComponent; var data = this.data; - var el = this.el!; + var el = this.el; var value; analyserComponent = data.analyserEl.components.audioanalyser; @@ -404,7 +404,7 @@ AFRAME.registerComponent('audioanalyser-volume-scale', { tick: function() { var analyserEl = this.data.analyserEl || this.el; var analyserComponent; - var el = this.el!; + var el = this.el; var volume; analyserComponent = analyserEl.components.audioanalyser; @@ -542,7 +542,7 @@ AFRAME.registerComponent('audioanalyser-waveform', { }, remove: function() { - this.el!.removeObject3D('waveformContainer'); + this.el.removeObject3D('waveformContainer'); } }); @@ -874,7 +874,7 @@ AFRAME.registerComponent('color-on-beat', { init: function() { var analyserEl = this.data.analyserEl || this.el; - var el = this.el!; + var el = this.el; analyserEl.addEventListener('audioanalyser-beat', function() { el.setAttribute( @@ -909,12 +909,12 @@ AFRAME.registerComponent('remove-on-event', { removeEventListener: function() { var data = this.data; - var el = this.el!; + var el = this.el; el.removeEventListener(data.event, this._removeEntity); }, _removeEntity: function() { - var el = this.el!; + var el = this.el; if ((el as any).parentEl) { (el as any).parentEl.removeChild(el); } @@ -1016,7 +1016,7 @@ function rgbToHex(r: number, g: number, b: number) { AFRAME.registerComponent('random-material', { init: function() { - this.el!.setAttribute('material', { + this.el.setAttribute('material', { color: this.getRandomColor(), metalness: Math.random(), roughness: Math.random() @@ -1034,7 +1034,7 @@ AFRAME.registerComponent('random-material', { AFRAME.registerComponent('random-torus-knot', { init: function() { - this.el!.setAttribute('geometry', { + this.el.setAttribute('geometry', { primitive: 'torusKnot', radius: Math.random() * 10, radiusTubular: Math.random() * 0.75, diff --git a/types/aframe/test/aframe-tests.ts b/types/aframe/test/aframe-tests.ts index 2d6ff5bb7e..ac61f7f806 100644 --- a/types/aframe/test/aframe-tests.ts +++ b/types/aframe/test/aframe-tests.ts @@ -75,6 +75,7 @@ const Component = registerComponent('test-component', { }, init() { this.data.num = 0; + this.el.setAttribute('custom-attribute', 'custom-value'); }, update() {}, tick() {}, diff --git a/types/airbnb-prop-types/airbnb-prop-types-tests.ts b/types/airbnb-prop-types/airbnb-prop-types-tests.ts new file mode 100644 index 0000000000..7b79086848 --- /dev/null +++ b/types/airbnb-prop-types/airbnb-prop-types-tests.ts @@ -0,0 +1,206 @@ +import * as React from 'react'; +import * as PropTypes from 'prop-types'; +import * as AirbnbPropTypes from 'airbnb-prop-types'; + +class ClassComp extends React.Component { + render() { + return null; + } +} + +function FuncComp() { + return null; +} + +// $ExpectType Requireable +AirbnbPropTypes.and([PropTypes.number]); +// $ExpectType Requireable +AirbnbPropTypes.and([PropTypes.number, AirbnbPropTypes.nonNegativeInteger]); +// $ExpectType Validator +AirbnbPropTypes.and([PropTypes.number, AirbnbPropTypes.integer()], 'foo').isRequired; + +// $ExpectType Requireable +AirbnbPropTypes.between({ lt: 1 }); +// $ExpectType Requireable +AirbnbPropTypes.between({ lte: 2 }); +// $ExpectType Requireable +AirbnbPropTypes.between({ gt: 3 }); +// $ExpectType Requireable +AirbnbPropTypes.between({ gte: 4 }); +// $ExpectType Requireable +AirbnbPropTypes.between({ lt: 1, gt: 0 }); + +// $ExpectType Requireable +AirbnbPropTypes.booleanSome('foo', 'bar', 'baz'); + +// $ExpectType Requireable +AirbnbPropTypes.childrenHavePropXorChildren('foo'); + +// $ExpectType Requireable +AirbnbPropTypes.childrenOf(PropTypes.string); + +// $ExpectType Requireable +AirbnbPropTypes.childrenOfType(ClassComp); +// $ExpectType Requireable +AirbnbPropTypes.childrenOfType(FuncComp); +// $ExpectType Requireable +AirbnbPropTypes.childrenOfType('div'); +// $ExpectType Requireable +AirbnbPropTypes.childrenOfType(ClassComp, FuncComp, 'div'); + +// $ExpectType Requireable +AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.number }); +// $ExpectType Requireable +AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.string, max: 100 }); +// $ExpectType Requireable +AirbnbPropTypes.childrenSequenceOf({ validator: PropTypes.bool, min: 0 }); + +// $ExpectType Requireable +AirbnbPropTypes.componentWithName('Foo'); +// $ExpectType Requireable +AirbnbPropTypes.componentWithName(/Foo/); +// $ExpectType Requireable +AirbnbPropTypes.componentWithName('Foo', { stripHOCs: ['connect'] }); + +// $ExpectType Requireable +AirbnbPropTypes.disallowedIf(PropTypes.number, 'foo', PropTypes.string); + +// $ExpectType Requireable +AirbnbPropTypes.elementType(ClassComp); +// $ExpectType Requireable +AirbnbPropTypes.elementType(FuncComp); +// $ExpectType Requireable +AirbnbPropTypes.elementType('div'); +// $ExpectType Requireable +AirbnbPropTypes.elementType('*'); +// $ExpectError +AirbnbPropTypes.elementType(ClassComp, FuncComp, 'div'); + +// $ExpectType Requireable +AirbnbPropTypes.explicitNull(); +// $ExpectType Validator +AirbnbPropTypes.explicitNull().isRequired; + +interface ForbidShape { + foo: string; + bar: number; + baz?: boolean | null; +} + +// $ExpectType ValidationMap<{ foo: string | null; bar: number; baz: boolean | null; }> +AirbnbPropTypes.forbidExtraProps({ + foo: PropTypes.string, + bar: PropTypes.number.isRequired, + baz: PropTypes.bool, +}); + +// $ExpectType ValidationMap +AirbnbPropTypes.forbidExtraProps({ + foo: PropTypes.string.isRequired, + bar: PropTypes.number.isRequired, + baz: PropTypes.bool, +}); + +// $ExpectType Requireable +AirbnbPropTypes.integer(); + +// $ExpectType Requireable<{}> +AirbnbPropTypes.keysOf(PropTypes.number); +// $ExpectType Requireable<{}> +AirbnbPropTypes.keysOf(PropTypes.number, 'foo'); +// $ExpectType Requireable<{}> +AirbnbPropTypes.keysOf(PropTypes.oneOf(['foo', 'bar'])); + +// $ExpectType Requireable +AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.number); +// $ExpectType Requireable +AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.number, 'foo'); +// $ExpectType Requireable +AirbnbPropTypes.mutuallyExclusiveProps(PropTypes.string, 'foo', 'bar'); + +// $ExpectType Requireable +AirbnbPropTypes.mutuallyExclusiveTrueProps('foo'); +// $ExpectType Requireable +AirbnbPropTypes.mutuallyExclusiveTrueProps('foo', 'bar'); + +// $ExpectType Requireable +AirbnbPropTypes.nChildren(1, PropTypes.number); +// $ExpectType Requireable +AirbnbPropTypes.nChildren(1, AirbnbPropTypes.childrenOfType('span')); + +// $ExpectType Requireable +AirbnbPropTypes.nonNegativeInteger; + +// $ExpectType Requireable +AirbnbPropTypes.nonNegativeNumber(); + +// $ExpectType Requireable +AirbnbPropTypes.numericString(); + +// $ExpectType Requireable<{}> +AirbnbPropTypes.object(); +// $ExpectType Requireable<{ foo: string; }> +AirbnbPropTypes.object<{ foo: string }>(); + +AirbnbPropTypes.or([PropTypes.bool.isRequired, AirbnbPropTypes.explicitNull().isRequired]); +AirbnbPropTypes.or([PropTypes.bool, PropTypes.number, PropTypes.arrayOf(PropTypes.string)]); +AirbnbPropTypes.or([PropTypes.number, PropTypes.string, PropTypes.bool], 'foo'); + +// $ExpectType Requireable +AirbnbPropTypes.range(0, 10); +// $ExpectType Requireable<5> +AirbnbPropTypes.range<5>(0, 10); + +// $ExpectType Requireable +AirbnbPropTypes.requiredBy('foo', PropTypes.string); +// $ExpectType Validator +AirbnbPropTypes.requiredBy('bar', PropTypes.number, 42).isRequired; + +// $ExpectType Requireable<{}> +AirbnbPropTypes.restrictedProp(); +// $ExpectType Requireable<{}> +AirbnbPropTypes.restrictedProp(() => 'Error'); +// $ExpectType Requireable<{}> +AirbnbPropTypes.restrictedProp(() => new Error('Error')); + +// $ExpectType Requireable<{}> +AirbnbPropTypes.sequenceOf({ validator: PropTypes.number }); +// $ExpectType Requireable<{}> +AirbnbPropTypes.sequenceOf({ validator: PropTypes.number }, { validator: PropTypes.string }); +// $ExpectType Requireable<{}> +AirbnbPropTypes.sequenceOf( + { validator: PropTypes.number, min: 0, max: 10 }, + { validator: PropTypes.string }, + { validator: PropTypes.bool }, +); + +interface ShapeShape { + foo: string; + bar?: number | null; +} + +// $ExpectType Requireable<{ foo: string | null; }> +AirbnbPropTypes.shape({ + foo: PropTypes.string, +}); +// $ExpectType Requireable<{ foo: string | null; bar: number | null; }> +AirbnbPropTypes.shape({ + foo: PropTypes.string, + bar: PropTypes.number, +}); +// $ExpectType Requireable +AirbnbPropTypes.shape({ + foo: PropTypes.string.isRequired, + bar: PropTypes.number, +}); + +// $ExpectType Requireable +AirbnbPropTypes.stringStartsWith('foo'); + +// $ExpectType Requireable +AirbnbPropTypes.uniqueArray(); +// $ExpectType Requireable +AirbnbPropTypes.uniqueArray(); + +// $ExpectType Requireable<{ [key: string]: number | null; }> +AirbnbPropTypes.valuesOf(PropTypes.number); diff --git a/types/airbnb-prop-types/index.d.ts b/types/airbnb-prop-types/index.d.ts new file mode 100644 index 0000000000..10c58556c7 --- /dev/null +++ b/types/airbnb-prop-types/index.d.ts @@ -0,0 +1,198 @@ +// Type definitions for airbnb-prop-types 2.11 +// Project: https://github.com/airbnb/prop-types +// Definitions by: Miles Johnson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +import * as PropTypes from 'prop-types'; + +export interface ReactComponentLike { + setState(...args: any[]): any; + forceUpdate(...args: any[]): any; + render(): PropTypes.ReactNodeLike; + props: any; + state: any; + context: any; + refs: any; +} + +export interface ReactClassComponentLike { + new (...args: any[]): ReactComponentLike; +} + +export type ReactFunctionComponentLike = (...args: any[]) => PropTypes.ReactNodeLike; + +export type ReactTypeLike = string | ReactClassComponentLike | ReactFunctionComponentLike; + +export interface Specifier { + max?: number; + min?: number; + validator: PropTypes.Validator; +} + +export function and( + propTypes: [PropTypes.Validator], + name?: string, +): PropTypes.Requireable; + +export function and( + propTypes: [PropTypes.Validator, PropTypes.Validator], + name?: string, +): PropTypes.Requireable; + +export function and( + propTypes: [PropTypes.Validator, PropTypes.Validator, PropTypes.Validator], + name?: string, +): PropTypes.Requireable; + +export function and( + propTypes: Array>, + name?: string, +): PropTypes.Requireable; + +export function between(options: { + lt?: number; + lte?: number; + gt?: number; + gte?: number; +}): PropTypes.Requireable; + +export function booleanSome(...props: string[]): PropTypes.Requireable; + +export function childrenHavePropXorChildren( + prop: string | symbol, +): PropTypes.Requireable; + +export function childrenOf( + propType: PropTypes.Validator

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

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

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

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

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

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

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

, + propTypes: PropTypes.ValidationMap, +): PropTypes.Requireable; diff --git a/types/airbnb-prop-types/tsconfig.json b/types/airbnb-prop-types/tsconfig.json new file mode 100644 index 0000000000..ccefe4943c --- /dev/null +++ b/types/airbnb-prop-types/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "airbnb-prop-types-tests.ts"] +} diff --git a/types/airbnb-prop-types/tslint.json b/types/airbnb-prop-types/tslint.json new file mode 100644 index 0000000000..71ee04c4e1 --- /dev/null +++ b/types/airbnb-prop-types/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-unnecessary-generics": false + } +} diff --git a/types/ali-oss/index.d.ts b/types/ali-oss/index.d.ts index 13f7f56ff9..e4f9e09e7c 100644 --- a/types/ali-oss/index.d.ts +++ b/types/ali-oss/index.d.ts @@ -18,6 +18,7 @@ declare namespace OSS { internal?: boolean; // access OSS with aliyun internal network or not, default is false. If your servers are running on aliyun too, you can set true to save lot of money. secure?: boolean; // instruct OSS client to use HTTPS (secure: true) or HTTP (secure: false) protocol. timeout?: string | number; // instance level timeout for all operations, default is 60s + cname?: boolean; // use custom domain name } interface Bucket { @@ -29,7 +30,7 @@ declare namespace OSS { type StorageType = "Standard" | "IA" | "Archive"; - type ACLType = "public-read-write" | "public-read" | "and private"; + type ACLType = "public-read-write" | "public-read" | "private"; type HTTPMethods = "GET" | "POST" | "DELETE" | "PUT"; @@ -174,6 +175,7 @@ declare namespace OSS { mime?: string; // custom mime, will send with Content-Type entity header meta?: UserMeta; // user meta, will send with x-oss-meta- prefix string e.g.: { uid: 123, pid: 110 } callback: ObjectCallback; + headers?: object; } interface PutObjectResult { @@ -188,6 +190,7 @@ declare namespace OSS { mime: string; // custom mime, will send with Content-Type entity header meta: UserMeta; callback: ObjectCallback; + headers?: object; } interface AppendObjectOptions { diff --git a/types/all-keys/all-keys-tests.ts b/types/all-keys/all-keys-tests.ts new file mode 100644 index 0000000000..6bbb6021c7 --- /dev/null +++ b/types/all-keys/all-keys-tests.ts @@ -0,0 +1,5 @@ +import allKeys = require('all-keys'); + +allKeys(Symbol.prototype); // $ExpectType Set +allKeys(Symbol.prototype, { includeObjectPrototype: false }); // $ExpectType Set +allKeys(Symbol.prototype, { includeSymbols: false }); // $ExpectType Set diff --git a/types/all-keys/index.d.ts b/types/all-keys/index.d.ts new file mode 100644 index 0000000000..9301c8f929 --- /dev/null +++ b/types/all-keys/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for all-keys 2.0 +// Project: https://github.com/sindresorhus/all-keys#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export = allKeys; + +/** + * Get all property keys of an object including non-enumerable and inherited ones. + * Like [Reflect.ownKeys()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/ownKeys) + * but traverses up the prototype-chain. + */ +declare function allKeys(obj: object, options?: allKeys.Options): Set; + +declare namespace allKeys { + interface Options { + /** + * Include `Object.prototype` properties like `isPrototypeOf`. + * @default true + */ + includeObjectPrototype?: boolean; + /** + * Include [Symbol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) keys. + * @default true + */ + includeSymbols?: boolean; + } +} diff --git a/types/all-keys/tsconfig.json b/types/all-keys/tsconfig.json new file mode 100644 index 0000000000..a6f20f786f --- /dev/null +++ b/types/all-keys/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "all-keys-tests.ts" + ] +} diff --git a/types/all-keys/tslint.json b/types/all-keys/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/all-keys/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/all-property-names/all-property-names-tests.ts b/types/all-property-names/all-property-names-tests.ts new file mode 100644 index 0000000000..b32daa59a3 --- /dev/null +++ b/types/all-property-names/all-property-names-tests.ts @@ -0,0 +1,4 @@ +import allPropertyNames = require('all-property-names'); + +// $ExpectType Set +allPropertyNames(Symbol.prototype); diff --git a/types/all-property-names/index.d.ts b/types/all-property-names/index.d.ts new file mode 100644 index 0000000000..0b396ec94d --- /dev/null +++ b/types/all-property-names/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for all-property-names 1.0 +// Project: https://github.com/sindresorhus/all-property-names#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export = allPropertyNames; + +declare function allPropertyNames(input: object): Set; diff --git a/types/all-property-names/tsconfig.json b/types/all-property-names/tsconfig.json new file mode 100644 index 0000000000..394cd3bb53 --- /dev/null +++ b/types/all-property-names/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "all-property-names-tests.ts" + ] +} diff --git a/types/all-property-names/tslint.json b/types/all-property-names/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/all-property-names/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/alt/index.d.ts b/types/alt/index.d.ts index 9094642e70..515a67986a 100644 --- a/types/alt/index.d.ts +++ b/types/alt/index.d.ts @@ -54,12 +54,12 @@ declare namespace AltJS { export type Source = {[name:string]: () => SourceModel}; export interface SourceModel { - local(state:any, ...args: any[]):any; + local?(state:any, ...args: any[]):any; remote(state:any, ...args: any[]):Promise; shouldFetch?(fetchFn:(...args:Array) => boolean):void; loading?:(args:any) => void; - success?:(state:S) => void; - error?:(args:any) => void; + success:(state:S) => void; + error:(args:any) => void; interceptResponse?(response:any, action:Action, ...args:Array):any; } diff --git a/types/amap-js-sdk/amap-js-sdk-tests.ts b/types/amap-js-sdk/amap-js-sdk-tests.ts new file mode 100644 index 0000000000..f09bca3760 --- /dev/null +++ b/types/amap-js-sdk/amap-js-sdk-tests.ts @@ -0,0 +1,22 @@ +const aMap = new AMap.Map('id', { + resizeEnable: true, + animateEnable: true +}); + +aMap.setCenter(new AMap.LngLat(0, 0)); + +AMap.plugin(['someplugin'], () => { + console.log('plugin loaded'); +}); + +AMap.convertFrom([116.3, 39.9], 'gps', (status, result) => { + if (result.info === 'ok') { + const _ = result.locations; + } +}); + +new AMap.Marker({ + map: aMap, + title: '', + position: new AMap.LngLat(0, 0), +}); diff --git a/types/amap-js-sdk/index.d.ts b/types/amap-js-sdk/index.d.ts new file mode 100644 index 0000000000..a1b93e6cb3 --- /dev/null +++ b/types/amap-js-sdk/index.d.ts @@ -0,0 +1,1392 @@ +// Type definitions for amap-js-sdk 1.4 +// Project: http://lbs.amap.com/api/javascript-api/summary/ +// Definitions by: Bian Zhongjie +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace AMap { + type EventCallback = (...args: any[]) => void; + type GenericEventCallback = (res: T) => void; + + /** + * 加载插件 + * @param pluginNames + * @param ready + */ + function plugin(pluginNames: string[], ready?: () => void): void; + + /** + * 加载服务 + * @param serviceName + * @param ready + */ + function service(serviceName: string, ready?: () => void): void; + + namespace event { + /** + * 注册DOM对象事件:给DOM对象注册事件,并返回eventListener。运行AMap.event.removeListener(eventListener)可以删除该事件的监听器。 + * @param instance:需注册事件的DOM对象(必填) + * @param eventName:事件名称(必填) + * @param handler:事件功能函数(必填) + * @param context:事件上下文(可选,缺省时,handler中this指向参数instance引用的对象,否则this指向context引用的对象) + */ + const addDomListener: (instance: any, eventName: string, handler: EventCallback, context?: any) => EventListener; + + /** + * 注册对象事件:给对象注册事件,并返回eventListener。运行AMap.event.removeListener(eventListener)可以删除该事件的监听器。 + * @param instance:需注册事件的对象(必填) + * @param eventName:事件名称(必填) + * @param handler:事件功能函数(必填) + * @param context:事件上下文(可选,缺省时,handler中this指向参数instance引用的对象,否则this指向context引用的对象) + */ + const addListener: (instance: any, eventName: string, handler: EventCallback, context?: any) => EventListener; + + /** + * 类似于addListener,但处理程序会在处理完第一个事件后将自已移除。 + */ + const addListenerOnce: (instance: any, eventName: string, handler: EventCallback, context?: any) => EventListener; + + /** + * 删除由上述 event.addDomListener 和 event.addListener 传回的指定侦听器。 + */ + const removeListener: (listener: EventListener) => void; + + /** + * 触发非DOM事件:触发非DOM事件eventName,extArgs将扩展到事件监听函数(handler)接受到的event参数中。如:在extArgs内写入{m:10,p:2},eventName监听函数(handler)可以接收到包含m,p两个key值的event对象。 + */ + const trigger: (instance: any, eventName: string, extArgs: any) => void; + } + + /** + * 此对象用于表示地图、覆盖物、叠加层上的各种鼠标事件返回,包含以下字段: + */ + interface MapsEventOptions { + lnglat: LngLat; + pixel: Pixel; + type: string; + target: any; + } + + abstract class EventBindable { + on(eventName: string, callback: EventCallback): void; + off(eventName: string, callback: EventCallback): void; + } + + /* --------------------------- 基础类 --------------------------- */ + /* 参考地址:http://lbs.amap.com/api/javascript-api/reference/core */ + + /** + * 像素坐标,确定地图上的一个像素点。 + */ + class Pixel { + /** + * 构造一个像素坐标对象。 + */ + constructor(x: number, y: number); + /** + * 获得X方向像素坐标 + */ + getX(): number; + + /** + * 获得Y方向像素坐标 + */ + getY(): number; + + /** + * 当前像素坐标与传入像素坐标是否相等 + */ + equals(point: Pixel): boolean; + + /** + * 以字符串形式返回像素坐标对象 + */ + toString(): string; + } + + /** + * 地物对象的像素尺寸 + */ + class Size { + /** + * 构造尺寸对象 + * @param width 宽度,单位:像素 + * @param height 高度,单位:像素 + */ + constructor(width: number, height: number); + + /** + * 获得宽度 + */ + getWidth(): number; + + /** + * 获得高度 + */ + getHeight(): number; + + /** + * 以字符串形式返回尺寸大小对象 + */ + toString(): string; + } + + /** + * 经纬度坐标,确定地图上的一个点 + */ + class LngLat { + /** + * 构造一个地理坐标对象 + * @param lng 经度 + * @param lat 纬度 + */ + constructor(lng: number, lat: number); + + /** + * 当前经纬度坐标值经度移动w,纬度移动s,得到新的坐标。 + * + * @param w 经度,向右移为正值,单位:米 + * @param s 纬度,向上移为正值,单位:米 + */ + offset(w: number, s: number): LngLat; + + /** + * 计算当前经纬度和传入经纬度或者经纬度数组连线之间的地面距离,单位为米 + * + * @param lnglat 传入的经纬度 + */ + distance(lnglat: LngLat | [number, number]): number; + + /** + * 获取经度值 + */ + getLng(): number; + + /** + * 获取纬度值 + */ + getLat(): number; + + /** + * 判断当前坐标对象与传入坐标对象是否相等 + * + * @param lnglat 传入坐标对象 + */ + equals(lnglat: LngLat): boolean; + + /** + * LngLat对象以字符串的形式返回 + */ + toString(): string; + } + + /** + * 地物对象的经纬度矩形范围 + */ + class Bounds { + /** + * 构造一个矩形范围 + * @param southWest 西南角经纬度坐标 + * @param northEast 东北角经纬度坐标 + */ + constructor(southWest: LngLat, northEast: LngLat); + + /** + * 判断指定点坐标是否在矩形范围内 + * @param point 指定点 + */ + contains(point: LngLat): boolean; + + /** + * 获取当前Bounds的中心点经纬度坐标 + */ + getCenter(): LngLat; + + /** + * 获取西南角坐标 + */ + getSouthWest(): LngLat; + + /** + * 获取东北角坐标 + */ + getNorthEast(): LngLat; + + /** + * 以字符串形式返回地物对象的矩形范围 + */ + toString(): string; + } + + interface TileLayerOptions { + map: Map; + tileSize: number; + tileUrl: string; + errorUrl: string; + getTileUrl: (x: number, y: number, z: number) => string; + zIndex: number; + opacity: number; + zooms: number[]; + detectRetina: boolean; + } + + abstract class Layer extends EventBindable { + setOpacity(alpha: number): void; + show(): void; + hide(): void; + getTiles(): string[]; + reload(): void; + setTileUrl(): void; + getZooms(): number[]; + setzIndex(index: number): void; + setMap(map: Map): void; + } + + class TileLayer extends Layer { + constructor(tileOpt?: { + map: Map, + tileSize?: number, + tileUrl?: string, + errorUrl?: string, + getTileUrl?: (x: number, y: number, z: number) => string, + zIndex?: number, + opacity?: number, + zooms?: number[], + detectRetina?: boolean + }); + } + + namespace TileLayer { + abstract class MapTypeLayer extends Layer { + constructor(options?: { + map: Map, + zIndex?: number, + opacity?: number, + zooms?: number[], + detectRetina?: boolean + }); + } + + class Satellite extends MapTypeLayer { + } + + class RoadNet extends MapTypeLayer { + } + + class Traffic extends MapTypeLayer { + constructor(options?: { + map: Map, + zIndex?: number, + opacity?: number, + zooms?: number[], + detectRetina?: boolean, + autoRefresh?: boolean, + interval?: number + }); + + interval: number; + autoRefresh: boolean; + } + } + + class IndoorMap { + constructor(opts: { + zIndex?: number, + opacity?: number, + cursor?: string, + hideFloorBar?: boolean, + alwaysShow?: boolean + }); + + showIndoorMap(indoorid: string, floor: number, shopid: string): void; + + showFloor(floor: number, noMove: boolean): void; + + setMap(map: Map): void; + + show(): void; + + hide(): void; + + setzIndex(): void; + + showFloorBar(): void; + + hideFloorBar(): void; + + setOpacity(alpha: number): void; + + getOpacity(): number; + + showLabels(): void; + + hideLabels(): void; + + getSelectedBuildingId(): string; + + getSelectedBuilding(): string; + } + + interface MapOptions { + view?: View2D; + layers?: TileLayer[]; + level?: number; + center?: LngLat; + labelzIndex?: number; + zooms?: number[]; + lang?: string; + cursor?: string; + crs?: string; + animateEnable?: boolean; + isHotspot?: boolean; + defaultLayer?: TileLayer; + rotateEnable?: boolean; + resizeEnable?: boolean; + showIndoorMap?: boolean; + indoorMap?: IndoorMap; + expandZoomRange?: boolean; + dragEnable?: boolean; + zoomEnable?: boolean; + doubleClickZoom?: boolean; + keyboardEnable?: boolean; + jogEnable?: boolean; + scrollWheel?: boolean; + touchZoom?: boolean; + mapStyle?: string; + features?: string[]; + } + + class View2D { + constructor(opt: { + center?: LngLat, + rotation?: number, + zoom?: number, + crs?: 'EPSG3857'|'EPSG3395'|'EPSG4326' + }); + + /** + * To silence lint error, this class has to be exists. + */ + toString(): string; + } + + class Map extends EventBindable { + constructor(mapDiv: string, opts?: MapOptions); + + getZoom(): number; + + getLayers(): TileLayer[]; + + getCenter(): LngLat; + + getCity(callback: (result: { + provice: string, + city: string, + citycode: string, + district: string + }) => void): void; + + getBounds(): Bounds; + getlabelzIndex(): number; + getLimitBounds(): Bounds; + getLang(): string; + getSize(): Size; + getRotation(): number; + getStatus(): any; + getDefaultCursor(): string; + getResolution(point: LngLat): number; + getScale(dpi: number): number; + setZoom(level: number): void; + setlabelzIndex(index: number): void; + setLayers(layers: TileLayer[]): void; + add(overlayers: any[]): void; + remove(overlayers: any[]): void; + getAllOverlays(type: string): Marker[] | Circle[] | Polygon[] | Polyline[]; + setCenter(position: LngLat): void; + setZoomAndCenter(zoomLevel: number, center: LngLat): void; + setCity(city: string, callback: () => void): void; + setBounds(bound: Bounds): void; + setLimitBounds(bound: Bounds): void; + clearLimitBounds(): void; + setLang(lang: string): void; + setRotation(rotation: number): void; + setStatus(status: any): void; + setDefaultCursor(cursor: string): void; + zoomIn(): void; + zoomOut(): void; + panTo(position: LngLat): void; + panBy(x: number, y: number): void; + setFitView(overlayList?: any[]): void; + clearMap(): void; + destroy(): void; + plugin(name: string| string[], callback: () => void): void; + addControl(obj: any): void; + removeControl(obj: any): void; + clearInfoWindow(): void; + pixelToLngLat(pixel: Pixel, level: number): LngLat; + lnglatToPixel(lnglat: LngLat, level: number): Pixel; + containerToLngLat(pixel: Pixel, level: number): LngLat; + lngLatToContainer(lnglat: LngLat, level: number): Pixel; + setMapStyle(style: string): void; + getMapStyle(): string; + setFeatures(features: string[]): void; + getFeatures(): string[]; + setDefaultLayer(layer: TileLayer): void; + } + + class Icon { + constructor(options?: { + size?: Size, + imageOffset?: Pixel, + image?: string, + imageSize?: Size + }); + + getImageSize(): Size; + setImageSize(size: Size): void; + } + + /** + * MarkerShape用于划定Marker的可点击区域范围。需要注意的是,在IE浏览器中图标透明区域默认为不触发事件,因此MarkerShape在IE中不起作用。 + */ + class MarkerShape { + constructor(options: { + /** + * + * 可点击区域组成元素数组,存放图形的像素坐标等信息,该数组元素由type决定: + * - circle:coords格式为 [x1, y1, r],x1,y1为圆心像素坐标,r为圆半径 + * - poly: coords格式为 [x1, y1, x2, y2 … xn, yn],各x,y表示多边形边界像素坐标 + * - rect: coords格式为 [x1, y1, x2, y2],x1,y1为矩形左上角像素坐标,x2,y2为矩形右下角像素坐标 + * Markshape的像素坐标是指相对于marker的左上角的像素坐标偏移量 + */ + coords?: number[], + + /** + * 可点击区域类型,可选值: + * - circle:圆形 + * - poly:多边形 + * - rect:矩形 + */ + type?: string + }); + + /** + * To silence lint error, this class has to be exists. + */ + toString(): string; + } + + interface MarkerOptions { + map?: Map; + position?: LngLat; + offset?: Pixel; + icon?: string|Icon; + content?: string| HTMLElement; + topWhenClick?: boolean; + topWhenMouseOver?: boolean; + draggable?: boolean; + raiseOnDrag?: boolean; + cursor?: string; + visible?: boolean; + zIndex?: number; + angle?: number; + autoRotation?: boolean; + animation?: string; + shadow?: Icon; + title?: string; + clickable?: boolean; + shape?: MarkerShape; + extData?: any; + label?: { content: string, offset: Pixel }; + } + + /** + * 点标记。 + */ + class Marker extends EventBindable { + constructor(options?: MarkerOptions); + + markOnAMAP(obj: { + name: string, + position: LngLat + }): void; + + getOffset(): Pixel; + setOffset(offset: Pixel): void; + + setAnimation(animate: string): void; + getAnimation(): string; + + setClickable(clickable: boolean): void; + getClickable(): boolean; + + getPosition(): LngLat; + setPosition(lnglat: LngLat): void; + + setAngle(angle: number): void; + getAngle(): number; + + setLabel(label: { + content?: string, + offset?: Pixel + }): void; + getLabel(): { + content?: string, + offset?: Pixel + }; + + setzIndex(index: number): void; + + getIcon(): string|Icon; + setIcon(content: string|Icon): void; + + setDraggable(draggable: boolean): void; + getDraggable(): boolean; + + hide(): void; + show(): void; + + setCursor(cursor: string): void; + + setContent(content: string| HTMLElement): void; + getContent(): string; + + moveAlong(lnglatlist: LngLat[], speed?: number, f?: (k: number) => number, circlable?: boolean): void; + moveTo(lnglat: LngLat, speed?: number, f?: (k: number) => number): void; + stopMove(): void; + setMap(map: Map): void; + getMap(): Map; + setTitle(title: string): void; + getTitle(): string; + setTop(isTop: boolean): void; + getTop(): boolean; + setShadow(icon: Icon): void; + getShadow(): Icon; + setShape(shape: MarkerShape): void; + getShape(): MarkerShape; + setExtData(ext: any): void; + getExtData(): any; + } + + interface MarkerClustererOptions { + gridSize?: number; + minClusterSize?: number; + maxZoom?: number; + averageCenter?: boolean; + styles?: any[]; + renderCluserMarker?: (obj: any) => void; + zoomOnClick?: boolean; + } + + /** + * 用于地图上加载大量点标记,提高地图的绘制和显示性能。 + */ + class MarkerClusterer extends EventBindable { + constructor(map: Map, markers: Marker[], opt?: MarkerClustererOptions); + + /** + * 添加一个需进行聚合的点标记 + * @param marker + */ + addMarker(marker: Marker): void; + + /** + * 删除一个聚合的点标记 + * @param marker 点标记 + */ + removeMarker(marker: Marker): void; + + /** + * 获取聚合点的总数量 + */ + getClustersCount(): number; + + /** + * 获取聚合网格的像素大小 + */ + getGridSize(): number; + + /** + * 获取地图中点标记的最大聚合级别 + */ + getMaxZoom(): number; + + /** + * 获取单个聚合的最小数量 + */ + getMinClusterSize(): number; + + /** + * 获取聚合的样式风格集合 + */ + getStyles(): any[]; + + /** + * 设置聚合网格的像素大小 + * @param size + */ + setGridSize(size: number): void; + + /** + * 设置地图中点标记的最大聚合级别 + * @param zoom + */ + setMaxZoom(zoom: number): void; + + /** + * 设置单个聚合的最小数量 + * @param size + */ + setMinClusterSize(size: number): void; + + /** + * 设置聚合的样式风格 + * @param styles + */ + setStyles(styles: any[]): void; + + /** + * 从地图上彻底清除所有聚合点标记 + */ + clearMarkers(): void; + + /** + * 设置将进行点聚合的地图对象 + * @param map + */ + setMap(map: Map): void; + + /** + * 设置将进行点聚合显示的点标记集合 + * @param markers + */ + setMarkers(markers: Marker[]): void; + + /** + * 获取该点聚合的地图对象 + */ + getMap(): Map; + + /** + * 获取该点聚合中的点标记集合 + */ + getMarkers(): Marker[]; + + /** + * 添加一组需进行聚合的点标记 + */ + addMarkers(markers: Marker[]): void; + + /** + * 删除一组聚合的点标记 + * @param markers + */ + removeMarkers(markers: Marker[]): void; + + /** + * 获取单个聚合点位置是否是聚合内所有标记的平均中心 + */ + isAverageCenter(): boolean; + + /** + * 设置单个聚合点位置是否是聚合内所有标记的平均中心 + * @param averageCenter + */ + setAverageCenter(averageCenter: boolean): void; + } + + interface CircleOptions { + map: Map; + zIndex?: number; + center: LngLat; + radius?: number; + strokeColor?: string; + strokeOpacity?: number; + fillColor?: string; + fillOpacity?: string; + strokeStyle?: string; + extData?: any; + strokeDasharray?: number[]; + } + + class Circle { + constructor(options?: CircleOptions); + setCenter(lnglat: LngLat): void; + getCenter(): LngLat; + getBounds(): Bounds; + setRadius(radius: number): void; + getRadius(): number; + setOptions(circleopt: CircleOptions): void; + getOptions(): CircleOptions; + hide(): void; + show(): void; + setMap(map: Map): void; + setExtData(ext: any): void; + getExtData(): any; + contains(point: LngLat): boolean; + } + + interface PolygonOptions { + map?: Map; + zIndex?: number; + path?: LngLat[]|LngLat[][]; + strokeColor?: string; + strokeOpacity?: number; + strokeWeight?: number; + fillColor?: string; + fillOpacity?: number; + extData?: any; + strokeStyle?: string; + strokeDasharray?: number[]; + } + + class Polygon extends EventBindable { + constructor(options?: PolygonOptions); + + setPath(path: LngLat[]|LngLat[][]): void; + getPath(): LngLat[]|LngLat[][]; + setOptions(opt: PolygonOptions): void; + getOptions(): PolygonOptions; + getBounds(): Bounds; + getArea(): number; + hide(): void; + show(): void; + setMap(map: Map): void; + setExtData(ext: any): void; + getExtData(): any; + contains(point: LngLat): boolean; + } + + interface PolylineOptions { + map?: Map; + zIndex?: number; + geodesic?: boolean; + isOutline?: boolean; + outlineColor?: string; + path?: LngLat[]; + strokeColor?: string; + strokeOpacity?: number; + strokeWeight?: number; + strokeStyle?: string; + strokeDasharray?: number[]; + extData?: any; + } + + class Polyline extends EventBindable { + constructor(options?: PolylineOptions); + + setPath(path: LngLat[]): void; + getPath(): LngLat[]; + + setOptions(opt: PolylineOptions): void; + getOptions(): PolylineOptions; + + getLength(): number; + getBounds(): Bounds; + hide(): void; + show(): void; + + setMap(map: Map): void; + setExtData(ext: any): void; + getExtData(): any; + } + + interface MapControl { + show(): void; + hide(): void; + } + + class MapType implements MapControl { + constructor(options?: { + defaultType?: number; + showTraffic?: boolean; + showRoad?: boolean; + }); + + show(): void; + hide(): void; + } + + class OverView extends EventBindable implements MapControl { + constructor(options?: { + tileLayer?: TileLayer[], + isOpen?: boolean, + visible?: boolean + }); + + open(): void; + close(): void; + setTileLayer(layer: TileLayer): void; + getTileLayer(): TileLayer; + show(): void; + hide(): void; + } + + class Scale extends EventBindable implements MapControl { + offset: Pixel; + position: string; + + show(): void; + hide(): void; + } + + class ToolBar extends EventBindable implements MapControl { + constructor(options?: { + offset?: Pixel, + position?: string, + ruler?: boolean, + noIpLocate?: boolean, + locate?: boolean, + liteStyle?: boolean, + direction?: boolean, + autoPosition?: boolean, + locationMarker?: Marker, + useNative?: boolean + }); + + getOffset(): Pixel; + setOffset(offset: Pixel): void; + hideRuler(): void; + showRuler(): void; + hideDirection(): void; + showDirection(): void; + hideLocation(): void; + showLocation(): void; + doLocation(): void; + getLocation(): { lng: number, lat: number }; + show(): void; + hide(): void; + } + + class InfoWindow extends EventBindable { + constructor(options?: { + isCustom?: boolean, + autoMove?: boolean, + closeWhenClickMap?: boolean, + content?: string | HTMLElement, + size?: Size, + offset?: Pixel, + position?: LngLat, + showShadow?: boolean + }); + + open(map: Map, pos: LngLat): void; + close(): void; + getIsOpen(): boolean; + setPosition(lnglat: LngLat): void; + getPosition(): LngLat; + setSize(size: Size): void; + getSize(): Size; + getContent(): string; + setContent(content: string|HTMLElement): void; + } + + class AdvancedInfoWindow extends EventBindable { + constructor(options?: { + autoMove?: boolean, + closeWhenClickMap?: boolean, + content?: string|HTMLElement, + offset?: Pixel, + position?: LngLat, + panel?: string|HTMLElement, + searchRadius?: number, + placeSearch?: boolean, + driving?: boolean, + walking?: boolean, + transit?: boolean, + asOrigin?: boolean, + asDestination?: boolean + }); + + open(map: Map, pos: LngLat): void; + close(): void; + getIsOpen(): boolean; + setPosition(lnglat: LngLat): void; + getPosition(): LngLat; + setContent(content: string|HTMLElement): void; + getContent(): string; + } + + class Geolocation extends EventBindable { + constructor(options: { + enableHighAccuracy?: boolean, + timeout?: number, + noIpLocate?: boolean, + maximumAge?: number, + convert?: boolean, + showButton?: boolean, + buttonDom?: string|HTMLElement, + buttonPosition?: string, + buttonOffset?: Pixel, + showMarker?: boolean, + markerOptions?: MarkerOptions, + showCircle?: boolean, + circleOptions?: CircleOptions, + panToLocation?: boolean, + zoomToAccuracy?: boolean, + useNative?: boolean + }); + + isSupported(): boolean; + getCurrentPosition(): void; + watchPosition(): number; + clearWatch(watchId: number): number; + } + + interface GeolocationResult { + position: LngLat; + accuracy: number; + isConverted: boolean; + info: string; + } + + interface GeolocationError { + info: string; + } + + interface BusinessArea { + id: string; + name: string; + location: string; + } + + interface Road { + id: string; + name: string; + distance: number; + location: LngLat; + direction: string; + } + + interface Cross { + distance: number; + direction: string; + location: LngLat; + first_id: string; + first_name: string; + second_id: string; + second_name: string; + } + + interface AddressComponent { + province: string; + city: string; + citycode: string; + district: string; + adcode: string; + township: string; + street: string; + streetNumber: string; + neighborhood: string; + neighborhoodType: string; + building: string; + buildingType: string; + businessAreas: BusinessArea[]; + } + + interface Geocode { + addressComponent: AddressComponent; + formattedAddress: string; + location: LngLat; + adcode: string; + level: string; + } + + interface ReGeocode { + addressComponent: AddressComponent; + formattedAddress: string; + roads: Road[]; + crosses: Cross[]; + pois: ReGeocodePoi[]; + } + + interface ReGeocodePoi { + id: string; + name: string; + type: string; + tel: string; + distance: number; + direction: string; + address: string; + location: LngLat; + businessArea: string; + } + + interface GeocodeResult { + info: string; + geocodes: LngLat[]; + resultNum: number; + } + + interface ReGeocodeResult { + info: string; + regeocode: ReGeocode; + } + + class Geocoder { + constructor(opts?: { + city?: string, + radius?: number, + batch?: boolean, + extensions?: string + }); + + getLocation(address: string, callback?: (status?: string, result?: string | GeocodeResult) => void): void; + + setCity(city: string): void; + + getAddress(location: LngLat|LngLat[], callback: (status?: string, result?: string | ReGeocodeResult) => void): void; + } + + /** + * 坐标转换结果 + */ + interface ConvertorResult { + info: string; + locations: LngLat[]; + } + + /** + * 坐标转换 + */ + function convertFrom(lnglat: LngLat | LngLat[] | [number, number], type: string, result: (status: string, result: ConvertorResult) => void): void; + + interface Poi { + id: string; + name: string; + type: string; + location: LngLat; + address: string; + distance: number; + tel: string; + + website: string; + pcode: string; + citycode: string; + adcode: string; + postcode: string; + pname: string; + cityname: string; + adname: string; + email: string; + entr_location: LngLat; + exit_location: LngLat; + groupbuy: boolean; + discount: boolean; + } + + interface CitySearchResult { + city: string; + bounds: Bounds; + } + + class CitySearch extends EventBindable { + getLocalCity(callback: (status: string, result: string | CitySearchResult) => void): void; + getCityByIp(ip: string, callback: (status: string, result: string | CitySearchResult) => void): void; + } + + enum DrivingPolicy { + LEAST_TIME, + LEAST_FEE, + LEAST_DISTANCE, + REAL_TRAFFIC + } + + interface ViaCity { + name: string; + citycode: string; + adcode: string; + districts: District[]; + } + + interface District { + name: string; + adcode: string; + } + + interface TMC { + lcode: string; + distance: number; + status: string; + } + + interface DriveStep { + start_location: LngLat; + end_location: LngLat; + instruction: string; + action: string; + assist_action: string; + orientation: string; + road: string; + distance: number; + tolls: number; + tolls_distance: number; + toll_road: string; + time: number; + path: LngLat[]; + cities?: ViaCity[]; + tmcs?: TMC[]; + } + + interface DriveRoute { + distance: number; + time: number; + policy: string; + tolls: number; + tolls_distance: number; + steps: DriveStep[]; + } + + interface DrivingResult { + info: string; + origin: LngLat; + destination: LngLat|Poi; + start: Poi; + waypoints: Poi; + taxi_cost: number; + routes: DriveRoute[]; + } + + class Driving extends EventBindable { + constructor(options?: { + policy?: DrivingPolicy, + extensions?: string, + map?: Map, + panel?: string|HTMLElement, + hideMarkers?: boolean, + showTraffic?: boolean + }); + + search(origin: LngLat, destination: LngLat, opts?: { + waypoints: LngLat[] + }, callback?: (status: string, result: string|DrivingResult) => void): void; + + search(point: Array<{ + keyword: string, + city: string + }>, callback: (status: string, result: string|DrivingResult) => void): void; + + setPolicy(policy: DrivingPolicy): void; + setAvoidPolygons(path: LngLat[][]): void; + setAvoidRoad(road: string): void; + clearAvoidRoad(): void; + clearAvoidPolygons(): void; + getAvlidPolygons(): LngLat[][]; + getAvoidRoad(): string; + clear(): void; + searchOnAMAP(obj: { + origin?: LngLat, + originName?: string, + destination?: LngLat, + destinationName?: string + }): void; + } + + // 天气插件 + + interface WeatherLiveResult { + info: string; + province: string; + city: string; + adcode: string; + weather: string; + temperature: number; + windDirection: string; + windPower: number; + humidity: string; + reportTime: string; + } + + interface Forecast { + date: string; + week: string; + dayWeather: string; + nightWeather: string; + dayTemp: number; + nightTemp: number; + dayWindDir: string; + nightWindDir: string; + dayWindPower: string; + nightWindPower: string; + } + + interface WeatherForecastResult { + info: string; + province: string; + city: string; + adcode: string; + reportTime: string; + forecasts: Forecast[]; + } + + class Weather { + /** + * 查询实时天气信息 + * @param district 支持城市名称/区域编码(如:“杭州市”/“330100”) + * @param callback 当请求成功时ErrorStatus为null,当请求不成功时ErrorStatus为Obj + */ + getLive(district: string, callback: (errorStatus: any, result: WeatherLiveResult) => void): void; + + /** + * 查询四天预报天气,包括查询当天天气信息 + * @param district 支持城市名称/区域编码(如:“杭州市”/“330100”) + * @param callback 当请求成功时ErrorStatus为null,当请求不成功时ErrorStatus为Obj + */ + getForecast(district: string, callback: (errorStatus: any, result: WeatherForecastResult) => void): void; + } + + interface Tip { + name: string; + district: string; + adcode: string; + } + + interface AutocompleteResult { + info: string; + count: number; + tips: Tip[]; + } + + class Autocomplete { + constructor(opts: { + type?: string, + city?: string, + datatype?: string, + citylimit?: boolean, + input?: string + }); + + search(keyword: string, callback: (status: string, result: string | AutocompleteResult) => void): void; + } + + interface SelectChangeEvent { + type: string; + id: string; + marker: Marker; + listElement: HTMLLIElement; + data: Poi; + } + + interface PoiList { + pois: Poi[]; + pageIndex: number; + pageSize: number; + count: number; + } + + interface CityInfo { + name: string; + citycode: string; + adcode: string; + count: number; + } + + interface SearchResult { + info: string; + poiList: PoiList; + keywordList: string[]; + cityList: CityInfo[]; + } + + interface Photo { + title: string; + url: string; + } + + interface Content { + id: string; + name: string; + } + + interface Discount { + title: string; + detail: string; + start_time: string; + end_time: string; + sold_num: string; + photos: Photo[]; + url: string; + provider: string; + } + + interface Groupbuy { + title: string; + type_code: string; + type: string; + detail: string; + stime: string; + etime: string; + count: number; + sold_num: number; + original_price: number; + groupbuy_price: number; + discount: number; + ticket_address: string; + ticket_tel: string; + photos: Photo[]; + url: string; + provider: string; + } + + class PlaceSearch { + constructor(opts: { + city?: string, + citylimit?: boolean, + children?: number, + type?: string, + lang?: string, + pageSize?: number, + pageIndex?: number, + extensions?: string, + map?: Map, + panel?: string|HTMLElement, + showCover?: boolean, + renderStyle?: string, + autoFitView?: boolean + }); + + search(keyword: string, callback: (status: string, result: string | SearchResult) => void): void; + searchNearBy(keyword: string, center: LngLat, radius: number, callback: (status: string, result: string|SearchResult) => void): void; + searchInBounds(keyword: string, bounds: Bounds|Polygon, callback: (status: string, result: string|SearchResult) => void): void; + getDetails(POIID: string, callback: (status: string, result: string|SearchResult) => void): void; + setType(type: string): void; + setCityLimit(p: boolean): void; + setPageIndex(pageIndex: number): void; + setPageSize(setPageSize: number): void; + setCity(city: string): void; + setLang(lang: string): string; + getLang(): string; + clear(): void; + poiOnAMAP(obj: any): void; + detailOnAMAP(obj: any): void; + } + + interface DistrictSearchOptions { + level: string; + showbiz?: boolean; + extensions?: string; + subdistrict?: number; + } + + interface DistrictSearchResult { + info: string; + districtList: District[]; + } + + interface District { + name: string; + center: LngLat; + citycode: string; + adcode: string; + level: string; + boundaries: LngLat[]; + districtList: District[]; + } + + class DistrictSearch { + constructor(opts: DistrictSearchOptions); + + search(keywords: string, callback?: (status: string, result: string| DistrictSearchResult) => void, opts?: DistrictSearchOptions): void; + setLevel(level: string): void; + setSubdistrict(district: number): void; + } + } diff --git a/types/amap-js-sdk/tsconfig.json b/types/amap-js-sdk/tsconfig.json new file mode 100644 index 0000000000..ba4581a859 --- /dev/null +++ b/types/amap-js-sdk/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "amap-js-sdk-tests.ts" + ] +} diff --git a/types/amap-js-sdk/tslint.json b/types/amap-js-sdk/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/amap-js-sdk/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/amplitude-js/amplitude-js-tests.ts b/types/amplitude-js/amplitude-js-tests.ts index c5ffbe9898..0b6bb49751 100644 --- a/types/amplitude-js/amplitude-js-tests.ts +++ b/types/amplitude-js/amplitude-js-tests.ts @@ -1,5 +1,7 @@ // Tests for Amplitude SDK TypeScript definitions +import amplitude = require('amplitude-js'); + module Amplitude.Tests { function all() { diff --git a/types/amplitude-js/index.d.ts b/types/amplitude-js/index.d.ts index 1cdb843589..10465f6647 100644 --- a/types/amplitude-js/index.d.ts +++ b/types/amplitude-js/index.d.ts @@ -4,143 +4,142 @@ // Dan Manastireanu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module amplitude { +export as namespace amplitude; - type Callback = (responseCode: number, responseBody: string, details?: { reason: string; }) => void; - type LogReturn = number | void; +type Callback = (responseCode: number, responseBody: string, details?: { reason: string; }) => void; +type LogReturn = number | void; - interface Config { - apiEndpoint?: string; - batchEvents?: boolean; - cookieExpiration?: number; - cookieName?: string; - userId?: string; - deviceId?: string; - deviceIdFromUrlParam?: boolean; - domain?: string; - eventUploadPeriodMillis?: number; - eventUploadThreshold?: number; - forceHttps?: boolean; - includeGclid?: boolean; - includeReferrer?: boolean; - includeUtm?: boolean; - language?: string; - logLevel?: 'DISABLE' | 'ERROR' | 'WARN' | 'INFO'; - optOut?: boolean; - platform?: string; - saveEvents?: boolean; - savedMaxCount?: number; - saveParamsReferrerOncePerSession?: boolean; - sessionTimeout?: number; - trackingOptions?: { - city?: boolean; - country?: boolean; - device_model?: boolean; - dma?: boolean; - ip_address?: boolean; - language?: boolean; - os_name?: boolean; - os_version?: boolean; - platform?: boolean; - region?: boolean; - version_name?: boolean; - }, - unsentKey?: string; - unsentIdentifyKey?: string; - uploadBatchSize?: number; - } - - export class Identify { - set(key: string, value: any): Identify; - setOnce(key: string, value: any): Identify; - add(key: string, value: number | string): Identify; - append(key: string, value: any): Identify; - prepend(key: string, value: any): Identify; - - unset(key: string): Identify; - } - - export class Revenue { - - setProductId(productId: string): Revenue; - setQuantity(quantity: number): Revenue; - setPrice(price: number): Revenue; - setRevenueType(revenueType: string): Revenue; - setEventProperties(eventProperties: any): Revenue; - } - - export class AmplitudeClient { - - constructor(instanceName?: string); - - options: Config; - - init(apiKey: string, userId?: string, config?: Config, callback?: (client: AmplitudeClient) => void): void; - - setVersionName(versionName: string): void; - - isNewSession(): boolean; - setSessionId(sessionId: number): void; - getSessionId(): number; - - setDomain(domain: string): void; - setUserId(userId: string): void; - - setDeviceId(id: string): void; - regenerateDeviceId(): void; - - identify(identify_obj: Identify, opt_callback?: Callback): void; - - setUserProperties(properties: any): void; - setGlobalUserProperties(properties: any): void; - clearUserProperties(): void; - - setOptOut(enable: boolean): void; - - setGroup(groupType: string, groupName: string | string[]): void; - - logEvent(event: string, data?: any, callback?: Callback): LogReturn; - logEventWithGroups(event: string, data?: any, groups?: any, callback?: Callback): LogReturn; - logRevenueV2(revenue_obj: Revenue): LogReturn; - logRevenue(pric: number, quantity: number, product: string): LogReturn; - logEventWithTimestamp(event: string, data?: any, timestamp?: number, callback?: Callback): LogReturn; - } - - // Proxy methods that get executed on the default AmplitudeClient instance (not all client methods are proxied) - - export function init(apiKey: string, userId?: string, options?: Config, callback?: (client: AmplitudeClient) => void): void; - - export function setVersionName(version: string): void; - - export function isNewSession(): boolean; - export function getSessionId(): number; - - export function setDomain(domain: string): void; - - export function setUserId(userId: string): void; - - export function setDeviceId(id: string): void; - export function regenerateDeviceId(): void; - - export function identify(identify: Identify, callback?: Callback): void; - - export function setUserProperties(properties: any): void; - export function setGlobalUserProperties(properties: any): void; - export function clearUserProperties(): void; - - export function setOptOut(optOut: boolean): void; - - export function setGroup(groupType: string, groupName: string | string[]): void; - - export function logEvent(event: string, data?: any, callback?: Callback): LogReturn; - export function logEventWithGroups(event: string, data?: any, groups?: any, callback?: Callback): LogReturn; - export function logRevenueV2(revenue_obj: Revenue): LogReturn; - export function logRevenue(pric: number, quantity: number, product: string): LogReturn; - export function logEventWithTimestamp(event: string, data?: any, timestamp?: number, callback?: Callback): LogReturn; - - - - export function getInstance(instanceName?: string): AmplitudeClient; - export const __VERSION__: string; - export var options: Config; +interface Config { + apiEndpoint?: string; + batchEvents?: boolean; + cookieExpiration?: number; + cookieName?: string; + userId?: string; + deviceId?: string; + deviceIdFromUrlParam?: boolean; + domain?: string; + eventUploadPeriodMillis?: number; + eventUploadThreshold?: number; + forceHttps?: boolean; + includeGclid?: boolean; + includeReferrer?: boolean; + includeUtm?: boolean; + language?: string; + logLevel?: 'DISABLE' | 'ERROR' | 'WARN' | 'INFO'; + optOut?: boolean; + platform?: string; + saveEvents?: boolean; + savedMaxCount?: number; + saveParamsReferrerOncePerSession?: boolean; + sessionTimeout?: number; + trackingOptions?: { + city?: boolean; + country?: boolean; + device_model?: boolean; + dma?: boolean; + ip_address?: boolean; + language?: boolean; + os_name?: boolean; + os_version?: boolean; + platform?: boolean; + region?: boolean; + version_name?: boolean; + }, + unsentKey?: string; + unsentIdentifyKey?: string; + uploadBatchSize?: number; } + +export class Identify { + set(key: string, value: any): Identify; + setOnce(key: string, value: any): Identify; + add(key: string, value: number | string): Identify; + append(key: string, value: any): Identify; + prepend(key: string, value: any): Identify; + + unset(key: string): Identify; +} + +export class Revenue { + + setProductId(productId: string): Revenue; + setQuantity(quantity: number): Revenue; + setPrice(price: number): Revenue; + setRevenueType(revenueType: string): Revenue; + setEventProperties(eventProperties: any): Revenue; +} + +export class AmplitudeClient { + + constructor(instanceName?: string); + + options: Config; + + init(apiKey: string, userId?: string, config?: Config, callback?: (client: AmplitudeClient) => void): void; + + setVersionName(versionName: string): void; + + isNewSession(): boolean; + setSessionId(sessionId: number): void; + getSessionId(): number; + + setDomain(domain: string): void; + setUserId(userId: string): void; + + setDeviceId(id: string): void; + regenerateDeviceId(): void; + + identify(identify_obj: Identify, opt_callback?: Callback): void; + + setUserProperties(properties: any): void; + setGlobalUserProperties(properties: any): void; + clearUserProperties(): void; + + setOptOut(enable: boolean): void; + + setGroup(groupType: string, groupName: string | string[]): void; + + logEvent(event: string, data?: any, callback?: Callback): LogReturn; + logEventWithGroups(event: string, data?: any, groups?: any, callback?: Callback): LogReturn; + logRevenueV2(revenue_obj: Revenue): LogReturn; + logRevenue(pric: number, quantity: number, product: string): LogReturn; + logEventWithTimestamp(event: string, data?: any, timestamp?: number, callback?: Callback): LogReturn; +} + +// Proxy methods that get executed on the default AmplitudeClient instance (not all client methods are proxied) + +export function init(apiKey: string, userId?: string, options?: Config, callback?: (client: AmplitudeClient) => void): void; + +export function setVersionName(version: string): void; + +export function isNewSession(): boolean; +export function getSessionId(): number; + +export function setDomain(domain: string): void; + +export function setUserId(userId: string): void; + +export function setDeviceId(id: string): void; +export function regenerateDeviceId(): void; + +export function identify(identify: Identify, callback?: Callback): void; + +export function setUserProperties(properties: any): void; +export function setGlobalUserProperties(properties: any): void; +export function clearUserProperties(): void; + +export function setOptOut(optOut: boolean): void; + +export function setGroup(groupType: string, groupName: string | string[]): void; + +export function logEvent(event: string, data?: any, callback?: Callback): LogReturn; +export function logEventWithGroups(event: string, data?: any, groups?: any, callback?: Callback): LogReturn; +export function logRevenueV2(revenue_obj: Revenue): LogReturn; +export function logRevenue(pric: number, quantity: number, product: string): LogReturn; +export function logEventWithTimestamp(event: string, data?: any, timestamp?: number, callback?: Callback): LogReturn; + + + +export function getInstance(instanceName?: string): AmplitudeClient; +export const __VERSION__: string; +export var options: Config; diff --git a/types/analytics-node/analytics-node-tests.ts b/types/analytics-node/analytics-node-tests.ts index 6740aaccff..a7dc5336ec 100644 --- a/types/analytics-node/analytics-node-tests.ts +++ b/types/analytics-node/analytics-node-tests.ts @@ -1,10 +1,10 @@ import Analytics = require("analytics-node"); -var analytics: Analytics; +let analytics: Analytics; function testConfig(): void { analytics = new Analytics('YOUR_WRITE_KEY', { flushAt: 20, - flushAfter: 10000, + flushInterval: 10000, host: "http://example.com", enable: true }); @@ -33,7 +33,7 @@ function testIdentify(): void { if (err) { console.error(err); } else { - data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)) + data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)); } }); } @@ -59,7 +59,7 @@ function testTrack(): void { if (err) { console.error(err); } else { - data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)) + data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)); } }); } @@ -91,20 +91,20 @@ function testPage(): void { if (err) { console.error(err); } else { - data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)) + data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)); } }); } function testAlias(): void { // the anonymous user does actions ... - analytics.track({ userId: 'anonymous_user', event: 'Anonymous Event' }) + analytics.track({ userId: 'anonymous_user', event: 'Anonymous Event' }); // the anonymous user signs up and is aliased - analytics.alias({ previousId: 'anonymous_user', userId: 'identified@gmail.com' }) + analytics.alias({ previousId: 'anonymous_user', userId: 'identified@gmail.com' }); // the identified user is identified - analytics.identify({ userId: 'identified@gmail.com', traits: { plan: 'Free' } }) + analytics.identify({ userId: 'identified@gmail.com', traits: { plan: 'Free' } }); // the identified user does actions ... - analytics.track({ userId: 'identified@gmail.com', event: 'Identified Action' }) + analytics.track({ userId: 'identified@gmail.com', event: 'Identified Action' }); } function testGroup(): void { @@ -128,35 +128,41 @@ function testGroup(): void { if (err) { console.error(err); } else { - data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)) + data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)); } }); } function testIntegrations(): void { analytics.track({ - event: 'Upgraded Membershipt', + event: 'Upgraded Membership', userId: '97234974', integrations: { - 'All': false, - 'Vero': true, - 'Google Analytics': false + All: false, + Vero: true, + 'Google Analytics': false, + AppsFlyer: { + appsflyer_id: 'example-id' + } } }); analytics.track({ - event: 'Upgraded Membershipt', + event: 'Upgraded Membership', userId: '97234974', integrations: { - 'All': false, - 'Vero': true, - 'Google Analytics': false + All: false, + Vero: true, + 'Google Analytics': false, + AppsFlyer: { + appsflyer_id: 'example-id' + } } }, (err, data) => { if (err) { console.error(err); } else { - data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)) + data.batch.forEach((message) => console.log(`${data.sentAt} : ${message}`)); } }); } @@ -164,8 +170,10 @@ function testIntegrations(): void { function testFlush(): void { analytics.flush(); analytics.flush((err, batch) => { - if (err) { alert("Oh nos!"); } - else { console.log(batch.batch[0].type); } + if (err) { + alert("Oh nos!"); + } else { + console.log(batch.batch[0].type); + } }); } - diff --git a/types/analytics-node/index.d.ts b/types/analytics-node/index.d.ts index cc9e5386e2..168e0f17ea 100644 --- a/types/analytics-node/index.d.ts +++ b/types/analytics-node/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Segment's analytics.js for Node.js +// Type definitions for analytics-node 3.1 // Project: https://segment.com/docs/libraries/node/ // Definitions by: Andrew Fong // Thomas Thiebaud @@ -19,7 +19,7 @@ declare namespace AnalyticsNode { _metadata: { nodeVersion: string; [key: string]: any; - }, + }; timestamp?: Date; messageId?: string; anonymousId?: string | number; @@ -27,19 +27,21 @@ declare namespace AnalyticsNode { } interface Data { - batch: Message[], + batch: Message[]; timestamp: Date; sentAt: Date; } interface Integrations { - [index: string]: boolean; + [integration_name: string]: IntegrationValue; } - export class Analytics { + type IntegrationValue = boolean | { [integration_key: string]: any }; + + class Analytics { constructor(writeKey: string, opts?: { flushAt?: number, - flushAfter?: number, + flushInterval?: number, host?: string, enable?: boolean }); @@ -49,9 +51,9 @@ declare namespace AnalyticsNode { identify(message: { userId?: string | number; anonymousId?: string | number; - traits?: Object; + traits?: any; timestamp?: Date; - context?: Object; + context?: any; integrations?: Integrations; }, callback?: (err: Error, data: Data) => void): Analytics; @@ -60,9 +62,9 @@ declare namespace AnalyticsNode { userId?: string | number; anonymousId?: string | number; event: string; - properties?: Object; + properties?: any; timestamp?: Date; - context?: Object; + context?: any; integrations?: Integrations; }, callback?: (err: Error, data: Data) => void): Analytics; @@ -73,9 +75,9 @@ declare namespace AnalyticsNode { anonymousId?: string | number; category?: string; name?: string; - properties?: Object; + properties?: any; timestamp?: Date; - context?: Object; + context?: any; integrations?: Integrations; }, callback?: (err: Error, data: Data) => void): Analytics; @@ -93,8 +95,8 @@ declare namespace AnalyticsNode { userId?: string | number; anonymousId?: string | number; groupId: string | number; - traits?: Object; - context?: Object; + traits?: any; + context?: any; timestamp?: Date; integrations?: Integrations; }, callback?: (err: Error, data: Data) => void): Analytics; diff --git a/types/analytics-node/tslint.json b/types/analytics-node/tslint.json index a41bf5d19a..3db14f85ea 100644 --- a/types/analytics-node/tslint.json +++ b/types/analytics-node/tslint.json @@ -1,79 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} +{ "extends": "dtslint/dt.json" } diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index db74c97d10..19c6dcc9e5 100644 --- a/types/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -153,6 +153,10 @@ declare module 'angular' { defaultFontSet(name: string): IIconProvider; } + interface IInkRippleProvider { + disableInkRipple(): void; + } + type IMedia = (media: string) => boolean; interface ISidenavObject { @@ -340,6 +344,7 @@ declare module 'angular' { } interface IMenuService { + close(): void; hide(response?: any, options?: any): IPromise; open(event?: MouseEvent): void; } diff --git a/types/angular-resource/angular-resource-tests.ts b/types/angular-resource/angular-resource-tests.ts index c35f27a98d..f7b8db579c 100644 --- a/types/angular-resource/angular-resource-tests.ts +++ b/types/angular-resource/angular-resource-tests.ts @@ -90,6 +90,7 @@ angular.injector(['ng']).invoke(function ($cacheFactory: angular.ICacheFactorySe responseError() {} }; actionDescriptor.cancellable = true; + actionDescriptor.hasBody = true; }); /////////////////////////////////////// diff --git a/types/angular-resource/index.d.ts b/types/angular-resource/index.d.ts index 1ebd198b82..c298001533 100644 --- a/types/angular-resource/index.d.ts +++ b/types/angular-resource/index.d.ts @@ -88,6 +88,7 @@ declare module 'angular' { withCredentials?: boolean; responseType?: string; interceptor?: IResourceInterceptor; + hasBody?: boolean; } // Allow specify more resource methods diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index 44f8539af2..b83a41a6df 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -1502,16 +1502,28 @@ interface MyScope extends ng.IScope { foo: string; } -const directiveCompileFnWithGeneric: ng.IDirectiveCompileFn = ( - templateElement: JQLite, - templateAttributes: ng.IAttributes, - transclude: ng.ITranscludeFunction - ): ng.IDirectiveLinkFn => { - return ( - scope: MyScope, - instanceElement: JQLite, - instanceAttributes: ng.IAttributes - ) => { - return null; - }; -}; +interface MyElement extends JQLite { + foo: string; +} + +interface MyAttributes extends ng.IAttributes { + foo: string; +} +interface MyController extends ng.INgModelController { + foo: string; +} + +angular.module('WithGenerics', []) + .directive('directiveUsingGenerics', () => { + return { + restrict: 'E', + link(scope: MyScope, element: MyElement, templateAttributes: MyAttributes, controller: MyController) { + scope['name'] = 'Jeff'; + } + }; + }) + .directive('linkFunctionUsingGenerics', () => { + return (scope: MyScope, element: MyElement, templateAttributes: MyAttributes, controller: MyController) => { + scope['name'] = 'Jeff'; + }; + }); diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index fe90fa15b8..4a8b26fba9 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -240,8 +240,9 @@ declare namespace angular { * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind) * @param directiveFactory An injectable directive factory function. */ - directive(name: string, directiveFactory: Injectable>): IModule; - directive(object: {[directiveName: string]: Injectable>}): IModule; + directive(name: string, directiveFactory: Injectable>): IModule; + directive(object: {[directiveName: string]: Injectable>}): IModule; + /** * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider. * @@ -1346,8 +1347,8 @@ declare namespace angular { } interface ICompileProvider extends IServiceProvider { - directive(name: string, directiveFactory: Injectable>): ICompileProvider; - directive(object: {[directiveName: string]: Injectable>}): ICompileProvider; + directive(name: string, directiveFactory: Injectable>): ICompileProvider; + directive(object: {[directiveName: string]: Injectable>}): ICompileProvider; component(name: string, options: IComponentOptions): ICompileProvider; component(object: {[componentName: string]: IComponentOptions}): ICompileProvider; @@ -2066,29 +2067,31 @@ declare namespace angular { // and http://docs.angularjs.org/guide/directive /////////////////////////////////////////////////////////////////////////// - interface IDirectiveFactory { - (...args: any[]): IDirective | IDirectiveLinkFn; + type IDirectiveController = IController | IController[] | {[key: string]: IController}; + + interface IDirectiveFactory { + (...args: any[]): IDirective | IDirectiveLinkFn; } - interface IDirectiveLinkFn { + interface IDirectiveLinkFn { ( scope: TScope, - instanceElement: JQLite, - instanceAttributes: IAttributes, - controller?: IController | IController[] | {[key: string]: IController}, + instanceElement: TElement, + instanceAttributes: TAttributes, + controller?: TController, transclude?: ITranscludeFunction ): void; } - interface IDirectivePrePost { - pre?: IDirectiveLinkFn; - post?: IDirectiveLinkFn; + interface IDirectivePrePost { + pre?: IDirectiveLinkFn; + post?: IDirectiveLinkFn; } - interface IDirectiveCompileFn { + interface IDirectiveCompileFn { ( - templateElement: JQLite, - templateAttributes: IAttributes, + templateElement: TElement, + templateAttributes: TAttributes, /** * @deprecated * Note: The transclude function that is passed to the compile function is deprecated, @@ -2096,11 +2099,11 @@ declare namespace angular { * that is passed to the link function instead. */ transclude: ITranscludeFunction - ): void | IDirectiveLinkFn | IDirectivePrePost; + ): void | IDirectiveLinkFn | IDirectivePrePost; } - interface IDirective { - compile?: IDirectiveCompileFn; + interface IDirective { + compile?: IDirectiveCompileFn; controller?: string | Injectable; controllerAs?: string; /** @@ -2109,7 +2112,7 @@ declare namespace angular { * relies upon bindings inside a $onInit method on the controller, instead. */ bindToController?: boolean | {[boundProperty: string]: string}; - link?: IDirectiveLinkFn | IDirectivePrePost; + link?: IDirectiveLinkFn | IDirectivePrePost; multiElement?: boolean; priority?: number; /** @@ -2119,9 +2122,9 @@ declare namespace angular { require?: string | string[] | {[controller: string]: string}; restrict?: string; scope?: boolean | {[boundProperty: string]: string}; - template?: string | ((tElement: JQLite, tAttrs: IAttributes) => string); + template?: string | ((tElement: TElement, tAttrs: TAttributes) => string); templateNamespace?: string; - templateUrl?: string | ((tElement: JQLite, tAttrs: IAttributes) => string); + templateUrl?: string | ((tElement: TElement, tAttrs: TAttributes) => string); terminal?: boolean; transclude?: boolean | 'element' | {[slot: string]: string}; } diff --git a/types/angular/jqlite.d.ts b/types/angular/jqlite.d.ts index a9da89cf65..ac4f8ec10c 100644 --- a/types/angular/jqlite.d.ts +++ b/types/angular/jqlite.d.ts @@ -774,6 +774,7 @@ interface BaseJQueryEventObject extends Event { pageY: number; /** * For key or mouse events, this property indicates the specific key or button that was pressed. + * @deprecated Use `key` for KeyEvents or `button` for MouseEvents instead. * @see {@link https://api.jquery.com/event.which/} */ which: number; @@ -804,9 +805,12 @@ interface JQueryMouseEventObject extends JQueryInputEventObject { } interface JQueryKeyEventObject extends JQueryInputEventObject { - char: any; + /** @deprecated */ + char: string; + /** @deprecated */ charCode: number; - key: any; + key: string; + /** @deprecated */ keyCode: number; } diff --git a/types/ansi-colors/ansi-colors-tests.ts b/types/ansi-colors/ansi-colors-tests.ts index 9a9afc43f4..c267e879eb 100644 --- a/types/ansi-colors/ansi-colors-tests.ts +++ b/types/ansi-colors/ansi-colors-tests.ts @@ -1,30 +1,35 @@ -import * as colors from 'ansi-colors'; +import colors = require('ansi-colors'); -let s: string; +colors.red('This is a red string!'); // $ExpectType string +colors.green('This is a red string!'); // $ExpectType string +colors.cyan('This is a cyan string!'); // $ExpectType string +colors.yellow('This is a yellow string!'); // $ExpectType string -s = colors.bgblack("hello"); -s = colors.bgblue("hello"); -s = colors.bgcyan("hello"); -s = colors.bggreen("hello"); -s = colors.bgmagenta("hello"); -s = colors.bgred("hello"); -s = colors.bgwhite("hello"); -s = colors.bgyellow("hello"); -s = colors.black("hello"); -s = colors.blue("hello"); -s = colors.bold("hello"); -s = colors.cyan("hello"); -s = colors.dim("hello"); -s = colors.gray("hello"); -s = colors.green("hello"); -s = colors.grey("hello"); -s = colors.hidden("hello"); -s = colors.inverse("hello"); -s = colors.italic("hello"); -s = colors.magenta("hello"); -s = colors.red("hello"); -s = colors.reset("hello"); -s = colors.strikethrough("hello"); -s = colors.underline("hello"); -s = colors.white("hello"); -s = colors.yellow("hello"); +colors.bold.red('this is a bold red message'); // $ExpectType string +colors.bold.yellow.italic('this is a bold yellow italicized message'); // $ExpectType string +colors.green.bold.underline('this is a bold green underlined message'); // $ExpectType string + +colors.yellow(`foo ${colors.red.bold('red')} bar ${colors.cyan('cyan')} baz`); // $ExpectType string +colors.bold(`foo ${colors.red.dim('bar')} baz`); // $ExpectType string + +colors.enabled = false; +colors.visible = false; + +colors.hasAnsi(colors.blue('foo')); // $ExpectType boolean +colors.hasColor(colors.blue('foo')); // $ExpectType boolean + +colors.unstyle(colors.blue.bold('foo bar baz')); // $ExpectType string +colors.stripColor(colors.blue.bold('foo bar baz')); // $ExpectType string + +colors.none('foo'); // $ExpectType string +colors.clear('foo'); // $ExpectType string +colors.noop('foo'); // $ExpectType string + +colors.define('reset', [0, 0], 'modifier'); + +colors.symbols.ballotCross; // $ExpectType string | undefined +colors.symbols.windows.ballotCross; // $ExpectError +colors.symbols.other.ballotCross; // $ExpectType string +colors.symbols.cross; // $ExpectType string +colors.symbols.windows.cross; // $ExpectType string +colors.symbols.other.cross; // $ExpectType string diff --git a/types/ansi-colors/index.d.ts b/types/ansi-colors/index.d.ts index 092c4c1f2b..0cf9cd0d9f 100644 --- a/types/ansi-colors/index.d.ts +++ b/types/ansi-colors/index.d.ts @@ -1,31 +1,111 @@ -// Type definitions for ansi-colors 1.0 +// Type definitions for ansi-colors 3.2 // Project: https://github.com/doowb/ansi-colors // Definitions by: Rogier Schouten +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 -export function bgblack(s: string): string; -export function bgblue(s: string): string; -export function bgcyan(s: string): string; -export function bggreen(s: string): string; -export function bgmagenta(s: string): string; -export function bgred(s: string): string; -export function bgwhite(s: string): string; -export function bgyellow(s: string): string; -export function black(s: string): string; -export function blue(s: string): string; -export function bold(s: string): string; -export function cyan(s: string): string; -export function dim(s: string): string; -export function gray(s: string): string; -export function green(s: string): string; -export function grey(s: string): string; -export function hidden(s: string): string; -export function inverse(s: string): string; -export function italic(s: string): string; -export function magenta(s: string): string; -export function red(s: string): string; -export function reset(s: string): string; -export function strikethrough(s: string): string; -export function underline(s: string): string; -export function white(s: string): string; -export function yellow(s: string): string; +export = colors; + +declare const colors: colors.Colors; + +declare namespace colors { + type ColorFn = ((text: string) => string) & Colors; + + interface Colors { + enabled: boolean; + visible: boolean; + + reset: ColorFn; + bold: ColorFn; + dim: ColorFn; + italic: ColorFn; + underline: ColorFn; + inverse: ColorFn; + hidden: ColorFn; + strikethrough: ColorFn; + + black: ColorFn; + red: ColorFn; + green: ColorFn; + yellow: ColorFn; + blue: ColorFn; + magenta: ColorFn; + cyan: ColorFn; + white: ColorFn; + gray: ColorFn; + grey: ColorFn; + + bgBlack: ColorFn; + bgRed: ColorFn; + bgGreen: ColorFn; + bgYellow: ColorFn; + bgBlue: ColorFn; + bgMagenta: ColorFn; + bgCyan: ColorFn; + bgWhite: ColorFn; + + blackBright: ColorFn; + redBright: ColorFn; + greenBright: ColorFn; + yellowBright: ColorFn; + blueBright: ColorFn; + magentaBright: ColorFn; + cyanBright: ColorFn; + whiteBright: ColorFn; + + bgBlackBright: ColorFn; + bgRedBright: ColorFn; + bgGreenBright: ColorFn; + bgYellowBright: ColorFn; + bgBlueBright: ColorFn; + bgMagentaBright: ColorFn; + bgCyanBright: ColorFn; + bgWhiteBright: ColorFn; + + hasColor(text: string): boolean; + hasAnsi(text: string): boolean; + unstyle(text: string): string; + stripColor(text: string): string; + none(text: string): string; + clear(text: string): string; + noop(text: string): string; + + symbols: Symbols & { + windows: WindowsSymbols; + other: OtherPlatformsSymbols; + }; + + define( + name: string, + codes: [number, number], + type: 'modifier' | 'color' | 'bg' | 'bright' | 'bgBright' + ): void; + } + + interface WindowsSymbols { + bullet: string; + check: string; + cross: string; + ellipsis: string; + heart: string; + info: string; + line: string; + middot: string; + minus: string; + plus: string; + question: string; + questionSmall: string; + pointer: string; + pointerSmall: string; + warning: string; + } + + interface ExtendedSymbols { + ballotCross: string; + questionFull: string; + } + + type Symbols = WindowsSymbols & Partial; + type OtherPlatformsSymbols = WindowsSymbols & ExtendedSymbols; +} diff --git a/types/ansi-colors/tsconfig.json b/types/ansi-colors/tsconfig.json index ebd56021f9..8a0f980cbc 100644 --- a/types/ansi-colors/tsconfig.json +++ b/types/ansi-colors/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "ansi-colors-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/ansi-colors/v1/ansi-colors-tests.ts b/types/ansi-colors/v1/ansi-colors-tests.ts new file mode 100644 index 0000000000..9a9afc43f4 --- /dev/null +++ b/types/ansi-colors/v1/ansi-colors-tests.ts @@ -0,0 +1,30 @@ +import * as colors from 'ansi-colors'; + +let s: string; + +s = colors.bgblack("hello"); +s = colors.bgblue("hello"); +s = colors.bgcyan("hello"); +s = colors.bggreen("hello"); +s = colors.bgmagenta("hello"); +s = colors.bgred("hello"); +s = colors.bgwhite("hello"); +s = colors.bgyellow("hello"); +s = colors.black("hello"); +s = colors.blue("hello"); +s = colors.bold("hello"); +s = colors.cyan("hello"); +s = colors.dim("hello"); +s = colors.gray("hello"); +s = colors.green("hello"); +s = colors.grey("hello"); +s = colors.hidden("hello"); +s = colors.inverse("hello"); +s = colors.italic("hello"); +s = colors.magenta("hello"); +s = colors.red("hello"); +s = colors.reset("hello"); +s = colors.strikethrough("hello"); +s = colors.underline("hello"); +s = colors.white("hello"); +s = colors.yellow("hello"); diff --git a/types/ansi-colors/v1/index.d.ts b/types/ansi-colors/v1/index.d.ts new file mode 100644 index 0000000000..092c4c1f2b --- /dev/null +++ b/types/ansi-colors/v1/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for ansi-colors 1.0 +// Project: https://github.com/doowb/ansi-colors +// Definitions by: Rogier Schouten +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function bgblack(s: string): string; +export function bgblue(s: string): string; +export function bgcyan(s: string): string; +export function bggreen(s: string): string; +export function bgmagenta(s: string): string; +export function bgred(s: string): string; +export function bgwhite(s: string): string; +export function bgyellow(s: string): string; +export function black(s: string): string; +export function blue(s: string): string; +export function bold(s: string): string; +export function cyan(s: string): string; +export function dim(s: string): string; +export function gray(s: string): string; +export function green(s: string): string; +export function grey(s: string): string; +export function hidden(s: string): string; +export function inverse(s: string): string; +export function italic(s: string): string; +export function magenta(s: string): string; +export function red(s: string): string; +export function reset(s: string): string; +export function strikethrough(s: string): string; +export function underline(s: string): string; +export function white(s: string): string; +export function yellow(s: string): string; diff --git a/types/ansi-colors/v1/tsconfig.json b/types/ansi-colors/v1/tsconfig.json new file mode 100644 index 0000000000..8321162c90 --- /dev/null +++ b/types/ansi-colors/v1/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "ansi-colors": [ + "ansi-colors/v1" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ansi-colors-tests.ts" + ] +} diff --git a/types/ansi-colors/v1/tslint.json b/types/ansi-colors/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ansi-colors/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ansi-regex/ansi-regex-tests.ts b/types/ansi-regex/ansi-regex-tests.ts index a5787902f0..d4217e9608 100644 --- a/types/ansi-regex/ansi-regex-tests.ts +++ b/types/ansi-regex/ansi-regex-tests.ts @@ -9,5 +9,8 @@ ansiRegex().test('\u001B[4mcake\u001B[0m'); // $ExpectType boolean ansiRegex().test('cake'); // $ExpectType boolean // => false +ansiRegex({onlyFirst: true}).test('cake'); // $ExpectType boolean +// => false + '\u001B[4mcake\u001B[0m'.match(ansiRegex()); // $ExpectType RegExpMatchArray | null // => ['\u001B[4m', '\u001B[0m'] diff --git a/types/ansi-regex/index.d.ts b/types/ansi-regex/index.d.ts index 34890912dc..52979125f7 100644 --- a/types/ansi-regex/index.d.ts +++ b/types/ansi-regex/index.d.ts @@ -1,7 +1,16 @@ -// Type definitions for ansi-regex 3.0 +// Type definitions for ansi-regex 4.0 // Project: https://github.com/chalk/ansi-regex#readme // Definitions by: Manish Vachharajani +// Florian Keller // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare function r(): RegExp; -export = r; +declare namespace ansiRegex { + interface Options { + /** Match only the first ANSI escape. */ + onlyFirst?: boolean; + } +} + +declare function ansiRegex(options?: ansiRegex.Options): RegExp; + +export = ansiRegex; diff --git a/types/arcgis-js-api/index.d.ts b/types/arcgis-js-api/index.d.ts index 28e51384c9..4e43778473 100644 --- a/types/arcgis-js-api/index.d.ts +++ b/types/arcgis-js-api/index.d.ts @@ -1,48 +1,55 @@ -// Type definitions for ArcGIS API for JavaScript 4.9 +// Type definitions for ArcGIS API for JavaScript 4.10 // Project: http://js.arcgis.com // Definitions by: Esri // Bjorn Svensson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.7 - interface HashMap { [index: string]: T; } interface IPromiseLike { - then(onfulfilled?: ((value: T) => TResult1 | IPromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | IPromiseLike) | undefined | null): IPromiseLike; + then( + onfulfilled?: ((value: T) => TResult1 | IPromiseLike) | undefined | null, + onrejected?: ((reason: any) => TResult2 | IPromiseLike) | undefined | null + ): IPromiseLike; } interface IPromise { - always(callback?: ((valueOrError: T | any) => TResult1 | IPromiseLike) | undefined | null): IPromise; + always( + callback?: ((valueOrError: T | any) => TResult1 | IPromiseLike) | undefined | null + ): IPromise; cancel?(reason?: U, strict?: boolean): U; - catch(onrejected?: ((reason: any) => TResult | IPromiseLike) | undefined | null): IPromise; + catch( + onrejected?: ((reason: any) => TResult | IPromiseLike) | undefined | null + ): IPromise; isCanceled?(): boolean; isFulfilled(): boolean; isRejected(): boolean; isResolved(): boolean; - otherwise(onrejected?: ((reason: any) => TResult | IPromiseLike) | undefined | null): IPromise; - then(onfulfilled?: ((value: T) => TResult1 | IPromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | IPromiseLike) | undefined | null): IPromise; + otherwise( + onrejected?: ((reason: any) => TResult | IPromiseLike) | undefined | null + ): IPromise; + then( + onfulfilled?: ((value: T) => TResult1 | IPromiseLike) | undefined | null, + onrejected?: ((reason: any) => TResult2 | IPromiseLike) | undefined | null + ): IPromise; } interface IHandle { remove(): void; } - - declare namespace JSX { interface IntrinsicElements { [elementName: string]: any; } - interface Element { - } + interface Element {} } declare namespace __esri { - export class Accessor { constructor(obj?: any); @@ -70,8 +77,6 @@ declare namespace __esri { set?(props: HashMap): this; watch?(path: string | string[], callback: WatchCallback, sync?: boolean): WatchHandle; } - - export type ItemCallback = (item: T, index: number) => void; @@ -134,16 +139,15 @@ declare namespace __esri { static isCollection(value: any | Collection): value is Collection; - static ofType(type: Constructor | Types): new (items?: (T[] | Collection) | { items?: T[] | Collection }) => Collection; + static ofType( + type: Constructor | Types + ): new (items?: (T[] | Collection) | { items?: T[] | Collection }) => Collection; } type CollectionProperties = T[] | Collection; - - type DateProperties = number | string | Date; - export type BaseDynamicLayerLayerviewCreateEventHandler = (event: BaseDynamicLayerLayerviewCreateEvent) => void; export type BaseDynamicLayerLayerviewDestroyEventHandler = (event: BaseDynamicLayerLayerviewDestroyEvent) => void; @@ -160,6 +164,14 @@ declare namespace __esri { export type BingMapsLayerLayerviewDestroyEventHandler = (event: BingMapsLayerLayerviewDestroyEvent) => void; + export type BuildingSceneLayerLayerviewCreateEventHandler = (event: BuildingSceneLayerLayerviewCreateEvent) => void; + + export type BuildingSceneLayerLayerviewDestroyEventHandler = (event: BuildingSceneLayerLayerviewDestroyEvent) => void; + + export type CredentialDestroyEventHandler = (event: CredentialDestroyEvent) => void; + + export type CredentialTokenChangeEventHandler = (event: CredentialTokenChangeEvent) => void; + export type CSVLayerLayerviewCreateEventHandler = (event: CSVLayerLayerviewCreateEvent) => void; export type CSVLayerLayerviewDestroyEventHandler = (event: CSVLayerLayerviewDestroyEvent) => void; @@ -186,17 +198,15 @@ declare namespace __esri { export type GroupLayerLayerviewDestroyEventHandler = (event: GroupLayerLayerviewDestroyEvent) => void; - export type IdentityManagerCredentialCreateEventHandler = (event: IdentityManagerCredentialCreateEvent) => void; - - export type IdentityManagerCredentialsDestroyEventHandler = (event: IdentityManagerCredentialsDestroyEvent) => void; - export type ImageryLayerLayerviewCreateEventHandler = (event: ImageryLayerLayerviewCreateEvent) => void; export type ImageryLayerLayerviewDestroyEventHandler = (event: ImageryLayerLayerviewDestroyEvent) => void; export type IntegratedMeshLayerLayerviewCreateEventHandler = (event: IntegratedMeshLayerLayerviewCreateEvent) => void; - export type IntegratedMeshLayerLayerviewDestroyEventHandler = (event: IntegratedMeshLayerLayerviewDestroyEvent) => void; + export type IntegratedMeshLayerLayerviewDestroyEventHandler = ( + event: IntegratedMeshLayerLayerviewDestroyEvent + ) => void; export type KMLLayerLayerviewCreateEventHandler = (event: KMLLayerLayerviewCreateEvent) => void; @@ -249,63 +259,63 @@ declare namespace __esri { interface Basemap extends Accessor, Loadable, JSONSupport { /** * A collection of tile layers that make up the basemap's features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) */ baseLayers: Collection; /** * An identifier used to refer to the basemap when referencing it elsewhere. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#id) */ id: string; /** * Indicates whether the basemap instance has loaded. When `true`, all the properties of the object can be accessed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#loaded) - * + * * @default false */ readonly loaded: boolean; /** * The portal item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#portalItem) */ portalItem: PortalItem; /** * A collection of tiled reference layers for displaying labels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) */ referenceLayers: Collection; /** * The URL pointing to an image that represents the basemap. When using a custom basemap in the [BasemapToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html) widget, the image specified here will display in the widget. When the user clicks the image, the map's basemap will update to the basemap associated with the image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#thumbnailUrl) */ thumbnailUrl: string; /** * The title of the basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#title) */ title: string; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#clone) - * - * + * + * */ clone(): Basemap; /** * Loads all the externally loadable resources associated with the basemap. For the basemap this will load all the base layers and reference layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#loadAll) - * - * + * + * */ loadAll(): IPromise; } @@ -313,20 +323,19 @@ declare namespace __esri { interface BasemapConstructor { /** * Creates a new basemap object. Basemaps can be created from a [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html), from a well known [basemap ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#fromId), or can be used for creating custom basemaps. These basemaps may be created from tiled services you publish to your own server, or from tiled services published by third parties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) */ - new(properties?: BasemapProperties): Basemap; - + new (properties?: BasemapProperties): Basemap; /** * Creates a new basemap instance from a [well known basemap ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). See [Map.basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) for a list of possible values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#fromId) - * + * * @param id The basemap ID. - * + * */ fromId(id: string): Basemap; @@ -338,37 +347,37 @@ declare namespace __esri { interface BasemapProperties extends LoadableProperties { /** * A collection of tile layers that make up the basemap's features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) */ baseLayers?: CollectionProperties; /** * An identifier used to refer to the basemap when referencing it elsewhere. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#id) */ id?: string; /** * The portal item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#portalItem) */ portalItem?: PortalItemProperties; /** * A collection of tiled reference layers for displaying labels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) */ referenceLayers?: CollectionProperties; /** * The URL pointing to an image that represents the basemap. When using a custom basemap in the [BasemapToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html) widget, the image specified here will display in the widget. When the user clicks the image, the map's basemap will update to the basemap associated with the image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#thumbnailUrl) */ thumbnailUrl?: string; /** * The title of the basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#title) */ title?: string; @@ -377,42 +386,42 @@ declare namespace __esri { interface Camera extends Accessor, JSONSupport { /** * The field of view of the camera in degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#fov) - * + * * @default 55 */ fov: number; /** * The compass heading of the camera in degrees. Heading is zero when north is the top of the screen. It increases as the view rotates clockwise. The angles are always normalized between 0 and 360 degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) - * + * * @default 0 */ heading: number; /** - * The position of the camera defined by a map point. + * The position of the camera defined by a map point. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) */ position: Point; /** * The tilt of the camera in degrees with respect to the surface as projected down from the camera position. Tilt is zero when looking straight down at the surface and 90 degrees when the camera is looking parallel to the surface. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#tilt) - * + * * @default 0 */ tilt: number; /** * Creates a deep clone of the camera object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone) - * - * + * + * */ clone(): Camera; } @@ -420,11 +429,11 @@ declare namespace __esri { interface CameraConstructor { /** * The camera defines the [position](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position), [tilt](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#tilt), and [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) of the point from which the [SceneView's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) visible extent is observed. It is not associated with device hardware. This class only applies to 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html) */ - new(properties?: CameraProperties): Camera; + new (properties?: CameraProperties): Camera; fromJSON(json: any): Camera; } @@ -434,32 +443,32 @@ declare namespace __esri { interface CameraProperties { /** * The field of view of the camera in degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#fov) - * + * * @default 55 */ fov?: number; /** * The compass heading of the camera in degrees. Heading is zero when north is the top of the screen. It increases as the view rotates clockwise. The angles are always normalized between 0 and 360 degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) - * + * * @default 0 */ heading?: number; /** - * The position of the camera defined by a map point. + * The position of the camera defined by a map point. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) */ position?: PointProperties; /** * The tilt of the camera in degrees with respect to the surface as projected down from the camera position. Tilt is zero when looking straight down at the surface and 90 degrees when the camera is looking parallel to the surface. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#tilt) - * + * * @default 0 */ tilt?: number; @@ -468,158 +477,157 @@ declare namespace __esri { interface Color { /** * The alpha value. This value can be any number between `0` and `1` and represents the opacity of the Color. `0` indicates the color is fully transparent and `1` indicates it is fully opaque. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#a) */ a: number; /** * The blue value. This value can range between `0` and `255`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#b) */ b: number; /** * The green value. This value can range between `0` and `255`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#g) */ g: number; /** * The red value. This value can range between `0` and `255`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#r) */ r: number; /** * Creates a deep clone of the Color instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#clone) - * - * + * + * */ clone(): Color; /** * Takes a named string, hex string, array of rgb or rgba values, an object with r, g, b, and a properties, or another Color object and sets this color instance to the input value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#setColor) - * + * * @param color The new color value. This parameter can be a string representing a named color or a hex value; an array of three or four numbers representing r, g, b, a values; or an object with r, g, b, a properties. - * + * */ setColor(color: string | number[] | any): Color; /** * Returns a CSS color string in rgba form representing the Color instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toCss) - * + * * @param includeAlpha If `true`, the alpha value will be included in the result. - * + * */ toCss(includeAlpha?: boolean): string; /** * Returns a CSS color string in hexadecimal form that represents the Color instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toHex) - * - * + * + * */ toHex(): string; /** * Returns a JSON object with all the values from a Color instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toJSON) - * - * + * + * */ toJSON(): any; /** * Returns a 3-component array of rgb values that represent the Color instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toRgb) - * - * + * + * */ toRgb(): number[]; /** * Returns a 4-component array of rgba values that represent the Color instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#toRgba) - * - * + * + * */ toRgba(): number[]; } interface ColorConstructor { /** - * Creates a new color object by passing either a hex, rgba, or named color value. This class inherits all attributes from **dojo/_base/Color** to provide functions for setting colors. - * + * Creates a new color object by passing either a hex, rgba, or named color value. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) */ - /** * Creates a Color instance by blending two colors using a weight factor. Optionally accepts a Color object to update and return instead of creating a new object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#blendColors) - * + * * @param start The start color. * @param end The end color. * @param weight The weight value is a number from 0 to 1, with 0.5 being a 50/50 blend. - * @param obj A previously allocated Color object to reuse for the result. - * + * @param out A previously allocated Color object to reuse for the result. + * */ - blendColors(start: Color, end: Color, weight: number, obj?: Color): Color; + blendColors(start: Color, end: Color, weight: number, out?: Color): Color; - new(color: string | number[] | any): Color; + new (color: string | number[] | any): Color; /** * Creates a Color instance using a 3 or 4 element array, mapping each element in sequence to the rgb(a) values of the color. Optionally accepts a Color object to update with the color value and return instead of creating a new object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromArray) - * + * * @param a The input array. * @param obj A previously allocated Color object to reuse for the result. - * + * */ fromArray(a: number[], obj?: Color): Color; /** * Creates a Color instance from a hex string with a '#' prefix. Supports 12-bit #rgb shorthand. Optionally accepts a Color object to update with the parsed value and return instead of creating a new object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromHex) - * + * * @param color The input color in a hex string. * @param obj A previously allocated Color object to reuse for the result. - * + * */ fromHex(color: string, obj?: Color): Color; /** * Creates a new Color instance, and initializes it with values from a JSON object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromJSON) - * + * * @param json A JSON representation of the instance. - * + * */ fromJSON(json: any): Color; /** * Creates a Color instance from a string of the form "rgb()" or "rgba()". Optionally accepts a Color object to update with the parsed value and return instead of creating a new object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromRgb) - * + * * @param color The input color in a string of the form "rgb()" or "rgba()". - * @param obj A previously allocated Color object to reuse for the result. - * + * @param out A previously allocated Color object to reuse for the result. + * */ - fromRgb(color: string, obj?: Color): Color; + fromRgb(color: string, out?: Color): Color; /** * Creates a Color instance by parsing a generic string. Accepts hex, rgb, and rgba style color values. Optionally accepts a Color object to update with the parsed value and return instead of creating a new object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html#fromString) - * + * * @param str The input value. * @param obj A previously allocated Color object to reuse for the result. - * + * */ fromString(str: string, obj?: Color): Color; } @@ -628,59 +636,59 @@ declare namespace __esri { /** * Configure global properties of the library. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html) */ interface config { /** - * The URL for font resources used by the [Font](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#family) class in [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) labels. To use your own hosted fonts, you must follow the kebab-case naming convention (e.g. "arial-unicode-ms-bold"). - * + * The URL for font resources used by the [Font](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#family) class in [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) labels. To use your own hosted fonts, the font files need to be in `.pbf` format, and you must follow the kebab-case naming convention (e.g. "arial-unicode-ms-bold"). + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#fontsUrl) - * + * * @default "https://static.arcgis.com/fonts" */ fontsUrl: string; /** * The default [GeometryService](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html) used by widgets and other operations, such as on-the-fly projections. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#geometryServiceUrl) - * + * * @default "https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer" */ geometryServiceUrl: string; /** * The URL for the utility service used by [GeoRSSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html) to convert GeoRSS documents. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#geoRSSServiceUrl) - * + * * @default "https://utility.arcgis.com/sharing/rss" */ geoRSSServiceUrl: string; /** * The URL for the utility service used by [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html) to convert KML documents. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#kmlServiceUrl) - * + * * @default "https://utility.arcgis.com/sharing/kml" */ kmlServiceUrl: string; /** * The URL of the portal instance. If using an on-premise portal, this value should be set to the portal instance, for example: `https://www.example.com/arcgis` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) - * + * * @default "https://www.arcgis.com" */ portalUrl: string; /** * An object with properties that control various aspects of communication between the library and web servers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ request: configRequest; /** * The AMD loader's configuration object, which is loaded with each worker. Modify the configuration to specify locations of packages to be loaded with [the workers framework](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html) or to define a feature detection. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ workers: configWorkers; @@ -692,21 +700,20 @@ declare namespace __esri { export type BeforeInterceptorCallback = (params: any) => any; - export interface configRequest extends Object { /** * List of domain suffixes known to support https. This will automatically upgrade requests made to such domains to use https instead of http when the application is not running on http. Note that port numbers should not be included in the domain suffix to be matched. If no `httpsDomains` list exists , the API redirects all calls using https. If the list exists and a domain of a required http resource is not listed, the API sends the URL as it is specified within the code. Likewise, if the list exists and the domain of a required http resource is listed in it, the API sends an https request to that resource. The list includes the following domain suffixes by default: * * `arcgis.com` * * `arcgisonline.com` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ httpsDomains?: string[]; /** - * Allows developers to modify requests before or after they are sent. The first interceptor that matches the request URL will be used. Example: + * **Since:** 4.8 Allows developers to modify requests before or after they are sent. The first interceptor that matches the request URL will be used. Example: * ```js * const featureLayerUrl = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0"; - * + * * esriConfig.request.interceptors.push({ * // set the `urls` property to the URL of the FeatureLayer so that this * // interceptor only applies to requests made to the FeatureLayer URL @@ -729,125 +736,122 @@ declare namespace __esri { * } * }); * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ interceptors?: RequestInterceptor[]; /** * Maximum number of characters allowed in the URL for HTTP GET requests made by [request](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html). If this limit is exceeded, HTTP POST method will be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) - * + * * @default 2000 */ maxUrlLength?: number; /** * A proxy rule defines a proxy for a set of resources with an identical URL prefix. When using [esriRequest](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html), if a target URL matches a rule, then the request will be sent to the specified proxy. Rather than populating this array directly, use the urlUtils.addProxyRule() method. Rule objects have the following properties: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ proxyRules?: configRequestProxyRules[]; /** - * Resource proxy for your application. It is used by the library when communicating with a web server hosted on a domain that is different from the domain where your application is hosted. The library may or may not use the proxy depending on the type of request made, whether the server support CORS, whether the application is being run on older versions of browsers etc. To keep it simple, it is recommended that you always configure a resource proxy for your application. You can download the resource proxy from this [GitHub repo](https://github.com/Esri/resource-proxy). + * Resource proxy for your application. It is used by the library when communicating with a web server hosted on a domain that is different from the domain where your application is hosted. The library may or may not use the proxy depending on the type of request made, whether the server support CORS, whether the application is being run on older versions of browsers etc. To keep it simple, it is recommended that you always configure a resource proxy for your application. You can download the resource proxy from this [GitHub repo](https://github.com/Esri/resource-proxy). * ```js * require(["esri/config"], function(esriConfig) { * esriConfig.request.proxyUrl = "/resource-proxy/Java/proxy.jsp"; * }); * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ proxyUrl?: string; /** * Number of milliseconds [request](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html) will wait for response from a server. If a server fails to respond before this time expires, then the request is considered to have encountered an error. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) - * + * * @default 60000 */ timeout?: number; /** - * **Since:** 4.9 Indicates whether cross origin requests made to the associated server should include credentials such as cookies and authorization headers. + * **Since:** 4.9 Indicates whether cross origin requests made to the associated server should include credentials such as cookies and authorization headers. * ```js * require(["esri/config"], function(esriConfig) { * esriConfig.request.trustedServers.push("[//].[:]"); * }); * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ trustedServers?: string[]; /** * **Since:** 4.5 Indicates whether `esri/request` will request a credential from `IdentityManager`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) - * + * * @default true */ useIdentity?: boolean; } - export interface configRequestProxyRules extends Object { /** * The URL of the proxy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ proxyUrl?: string; /** * URL prefix for resources that need to be accessed through a specific proxy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request) */ urlPrefix?: string; } - export interface configWorkers extends Object { /** * The absolute url to the AMD loader used in the worker. The default url points to the AMD loader used by the API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ loaderUrl?: any; /** * The configuration parameters for [the workers framework](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ loaderConfig?: configWorkersLoaderConfig; } - export interface configWorkersLoaderConfig extends Object { /** * The AMD loader loads all code relative to the baseUrl. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ baseUrl?: string; /** * Determines if the specified feature capabilities are supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ has?: any; /** * Map of module id fragments to file paths. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ paths?: any; /** * Map paths in module identifiers to different paths. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ map?: any; /** * An array of objects which provide the package name and its location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#workers) */ packages?: any[]; @@ -855,112 +859,109 @@ declare namespace __esri { /** * Specifies the object used for intercepting and modifying requests made via [esriRequest](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ export interface RequestInterceptor extends Object { /** * Makes changes to the response after the request is sent, but before it's returned to the caller. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ after?: AfterInterceptorCallback; /** * Make changes to the request URL or options before the request is sent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ before?: BeforeInterceptorCallback; /** * Sets or adds headers into `requestOptions.headers`. See also: [requestOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ headers?: any; /** * Sets or adds query parameters into `requestOptions.query`. See also: [requestOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ query?: any; /** * Hardcodes the [response](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse). The request will not be sent. This is resolved as the response `data`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ responseData?: any; /** * Specifies the URL(s) to apply to the interceptors. If the value is type `String`, then it matches if the request URL starts with that string. If null or undefined, the interceptor will apply to all relevant requests. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#RequestInterceptor) */ urls?: string | RegExp | (string | RegExp)[]; } - - export type WatchCallback = (newValue: any, oldValue: any, propertyName: string, target: Accessor) => void; /** * Represents a watch created when an object invokes [watch()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#WatchHandle) */ export interface WatchHandle extends Object { /** * Removes the watch handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#WatchHandle) - * - * + * + * */ remove(): void; } - interface decorators { /** * A property decorator that creates a two-way binding between the property it decorates and an inner property of one of its members. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#aliasOf) - * + * * @param propertyName The aliased property name. - * + * */ aliasOf(propertyName: string): Function; /** * This method decorator is used to define the method that will cast a property from a class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#cast) - * + * * @param propertyName The property name the function will cast. - * + * */ cast(propertyName: string): Function; /** * This parameter decorator is used to define the function or class for a parameter of a method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#cast) - * + * * @param classFunction The function or class to cast the parameter - * + * */ cast(classFunction: Function): Function; /** * A function that can be used as a class. It extends [expression](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-6.html#extending-expressions) and is used in conjunction with the `@subclass` decorator to create a class compatible to [dojo.declare](https://dojotoolkit.org/reference-guide/1.10/dojo/declare.html). Please refer to the `subclass` documentation for further information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#declared) - * + * * @param baseClass The class to extend. * @param mixinClasses The mixin classes used to extend the base class. - * + * */ declared(baseClass: T, ...mixinClasses: any[]): T; /** * This convenience decorator is used to define an [Accessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html) property. Any property defined with this decorator can now be `get` and `set`. In addition, you can [watch for any property changes](https://developers.arcgis.com/javascript/latest/guide/working-with-props/index.html). Many times this decorator is used in conjunction with the [@renderable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#renderable) decorator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) - * + * * @param propertyMetadata An object describing the property. * @param propertyMetadata.dependsOn Property names of dependencies. * @param propertyMetadata.type The constructor used to [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html) the property. @@ -969,101 +970,87 @@ declare namespace __esri { * @param propertyMetadata.constructOnly Indicates whether the property can be set during construction but is otherwise read-only. * @param propertyMetadata.aliasOf The property decorator that creates a two-way binding between the property it decorates and an inner property of one of its members. * @param propertyMetadata.value The default value for the property. - * + * */ property(propertyMetadata?: decoratorsPropertyPropertyMetadata): Function; /** * A class decorator that must be used together with the `declared` function to create a class compatible to [dojo.declare](https://dojotoolkit.org/reference-guide/1.10/dojo/declare.html). It supports both single and multiple inheritance and can be considered the underlying functionality needed when creating 4.x classes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#subclass) - * + * * @param declaredClass The subclass name. - * + * */ subclass(declaredClass?: string): Function; } export const decorators: decorators; - export interface decoratorsPropertyPropertyMetadata extends Object { /** * Property names of dependencies. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) */ dependsOn?: string[]; /** * The constructor used to [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html) the property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) */ type?: Function; /** * The function to use to [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html) the property. Alternative to define the `type`. The function is called with the value set by the user and should return the cast value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) */ cast?: Function; /** * Indicates whether the property is read-only. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) - * + * * @default false */ readOnly?: boolean; /** * Indicates whether the property can be set during construction but is otherwise read-only. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) - * + * * @default false */ constructOnly?: boolean; /** * The property decorator that creates a two-way binding between the property it decorates and an inner property of one of its members. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) */ aliasOf?: string; /** * The default value for the property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html#property) */ value?: any; } - - - - - - - - - - - - - interface Error { /** * The details object provides additional details specific to the error, giving more information about why the error was raised. For example, the details object for esriRequest includes additional information to help the developer diagnose issues with a problematic request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html#details) */ details: any; /** * A message describing the details of the error. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html#message) */ message: string; /** * A unique error name. This can be used to map to a localized error message to present to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html#name) */ name: string; @@ -1074,39 +1061,37 @@ declare namespace __esri { interface Evented { /** * Emits an event on the instance. This method should only be used when creating subclasses of this class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Evented.html#emit) - * + * * @param type The name of the event. * @param event The event payload. - * + * */ - emit(type: string, event: any): void; + emit(type: string, event?: any): void; /** * Indicates whether there is an event listener on the instance that matches the provided event name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Evented.html#hasEventListener) - * + * * @param type The name of the event. - * + * */ hasEventListener(type: string): boolean; /** * Registers an event handler on the instance. Call this method to hook an event with a listener. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Evented.html#on) - * + * * @param type The name of event to listen for. * @param listener The function to call when the event is fired. - * + * */ on(type: string, listener: EventHandler): IHandle; } interface EventedConstructor { - - - new(): Evented; + new (): Evented; } export const Evented: EventedConstructor; @@ -1116,16 +1101,14 @@ declare namespace __esri { interface HandleOwner extends Accessor { /** * Handle registry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-HandleOwner.html#handles) */ handles: void; } interface HandleOwnerConstructor { - - - new(properties?: HandleOwnerProperties): HandleOwner; + new (properties?: HandleOwnerProperties): HandleOwner; } export const HandleOwner: HandleOwnerConstructor; @@ -1133,7 +1116,7 @@ declare namespace __esri { interface HandleOwnerProperties { /** * Handle registry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-HandleOwner.html#handles) */ handles?: void; @@ -1142,93 +1125,85 @@ declare namespace __esri { interface Handles extends Accessor { /** * Adds a group of handles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Handles.html#add) - * + * * @param handles An array or collection handles to group. * @param key group handle key - * + * */ add(handles: WatchHandle | WatchHandle[] | Collection, key?: any): void; /** * Returns true if a group exists for the provided key, false otherwise. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Handles.html#has) - * + * * @param key group handle key - * + * */ has(key: any): boolean; /** * Removes a group of handles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Handles.html#remove) - * + * * @param key A group key or an array or collection of group keys to remove. - * + * */ remove(key?: any): void; /** * Removes all handles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Handles.html#removeAll) - * - * + * + * */ removeAll(): void; } interface HandlesConstructor { - - - new(properties?: HandlesProperties): Handles; + new (properties?: HandlesProperties): Handles; } export const Handles: HandlesConstructor; - interface HandlesProperties { - - } + interface HandlesProperties {} interface JSONSupport { /** * Converts an instance of [this class]() to its [ArcGIS portal JSON](https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm) representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-JSONSupport.html#toJSON) - * - * + * + * */ toJSON(): any; } interface JSONSupportConstructor { - - - new(): JSONSupport; - + new (): JSONSupport; /** * Creates a new instance of [this class]() and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-JSONSupport.html#fromJSON) - * + * * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](https://developers.arcgis.com/documentation/common-data-types/overview-of-common-data-types.htm) for examples of the structure of various input JSON objects. - * + * */ fromJSON(json: any): any; } export const JSONSupport: JSONSupportConstructor; - interface lang { /** * Use this method to deeply clone objects with properties that are computed or have their own `clone()` method. For example, if you are creating an object that stores an initial extent and a spatial reference for your application, you can use `esriLang.clone(initialProps)` to clone this object so that the `extent` and `spatialReference` are properly cloned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-lang.html#clone) - * + * * @param elem The object to be cloned. - * + * */ clone(elem: any): any; } @@ -1238,181 +1213,183 @@ declare namespace __esri { interface Loadable { /** * The Error object returned if an error occurred while loading. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#loadError) - * + * * @default null */ readonly loadError: Error; /** - * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#load) operation. - * + * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#load) operation. + * * Value | Description * ------|------------ * not-loaded | The object's resources have not loaded. * loading | The object's resources are currently loading. * loaded | The object's resources have loaded without errors. * failed | The object's resources failed to load. See [loadError](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#loadError) for more details. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#loadStatus) - * + * * @default not-loaded */ readonly loadStatus: string; /** * A list of warnings which occurred while loading. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#loadWarnings) */ readonly loadWarnings: any[]; /** * Cancels a [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#load) operation if it is already in progress. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#cancelLoad) - * - * + * + * */ cancelLoad(): void; /** * `isFulfilled()` may be used to verify if creating an instance of the class is fulfilled (either resolved or rejected). If it is fulfilled, `true` will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#isFulfilled) - * - * + * + * */ isFulfilled(): boolean; /** * `isRejected()` may be used to verify if creating an instance of the class is rejected. If it is rejected, `true` will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#isRejected) - * - * + * + * */ isRejected(): boolean; /** * `isResolved()` may be used to verify if creating an instance of the class is resolved. If it is resolved, `true` will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#isResolved) - * - * + * + * */ isResolved(): boolean; /** * Loads the resources referenced by this class. This method automatically executes for a [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) and all of the resources it references in [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) if the view is constructed with a map instance. This method must be called by the developer when accessing a resource that will not be loaded in a [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#load) - * - * + * + * */ load(): IPromise; /** * `when()` may be leveraged once an instance of the class is created. This method takes two input parameters: a `callback` function and an `errback` function. The `callback` executes when the instance of the class loads. The `errback` executes if the instance of the class fails to load. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Loadable.html#when) - * + * * @param callback The function to call when the promise resolves. * @param errback The function to execute when the promise fails. - * + * */ when(callback?: Function, errback?: Function): IPromise; } interface LoadableConstructor { - - - new(): Loadable; + new (): Loadable; } export const Loadable: LoadableConstructor; - interface LoadableProperties { - - } + interface LoadableProperties {} interface corePromise { /** * `isFulfilled()` may be used to verify if creating an instance of the class is fulfilled (either resolved or rejected). If it is fulfilled, `true` will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#isFulfilled) - * - * + * + * */ isFulfilled(): boolean; /** * `isRejected()` may be used to verify if creating an instance of the class is rejected. If it is rejected, `true` will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#isRejected) - * - * + * + * */ isRejected(): boolean; /** * `isResolved()` may be used to verify if creating an instance of the class is resolved. If it is resolved, `true` will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#isResolved) - * - * + * + * */ isResolved(): boolean; /** * `when()` may be leveraged once an instance of the class is created. This method takes two input parameters: a `callback` function and an `errback` function. The `callback` executes when the instance of the class loads. The `errback` executes if the instance of the class fails to load. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Promise.html#when) - * + * * @param callback The function to call when the promise resolves. * @param errback The function to execute when the promise fails. - * + * */ when(callback?: Function, errback?: Function): IPromise; } interface corePromiseConstructor { - - - new(): corePromise; + new (): corePromise; } export const corePromise: corePromiseConstructor; - interface promiseUtils { + /** + * Convenience utility method for creating and resolving a promise. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#create) + * + * @param executor A function that will be called with two methods, `resolve` and `reject`. + * + */ + create(executor: Executor): IPromise; /** * Convenience utility method to wait for a number of promises to either resolve or reject. The resulting promise resolves to an array of result objects containing the promise and either a value if the promise resolved, or an error if the promise rejected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#eachAlways) - * + * * @param promises Array of promises, or object where each property is a promise. - * + * */ eachAlways(promises: IPromise[] | any): IPromise | any; /** * A convenience utility method for filtering an array of values using an asynchronous predicate function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#filter) - * + * * @param input The array of input values to filter. * @param predicate A predicate function returning a promise. Only array entries for which the returned promise contains `true` are kept. - * + * */ filter(input: T[], predicate: FilterPredicateCallback): IPromise; /** * Convenience utility method to create a promise that has been rejected with a provided error value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#reject) - * + * * @param error The error to reject the resulting promise with. - * + * */ reject(error?: any): IPromise; /** * Convenience utility method to create a promise that will be resolved with a provided value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#resolve) - * + * * @param value The value to resolve the resulting promise with. - * + * */ resolve(value?: T): IPromise; } @@ -1421,42 +1398,71 @@ declare namespace __esri { /** * The result object for a promise passed to [promiseUtils.eachAlways](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#eachAlways). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#EachAlwaysResult) */ export interface EachAlwaysResult extends Object { /** * The promise that has been fulfilled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#EachAlwaysResult) */ promise: IPromise; /** * The value with which the promise resolved. Defined only if the promise resolved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#EachAlwaysResult) */ value?: any; /** * The error with which the promise rejected. Defined only if the promise rejected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#EachAlwaysResult) */ error?: any; } + export type Executor = () => void; + export type FilterPredicateCallback = (value: any, index: number) => IPromise; + /** + * A function that will reject the promise created in [create()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#create). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#RejectCallback) + */ + export interface RejectCallback extends Object { + /** + * The error with which the promise rejected. Defined only if the promise is rejected. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#RejectCallback) + */ + error?: any; + } + + /** + * A function that will resolve the promise created in [create()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#create). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#ResolveCallback) + */ + export interface ResolveCallback extends Object { + /** + * The value with which the promise resolved. Defined only if the promise is fulfilled. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#ResolveCallback) + */ + value?: any | IPromise; + } interface requireUtils { /** - * Dynamically requires one or more modules and returns a promise that resolves when all the specified modules have loaded. - * + * **Deprecated in favor of [promiseUtils.create()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-promiseUtils.html#create).** Dynamically requires one or more modules and returns a promise that resolves when all the specified modules have loaded. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-requireUtils.html#when) - * + * * @param moduleRequire The `require` function used to load the modules. This is the AMD alias (e.g. the `moduleRequire` reference in the snippets below) used to reference the `require` module. * @param moduleNames The names of the modules to load. - * + * */ when(moduleRequire: any, moduleNames: string[] | string): IPromise; } @@ -1465,26 +1471,26 @@ declare namespace __esri { /** * Various utilities and convenience functions for executing code at various phases of browser frames. The scheduling module allows you to register tasks that are executed in every animation frame. This can be used to synchronize updates with ongoing animations of the view, or to animate the view manually by adjusting the extent or camera in every frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html) */ interface scheduling { /** * Registers a frame task. An animation frame is composed of different phases to let various actors execute code before, after, or during the rendering of [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#addFrameTask) - * + * * @param phases The callbacks for each phase of the frame. - * + * */ addFrameTask(phases: PhaseCallbacks): FrameTaskHandle; /** * Schedules the execution of a `callback` function at the next web browser tick. Unlike [addFrameTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#addFrameTask), a scheduled `callback` will only run once. Scheduling a task for the next execution tick can be useful when you want to throttle/accumulate functionality over a single javascript execution context. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#schedule) - * + * * @param callback The function to call at the next tick. - * + * */ schedule(callback: Function): any; } @@ -1493,32 +1499,32 @@ declare namespace __esri { /** * An object to remove or pause a frame task registered with [addFrameTask()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#addFrameTask). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#FrameTaskHandle) */ export interface FrameTaskHandle extends Object { /** * Pause the execution the frame task at every frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#FrameTaskHandle) - * - * + * + * */ pause(): void; /** * Resumes the execution the frame task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#FrameTaskHandle) - * - * + * + * */ resume(): void; /** * Removes the frame task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#FrameTaskHandle) - * - * + * + * */ remove(): void; } @@ -1527,25 +1533,25 @@ declare namespace __esri { /** * A set of [callbacks](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseCallback) that will be called at specific phases of the animation frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseCallbacks) */ export interface PhaseCallbacks extends Object { /** * A callback called before rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseCallbacks) */ prepare?: PhaseCallback; /** * A callback to execute rendering logic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseCallbacks) */ render?: PhaseCallback; /** * A callback to execute state update logic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseCallbacks) */ update?: PhaseCallback; @@ -1553,271 +1559,275 @@ declare namespace __esri { /** * An object with timing information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseEvent) */ export interface PhaseEvent extends Object { /** * The absolute time at the start of the current animation frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseEvent) */ time: number; /** * The elapsed time since the last animation frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseEvent) */ deltaTime: number; /** * The amount of time spent within the current animation frame. This can be used for budgeting (e.g. some tasks may already have run). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-scheduling.html#PhaseEvent) */ elapsedFrameTime: number; } - interface urlUtils { /** * Adds the given proxy rule to the proxy rules list: `esriConfig.request.proxyRules`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#addProxyRule) - * + * * @param rule An object specifying a URL that should use the proxy. See the object specification table below for the required properties of this object. * @param rule.proxyUrl The URL of the proxy. * @param rule.urlPrefix The URL prefix of the resources that should be accessed through the given proxy. - * + * */ addProxyRule(rule: urlUtilsAddProxyRuleRule): number; /** * Returns the proxy rule that matches the given URL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#getProxyRule) - * + * * @param url The URL of the resources accessed via proxy. - * + * */ getProxyRule(url: string): any; /** * Converts the URL arguments to an object representation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#urlToObject) - * + * * @param url The input URL. - * + * */ urlToObject(url: string): any; } export const urlUtils: urlUtils; - export interface urlUtilsAddProxyRuleRule extends Object { /** * The URL of the proxy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#addProxyRule) */ proxyUrl: string; /** * The URL prefix of the resources that should be accessed through the given proxy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#addProxyRule) */ urlPrefix: string; } - interface watchUtils { /** * Watches a property for changes and calls the callback with the initial value of the property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#init) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call with the initial value of the property when the property changes. - * + * */ init(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for changes and automatically attaches and detaches an event handler for a given event to the property value as needed. The attachedHandler and detachedHandler are optional and if provided will be called whenever the event handler is attached and detached respectively. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#on) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param eventName The name of the event to attach the event handler for. * @param eventHandler The event handler callback function. * @param attachedHandler Callback called each time the event handler is attached. * @param detachedHandler Callback called each time the event handler is detached. - * + * */ - on(obj: Accessor, propertyName: string | string[], eventName: string, eventHandler: Function, attachedHandler?: EventAttachedCallback, detachedHandler?: EventAttachedCallback): WatchHandle; + on( + obj: Accessor, + propertyName: string | string[], + eventName: string, + eventHandler: Function, + attachedHandler?: EventAttachedCallback, + detachedHandler?: EventAttachedCallback + ): WatchHandle; /** * Watches a property for changes once. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming truthy. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#once) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ once(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; /** * Watches a property for changes. The returned handle can be paused (and resumed) to temporarily prevent the callback from being called on property changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#pausable) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ pausable(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PausableWatchHandle; /** * Watches a property for changes. This is an alias for [Accessor.watch()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch), provided for completeness. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#watch) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ watch(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for becoming truthy. As with module:esri/core/watchUtils#init, the callback is called initially if the property is initially truthy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#when) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ when(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for becoming `defined`. As with init(), the callback is called if the property is initially defined. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenDefined) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenDefined(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for becoming `defined` once. As with init(), the callback is called if the property is initially `defined`. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming defined. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenDefinedOnce) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenDefinedOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; /** * Watches a property for becoming `false`. As with init(), the callback is called if the property is initially `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenFalse) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenFalse(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for becoming `false` once. As with init(), the callback is called if the property is initially `false`. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming false. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenFalseOnce) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenFalseOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; /** * Watches a property for becoming falsy. As with module:esri/core/watchUtils#init, the callback is called initially if the property is initially falsy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenNot) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenNot(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for becoming falsy once. As with init(), the callback is called if the property is initially falsy. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming falsy. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenNotOnce) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenNotOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; /** * Watches a property for becoming truthy once. As with init(), the callback is called if the property is initially truthy. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming truthy. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenOnce) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; /** * Watches a property for becoming `true`. As with init(), the callback is called if the property is initially `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenTrue) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenTrue(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for becoming `true` once. As with init(), the callback is called if the property is initially `true`. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming true. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenTrueOnce) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenTrueOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; /** * Watches a property for becoming `undefined`. As with init(), the callback is called if the property is initially `undefined`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenUndefined) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenUndefined(obj: Accessor, propertyName: string | string[], callback: WatchCallback): WatchHandle; /** * Watches a property for becoming `undefined` once. As with init(), the callback is called if the property is initially `undefined`. The returned watch handle is removed after the first time the callback has been invoked. The returned handle additionally implements the Promise interface and can be used to create a promise chain to asynchronously handle a property value becoming undefined. The promise result is an object containing a `value`, `oldValue`, `propertyName` and `target`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#whenUndefinedOnce) - * + * * @param obj The object containing the property to watch. * @param propertyName The name of the property to watch. * @param callback The function to call when the property changes. - * + * */ whenUndefinedOnce(obj: Accessor, propertyName: string | string[], callback?: WatchCallback): PromisedWatchHandle; } @@ -1828,64 +1838,63 @@ declare namespace __esri { /** * Represents a watch created when an object invokes [watch()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#PausableWatchHandle) */ export interface PausableWatchHandle extends Object { /** * Removes the watch handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#PausableWatchHandle) - * - * + * + * */ remove(): void; /** * Pauses the handle preventing changes to invoke the associated callback. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#PausableWatchHandle) - * - * + * + * */ pause(): void; /** * Resumes a paused the handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-watchUtils.html#PausableWatchHandle) - * - * + * + * */ resume(): void; } export interface PromisedWatchHandle extends IPromise { - remove(): void; } /** * This module is a utility framework that simplifies the use of [Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) in the ArcGIS API for JavaScript. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html) */ interface workers { /** * Opens a connection to workers and loads a script with the workers framework. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html#open) - * + * * @param modulePath A fully qualified URL to a script to execute with the workers framework. * @param options Worker options. See properties below for object specifications. * @param options.client The objects defining the API accessible from the module. - * @param options.strategy - * Indicates how to load the module. See the table below for a list of possible values. - * + * @param options.strategy + * Indicates how to load the module. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * distributed | The module is loaded in each available worker. Each call to [Connection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) will be targeting an available worker. Use this strategy if the module doesn't maintain information between invocations (stateless). * dedicated | The module is loaded in one worker. Each call to [Connection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) will be targeting a same worker. Use this strategy if the module maintains information from previous invocations or communication between main and worker threads needs to be stateful. * local | The module is loaded in the main thread. Use this strategy if when using the worker framework API while disabling the use of workers. - * + * */ open(modulePath: string, options?: workersOpenOptions): IPromise; } @@ -1895,68 +1904,94 @@ declare namespace __esri { interface Connection { /** * A convenient method that invokes a method on each worker. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#broadcast) - * + * * @param methodName The name of the remote method to invoke on all workers. * @param data The unique parameter passed as argument of the remote method. - * + * @param options An object specifying additional options. See the object specification table below for the required properties of this object. + * @param options.signal A signal to abort the executions of the remote method. + * */ - broadcast(methodName: string, data?: any): IPromise[]; + broadcast(methodName: string, data?: any, options?: ConnectionBroadcastOptions): IPromise[]; /** * Closes the existing connection instance to workers. Notifies all workers to destroy the connection instance and dispose the remote module. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#close) - * - * + * + * */ close(): void; /** * Invokes a [method](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#basic-invocation) on the remote module loaded with the worker. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) - * + * * @param methodName The name of the method to be invoked in the script. * @param data The unique parameter passed as argument of the remote method. See [Passing multiple parameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#multiple-parameters) section to pass more than one parameter to the remote method. - * @param transferList An array of [Transferable](https://developer.mozilla.org/en-US/docs/Web/API/Transferable) objects. Each transferable object in the array should have a corresponding entry in the data object. See [Using transferables](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#using-transferables) section for more information. - * + * @param options An object specifying additional options. See the object specification table below for the required properties of this object. + * @param options.transferList An array of [Transferable](https://developer.mozilla.org/en-US/docs/Web/API/Transferable) objects. Each transferable object in the array should have a corresponding entry in the data object. See [Using transferables](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#using-transferables) section for more information. + * @param options.signal A signal to abort the execution of the remote method. + * */ - invoke(methodName: string, data?: any, transferList?: any[]): IPromise; + invoke(methodName: string, data?: any, options?: ConnectionInvokeOptions): IPromise; } interface ConnectionConstructor { /** * This class is used to execute remote methods located on the module loaded into a separate thread via the [workers framework](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html) */ - - new(): Connection; + new (): Connection; } export const Connection: ConnectionConstructor; + export interface ConnectionBroadcastOptions extends Object { + /** + * A signal to abort the executions of the remote method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#broadcast) + */ + signal?: AbortSignal; + } + + export interface ConnectionInvokeOptions extends Object { + /** + * An array of [Transferable](https://developer.mozilla.org/en-US/docs/Web/API/Transferable) objects. Each transferable object in the array should have a corresponding entry in the data object. See [Using transferables](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#using-transferables) section for more information. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) + */ + transferList?: any[]; + /** + * A signal to abort the execution of the remote method. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) + */ + signal?: AbortSignal; + } export interface workersOpenOptions extends Object { /** * The objects defining the API accessible from the module. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html#open) */ client?: any; /** - * Indicates how to load the module. See the table below for a list of possible values. - * + * Indicates how to load the module. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * distributed | The module is loaded in each available worker. Each call to [Connection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) will be targeting an available worker. Use this strategy if the module doesn't maintain information between invocations (stateless). * dedicated | The module is loaded in one worker. Each call to [Connection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers-Connection.html#invoke) will be targeting a same worker. Use this strategy if the module maintains information from previous invocations or communication between main and worker threads needs to be stateful. * local | The module is loaded in the main thread. Use this strategy if when using the worker framework API while disabling the use of workers. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-workers.html#open) - * + * * @default distributed */ strategy?: any; @@ -1964,68 +1999,124 @@ declare namespace __esri { /** * A convenience module for importing [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing geometries one at a time like this: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html) */ - interface geometry { - } + namespace geometry { + /** + * Geometry types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Geometry) + */ + export type Geometry = + | __esri.Extent + | __esri.Multipoint + | __esri.Point + | __esri.Polygon + | __esri.Polyline + | __esri.Mesh; - export const geometry: geometry; + /** + * Extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Extent) + */ + export type Extent = __esri.Extent; + export const Extent: typeof __esri.Extent; + + /** + * Multipoint. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Multipoint) + */ + export type Multipoint = __esri.Multipoint; + export const Multipoint: typeof __esri.Multipoint; + + /** + * Point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Point) + */ + export type Point = __esri.Point; + export const Point: typeof __esri.Point; + + /** + * Polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Polygon) + */ + export type Polygon = __esri.Polygon; + export const Polygon: typeof __esri.Polygon; + + /** + * Polyline. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Polyline) + */ + export type Polyline = __esri.Polyline; + export const Polyline: typeof __esri.Polyline; + + /** + * Mesh. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Mesh) + */ + export type Mesh = __esri.Mesh; + export const Mesh: typeof __esri.Mesh; + } interface Circle extends Polygon { /** * The center point of the circle. The center must be specified either as a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or an array of longitude/latitude coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#center) */ center: Point; /** * Applicable when the spatial reference of the center point is either set to Web Mercator (wkid: 3857) or geographic/geodesic (wkid: 4326). When either of those spatial references is used, set geodesic to `true` to minimize distortion. Other coordinate systems will not create geodesic circles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#geodesic) - * + * * @default false */ geodesic: boolean; /** * This value defines the number of points along the curve of the circle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#numberOfPoints) - * + * * @default 60 */ numberOfPoints: number; /** * The radius of the circle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#radius) - * + * * @default 1000 */ radius: number; /** * Unit of the radius. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#radiusUnit) - * + * * @default meters */ radiusUnit: string; /** * Creates a deep clone of Circle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#clone) - * - * + * + * */ clone(): Circle; } interface CircleConstructor { - - - new(properties?: CircleProperties): Circle; + new (properties?: CircleProperties): Circle; fromJSON(json: any): Circle; } @@ -2035,39 +2126,39 @@ declare namespace __esri { interface CircleProperties extends PolygonProperties { /** * The center point of the circle. The center must be specified either as a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or an array of longitude/latitude coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#center) */ center?: PointProperties; /** * Applicable when the spatial reference of the center point is either set to Web Mercator (wkid: 3857) or geographic/geodesic (wkid: 4326). When either of those spatial references is used, set geodesic to `true` to minimize distortion. Other coordinate systems will not create geodesic circles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#geodesic) - * + * * @default false */ geodesic?: boolean; /** * This value defines the number of points along the curve of the circle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#numberOfPoints) - * + * * @default 60 */ numberOfPoints?: number; /** * The radius of the circle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#radius) - * + * * @default 1000 */ radius?: number; /** * Unit of the radius. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Circle.html#radiusUnit) - * + * * @default meters */ radiusUnit?: string; @@ -2079,13 +2170,13 @@ declare namespace __esri { * * degrees, minutes, and seconds * * U.S. National Grid (USNG) * * Military Grid Reference System (MGRS). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html) */ interface coordinateFormatter { /** * Parses coordinates in latitude/longitude notation, and returns a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) representing that location. The coordinates may use decimal degrees, degrees and decimal minutes, or degrees, minutes, and seconds format. The spatial reference provided must have an ellipsoid and datum matching those used by the source of the latitude/longitude string. If no spatial reference is provided, it is assumed the latitude/longitude coordinates are in WGS84. **Supported characters** - * + * * | Symbol | Character | Name | Unicode number | HTML code | * | --- | --- | --- | --- | --- | * | Degree | * | Asterisk | U+002A | &#42; | @@ -2095,43 +2186,43 @@ declare namespace __esri { * | Minute | ' | Apostrophe | U+0027 | &#39; | * | | ′ | Prime | U+2032 | &#8242; | * | Second | " | Quotation Mark | U+0022 | &#34; | - * + * * The latitude/longitude string may contain leading and trailing whitespace, and may also contain a space, comma, or vertical bar symbol to separate the latitude from the longitude. It may also contain the characters 'N', 'S', 'E' and 'W', or use a minus (-) symbol to indicate the hemisphere of each value. Latitude/longitude notation examples: * * 55 56 39.123N 003 09 43.034W * * 55°56′39″N 3°09′43″W * * 55~56.65205', -003~09.71723' * * 55.9442008* | -3.1619539* - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#fromLatitudeLongitude) - * + * * @param coordinates The latitude/longitude notation string for the coordinates. * @param spatialReference A spatial reference object representing a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm). If `null`, WGS84 will be used. - * + * */ fromLatitudeLongitude(coordinates: string, spatialReference?: SpatialReference): Point; /** * Parses coordinates in Military Grid Reference System (MGRS) notation, and returns a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) representing that location. The spatial reference provided must have an ellipsoid and datum matching those used by the source of the MGRS string. If no spatial reference is provided, it is assumed the MGRS string is referenced to WGS84. Note that the choice between zone 01 and 60 has no impact when reading from an MGRS notation string. The MGRS string can contain leading and trailing whitespace and can have whitespace between the grid zone designator, the 100km square identifier, and the numerical eastings and northings. MGRS notation examples: * * 30UVG898998 * * 30UVG 89885 99877 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#fromMgrs) - * + * * @param coordinates The MGRS notation string for the coordinates. * @param spatialReference A spatial reference object representing a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) referenced by the MGRS coordinates. If `null`, WGS84 will be used. * @param conversionMode The mode used by the given MGRS coordinates. **Possible Values**: automatic | new-180-in-zone-01 | new-180-in-zone-60 | old-180-in-zone-01 | old-180-in-zone-60 - * + * */ fromMgrs(coordinates: string, spatialReference: SpatialReference, conversionMode: string): Point; /** * Parses coordinates in United States National Grid (USNG) notation, and returns a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) representing that location. The spatial reference provided must have an ellipsoid and datum matching those used by the source of the USNG string. If no spatial reference is provided and the USNG string is suffixed with "(NAD 27)", it is assumed the USNG string is referenced to NAD 27. If no spatial reference is provided and no such suffix exists, it is assumed the USNG string is referenced to WGS84. USNG notation examples: * * 13TFJ 23 59 * * 13TFJ2374159574 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#fromUsng) - * + * * @param coordinates The USNG notation string for the coordinates. * @param spatialReference A spatial reference object representing a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) that the USNG coordinates are in. If `null`, WGS84 will be used. - * + * */ fromUsng(coordinates: string, spatialReference?: SpatialReference): Point; /** @@ -2139,42 +2230,42 @@ declare namespace __esri { * * 30U 489885 6199877 * * 30U4898856199877 * * 30N 489885 6199877 (using N/S indicator) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#fromUtm) - * + * * @param coordinates The UTM notation string for the coordinates. * @param spatialReference A spatial reference object representing a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) that the UTM coordinates are in. If `null`, WGS84 will be used. * @param conversionMode The latitude notation scheme used by the given UTM coordinates, either a latitudinal band, or a hemisphere designator. **Possible Values**: latitude-band-indicators | north-south-indicators - * + * */ fromUtm(coordinates: string, spatialReference: SpatialReference, conversionMode: string): Point; /** * Indicates if all dependencies of this module have been loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#isLoaded) - * - * + * + * */ isLoaded(): boolean; /** * Indicates if this module is supported in the current browser. The browser must support [WebAssembly](https://caniuse.com/#feat=wasm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#isSupported) - * - * + * + * */ isSupported(): boolean; /** * Load this module's dependencies. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#load) - * - * + * + * */ load(): IPromise; /** * Returns formatted coordinates in latitude/longitude notation representing the given point's location. The latitude/longitude string will contain a space separating the latitude from the longitude value, and the characters 'N' or 'S', and 'E' and 'W', to indicate the hemisphere of each value. The string will also contain spaces separating the components (degrees, minutes, seconds) of each value. The precision of the output is controlled by both the `format` and `decimalPlaces` parameters. For example: - * + * * | Decimal places | format | Example output | Angular precision | Approximate precision | * | --- | --- | --- | --- | --- | * | 0 | dd | 056N 0003W | 1deg | 100km | @@ -2189,19 +2280,19 @@ declare namespace __esri { * | 1 | dms | 55 56 39.1N 003 09 43.0W | 0.1sec| 3m | * | 2 | dms | 55 56 39.12N 003 09 43.03W | 0.01sec | 300mm | * | 3 | dms | 55 56 39.123N 003 09 43.034W | 0.001sec | 30mm | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#toLatitudeLongitude) - * + * * @param point The location to be represented as a formatted latitude/longitude string. The point's [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#spatialReference) should either be WGS84 or another [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm). * @param format The mode to use when formatting the latitude/longitude string. **Possible Values**: dd | ddm | dms * @param decimalPlaces The number of decimal places to use, it should be an integer from 0 to 16. - * + * */ toLatitudeLongitude(point: Point, format: string, decimalPlaces?: number): string; /** * Returns formatted coordinates in Military Grid Reference System (MGRS) notation representing the given point's location. Note that the choice between zone 01 and 60 has an impact only when generating the MGRS notation string for a point with longitude of exactly 180deg. The precision value controls the number of digits used to represent each numerical easting and northing value within the MGRS string. For example: - * + * * | precision | add_spaces | Example output | Approximate precision | * | --- | --- | --- | --- | * | 0 | false | 30UVG | 100km | @@ -2216,20 +2307,20 @@ declare namespace __esri { * | 3 | true | 30U VG 898 998 | 100m | * | 4 | true | 30U VG 8988 9988 | 10m | * | 5 | true | 30U VG 89884 99881 | 1m | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#toMgrs) - * + * * @param point The location to be represented in MGRS notation. The point's [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#spatialReference) should either be WGS84 or another [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) * @param conversionMode The mode to use for the returned MGRS notation string. **Possible Values**: automatic | new-180-in-zone-01 | new-180-in-zone-60 | old-180-in-zone-01 | old-180-in-zone-60 * @param precision The precision with which to represent the coordinates, it should be an integer from 0 to 8. * @param addSpaces If `false`, the generated string will contain no spaces. If `true`, a space separates the grid zone designator, the 100km square identifier, and the numerical easting and northing values. - * + * */ toMgrs(point: Point, conversionMode: string, precision?: number, addSpaces?: boolean): string; /** * Returns formatted coordinates in United States National Grid (USNG) notation representing the given point's location. The precision value controls the number of digits used to represent each numerical easting and northing value within the USNG string. For example: - * + * * | precision | add_spaces | Example output | Approximate precision | * | --- | --- | --- | --- | * | 0 | false | 13TFJ | 100km | @@ -2247,33 +2338,33 @@ declare namespace __esri { * | 4* | false | 13TFJ23795929 (NAD 27) | 10m | * | 2* | true | 13T FJ 23 59 (NAD 27) | 1km | * * *When the point's spatial reference is based on NAD 27.* - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#toUsng) - * + * * @param point The location to be represented in USNG notation. The point's [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#spatialReference) should either be WGS84 or another [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm). * @param precision The precision with which to represent the coordinates, it should be an integer from 0 to 8. * @param addSpaces If `false`, the generated string will contain no spaces. If `true`, a space separates the grid zone designator, the 100km square identifier, and the numerical easting and northing values. - * + * */ toUsng(point: Point, precision?: number, addSpaces?: boolean): string; /** * Returns formatted coordinates in Universal Transverse Mercator (UTM) notation representing the given point's location. Example output for a point in the southern hemisphere: - * + * * | conversionMode | add_spaces | Example output | * | --- | --- | --- | * | latitude-band-indicators | false | 30U4898846199881 | * | latitude-band-indicators | true | 30U 489884 6199881 | * | north-south-indicators | false | 30N4898846199881 | * | north-south-indicators | true | 30N 489884 6199881 | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-coordinateFormatter.html#toUtm) - * + * * @param point The location to be represented in UTM notation. The point's [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#spatialReference) should either be WGS84 or another [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) * @param conversionMode The latitude notation scheme to use in the returned UTM notation string, either a latitudinal band, or a hemisphere designator. **Possible Values**: latitude-band-indicators | north-south-indicators * @param addSpaces If `false`, the generated string will contain no spaces. If `true`, a space separates the UTM zone and latitude designator and each numerical easting and northing value. - * + * */ toUtm(point: Point, conversionMode: string, addSpaces?: boolean): string; } @@ -2283,191 +2374,189 @@ declare namespace __esri { interface Extent extends Geometry { /** * The center point of the extent in map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#center) */ readonly center: Point; /** * The height of the extent in map units (the distance between [ymin](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymin) and [ymax](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymax)). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#height) */ readonly height: number; /** * The maximum possible `m` value in an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#mmax) - * + * * @default undefined */ mmax: number; /** * The minimum possible `m` value of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#mmin) - * + * * @default undefined */ mmin: number; /** * For Extent, the type is always `extent`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#type) */ readonly type: "extent"; /** * The width of the extent in map units (the distance between [xmin](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmin) and [xmax](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmax)). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#width) */ readonly width: number; /** * The bottom-right X-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmax) - * + * * @default 0 */ xmax: number; /** * The top-left X-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmin) - * + * * @default 0 */ xmin: number; /** * The top-right Y-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymax) - * + * * @default 0 */ ymax: number; /** * The bottom-left Y-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymin) - * + * * @default 0 */ ymin: number; /** - * The maximum possible `z`, or elevation, value in an extent envelope. + * The maximum possible `z`, or elevation, value in an extent envelope. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#zmax) - * + * * @default undefined */ zmax: number; /** - * The minimum possible `z`, or elevation, value of an extent envelope. + * The minimum possible `z`, or elevation, value of an extent envelope. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#zmin) - * + * * @default undefined */ zmin: number; /** * Centers the extent to the specified [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#centerAt) - * + * * @param point The point to center the extent. - * + * */ centerAt(point: Point): Extent; /** * Creates a deep clone of Extent object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) - * - * + * + * */ clone(): Extent; /** * Checks if the input geometry is contained within the extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#contains) - * + * * @param geometry Input geometry to test if it is contained within the extent. - * + * */ contains(geometry: Point | Extent): boolean; /** * Indicates if the input extent is equal to the testing extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#equals) - * + * * @param extent Input extent. - * + * */ equals(extent: Extent): boolean; /** * Expands the extent by the given factor. For example, a value of 1.5 will expand the extent to be 50 percent larger than the original extent. This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#expand) - * + * * @param factor The multiplier value. - * + * */ expand(factor: number): Extent; /** * Shrinks the original extent to the intersection with the input extent. This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. If the original extent and the input extent have no intersection, the extent is not modified and null is returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#intersection) - * + * * @param extent The input extent to intersect. - * + * */ intersection(extent: Extent): Extent; /** * Tests to validate if the input geometry intersects the extent and returns a Boolean value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#intersects) - * + * * @param geometry The geometry used to test the intersection. It can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) or [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). - * + * */ intersects(geometry: Geometry): boolean; /** * Returns an array with either one Extent that's been shifted to within +/- 180 or two Extents if the original extent intersects the International Dateline. This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#normalize) - * - * + * + * */ normalize(): Extent[]; /** * Modifies the extent geometry in-place with X and Y offsets in map units. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#offset) - * + * * @param dx The offset distance in map units for the X-coordinate. * @param dy The offset distance in map units for the Y-coordinate. * @param dz The offset distance in map units for the Z-coordinate. - * + * */ offset(dx: number, dy: number, dz: number): Extent; /** * Expands the original extent to include the extent of the input Extent. This method modifies the extent geometry in-place. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone) the extent object before calling this method where appropriate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#union) - * + * * @param extent The input extent to union. - * + * */ union(extent: Extent): Extent; } interface ExtentConstructor { - - - new(properties?: ExtentProperties): Extent; + new (properties?: ExtentProperties): Extent; fromJSON(json: any): Extent; } @@ -2477,67 +2566,67 @@ declare namespace __esri { interface ExtentProperties extends GeometryProperties { /** * The maximum possible `m` value in an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#mmax) - * + * * @default undefined */ mmax?: number; /** * The minimum possible `m` value of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#mmin) - * + * * @default undefined */ mmin?: number; /** * The bottom-right X-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmax) - * + * * @default 0 */ xmax?: number; /** * The top-left X-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#xmin) - * + * * @default 0 */ xmin?: number; /** * The top-right Y-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymax) - * + * * @default 0 */ ymax?: number; /** * The bottom-left Y-coordinate of an extent envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#ymin) - * + * * @default 0 */ ymin?: number; /** - * The maximum possible `z`, or elevation, value in an extent envelope. + * The maximum possible `z`, or elevation, value in an extent envelope. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#zmax) - * + * * @default undefined */ zmax?: number; /** - * The minimum possible `z`, or elevation, value of an extent envelope. + * The minimum possible `z`, or elevation, value of an extent envelope. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#zmin) - * + * * @default undefined */ zmin?: number; @@ -2546,58 +2635,56 @@ declare namespace __esri { interface Geometry extends Accessor, JSONSupport { /** * The cache is used to store values computed from geometries that need to cleared or recomputed upon mutation. An example is the extent of a polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#cache) */ readonly cache: any; /** * The extent of the geometry. For a point, the extent is null. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#extent) */ readonly extent: Extent; /** * Indicates if the geometry has M values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#hasM) */ hasM: boolean; /** - * Indicates if the geometry has Z (elevation) values. + * Indicates if the geometry has Z (elevation) values. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#hasZ) */ hasZ: boolean; /** * The spatial reference of the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#spatialReference) - * + * * @default WGS84 (wkid: 4326) */ spatialReference: SpatialReference; /** * The geometry type. **Possible Values:** point | multipoint | polyline | polygon | extent | mesh - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type) */ readonly type: string; /** * Creates a deep clone of the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#clone) - * - * + * + * */ clone(): Geometry; } interface GeometryConstructor { - - - new(properties?: GeometryProperties): Geometry; + new (properties?: GeometryProperties): Geometry; fromJSON(json: any): Geometry; } @@ -2607,401 +2694,431 @@ declare namespace __esri { interface GeometryProperties { /** * Indicates if the geometry has M values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#hasM) */ hasM?: boolean; /** - * Indicates if the geometry has Z (elevation) values. + * Indicates if the geometry has Z (elevation) values. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#hasZ) */ hasZ?: boolean; /** * The spatial reference of the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#spatialReference) - * + * * @default WGS84 (wkid: 4326) */ spatialReference?: SpatialReferenceProperties; } - interface geometryEngine { /** * Creates planar (or Euclidean) buffer polygons at a specified distance around the input geometries. The GeometryEngine has two methods for buffering geometries client-side: buffer and [geodesicBuffer](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicBuffer). Use caution when deciding which method to use. As a general rule, use [geodesicBuffer](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicBuffer) if the input geometries have a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator). Only use buffer (this method) when attempting to buffer geometries with a [projected coordinate system](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) other than Web Mercator. If you need to buffer geometries with a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) other than WGS84 (wkid: 4326), use [GeometryService.buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#buffer) - * + * * @param geometry The buffer input geometry. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. * @param distance The specified distance(s) for buffering. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. When using an array of geometries as input, the length of the geometry array does not have to equal the length of the `distance` array. For example, if you pass an array of four geometries: `[g1, g2, g3, g4]` and an array with one distance: `[d1]`, all four geometries will be buffered by the single distance value. If instead you use an array of three distances: `[d1, d2, d3]`, `g1` will be buffered by `d1`, `g2` by `d2`, and `g3` and `g4` will both be buffered by `d3`. The value of the geometry array will be matched one to one with those in the distance array until the final value of the distance array is reached, in which case that value will be applied to the remaining geometries. * @param unit Measurement unit of the distance(s). Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards * @param unionResults Determines whether the output geometries should be unioned into a single polygon. - * + * */ - buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; + buffer( + geometry: Geometry | Geometry[], + distance: number | number[], + unit: string | number, + unionResults?: boolean + ): Polygon | Polygon[]; /** * Calculates the clipped geometry from a target geometry by an envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#clip) - * + * * @param geometry The geometry to be clipped. * @param envelope The envelope used to clip. - * + * */ clip(geometry: Geometry, envelope: Extent): Geometry; /** * Indicates if one geometry contains another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#contains) - * + * * @param containerGeometry The geometry that is tested for the "contains" relationship to the other geometry. Think of this geometry as the potential "container" of the `insideGeometry`. * @param insideGeometry The geometry that is tested for the "within" relationship to the `containerGeometry`. - * + * */ contains(containerGeometry: Geometry, insideGeometry: Geometry): boolean; /** * Calculates the convex hull of the input geometry. A convex hull is the smallest convex polygon that encloses a group of Objects, such as points. The input geometry can be a point, multipoint, polyline or polygon. The hull is typically a polygon but can also be a polyline or point in degenerate cases. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#convexHull) - * + * * @param geometry The input geometry. * @param merge Dictates whether to merge output geometries. - * + * */ convexHull(geometry: Geometry, merge?: boolean): Geometry | Geometry[]; /** * Indicates if one geometry crosses another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#crosses) - * + * * @param geometry1 The geometry to cross. * @param geometry2 The geometry being crossed. - * + * */ crosses(geometry1: Geometry, geometry2: Geometry): boolean; /** * Split the input Polyline or Polygon where it crosses a cutting Polyline. For Polylines, all left cuts are grouped together in the first Geometry. Right cuts and coincident cuts are grouped in the second Geometry and each undefined cut, along with any uncut parts, are output as separate Polylines. For Polygons, all left cuts are grouped in the first Polygon, all right cuts are grouped in the second Polygon, and each undefined cut, along with any left-over parts after cutting, are output as a separate Polygon. If no cuts are returned then the array will be empty. An undefined cut will only be produced if a left cut or right cut was produced and there was a part left over after cutting, or a cut is bounded to the left and right of the cutter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#cut) - * + * * @param geometry The geometry to be cut. * @param cutter The polyline to cut the geometry. - * + * */ cut(geometry: Geometry, cutter: Polyline): Geometry[]; /** * Densify geometries by plotting points between existing vertices. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#densify) - * + * * @param geometry The geometry to be densified. * @param maxSegmentLength The maximum segment length allowed. Must be a positive value. * @param maxSegmentLengthUnit Measurement unit for maxSegmentLength. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry; /** * Creates the difference of two geometries. The resultant geometry is the portion of `inputGeometry` not in the `subtractor`. The dimension of the `subtractor` has to be equal to or greater than that of the `inputGeometry`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#difference) - * + * * @param inputGeometry The input geometry to subtract from. * @param subtractor The geometry being subtracted from inputGeometry. - * + * */ difference(inputGeometry: Geometry | Geometry[], subtractor: Geometry): Geometry | Geometry[]; /** * Indicates if one geometry is disjoint (doesn't intersect in any way) with another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#disjoint) - * + * * @param geometry1 The base geometry that is tested for the "disjoint" relationship to the other geometry. * @param geometry2 The comparison geometry that is tested for the "disjoint" relationship to the other geometry. - * + * */ disjoint(geometry1: Geometry, geometry2: Geometry): boolean; /** - * Calculates the shortest planar distance between two geometries. Distance is reported in the linear units specified by `distanceUnit` or, if `distanceUnit` is null, the units of the spatialReference of input geometry. + * Calculates the shortest planar distance between two geometries. Distance is reported in the linear units specified by `distanceUnit` or, if `distanceUnit` is null, the units of the spatialReference of input geometry. * > To calculate the geodesic distance between two points, first construct a [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) using the two points of interest as the beginning and ending points of a single path. Then use the polyline as input for the [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicLength) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#distance) - * + * * @param geometry1 First input geometry. * @param geometry2 Second input geometry. * @param distanceUnit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): number; /** * Indicates if two geometries are equal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#equals) - * + * * @param geometry1 First input geometry. * @param geometry2 Second input geometry. - * + * */ equals(geometry1: Geometry, geometry2: Geometry): boolean; /** * Returns an Object containing additional information about the input spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#extendedSpatialReferenceInfo) - * + * * @param spatialReference The input spatial reference. - * + * */ extendedSpatialReferenceInfo(spatialReference: SpatialReference): any; /** * Flips a geometry on the horizontal axis. Can optionally be flipped around a point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#flipHorizontal) - * + * * @param geometry The input geometry to be flipped. * @param flipOrigin Point to flip the geometry around. Defaults to the centroid of the geometry. - * + * */ flipHorizontal(geometry: Geometry, flipOrigin?: Point): Geometry; /** * Flips a geometry on the vertical axis. Can optionally be flipped around a point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#flipVertical) - * + * * @param geometry The input geometry to be flipped. * @param flipOrigin Point to flip the geometry around. Defaults to the centroid of the geometry. - * + * */ flipVertical(geometry: Geometry, flipOrigin?: Point): Geometry; /** * Performs the generalize operation on the geometries in the cursor. Point and Multipoint geometries are left unchanged. Envelope is converted to a Polygon and then generalized. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#generalize) - * + * * @param geometry The input geometry to be generalized. * @param maxDeviation The maximum allowed deviation from the generalized geometry to the original geometry. * @param removeDegenerateParts When `true` the degenerate parts of the geometry will be removed from the output (may be undesired for drawing). * @param maxDeviationUnit Measurement unit for maxDeviation. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ - generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): Geometry; + generalize( + geometry: Geometry, + maxDeviation: number, + removeDegenerateParts?: boolean, + maxDeviationUnit?: string | number + ): Geometry; /** * Calculates the area of the input geometry. As opposed to [planarArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarArea), geodesicArea takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate areas using geodesicArea(). If the input geometries have a projected coordinate system other than Web Mercator, use [planarArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarArea) instead. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicArea) - * + * * @param geometry The input polygon. * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for area units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-miles - * + * */ geodesicArea(geometry: Polygon, unit: string | number): number; /** * Creates geodesic buffer polygons at a specified distance around the input geometries. When calculating distances, this method takes the curvature of the earth into account, which provides highly accurate results when dealing with very large geometries and/or geometries that spatially vary on a global scale where one projected coordinate system could not accurately plot coordinates and measure distances for all the geometries. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. In general, if your input geometries are assigned one of those two spatial references, you should always use geodesicBuffer() to obtain the most accurate results for those geometries. If needing to buffer points assigned a [projected coordinate system other than Web Mercator](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm), use [buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#buffer) instead. If the input geometries have a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) other than WGS84 (wkid: 4326), use [GeometryService.buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicBuffer) - * + * * @param geometry The buffer input geometry. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. * @param distance The specified distance(s) for buffering. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. When using an array of geometries as input, the length of the geometry array does not have to equal the length of the `distance` array. For example, if you pass an array of four geometries: `[g1, g2, g3, g4]` and an array with one distance: `[d1]`, all four geometries will be buffered by the single distance value. If instead you use an array of three distances: `[d1, d2, d3]`, `g1` will be buffered by `d1`, `g2` by `d2`, and `g3` and `g4` will both be buffered by `d3`. The value of the geometry array will be matched one to one with those in the distance array until the final value of the distance array is reached, in which case that value will be applied to the remaining geometries. * @param unit Measurement unit of the distance(s). Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards * @param unionResults Determines whether the output geometries should be unioned into a single polygon. - * + * */ - geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[]; + geodesicBuffer( + geometry: Geometry | Geometry[], + distance: number | number[], + unit: string | number, + unionResults?: boolean + ): Polygon | Polygon[]; /** * Returns a geodesically densified version of the input geometry. Use this function to draw the line(s) of the geometry along great circles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicDensify) - * + * * @param geometry A polyline or polygon to densify. * @param maxSegmentLength The maximum segment length allowed. This must be a positive value. * @param maxSegmentLengthUnit Measurement unit for `maxSegmentLength`. If a unit is not specified, the units are considered to be the same as the units of the `geometry`. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ - geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry; + geodesicDensify( + geometry: Polyline | Polygon, + maxSegmentLength: number, + maxSegmentLengthUnit: string | number + ): Geometry; /** * Calculates the length of the input geometry. As opposed to [planarLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarLength), geodesicLength() takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate lengths using geodesicLength(). If the input geometries have a projected coordinate system other than Web Mercator, use [planarLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarLength) instead. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicLength) - * + * * @param geometry The input geometry. * @param unit Measurement unit of the return value. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ geodesicLength(geometry: Geometry, unit: string | number): number; /** * Creates a new geometry through intersection between two geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#intersect) - * + * * @param geometry The input geometry(ies). * @param intersector The geometry being intersected. - * + * */ intersect(geometry: Geometry | Geometry[], intersector: Geometry): Geometry | Geometry[]; /** * Indicates if one geometry intersects another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#intersects) - * + * * @param geometry1 The geometry that is tested for the intersects relationship to the other geometry. * @param geometry2 The geometry being intersected. - * + * */ intersects(geometry1: Geometry, geometry2: Geometry): boolean; /** * Indicates if the given geometry is topologically simple. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#isSimple) - * + * * @param geometry The input geometry. - * + * */ isSimple(geometry: Geometry): boolean; /** * Finds the coordinate of the geometry that is closest to the specified point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestCoordinate) - * + * * @param geometry The geometry to consider. * @param inputPoint The point used to search the nearest coordinate in the geometry. - * + * */ nearestCoordinate(geometry: Geometry, inputPoint: Point): NearestPointResult; /** * Finds the vertex on the geometry nearest to the specified point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestVertex) - * + * * @param geometry The geometry to consider. * @param inputPoint The point used to search the nearest vertex in the geometry. - * + * */ nearestVertex(geometry: Geometry, inputPoint: Point): NearestPointResult; /** * Finds all vertices in the given distance from the specified point, sorted from the closest to the furthest and returns them as an array of Objects. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestVertices) - * + * * @param geometry The geometry to consider. * @param inputPoint The point from which to measure. * @param searchRadius The distance to search from the inputPoint in the units of the view's spatial reference. * @param maxVertexCountToReturn The maximum number of vertices to return. - * + * */ - nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): NearestPointResult[]; + nearestVertices( + geometry: Geometry, + inputPoint: Point, + searchRadius: number, + maxVertexCountToReturn: number + ): NearestPointResult[]; /** * The offset operation creates a geometry that is a constant planar distance from an input polyline or polygon. It is similar to buffering, but produces a one-sided result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#offset) - * + * * @param geometry The geometries to offset. * @param offsetDistance The planar distance to offset from the input geometry. If offsetDistance > 0, then the offset geometry is constructed to the right of the oriented input geometry, if offsetDistance = 0, then there is no change in the geometries, otherwise it is constructed to the left. For a simple polygon, the orientation of outer rings is clockwise and for inner rings it is counter clockwise. So the "right side" of a simple polygon is always its inside. * @param offsetUnit Measurement unit of the offset distance. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards * @param joinType The join type. **Possible values:** round | bevel | miter | square * @param bevelRatio Applicable when `joinType = 'miter'`; bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. * @param flattenError Applicable when `joinType = 'round'`; flattenError determines the maximum distance of the resulting segments compared to the true circular arc. The algorithm never produces more than around 180 vertices for each round join. - * + * */ - offset(geometry: Geometry | Geometry[], offsetDistance: number, offsetUnit: string | number, joinType: string, bevelRatio?: number, flattenError?: number): Geometry | Geometry[]; + offset( + geometry: Geometry | Geometry[], + offsetDistance: number, + offsetUnit: string | number, + joinType: string, + bevelRatio?: number, + flattenError?: number + ): Geometry | Geometry[]; /** * Indicates if one geometry overlaps another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#overlaps) - * + * * @param geometry1 The base geometry that is tested for the "overlaps" relationship with the other geometry. * @param geometry2 The comparison geometry that is tested for the "overlaps" relationship with the other geometry. - * + * */ overlaps(geometry1: Geometry, geometry2: Geometry): boolean; /** * Calculates the area of the input geometry. As opposed to [geodesicArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicArea), planarArea() performs this calculation using projected coordinates and does not take into account the earth's curvature. When using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate areas using [geodesicArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicArea). If the input geometries have a projected coordinate system other than Web Mercator, use planarArea() instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarArea) - * + * * @param geometry The input polygon. * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for area units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-miles - * + * */ planarArea(geometry: Polygon, unit: string | number): number; /** * Calculates the length of the input geometry. As opposed to [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicLength), planarLength() uses projected coordinates and does not take into account the curvature of the earth when performing this calculation. When using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate lengths using [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#geodesicLength). If the input geometries have a projected coordinate system other than Web Mercator, use planarLength() instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#planarLength) - * + * * @param geometry The input geometry. * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ planarLength(geometry: Geometry, unit: string | number): number; /** * Indicates if the given DE-9IM relation holds for the two geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#relate) - * + * * @param geometry1 The first geometry for the relation. * @param geometry2 The second geometry for the relation. * @param relation The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to test against the relationship of the two geometries. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: `0`,`1`,`2`), a Boolean value (`T` or `F`), or a mask character (for ignoring results: '\*'). Example: Each of the following DE-9IM string codes are valid for testing whether a polygon geometry completely contains a line geometry: `TTTFFTFFT` (Boolean), 'T*\*\*\*\*\*FF\*' (ignore irrelevant intersections), or '102FF\*FF\*' (dimension form). Each returns the same result. See [this article](https://en.wikipedia.org/wiki/DE-9IM) and [this ArcGIS help page](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) for more information about the DE-9IM model and how string codes are constructed. - * + * */ relate(geometry1: Geometry, geometry2: Geometry, relation: string): boolean; /** * Rotates a geometry counterclockwise by the specified number of degrees. Rotation is around the centroid, or a given rotation point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#rotate) - * + * * @param geometry The geometry to rotate. * @param angle The rotation angle in degrees. * @param rotationOrigin Point to rotate the geometry around. Defaults to the centroid of the geometry. - * + * */ rotate(geometry: Geometry, angle: number, rotationOrigin?: Point): Geometry; /** * Performs the simplify operation on the geometry which alters the given geometries to make their definitions topologically legal with respect to their geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#simplify) - * + * * @param geometry The geometry to be simplified. - * + * */ simplify(geometry: Geometry): Geometry; /** * Creates the symmetric difference of two geometries. The symmetric difference includes the parts that are in either of the sets, but not in both. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#symmetricDifference) - * + * * @param leftGeometry One of the Geometry instances in the XOR operation. * @param rightGeometry One of the Geometry instances in the XOR operation. - * + * */ symmetricDifference(leftGeometry: Geometry | Geometry[], rightGeometry: Geometry): Geometry | Geometry[]; /** * Indicates if one geometry touches another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#touches) - * + * * @param geometry1 The geometry to test the "touches" relationship with the other geometry. * @param geometry2 The geometry to be touched. - * + * */ touches(geometry1: Geometry, geometry2: Geometry): boolean; /** * All inputs must be of the same type of geometries and share one spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#union) - * + * * @param geometries An array of Geometries to union. - * + * */ union(geometries: Geometry[]): Geometry; /** * Indicates if one geometry is within another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#within) - * + * * @param innerGeometry The base geometry that is tested for the "within" relationship to the other geometry. * @param outerGeometry The comparison geometry that is tested for the "contains" relationship to the other geometry. - * + * */ within(innerGeometry: Geometry, outerGeometry: Geometry): boolean; } @@ -3010,416 +3127,446 @@ declare namespace __esri { /** * Object returned from the [nearestCoordinate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestCoordinate), [nearestVertex()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestVertex), and [nearestVertices()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#nearestVertices) methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) */ export interface NearestPointResult extends Object { /** * A vertex within the specified distance of the search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) */ coordinate: Point; /** * The distance from the `inputPoint` in the units of the view's spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) */ distance: number; /** * Indicates if the vertex is on the right side of the `geometry`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) */ isRightSide: boolean; /** * The index of the vertex within the geometry's rings or paths. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) */ vertexIndex: number; /** * Indicates if it is an empty geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#NearestPointResult) */ isEmpty: boolean; } - interface geometryEngineAsync { /** * Creates planar (or Euclidean) buffer polygons at a specified distance around the input geometries. The GeometryEngine has two methods for buffering geometries client-side: buffer and [geodesicBuffer](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicBuffer). Use caution when deciding which method to use. As a general rule, use [geodesicBuffer](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicBuffer) if the input geometries have a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator). Only use buffer (this method) when attempting to buffer geometries with a [projected coordinate system](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) other than Web Mercator. If you need to buffer geometries with a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) other than WGS84 (wkid: 4326), use [GeometryService.buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#buffer) - * + * * @param geometry The buffer input geometry. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. * @param distance The specified distance(s) for buffering. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. When using an array of geometries as input, the length of the geometry array does not have to equal the length of the `distance` array. For example, if you pass an array of four geometries: `[g1, g2, g3, g4]` and an array with one distance: `[d1]`, all four geometries will be buffered by the single distance value. If instead you use an array of three distances: `[d1, d2, d3]`, `g1` will be buffered by `d1`, `g2` by `d2`, and `g3` and `g4` will both be buffered by `d3`. The value of the geometry array will be matched one to one with those in the distance array until the final value of the distance array is reached, in which case that value will be applied to the remaining geometries. * @param unit Measurement unit of the distance(s). Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards * @param unionResults Determines whether the output geometries should be unioned into a single polygon. - * + * */ - buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): IPromise; + buffer( + geometry: Geometry | Geometry[], + distance: number | number[], + unit: string | number, + unionResults?: boolean + ): IPromise; /** * Calculates the clipped geometry from a target geometry by an envelope. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#clip) - * + * * @param geometry The geometry to be clipped. * @param envelope The envelope used to clip. - * + * */ clip(geometry: Geometry, envelope: Extent): IPromise; /** * Indicates if one geometry contains another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#contains) - * + * * @param containerGeometry The geometry that is tested for the "contains" relationship to the other geometry. Think of this geometry as the potential "container" of the `insideGeometry`. * @param insideGeometry The geometry that is tested for the "within" relationship to the `containerGeometry`. - * + * */ contains(containerGeometry: Geometry, insideGeometry: Geometry): IPromise; /** * Calculates the convex hull of the input geometry. A convex hull is the smallest convex polygon that encloses a group of Objects, such as points. The input geometry can be a point, multipoint, polyline or polygon. The hull is typically a polygon but can also be a polyline or point in degenerate cases. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#convexHull) - * + * * @param geometry The input geometry. * @param merge Dictates whether to merge output geometries. - * + * */ convexHull(geometry: Geometry, merge?: boolean): IPromise; /** * Indicates if one geometry crosses another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#crosses) - * + * * @param geometry1 The geometry to cross. * @param geometry2 The geometry being crossed. - * + * */ crosses(geometry1: Geometry, geometry2: Geometry): IPromise; /** * Split the input Polyline or Polygon where it crosses a cutting Polyline. For Polylines, all left cuts are grouped together in the first Geometry. Right cuts and coincident cuts are grouped in the second Geometry and each undefined cut, along with any uncut parts, are output as separate Polylines. For Polygons, all left cuts are grouped in the first Polygon, all right cuts are grouped in the second Polygon, and each undefined cut, along with any left-over parts after cutting, are output as a separate Polygon. If no cuts are returned then the array will be empty. An undefined cut will only be produced if a left cut or right cut was produced and there was a part left over after cutting, or a cut is bounded to the left and right of the cutter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#cut) - * + * * @param geometry The geometry to be cut. * @param cutter The polyline to cut the geometry. - * + * */ cut(geometry: Geometry, cutter: Polyline): IPromise; /** * Densify geometries by plotting points between existing vertices. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#densify) - * + * * @param geometry The geometry to be densified. * @param maxSegmentLength The maximum segment length allowed. Must be a positive value. * @param maxSegmentLengthUnit Measurement unit for maxSegmentLength. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): IPromise; /** * Creates the difference of two geometries. The resultant geometry is the portion of inputGeometry not in the subtractor. The dimension of the subtractor has to be equal to or greater than that of the inputGeometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#difference) - * + * * @param inputGeometry The input geometry to subtract from. * @param subtractor The geometry being subtracted from inputGeometry. - * + * */ difference(inputGeometry: Geometry | Geometry[], subtractor: Geometry): IPromise; /** * Indicates if one geometry is disjoint (doesn't intersect in any way) with another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#disjoint) - * + * * @param geometry1 The base geometry that is tested for the "disjoint" relationship to the other geometry. * @param geometry2 The comparison geometry that is tested for the "disjoint" relationship to the other geometry. - * + * */ disjoint(geometry1: Geometry, geometry2: Geometry): IPromise; /** - * Calculates the shortest planar distance between two geometries. Distance is reported in the linear units specified by `distanceUnit` or, if `distanceUnit` is null, the units of the spatialReference of input geometry. + * Calculates the shortest planar distance between two geometries. Distance is reported in the linear units specified by `distanceUnit` or, if `distanceUnit` is null, the units of the spatialReference of input geometry. * > To calculate the geodesic distance between two points, first construct a [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) using the two points of interest as the beginning and ending points of a single path. Then use the polyline as input for the [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicLength) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#distance) - * + * * @param geometry1 First input geometry. * @param geometry2 Second input geometry. * @param distanceUnit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): IPromise; /** * Indicates if two geometries are equal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#equals) - * + * * @param geometry1 First input geometry. * @param geometry2 Second input geometry. - * + * */ equals(geometry1: Geometry, geometry2: Geometry): IPromise; /** * Returns an Object containing additional information about the input spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#extendedSpatialReferenceInfo) - * + * * @param spatialReference The input spatial reference. - * + * */ extendedSpatialReferenceInfo(spatialReference: SpatialReference): IPromise; /** * Flips a geometry on the horizontal axis. Can optionally be flipped around a point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#flipHorizontal) - * + * * @param geometry The input geometry to be flipped. * @param flipOrigin Point to flip the geometry around. Defaults to the centroid of the geometry. - * + * */ flipHorizontal(geometry: Geometry, flipOrigin?: Point): IPromise; /** * Flips a geometry on the vertical axis. Can optionally be flipped around a point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#flipVertical) - * + * * @param geometry The input geometry to be flipped. * @param flipOrigin Point to flip the geometry around. Defaults to the centroid of the geometry. - * + * */ flipVertical(geometry: Geometry, flipOrigin?: Point): IPromise; /** * Performs the generalize operation on the geometries in the cursor. Point and Multipoint geometries are left unchanged. Envelope is converted to a Polygon and then generalized. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#generalize) - * + * * @param geometry The input geometry to be generalized. * @param maxDeviation The maximum allowed deviation from the generalized geometry to the original geometry. * @param removeDegenerateParts When `true` the degenerate parts of the geometry will be removed from the output (may be undesired for drawing). * @param maxDeviationUnit Measurement unit for maxDeviation. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ - generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): IPromise; + generalize( + geometry: Geometry, + maxDeviation: number, + removeDegenerateParts?: boolean, + maxDeviationUnit?: string | number + ): IPromise; /** * Calculates the area of the input geometry. As opposed to [planarArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarArea), geodesicArea takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate areas using geodesicArea(). If the input geometries have a projected coordinate system other than Web Mercator, use [planarArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarArea) instead. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicArea) - * + * * @param geometry The input polygon. * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for area units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-miles - * + * */ geodesicArea(geometry: Polygon, unit: string | number): IPromise; /** * Creates geodesic buffer polygons at a specified distance around the input geometries. When calculating distances, this method takes the curvature of the earth into account, which provides highly accurate results when dealing with very large geometries and/or geometries that spatially vary on a global scale where one projected coordinate system could not accurately plot coordinates and measure distances for all the geometries. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. In general, if your input geometries are assigned one of those two spatial references, you should always use geodesicBuffer() to obtain the most accurate results for those geometries. If needing to buffer points assigned a [projected coordinate system other than Web Mercator](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm), use [buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#buffer) instead. If the input geometries have a [geographic coordinate system](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) other than WGS84 (wkid: 4326), use [GeometryService.buffer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicBuffer) - * + * * @param geometry The buffer input geometry. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. * @param distance The specified distance(s) for buffering. The `geometry` and `distance` parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array. When using an array of geometries as input, the length of the geometry array does not have to equal the length of the `distance` array. For example, if you pass an array of four geometries: `[g1, g2, g3, g4]` and an array with one distance: `[d1]`, all four geometries will be buffered by the single distance value. If instead you use an array of three distances: `[d1, d2, d3]`, `g1` will be buffered by `d1`, `g2` by `d2`, and `g3` and `g4` will both be buffered by `d3`. The value of the geometry array will be matched one to one with those in the distance array until the final value of the distance array is reached, in which case that value will be applied to the remaining geometries. * @param unit Measurement unit of the distance(s). Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards * @param unionResults Determines whether the output geometries should be unioned into a single polygon. - * + * */ - geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): IPromise; + geodesicBuffer( + geometry: Geometry | Geometry[], + distance: number | number[], + unit: string | number, + unionResults?: boolean + ): IPromise; /** * Returns a geodesically densified version of the input geometry. Use this function to draw the line(s) of the geometry along great circles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicDensify) - * + * * @param geometry A polyline or polygon to densify. * @param maxSegmentLength The maximum segment length allowed. This must be a positive value. * @param maxSegmentLengthUnit Measurement unit for `maxSegmentLength`. If a unit is not specified, the units are considered to be the same as the units of the `geometry`. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ - geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit: string | number): IPromise; + geodesicDensify( + geometry: Polyline | Polygon, + maxSegmentLength: number, + maxSegmentLengthUnit: string | number + ): IPromise; /** * Calculates the length of the input geometry. As opposed to [planarLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarLength), geodesicLength() takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate lengths using geodesicLength(). If the input geometries have a projected coordinate system other than Web Mercator, use [planarLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarLength) instead. This method only works with WGS84 (wkid: 4326) and [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) spatial references. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicLength) - * + * * @param geometry The input geometry. * @param unit Measurement unit of the return value. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ geodesicLength(geometry: Geometry, unit: string | number): IPromise; /** * Creates a new geometry through intersection between two geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#intersect) - * + * * @param geometry The input geometry(ies). * @param intersector The geometry being intersected. - * + * */ intersect(geometry: Geometry | Geometry[], intersector: Geometry): IPromise; /** * Indicates if one geometry intersects another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#intersects) - * + * * @param geometry1 The geometry that is tested for the intersects relationship to the other geometry. * @param geometry2 The geometry being intersected. - * + * */ intersects(geometry1: Geometry, geometry2: Geometry): IPromise; /** * Indicates if the given geometry is topologically simple. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#isSimple) - * + * * @param geometry The input geometry. - * + * */ isSimple(geometry: Geometry): IPromise; /** * Finds the coordinate of the geometry that is closest to the specified point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#nearestCoordinate) - * + * * @param geometry The geometry to consider. * @param inputPoint The point used to search the nearest coordinate in the geometry. - * + * */ nearestCoordinate(geometry: Geometry, inputPoint: Point): IPromise; /** * Finds vertex on the geometry nearest to the specified point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#nearestVertex) - * + * * @param geometry The geometry to consider. * @param inputPoint The point used to search the nearest vertex in the geometry. - * + * */ nearestVertex(geometry: Geometry, inputPoint: Point): IPromise; /** * Finds all vertices in the given distance from the specified point, sorted from the closest to the furthest and returns them as an array of Objects. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#nearestVertices) - * + * * @param geometry The geometry to consider. * @param inputPoint The point from which to measure. * @param searchRadius The distance to search from the inputPoint in the units of the view's spatial reference. * @param maxVertexCountToReturn The maximum number of vertices to return. - * + * */ - nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): IPromise; + nearestVertices( + geometry: Geometry, + inputPoint: Point, + searchRadius: number, + maxVertexCountToReturn: number + ): IPromise; /** * The offset operation creates a geometry that is a constant planar distance from an input polyline or polygon. It is similar to buffering, but produces a one-sided result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#offset) - * + * * @param geometry The geometries to offset. * @param offsetDistance The planar distance to offset from the input geometry. If offsetDistance > 0, then the offset geometry is constructed to the right of the oriented input geometry, if offsetDistance = 0, then there is no change in the geometries, otherwise it is constructed to the left. For a simple polygon, the orientation of outer rings is clockwise and for inner rings it is counter clockwise. So the "right side" of a simple polygon is always its inside. * @param offsetUnit Measurement unit of the offset distance. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards * @param joinType The join type. **Possible values:** round | bevel | miter | square * @param bevelRatio Applicable when `joinType = 'miter'`; bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. * @param flattenError Applicable when `joinType = 'round'`; flattenError determines the maximum distance of the resulting segments compared to the true circular arc. The algorithm never produces more than around 180 vertices for each round join. - * + * */ - offset(geometry: Geometry | Geometry[], offsetDistance: number, offsetUnit: string | number, joinType: string, bevelRatio?: number, flattenError?: number): IPromise; + offset( + geometry: Geometry | Geometry[], + offsetDistance: number, + offsetUnit: string | number, + joinType: string, + bevelRatio?: number, + flattenError?: number + ): IPromise; /** * Indicates if one geometry overlaps another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#overlaps) - * + * * @param geometry1 The base geometry that is tested for the "overlaps" relationship with the other geometry. * @param geometry2 The comparison geometry that is tested for the "overlaps" relationship with the other geometry. - * + * */ overlaps(geometry1: Geometry, geometry2: Geometry): IPromise; /** * Calculates the area of the input geometry. As opposed to [geodesicArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicArea), planarArea() performs this calculation using projected coordinates and does not take into account the earth's curvature. When using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate areas using [geodesicArea()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicArea). If the input geometries have a projected coordinate system other than Web Mercator, use planarArea() instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarArea) - * + * * @param geometry The input polygon. * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for area units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-miles - * + * */ planarArea(geometry: Polygon, unit: string | number): IPromise; /** * Calculates the length of the input geometry. As opposed to [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicLength), planarLength() uses projected coordinates and does not take into account the curvature of the earth when performing this calculation. When using input geometries with a spatial reference of either WGS84 (wkid: 4326) or [Web Mercator](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator), it is best practice to calculate lengths using [geodesicLength()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#geodesicLength). If the input geometries have a projected coordinate system other than Web Mercator, use planarLength() instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#planarLength) - * + * * @param geometry The input geometry. * @param unit Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** meters | feet | kilometers | miles | nautical-miles | yards - * + * */ planarLength(geometry: Geometry, unit: string | number): IPromise; /** * Indicates if the given DE-9IM relation holds for the two geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#relate) - * + * * @param geometry1 The first geometry for the relation. * @param geometry2 The second geometry for the relation. * @param relation The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to test against the relationship of the two geometries. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: `0`,`1`,`2`), a Boolean value (`T` or `F`), or a mask character (for ignoring results: '\*'). Example: Each of the following DE-9IM string codes are valid for testing whether a polygon geometry completely contains a line geometry: `TTTFFTFFT` (Boolean), 'T\*\*\*\*\*FF\*' (ignore irrelevant intersections), or '102FF\*FF\*' (dimension form). Each returns the same result. See [this article](https://en.wikipedia.org/wiki/DE-9IM) and [this ArcGIS help page](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) for more information about the DE-9IM model and how string codes are constructed. - * + * */ relate(geometry1: Geometry, geometry2: Geometry, relation: string): IPromise; /** * Rotates a geometry counterclockwise by the specified number of degrees. Rotation is around the centroid, or a given rotation point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#rotate) - * + * * @param geometry The geometry to rotate. * @param angle The rotation angle in degrees. * @param rotationOrigin Point to rotate the geometry around. Defaults to the centroid of the geometry. - * + * */ rotate(geometry: Geometry, angle: number, rotationOrigin?: Point): IPromise; /** * Performs the simplify operation on the geometry which alters the given geometries to make their definitions topologically legal with respect to their geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#simplify) - * + * * @param geometry The geometry to be simplified. - * + * */ simplify(geometry: Geometry): IPromise; /** * Creates the symmetric difference of two geometries. The symmetric difference includes the parts that are in either of the sets, but not in both. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#symmetricDifference) - * + * * @param leftGeometry One of the Geometry instances in the XOR operation. * @param rightGeometry One of the Geometry instances in the XOR operation. - * + * */ symmetricDifference(leftGeometry: Geometry | Geometry[], rightGeometry: Geometry): IPromise; /** * Indicates if one geometry touches another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#touches) - * + * * @param geometry1 The geometry to test the "touches" relationship with the other geometry. * @param geometry2 The geometry to be touched. - * + * */ touches(geometry1: Geometry, geometry2: Geometry): IPromise; /** * All inputs must be of the same type of geometries and share one spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#union) - * + * * @param geometries An array of Geometries to union. - * + * */ union(geometries: Geometry[]): IPromise; /** * Indicates if one geometry is within another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngineAsync.html#within) - * + * * @param innerGeometry The base geometry that is tested for the "within" relationship to the other geometry. * @param outerGeometry The comparison geometry that is tested for the "contains" relationship to the other geometry. - * + * */ within(innerGeometry: Geometry, outerGeometry: Geometry): IPromise; } @@ -3428,39 +3575,37 @@ declare namespace __esri { interface HeightModelInfo extends Accessor, JSONSupport { /** - * The surface type or height model of the vertical coordinate system (VCS). A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers containing data that is compatible with the HeightModelInfo of the scene. - * + * The surface type or height model of the vertical coordinate system (VCS). A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers containing data that is compatible with the HeightModelInfo of the scene. + * * Value | Description * ------|------------ * gravity-related-height | A gravity-related VCS may set its zero point through a local mean sea level or a benchmark, and is compatible with other gravity-related VCS for the purposes of rendering. * ellipsoidal | An ellipsoidal VCS defines heights that are referenced to an ellipsoid of a geographic coordinate system. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#heightModel) - * + * * @default "gravity-related-height" */ readonly heightModel: string; /** * The unit of the vertical coordinate system. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will use this property to check that the vertical data of layers that define a HeightModelInfo is compatible with the view. **Possible Values:** meters | feet | us-feet | clarke-feet | clarke-yards | clarke-links | sears-yards | sears-feet | sears-chains | benoit-1895-b-chains | indian-yards | indian-1937-yards | gold-coast-feet | sears-1922-truncated-chains | 50-kilometers | 150-kilometers - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#heightUnit) - * + * * @default "meters" */ readonly heightUnit: string; /** * The datum realization of the vertical coordinate system. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers that define a HeightModelInfo with an identical `vertCRS` to that of the scene, when using an `ellipsoidal` height model. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#vertCRS) */ readonly vertCRS: string; } interface HeightModelInfoConstructor { - - - new(properties?: HeightModelInfoProperties): HeightModelInfo; + new (properties?: HeightModelInfoProperties): HeightModelInfo; fromJSON(json: any): HeightModelInfo; } @@ -3469,30 +3614,30 @@ declare namespace __esri { interface HeightModelInfoProperties { /** - * The surface type or height model of the vertical coordinate system (VCS). A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers containing data that is compatible with the HeightModelInfo of the scene. - * + * The surface type or height model of the vertical coordinate system (VCS). A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers containing data that is compatible with the HeightModelInfo of the scene. + * * Value | Description * ------|------------ * gravity-related-height | A gravity-related VCS may set its zero point through a local mean sea level or a benchmark, and is compatible with other gravity-related VCS for the purposes of rendering. * ellipsoidal | An ellipsoidal VCS defines heights that are referenced to an ellipsoid of a geographic coordinate system. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#heightModel) - * + * * @default "gravity-related-height" */ heightModel?: string; /** * The unit of the vertical coordinate system. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will use this property to check that the vertical data of layers that define a HeightModelInfo is compatible with the view. **Possible Values:** meters | feet | us-feet | clarke-feet | clarke-yards | clarke-links | sears-yards | sears-feet | sears-chains | benoit-1895-b-chains | indian-yards | indian-1937-yards | gold-coast-feet | sears-1922-truncated-chains | 50-kilometers | 150-kilometers - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#heightUnit) - * + * * @default "meters" */ heightUnit?: string; /** * The datum realization of the vertical coordinate system. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) will only render layers that define a HeightModelInfo with an identical `vertCRS` to that of the scene, when using an `ellipsoidal` height model. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-HeightModelInfo.html#vertCRS) */ vertCRS?: string; @@ -3501,94 +3646,94 @@ declare namespace __esri { interface Mesh extends Geometry { /** * An array of mesh components that can be used to apply materials to different regions of the same mesh. There are three common usage patterns for components. 1. **Specify a material for the whole mesh.** In this case, use a single component with only a material (leaving faces as `null`). 2. **Reuse vertex attributes.** When modeling continuous surfaces, it can be convenient to only specify vertices once and then simply refer to them. In this case, use a single component with faces set to index the vertex attributes that form triangles. 3. **Specify multiple materials for the same mesh.** In this case, use multiple components with faces that determine to which region of the mesh the material of the component applies. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#components) */ components: MeshComponent[]; /** * For Mesh, the type is always `mesh`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#type) */ readonly type: "mesh"; /** * Object describing the attributes of each vertex of the mesh. Vertex attributes are flat numerical arrays that describe the position (mandatory), normal (used for lighting calculations and shading) and uv (used for mapping material images to the mesh surface) for each vertex. Vertex attributes can be addressed by indices specified in the components [faces](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#faces) property. If the mesh does not contain any components, or if a component does not specify any faces, then the vertex attributes are interpreted as if each consecutive vertex triple makes up a triangle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ vertexAttributes: MeshVertexAttributes; /** * Adds a component to the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#addComponent) - * + * * @param component The component to add. - * + * */ addComponent(component: MeshComponent): void; /** * Centers the mesh at the specified location without changing its scale. The mesh will be modified in place. To modify a copy of the mesh instead, use [clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#clone) before calling [centerAt()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#centerAt). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#centerAt) - * + * * @param location The location at which to center the mesh. * @param params Additional parameters. * @param params.geographic Indicates whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the offset applied to center the mesh is applied in a Cartesian system with respect to the local coordinate system on the globe and is specified in meters. * @param params.origin The origin at which to center. If not specified, the mesh will be centered at the mesh extent center. - * + * */ centerAt(location: Point, params?: MeshCenterAtParams): Mesh; /** * Creates a deep clone of the Mesh object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#clone) - * - * + * + * */ clone(): Mesh; /** * Offsets the mesh geometry by the specified distance in x, y, and z. The units of x, y, and z are the units of the spatial reference. When the offset is applied geographically (default for either WGS84 or WebMercator), then the offsets are interpreted in meters. The mesh will be modified in place. To modify a copy of the mesh instead, use [clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#clone) before calling [offset()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#offset). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#offset) - * + * * @param dx The amount to offset the geometry in the x direction. * @param dy The amount to offset the geometry in the y direction. * @param dz The amount to offset the geometry in the z direction. * @param params Additional parameters. * @param params.geographic Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the offset is applied in a Cartesian system with respect to the local coordinate system on the globe and is specified in meters. - * + * */ offset(dx: number, dy: number, dz: number, params?: MeshOffsetParams): Mesh; /** * Removes a component from the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#removeComponent) - * + * * @param component The component to remove. - * + * */ removeComponent(component: MeshComponent): void; /** * Rotates the mesh geometry around its x, y and z axis (in that order). For each rotation angle, the rotation direction is clockwise when looking in the direction of the respective axis. The mesh will be modified in place. To modify a copy of the mesh instead, use [clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#clone) before calling [rotate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#rotate). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#rotate) - * + * * @param angleX The angle by which to rotate around the x-axis (in degrees). * @param angleY The angle by which to rotate around the y-axis (in degrees). * @param angleZ The angle by which to rotate around the z-axis (in degrees). * @param params Additional parameters. * @param params.geographic Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the rotation is applied in a Cartesian system with respect to the local coordinate system on the globe and is specified in meters. * @param params.origin The origin around which to rotate. If not specified, the mesh will be rotated around the mesh extent center. - * + * */ rotate(angleX: number, angleY: number, angleZ: number, params?: MeshRotateParams): Mesh; /** * Notifies that any cached values that depend on vertex attributes need to be recalculated. Use this method after modifying the vertex attributes in place so that values that depend on them (such as the calculation of the extent) are recalculated accordingly. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributesChanged) - * - * + * + * */ vertexAttributesChanged(): void; } @@ -3596,78 +3741,77 @@ declare namespace __esri { interface MeshConstructor { /** * A mesh is a general, client-side 3D [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) type composed of [vertices with attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes). The vertices include geographic position, normals that affect lighting/shading and uv coordinates that can be used to map images to the mesh. Vertices are combined into 3D primitives to render the mesh in the scene (only triangle primitives are currently supported). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html) */ - new(properties?: MeshProperties): Mesh; - + new (properties?: MeshProperties): Mesh; /** * Creates a mesh representing a box. The spatial reference of the resulting mesh is the same as the location where it is placed. **Box UV coordinate space** The box geometry will have UV coordinates generated according to the following scheme: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) - * + * * @param location The location bottom center of the box. * @param params Additional parameters. * @param params.size A uniform size value or an object containing individual values width, height and depth. The unit of the size values is derived from the spatial reference of the provided location. * @param params.geographic Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. * @param params.material The material to be used for the mesh. * @param params.imageFace The face for generating image uv coordinates. By default, a single set of unwrapped UV coordinates are generated for all the faces. By setting the `imageFace` parameter to one of `east`, `west`, `north`, `south`, `up` or `down`, the specified face will have full sized UV coordinates while the other faces will pertain their regular unwrapped UV coordinates. This is useful for applying an image only to a single face of the box. The provided `material` parameter will be applied to the specified `imageFace`. The resulting mesh will have two components, the first contains the selected image face and the second contains the other faces of the box. - * + * */ createBox(location: Point, params?: MeshCreateBoxParams): Mesh; /** * Creates a mesh representing a cylinder. The spatial reference of the resulting mesh is the same as the location where it is placed. **Cylinder UV coordinate space** The cylinder geometry will have UV coordinates generated according to the following scheme (example is shown for 8 vertices cylinder): - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) - * + * * @param location The location of the bottom center of the cylinder. * @param params Additional parameters. * @param params.size A uniform size value or an object containing individual values width, height and depth. The unit of the size values is derived from the spatial reference of the provided location. * @param params.geographic Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. * @param params.densificationFactor The additional number of subdivisions for generating the mesh representing a cylinder. A densificationFactor parameter of 0 will generate a default of 16 vertices to approximate the cylinder. A densificationFactor of 1 will generate 32 vertices, etc. The larger the densificationFactor, the better the mesh will approximate a perfect cylinder (at the cost of processing and rendering performance). * @param params.material The material to be used for the mesh. - * + * */ createCylinder(location: Point, params?: MeshCreateCylinderParams): Mesh; /** * Creates a new mesh geometry from a polygon geometry. The resulting mesh contains only a position vertex attribute and a single component with faces. The default shading will be set to `flat`. The spatial reference of the resulting mesh is the same as the input polygon. The resulting mesh will not contain any uv nor normal vertex attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createFromPolygon) - * + * * @param polygon The input polygon. * @param params Optional parameters. * @param params.material The material to be used for the mesh. - * + * */ createFromPolygon(polygon: Polygon, params?: MeshCreateFromPolygonParams): Mesh; /** * Creates a mesh representing a plane. The spatial reference of the resulting mesh is the same as the location where it is placed. A plane consists of two triangles and may be conveniently oriented at creation time. **Plane UV coordinate space** The plane geometry will have UV coordinates generated according to the following scheme: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) - * + * * @param location The location of the bottom center of the plane. * @param params Additional parameters. * @param params.size A uniform size value or an object containing individual values width and height. The unit of the size values is derived from the spatial reference of the provided location. * @param params.facing Direction the plane is facing. Possible values are `east`, `west`, `north`, `south`, `up` and `down`. Defaults to `up`, * @param params.geographic Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. * @param params.material The material to be used for the mesh. - * + * */ createPlane(location: Point, params?: MeshCreatePlaneParams): Mesh; /** * Creates a mesh representing a sphere. The spatial reference of the resulting mesh is the same as the location where it is placed. **Sphere UV coordinate space** The sphere geometry will have UV coordinates generated according to the following scheme (example is shown for 8x8 vertices sphere): - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) - * + * * @param location The location of the bottom center of the sphere. * @param params Additional parameters. * @param params.size A uniform size value or an object containing individual values width, height and depth. The unit of the size values is derived from the spatial reference of the provided location. * @param params.geographic Indicates whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. * @param params.densificationFactor The additional number of subdivisions for generating the mesh representing a sphere. A densificationFactor parameter of 0 will generate a default of 16-by-16 vertices to approximate the sphere. A densificationFactor of 1 will generate 32-by-32 vertices, etc. The larger the densificationFactor, the better the mesh will approximate a perfect sphere (at the cost of processing and rendering performance). * @param params.material The material to be used for the mesh. - * + * */ createSphere(location: Point, params?: MeshCreateSphereParams): Mesh; @@ -3679,337 +3823,319 @@ declare namespace __esri { interface MeshProperties extends GeometryProperties { /** * An array of mesh components that can be used to apply materials to different regions of the same mesh. There are three common usage patterns for components. 1. **Specify a material for the whole mesh.** In this case, use a single component with only a material (leaving faces as `null`). 2. **Reuse vertex attributes.** When modeling continuous surfaces, it can be convenient to only specify vertices once and then simply refer to them. In this case, use a single component with faces set to index the vertex attributes that form triangles. 3. **Specify multiple materials for the same mesh.** In this case, use multiple components with faces that determine to which region of the mesh the material of the component applies. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#components) */ components?: MeshComponentProperties[]; /** * Object describing the attributes of each vertex of the mesh. Vertex attributes are flat numerical arrays that describe the position (mandatory), normal (used for lighting calculations and shading) and uv (used for mapping material images to the mesh surface) for each vertex. Vertex attributes can be addressed by indices specified in the components [faces](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#faces) property. If the mesh does not contain any components, or if a component does not specify any faces, then the vertex attributes are interpreted as if each consecutive vertex triple makes up a triangle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ vertexAttributes?: MeshVertexAttributesProperties; } - export interface MeshCenterAtParams extends Object { /** * Indicates whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the offset applied to center the mesh is applied in a Cartesian system with respect to the local coordinate system on the globe and is specified in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#centerAt) */ geographic?: boolean; /** * The origin at which to center. If not specified, the mesh will be centered at the mesh extent center. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#centerAt) */ origin?: Point; } - export interface MeshCreateBoxParams extends Object { /** * A uniform size value or an object containing individual values width, height and depth. The unit of the size values is derived from the spatial reference of the provided location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ size?: number | MeshCreateBoxParamsSize; /** * Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ geographic?: boolean; /** * The material to be used for the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ material?: MeshCreateBoxParamsMaterial; /** * The face for generating image uv coordinates. By default, a single set of unwrapped UV coordinates are generated for all the faces. By setting the `imageFace` parameter to one of `east`, `west`, `north`, `south`, `up` or `down`, the specified face will have full sized UV coordinates while the other faces will pertain their regular unwrapped UV coordinates. This is useful for applying an image only to a single face of the box. The provided `material` parameter will be applied to the specified `imageFace`. The resulting mesh will have two components, the first contains the selected image face and the second contains the other faces of the box. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ imageFace?: string; } - export interface MeshCreateBoxParamsMaterial extends Object { /** * The material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ color?: ValueMeshColor | ImageMeshColor | string | HTMLImageElement | HTMLCanvasElement | number[]; } - export interface MeshCreateBoxParamsSize extends Object { /** * The width of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ width?: number; /** * The depth of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ depth?: number; /** * The height of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createBox) */ height?: number; } - export interface MeshCreateCylinderParams extends Object { /** * A uniform size value or an object containing individual values width, height and depth. The unit of the size values is derived from the spatial reference of the provided location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ size?: number | MeshCreateCylinderParamsSize; /** * Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ geographic?: boolean; /** * The additional number of subdivisions for generating the mesh representing a cylinder. A densificationFactor parameter of 0 will generate a default of 16 vertices to approximate the cylinder. A densificationFactor of 1 will generate 32 vertices, etc. The larger the densificationFactor, the better the mesh will approximate a perfect cylinder (at the cost of processing and rendering performance). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ densificationFactor?: number; /** * The material to be used for the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ material?: MeshCreateCylinderParamsMaterial; } - export interface MeshCreateCylinderParamsMaterial extends Object { /** * The material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ color: ValueMeshColor | ImageMeshColor | string | HTMLImageElement | HTMLCanvasElement | number[]; } - export interface MeshCreateCylinderParamsSize extends Object { /** * The width of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ width?: number; /** * The depth of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ depth?: number; /** * The height of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createCylinder) */ height?: number; } - export interface MeshCreateFromPolygonParams extends Object { /** * The material to be used for the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createFromPolygon) */ material?: MeshCreateFromPolygonParamsMaterial; } - export interface MeshCreateFromPolygonParamsMaterial extends Object { /** * The material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createFromPolygon) */ color?: ValueMeshColor | ImageMeshColor | string | HTMLImageElement | HTMLCanvasElement | number[]; } - export interface MeshCreatePlaneParams extends Object { /** * A uniform size value or an object containing individual values width and height. The unit of the size values is derived from the spatial reference of the provided location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ size?: number | MeshCreatePlaneParamsSize; /** * Direction the plane is facing. Possible values are `east`, `west`, `north`, `south`, `up` and `down`. Defaults to `up`, - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ facing?: string; /** * Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ geographic?: boolean; /** * The material to be used for the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ material?: MeshCreatePlaneParamsMaterial; } - export interface MeshCreatePlaneParamsMaterial extends Object { /** * The material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ color?: ValueMeshColor | ImageMeshColor | string | HTMLImageElement | HTMLCanvasElement | number[]; } - export interface MeshCreatePlaneParamsSize extends Object { /** * The width of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ width?: number; /** * The height of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createPlane) */ height?: number; } - export interface MeshCreateSphereParams extends Object { /** * A uniform size value or an object containing individual values width, height and depth. The unit of the size values is derived from the spatial reference of the provided location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ size?: number | MeshCreateSphereParamsSize; /** * Indicates whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the mesh is created in a Cartesian system with respect to the local coordinate system on the globe and sizes are specified in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ geographic?: boolean; /** * The additional number of subdivisions for generating the mesh representing a sphere. A densificationFactor parameter of 0 will generate a default of 16-by-16 vertices to approximate the sphere. A densificationFactor of 1 will generate 32-by-32 vertices, etc. The larger the densificationFactor, the better the mesh will approximate a perfect sphere (at the cost of processing and rendering performance). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ densificationFactor?: number; /** * The material to be used for the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ material?: MeshCreateSphereParamsMaterial; } - export interface MeshCreateSphereParamsMaterial extends Object { /** * The material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ color?: ValueMeshColor | ImageMeshColor | string | HTMLImageElement | HTMLCanvasElement | number[]; } - export interface MeshCreateSphereParamsSize extends Object { /** * The width of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ width?: number; /** * The depth of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ depth?: number; /** * The height of the created mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#createSphere) */ height?: number; } - export interface MeshOffsetParams extends Object { /** * Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the offset is applied in a Cartesian system with respect to the local coordinate system on the globe and is specified in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#offset) */ geographic?: boolean; } - export interface MeshRotateParams extends Object { /** * Whether to georeference relative to the globe or the projected coordinate system (PCS). This parameter is only relevant for spatial references that can be used in both local and global viewing modes (currently only WebMercator). This parameter defaults to `true` for WebMercator and WGS84, and `false` for any other PCS. When true, the rotation is applied in a Cartesian system with respect to the local coordinate system on the globe and is specified in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#rotate) */ geographic?: boolean; /** * The origin around which to rotate. If not specified, the mesh will be rotated around the mesh extent center. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#rotate) */ origin?: Point; } - export interface MeshVertexAttributesProperties extends Object { /** * A flat array of vertex positions. Vertex positions have x, y and z coordinates and they should be in the spatial reference system of the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ position?: Float64Array | number[] | Float32Array; /** * A flat array of vertex uv coordinates (2 elements per vertex). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ uv?: Float32Array | number[] | Float64Array; /** * A flat array of the vertex normals (3 elements per vertex ranging from -1 to 1). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ normal?: Float32Array | number[] | Float64Array; /** * **Since: 4.9** A flat array of the vertex colors (4 elements per vertex ranging from 0 to 255). Vertex colors are multiplied by the component material color (if any is defined). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ color?: Uint8Array | number[] | Uint8ClampedArray; @@ -4018,25 +4144,25 @@ declare namespace __esri { export interface MeshVertexAttributes extends AnonymousAccessor { /** * A flat array of vertex positions. Vertex positions have x, y and z coordinates and they should be in the spatial reference system of the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ position: Float64Array; /** * A flat array of vertex uv coordinates (2 elements per vertex). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ uv?: Float32Array; /** * A flat array of the vertex normals (3 elements per vertex ranging from -1 to 1). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ normal?: Float32Array; /** * **Since: 4.9** A flat array of the vertex colors (4 elements per vertex ranging from 0 to 255). Vertex colors are multiplied by the component material color (if any is defined). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) */ color?: Uint8Array; @@ -4045,68 +4171,66 @@ declare namespace __esri { interface Multipoint extends Geometry { /** * An array of points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#points) */ points: number[][]; /** * For Multipoint, the type is always `multipoint`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#type) */ readonly type: "multipoint"; /** * Adds a point to the Multipoint. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#addPoint) - * + * * @param point The point to add to the multipoint. The point can either be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or an array of numbers representing XY coordinates. - * + * */ addPoint(point: Point | number[]): Multipoint; /** * Creates a deep clone of Multipoint object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#clone) - * - * + * + * */ clone(): Multipoint; /** * Returns the point at the specified index. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#getPoint) - * + * * @param index The index of the point in the [points](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#points) property. - * + * */ getPoint(index: number): Point; /** * Removes a point from the Multipoint. The index specifies which point to remove. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#removePoint) - * + * * @param index The index of the point to remove. - * + * */ removePoint(index: number): Point; /** * Updates the point at the specified index. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#setPoint) - * + * * @param index The index of the point in the [points](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#points) property. * @param point Point geometry that specifies the new location. - * + * */ setPoint(index: number, point: Point): Multipoint; } interface MultipointConstructor { - - - new(properties?: MultipointProperties): Multipoint; + new (properties?: MultipointProperties): Multipoint; fromJSON(json: any): Multipoint; } @@ -4116,7 +4240,7 @@ declare namespace __esri { interface MultipointProperties extends GeometryProperties { /** * An array of points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html#points) */ points?: number[][]; @@ -4125,97 +4249,97 @@ declare namespace __esri { interface Point extends Geometry { /** * The latitude of the point if the spatial reference is Web Mercator (wkid: 3857) or WGS84 (wkid: 4326). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#latitude) */ latitude: number; /** * The longitude of the point if the spatial reference is Web Mercator (wkid: 3857) or WGS84 (wkid: 4326). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#longitude) */ longitude: number; /** * The m-coordinate of the point in map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#m) - * + * * @default undefined */ m: number; /** * For Point, the type is always `point`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#type) */ readonly type: "point"; /** * The x-coordinate (easting) of the point in map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#x) - * + * * @default 0 */ x: number; /** * The y-coordinate (northing) of the point in map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#y) - * + * * @default 0 */ y: number; /** - * The z-coordinate (or elevation) of the point in map units. + * The z-coordinate (or elevation) of the point in map units. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#z) - * + * * @default undefined */ z: number; /** * Creates a deep clone of Point object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone) - * - * + * + * */ clone(): Point; /** * Copies all values from another Point instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#copy) - * + * * @param other The point to copy from. - * + * */ copy(other: Point): void; /** * Computes the Euclidean distance between this Point and a given Point. Points must have the same spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#distance) - * + * * @param other The point to compute the distance to. - * + * */ distance(other: Point): number; /** * Determines if the input point is equal to the point calling the function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#equals) - * + * * @param point The input point to test. - * + * */ equals(point: Point): boolean; /** * Modifies the point geometry in-place by shifting the X-coordinate to within +/- 180 span in map units. You should [clone](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone) the point object before calling this method where appropriate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#normalize) - * - * + * + * */ normalize(): Point; } @@ -4223,11 +4347,11 @@ declare namespace __esri { interface PointConstructor { /** * A location defined by X, Y, and Z coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) */ - new(properties?: PointProperties): Point; + new (properties?: PointProperties): Point; fromJSON(json: any): Point; } @@ -4237,46 +4361,46 @@ declare namespace __esri { interface PointProperties extends GeometryProperties { /** * The latitude of the point if the spatial reference is Web Mercator (wkid: 3857) or WGS84 (wkid: 4326). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#latitude) */ latitude?: number; /** * The longitude of the point if the spatial reference is Web Mercator (wkid: 3857) or WGS84 (wkid: 4326). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#longitude) */ longitude?: number; /** * The m-coordinate of the point in map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#m) - * + * * @default undefined */ m?: number; /** * The x-coordinate (easting) of the point in map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#x) - * + * * @default 0 */ x?: number; /** * The y-coordinate (northing) of the point in map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#y) - * + * * @default 0 */ y?: number; /** - * The z-coordinate (or elevation) of the point in map units. + * The z-coordinate (or elevation) of the point in map units. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#z) - * + * * @default undefined */ z?: number; @@ -4285,121 +4409,121 @@ declare namespace __esri { interface Polygon extends Geometry { /** * The centroid of the polygon. For a polygon with multiple rings, it represents the centroid of the largest ring. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#centroid) */ centroid: Point; /** * Checks to see if polygon rings cross each other and indicates if the polygon is self-intersecting, which means the ring of the polygon crosses itself. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#isSelfIntersecting) */ isSelfIntersecting: boolean; /** * An array of rings. Each ring is a two-dimensional array of numbers representing the coordinates of each vertex in the ring in the spatial reference of the view. The first vertex of each ring should always be the same as the last vertex. Each vertex is an array of two, three, or four numbers. The table below shows the various structures of a vertex array. - * + * * Case | Vertex array * --- | --- * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM)| [x, y] * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, m] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, z] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, z, m] - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings) */ rings: number[][][]; /** * For Polygon, the type is always `polygon`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#type) */ readonly type: "polygon"; /** * Adds a ring to the Polygon. The ring can be one of the following: an array of numbers or an array of points. When added the index of the ring is incremented by one. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#addRing) - * + * * @param points A polygon ring. The first and last coordinates/points in the ring must be the same. This can either be defined as an array of Point geometries or an array of XY coordinates. - * + * */ addRing(points: Point[] | number[][]): Polygon; /** * Creates a deep clone of Polygon object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#clone) - * - * + * + * */ clone(): Polygon; /** * Checks on the client if the input point is inside the polygon. A point on the polygon line is considered inside. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#contains) - * + * * @param point The point to test whether it is contained within the testing polygon. - * + * */ contains(point: Point): boolean; /** * Returns a point specified by a ring and point in the path. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#getPoint) - * + * * @param ringIndex The index of the ring containing the desired point. * @param pointIndex The index of the desired point within the ring. - * + * */ getPoint(ringIndex: number, pointIndex: number): Point; /** * Inserts a new point into the polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#insertPoint) - * + * * @param ringIndex The index of the ring in which to insert the point. * @param pointIndex The index of the point to insert within the ring. * @param point The point to insert. - * + * */ insertPoint(ringIndex: number, pointIndex: number, point: Point | number[]): Polygon; /** * Checks if a Polygon ring is clockwise. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#isClockwise) - * + * * @param ring A polygon ring. The first and last coordinates/points in the ring must be the same. This can either be defined as an array of Point geometries or an array of XY coordinates. - * + * */ isClockwise(ring: Point[] | number[][]): boolean; /** * Removes a point from the polygon at the given `pointIndex` within the ring identified by `ringIndex`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#removePoint) - * + * * @param ringIndex The index of the ring containing the point to remove. * @param pointIndex The index of the point to remove within the ring. - * + * */ removePoint(ringIndex: number, pointIndex: number): Point[]; /** * Removes a ring from the Polygon. The index specifies which ring to remove. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#removeRing) - * + * * @param index The index of the ring to remove. - * + * */ removeRing(index: number): Point[]; /** * Updates a point in the polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#setPoint) - * + * * @param ringIndex The index of the ring containing the point to update. * @param pointIndex The index of the point to update within the ring. * @param point The new point geometry. - * + * */ setPoint(ringIndex: number, pointIndex: number, point: Point | number[]): Polygon; } @@ -4407,20 +4531,19 @@ declare namespace __esri { interface PolygonConstructor { /** * A polygon contains an array of [rings](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings) and a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#spatialReference). Each ring is represented as an array points. The first and last points of a ring must be the same. A polygon also has boolean-valued [hasM](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) and [hasZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) */ - new(properties?: PolygonProperties): Polygon; - + new (properties?: PolygonProperties): Polygon; /** * Converts the given Extent to a Polygon instance. This is useful for scenarios in which you would like to display an area of interest, which is typically defined by an Extent or bounding box, as a polygon with a fill symbol in the view. Some geoprocessing tools require input geometries to be of a Polygon type and not an Extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#fromExtent) - * + * * @param extent An extent object to convert to a polygon. - * + * */ fromExtent(extent: Extent): Polygon; @@ -4432,27 +4555,27 @@ declare namespace __esri { interface PolygonProperties extends GeometryProperties { /** * The centroid of the polygon. For a polygon with multiple rings, it represents the centroid of the largest ring. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#centroid) */ centroid?: PointProperties; /** * Checks to see if polygon rings cross each other and indicates if the polygon is self-intersecting, which means the ring of the polygon crosses itself. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#isSelfIntersecting) */ isSelfIntersecting?: boolean; /** * An array of rings. Each ring is a two-dimensional array of numbers representing the coordinates of each vertex in the ring in the spatial reference of the view. The first vertex of each ring should always be the same as the last vertex. Each vertex is an array of two, three, or four numbers. The table below shows the various structures of a vertex array. - * + * * Case | Vertex array * --- | --- * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM)| [x, y] * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, m] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, z] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#hasM) | [x, y, z, m] - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#rings) */ rings?: number[][][]; @@ -4461,99 +4584,97 @@ declare namespace __esri { interface Polyline extends Geometry { /** * An array of paths, or line segments, that make up the polyline. Each path is a two-dimensional array of numbers representing the coordinates of each vertex in the path in the spatial reference of the view. Each vertex is represented as an array of two, three, or four numbers. The table below shows the various structures of a vertex array. - * + * * Case | Vertex array * --- | --- * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y] * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, m] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, z] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, z, m] - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#paths) */ paths: number[][][]; /** * For Polyline, the type is always `polyline`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#type) */ readonly type: "polyline"; /** * Adds a path, or line segment, to the polyline. When added, the index of the path is incremented by one. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#addPath) - * + * * @param points A polyline path. This can either be defined as an array of Point geometries or an array of XY coordinates. - * + * */ addPath(points: Point[] | number[][]): Polyline; /** * Creates a deep clone of Polyline object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#clone) - * - * + * + * */ clone(): Polyline; /** * Returns a point specified by a path and point in the path. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#getPoint) - * + * * @param pathIndex The index of a path in the polyline. * @param pointIndex The index of a point in a path. - * + * */ getPoint(pathIndex: number, pointIndex: number): Point; /** * Inserts a new point into a polyline. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#insertPoint) - * + * * @param pathIndex The index of the path in which to insert a point. * @param pointIndex The index of the inserted point in the path. * @param point The point to insert. - * + * */ insertPoint(pathIndex: number, pointIndex: number, point: Point | number[]): Polyline; /** * Removes a path from the Polyline. The index specifies which path to remove. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#removePath) - * + * * @param index The index of the path to remove from the polyline. - * + * */ removePath(index: number): Point[]; /** * Removes a point from the polyline at the given `pointIndex` within the path identified by the given `pathIndex`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#removePoint) - * + * * @param pathIndex The index of the path containing the point to be removed. * @param pointIndex The index of the point to be removed within the path. - * + * */ removePoint(pathIndex: number, pointIndex: number): Point; /** * Updates a point in a polyline. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#setPoint) - * + * * @param pathIndex The index of the path that contains the point to be updated. * @param pointIndex The index of the point to be updated in the path. * @param point Point geometry to update in the path. - * + * */ setPoint(pathIndex: number, pointIndex: number, point: Point | number[]): Polyline; } interface PolylineConstructor { - - - new(properties?: PolylineProperties): Polyline; + new (properties?: PolylineProperties): Polyline; fromJSON(json: any): Polyline; } @@ -4563,15 +4684,15 @@ declare namespace __esri { interface PolylineProperties extends GeometryProperties { /** * An array of paths, or line segments, that make up the polyline. Each path is a two-dimensional array of numbers representing the coordinates of each vertex in the path in the spatial reference of the view. Each vertex is represented as an array of two, three, or four numbers. The table below shows the various structures of a vertex array. - * + * * Case | Vertex array * --- | --- * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y] * [without z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, m] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [without m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, z] * [with z](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasZ) and [with m](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#hasM) | [x, y, z, m] - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html#paths) */ paths?: number[][][]; @@ -4579,74 +4700,86 @@ declare namespace __esri { /** * A client-side projection engine for converting geometries from one [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) to another. When projecting geometries the starting spatial reference must be specified on the input geometry. You can specify a specific geographic (datum) transformation for the [project](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#project) operation, or accept the default transformation if one is needed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) */ interface projection { /** - * Returns the default geographic transformation used to convert the geometry from the input spatial reference to the output spatial reference. The default transformation is used when [projecting geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#project) where the datum transformation is required but not specified in the `geographicTransformation` parameter. - * > **Known Limitations** + * Returns the default geographic transformation used to convert the geometry from the input spatial reference to the output spatial reference. The default transformation is used when [projecting geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#project) where the datum transformation is required but not specified in the `geographicTransformation` parameter. + * > **Known Limitations** * * This method returns equation-based geographic transformations only. * * Geographic transformations are returned with their maximum number of [steps](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformation.html#steps). Currently, number of steps is limited to 2. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#getTransformation) - * + * * @param inSpatialReference The input spatial reference from which to project geometries. This is the spatial reference of the input geometries. * @param outSpatialReference The spatial reference to which you are converting the geometries. * @param extent An extent used to determine the suitability of the returned transformation. The extent will be re-projected to the `inSpatialReference` if it has a different spatial reference. - * + * */ - getTransformation(inSpatialReference: SpatialReference | SpatialReferenceProperties, outSpatialReference: SpatialReference | SpatialReferenceProperties, extent?: Extent): GeographicTransformation; + getTransformation( + inSpatialReference: SpatialReference | SpatialReferenceProperties, + outSpatialReference: SpatialReference | SpatialReferenceProperties, + extent?: Extent + ): GeographicTransformation; /** - * Returns a list of all geographic transformations suitable to convert geometries from the input spatial reference to the specified output spatial reference. The list is ordered in descending order by suitability, with the most suitable being first in the list. - * > **Known Limitations** + * Returns a list of all geographic transformations suitable to convert geometries from the input spatial reference to the specified output spatial reference. The list is ordered in descending order by suitability, with the most suitable being first in the list. + * > **Known Limitations** * * This method returns all the suitable equation-based geographic transformations. * * Geographic transformations are returned with their maximum number of [steps](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformation.html#steps). Currently, number of steps is limited to 2. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#getTransformations) - * + * * @param inSpatialReference The spatial reference that the geometries are currently using. * @param outSpatialReference The spatial reference to which you are converting the geometries to. * @param extent An extent used to determine the suitability of the returned transformations. The extent will be re-projected to the input spatial reference if necessary. - * + * */ - getTransformations(inSpatialReference: SpatialReference | SpatialReferenceProperties, outSpatialReference: SpatialReference | SpatialReferenceProperties, extent?: Extent): GeographicTransformation[]; + getTransformations( + inSpatialReference: SpatialReference | SpatialReferenceProperties, + outSpatialReference: SpatialReference | SpatialReferenceProperties, + extent?: Extent + ): GeographicTransformation[]; /** * Indicates if all dependencies of this module have been loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#isLoaded) - * - * + * + * */ isLoaded(): boolean; /** * Indicates if this module is supported in the browser. The browser must support [WebAssembly](https://caniuse.com/#feat=wasm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#isSupported) - * - * + * + * */ isSupported(): boolean; /** * Loads this module's dependencies. This method must be called before [projecting](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#project) geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#load) - * - * + * + * */ load(): IPromise; /** - * Projects a geometry or an array of geometries to the specified output spatial reference. A default geographic transformation is used if not explicitly provided, but required. Use the [getTransformation()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#getTransformation) method to find out which transformation is used by default for the given input and output spatial references. Note that you must [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#load) this module before attempting to project geometries. + * Projects a geometry or an array of geometries to the specified output spatial reference. A default geographic transformation is used if not explicitly provided, but required. Use the [getTransformation()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#getTransformation) method to find out which transformation is used by default for the given input and output spatial references. Note that you must [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#load) this module before attempting to project geometries. * > **Known Limitations** This method uses the spatial reference of the first geometry as an input spatial reference. Therefore all geometries in the array must have the same spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#project) - * + * * @param geometry The geometry or geometries to project. * @param outSpatialReference The spatial reference to which you are converting the geometries' coordinates. * @param geographicTransformation The geographic transformation used to transform the geometries. Specify this parameter to project a geometry when the default transformation is not appropriate for your requirements. - * + * */ - project(geometry: Geometry | Geometry[], outSpatialReference: SpatialReference | SpatialReferenceProperties, geographicTransformation?: GeographicTransformation): Geometry | Geometry[]; + project( + geometry: Geometry | Geometry[], + outSpatialReference: SpatialReference | SpatialReferenceProperties, + geographicTransformation?: GeographicTransformation + ): Geometry | Geometry[]; } export const projection: projection; @@ -4654,35 +4787,33 @@ declare namespace __esri { interface ScreenPoint extends Accessor { /** * X-coordinate in pixels relative to the top-left corner of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html#x) - * + * * @default 0 */ x: number; /** * Y-coordinate in pixels relative to the top-left corner of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html#y) - * + * * @default 0 */ y: number; /** * Creates a deep clone of ScreenPoint object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html#clone) - * - * + * + * */ clone(): ScreenPoint; } interface ScreenPointConstructor { - - - new(properties?: ScreenPointProperties): ScreenPoint; + new (properties?: ScreenPointProperties): ScreenPoint; } export const ScreenPoint: ScreenPointConstructor; @@ -4690,17 +4821,17 @@ declare namespace __esri { interface ScreenPointProperties { /** * X-coordinate in pixels relative to the top-left corner of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html#x) - * + * * @default 0 */ x?: number; /** * Y-coordinate in pixels relative to the top-left corner of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html#y) - * + * * @default 0 */ y?: number; @@ -4709,75 +4840,72 @@ declare namespace __esri { interface SpatialReference extends Accessor, JSONSupport { /** * Indicates if the spatial reference refers to a geographic coordinate system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isGeographic) */ readonly isGeographic: boolean; /** * Indicates if the [wkid](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) of the spatial reference object is one of the following values: `102113`, `102100`, `3857`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWebMercator) */ readonly isWebMercator: boolean; /** * Indicates if the [wkid](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) of the spatial reference object is `4326`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWGS84) */ readonly isWGS84: boolean; /** * Indicates if the spatial reference of the map supports wrapping around the International Date Line. Value is `true` if the spatial reference is Web Mercator or WGS84. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#isWrappable) */ readonly isWrappable: boolean; /** * The well-known ID of a spatial reference. See [Projected Coordinate Systems](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) and [Geographic Coordinate Systems](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) for the list of supported spatial references. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) */ wkid: number; /** * The well-known text that defines a spatial reference. Many browsers have a limit to the length of a GET request of approximately 2048 characters. When using well-known text to specify the spatial reference you can easily exceed this limit. In these cases, you will need to setup and use a proxy page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkt) */ wkt: string; /** * Returns a deep clone of the spatial reference object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#clone) - * - * + * + * */ clone(): SpatialReference; /** * Checks if the specified spatial reference object has the same [wkid](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) or [wkt](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkt) as this spatial reference object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#equals) - * + * * @param spatialReference The spatial reference to compare to. - * + * */ equals(spatialReference: SpatialReference): boolean; } interface SpatialReferenceConstructor { - - - new(properties?: SpatialReferenceProperties): SpatialReference; - + new (properties?: SpatialReferenceProperties): SpatialReference; /** * A convenience spatial reference instance for Web Mercator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#WebMercator) */ WebMercator: SpatialReference; /** * A convenience spatial reference instance for WGS84. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#WGS84) */ WGS84: SpatialReference; @@ -4790,13 +4918,13 @@ declare namespace __esri { interface SpatialReferenceProperties { /** * The well-known ID of a spatial reference. See [Projected Coordinate Systems](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) and [Geographic Coordinate Systems](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) for the list of supported spatial references. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) */ wkid?: number; /** * The well-known text that defines a spatial reference. Many browsers have a limit to the length of a GET request of approximately 2048 characters. When using well-known text to specify the spatial reference you can easily exceed this limit. In these cases, you will need to setup and use a proxy page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkt) */ wkt?: string; @@ -4805,17 +4933,17 @@ declare namespace __esri { interface GeographicTransformation { /** * Geographic transformation steps. Each step represents a geographic transformation that will be used in the process of transforming coordinates from one geographic coordinate system to another. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformation.html#steps) */ steps: GeographicTransformationStep[]; /** * Returns the inverse of the geographic transformation calling this method or `null` if the transformation is not invertible. The inverse of a transformation converts coordinates using the same method and parameters, but in the opposite direction of the original object. For example if the original object represents the `NAD_1983_HARN_To_NAD_1983_NSRS2007_1` transformation, then the inverse will transform from `NAD 83 (NSRS 2007)` to `NAD 83 (HARN)`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformation.html#getInverse) - * - * + * + * */ getInverse(): GeographicTransformation; } @@ -4823,12 +4951,11 @@ declare namespace __esri { interface GeographicTransformationConstructor { /** * Projecting your data between coordinate systems sometimes requires transforming between geographic coordinate systems. Geographic transformations are used to transform coordinates between spatial references that have different geographic coordinate systems, and thus different datums. Using the most suitable transformation ensures the best possible accuracy when converting geometries from one spatial reference to another. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformation.html) */ - - new(properties?: any): GeographicTransformation; + new (properties?: any): GeographicTransformation; } export const GeographicTransformation: GeographicTransformationConstructor; @@ -4836,40 +4963,37 @@ declare namespace __esri { interface GeographicTransformationStep { /** * Indicates with the geographic transformation is inverted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformationStep.html#isInverse) - * + * * @default false */ isInverse: boolean; /** * The well-known id (wkid) hat represents a known geographic transformation. See [Geographic datum transformations](https://developers.arcgis.com/java/10-2/guide/datum-transformations.htm#ESRI_SECTION1_7635FE2A60E6449898D5AD0ADE2CA0C3) for the list of supported equation-based geographic transformations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformationStep.html#wkid) */ wkid: number; /** * The well-known text (wkt) that represents a known geographic transformation. See [Geographic datum transformations](https://developers.arcgis.com/java/10-2/guide/datum-transformations.htm#ESRI_SECTION1_7635FE2A60E6449898D5AD0ADE2CA0C3) for the list of supported equation-based geographic transformations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformationStep.html#wkt) */ wkt: string; /** * Gets the inverse of the geographic transformation step used to call this method or `null` if the transformation step is not invertible. The inverse of a transformation converts coordinates using the same method and parameters, but in the opposite direction of the original object. For example if the original object represents the `NAD_1983_HARN_To_NAD_1983_NSRS2007_1` transformation, then the inverse will transform from `NAD 83 (NSRS 2007)` to `NAD 83 (HARN)`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-GeographicTransformationStep.html#getInverse) - * - * + * + * */ getInverse(): GeographicTransformationStep; } interface GeographicTransformationStepConstructor { - - - - new(properties?: any): GeographicTransformationStep; + new (properties?: any): GeographicTransformationStep; } export const GeographicTransformationStep: GeographicTransformationStepConstructor; @@ -4877,37 +5001,37 @@ declare namespace __esri { interface ImageMeshColor extends Accessor { /** * A direct reference to the image data. The image data can be an [image element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement), [canvas element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement) or [ImageData](https://developer.mozilla.org/en-US/docs/Web/API/ImageData). The data property is mutually exclusive with the url property, setting the data will clear the url (if there is one). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#data) */ data: HTMLImageElement | HTMLCanvasElement | ImageData; /** * Indicates whether the image data should be interpreted as being semi-transparent. The default value is automatically derived when the data property contains a canvas element or an ImageData object. In all other cases it defaults to `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#transparent) - * + * * @default undefined */ transparent: boolean; /** * For ImageMeshColor the type is always `image`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#type) */ readonly type: "image"; /** * The url to the image resource. This can either be a remote url (absolute or relative) or a data url. The url property is mutually exclusive with the data property, setting the url will clear the data (if there is one). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#url) */ url: string; /** * Creates a deep clone. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#clone) - * - * + * + * */ clone(): ImageMeshColor; } @@ -4915,11 +5039,11 @@ declare namespace __esri { interface ImageMeshColorConstructor { /** * ImageMeshColor is a type of mesh color that represents an image mapped to the mesh by its uv vertex attributes. ImageMeshColor instances can be used with the [MeshComponent.material.color](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) property. Images can be referred to either by url or directly by data ( [image element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement), [canvas element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement) or [ImageData](https://developer.mozilla.org/en-US/docs/Web/API/ImageData)). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html) */ - new(properties?: ImageMeshColorProperties): ImageMeshColor; + new (properties?: ImageMeshColorProperties): ImageMeshColor; } export const ImageMeshColor: ImageMeshColorConstructor; @@ -4927,44 +5051,43 @@ declare namespace __esri { interface ImageMeshColorProperties { /** * A direct reference to the image data. The image data can be an [image element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement), [canvas element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement) or [ImageData](https://developer.mozilla.org/en-US/docs/Web/API/ImageData). The data property is mutually exclusive with the url property, setting the data will clear the url (if there is one). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#data) */ data?: HTMLImageElement | HTMLCanvasElement | ImageData; /** * Indicates whether the image data should be interpreted as being semi-transparent. The default value is automatically derived when the data property contains a canvas element or an ImageData object. In all other cases it defaults to `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#transparent) - * + * * @default undefined */ transparent?: boolean; /** * The url to the image resource. This can either be a remote url (absolute or relative) or a data url. The url property is mutually exclusive with the data property, setting the url will clear the data (if there is one). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html#url) */ url?: string; } - interface jsonUtils { /** * Creates a new instance of an appropriate [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-jsonUtils.html#fromJSON) - * + * * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](https://developers.arcgis.com/documentation/common-data-types/overview-of-common-data-types.htm) for examples of the structure of various input JSON objects. - * + * */ fromJSON(json: any): Geometry; /** * Returns the type for a given geometry in the JSON format used by the ArcGIS platform. This only applies to geometries that can be processed by the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-jsonUtils.html#getJsonType) - * + * * @param geometry The input geometry object. - * + * */ getJsonType(geometry: Geometry): string; } @@ -4974,36 +5097,36 @@ declare namespace __esri { interface MeshComponent extends Accessor { /** * A flat array of indices that refer to vertices in the [vertexAttributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) of the mesh to which the component belongs. Each triple of indices defines a triangle to render (i.e. the faces array must always have a length that is a multiple of 3). Note that the indices refer to **vertices** and not to the index of the first coordinate of a vertex in the [vertexAttributes.position](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) array. If faces is `null`, then all the vertices in the mesh will be rendered as triangles for this component. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#faces) */ faces: Uint32Array; /** * The material determines how the component is visualized. Materials specify a color that may either be a single color value (a [ValueMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html)) or an image ( an [ImageMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html)), which is mapped to the uv coordinate specified for each vertex in the mesh vertex attributes. The material property supports a number of convenience autocast types, including hex color strings and well known color strings (autocasts to [ValueMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html)), or strings representing urls, HTMLImageElements or HTMLCanvasElements (autocasts to [ImageMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html)). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) */ material: MeshComponentMaterial; /** - * Specifies the type of normals used for lighting. This determines whether the object has a smooth or an angular appearance. The following shading types are supported: - * + * Specifies the type of normals used for lighting. This determines whether the object has a smooth or an angular appearance. The following shading types are supported: + * * | Type | Description | * |------|-------------| * | source | Shading uses the normals as defined in the vertex attributes. If no normals are defined, then shading defaults back to `flat` | * | flat | Shading uses normals created per triangle face. This type of shading is good for objects with sharp edges such as boxes. | * | smooth | Shading uses per-vertex normals that average the normals of all the faces a vertex is a part of. This type of shading is good for meshes that approximate curved surfaces such as spheres. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#shading) */ shading: string; /** * Creates a deep clone. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#clone) - * - * + * + * */ clone(): MeshComponent; } @@ -5011,11 +5134,11 @@ declare namespace __esri { interface MeshComponentConstructor { /** * The MeshComponent class is used to apply one or more materials to a single [Mesh](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html). The [faces](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#faces) property is a flat array of indices in the mesh [vertexAttributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) and defines the region of vertices in the mesh on which to apply the material. Each triple of values in the flat array of indices specifies a triangle to be rendered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html) */ - new(properties?: MeshComponentProperties): MeshComponent; + new (properties?: MeshComponentProperties): MeshComponent; } export const MeshComponent: MeshComponentConstructor; @@ -5023,36 +5146,35 @@ declare namespace __esri { interface MeshComponentProperties { /** * A flat array of indices that refer to vertices in the [vertexAttributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) of the mesh to which the component belongs. Each triple of indices defines a triangle to render (i.e. the faces array must always have a length that is a multiple of 3). Note that the indices refer to **vertices** and not to the index of the first coordinate of a vertex in the [vertexAttributes.position](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html#vertexAttributes) array. If faces is `null`, then all the vertices in the mesh will be rendered as triangles for this component. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#faces) */ faces?: Uint32Array | number[] | Uint16Array; /** * The material determines how the component is visualized. Materials specify a color that may either be a single color value (a [ValueMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html)) or an image ( an [ImageMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html)), which is mapped to the uv coordinate specified for each vertex in the mesh vertex attributes. The material property supports a number of convenience autocast types, including hex color strings and well known color strings (autocasts to [ValueMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html)), or strings representing urls, HTMLImageElements or HTMLCanvasElements (autocasts to [ImageMeshColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ImageMeshColor.html)). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) */ material?: MeshComponentMaterialProperties; /** - * Specifies the type of normals used for lighting. This determines whether the object has a smooth or an angular appearance. The following shading types are supported: - * + * Specifies the type of normals used for lighting. This determines whether the object has a smooth or an angular appearance. The following shading types are supported: + * * | Type | Description | * |------|-------------| * | source | Shading uses the normals as defined in the vertex attributes. If no normals are defined, then shading defaults back to `flat` | * | flat | Shading uses normals created per triangle face. This type of shading is good for objects with sharp edges such as boxes. | * | smooth | Shading uses per-vertex normals that average the normals of all the faces a vertex is a part of. This type of shading is good for meshes that approximate curved surfaces such as spheres. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#shading) */ shading?: string; } - export interface MeshComponentMaterialProperties extends Object { /** * the material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) */ color?: ValueMeshColorProperties | ImageMeshColorProperties; @@ -5061,123 +5183,155 @@ declare namespace __esri { export interface MeshComponentMaterial extends AnonymousAccessor { /** * the material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) */ color: ValueMeshColor | ImageMeshColor; } - interface meshUtils { /** * Creates a mesh geometry by sampling elevation data from an elevation service on a regular grid. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#createFromElevation) - * + * * @param source The source from which to query the elevation data. * @param extent The extent from which to create the mesh. * @param params Optional parameters. * @param params.material The material. * @param params.demResolution Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See [ElevationLayer.queryElevation](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) for more details on the different settings. - * + * */ - createFromElevation(source: ElevationLayer | Ground | ElevationSampler, extent: Extent, params?: meshUtilsCreateFromElevationParams): IPromise; + createFromElevation( + source: ElevationLayer | Ground | ElevationSampler, + extent: Extent, + params?: meshUtilsCreateFromElevationParams + ): IPromise; /** * Georeferences vertices specified in a Cartesian coordinate system. This is useful when converting general 3D model meshes not typically georeferenced. This method operates on mesh vertex attributes and will convert positions and normals (if specified) from a local (0, 0, 0) Cartesian system to the properly georeferenced coordinates at the specified `location`. The `location`'s coordinate system determines the units of the converted positions. If the coordinate system is WGS84, metric units are used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#georeference) - * + * * @param vertexAttributes The position and normal buffers to georeference. * @param location The location at which to georeference the position and normal buffers. * @param params Optional parameters. * @param params.geographic Indicates whether to georeference relative to the globe or the projected coordinate system. - * + * */ - georeference(vertexAttributes: VertexAttributes, location: Point, params?: meshUtilsGeoreferenceParams): VertexAttributes; + georeference( + vertexAttributes: VertexAttributes, + location: Point, + params?: meshUtilsGeoreferenceParams + ): VertexAttributes; /** * Merges multiple meshes into a single mesh. All mesh geometries must be in the same spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#merge) - * + * * @param geometries One or more meshes. - * + * */ merge(geometries: Mesh[]): Mesh; + /** + * Projects georeferenced vertices to a Cartesian coordinate system. This is useful for converting existing scene geometry so that it can be used as source material for generating new 3D meshes. This method operates on mesh vertex attributes and will convert positions and normals (if specified) from georeferenced coordinates at the specified `location` to a local (0, 0, 0) Cartesian system. The units of the input positions are determined by the `location`'s coordinate system. If the coordinate system is WGS84, metric units are used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#ungeoreference) + * + * @param vertexAttributes The georeferenced position and normal buffers. + * @param location The location to which the position and normal buffers are georeferenced. + * @param params Optional parameters. + * @param params.geographic Indicates whether the coordinates are georeferenced relative to the globe or the projected coordinate system. + * + */ + ungeoreference( + vertexAttributes: VertexAttributes, + location: Point, + params?: meshUtilsUngeoreferenceParams + ): VertexAttributes; } export const meshUtils: meshUtils; - /** - * Represents the position and normal vertex attribute buffers of a mesh. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#VertexAttributes) - */ - export interface VertexAttributes extends Object { - /** - * The position buffer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#VertexAttributes) - */ - position: Float64Array; - /** - * The normal buffer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#VertexAttributes) - */ - normal?: Float32Array; - } - - export interface meshUtilsCreateFromElevationParams extends Object { /** * The material. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#createFromElevation) */ material?: meshUtilsCreateFromElevationParamsMaterial; /** * Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See [ElevationLayer.queryElevation](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) for more details on the different settings. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#createFromElevation) - * + * * @default auto */ demResolution?: number | string; } - export interface meshUtilsCreateFromElevationParamsMaterial extends Object { /** * The material color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#createFromElevation) */ color?: ValueMeshColor | ImageMeshColor | string | HTMLImageElement | HTMLCanvasElement | number[]; } - export interface meshUtilsGeoreferenceParams extends Object { /** * Indicates whether to georeference relative to the globe or the projected coordinate system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#georeference) */ geographic?: boolean; } + export interface meshUtilsUngeoreferenceParams extends Object { + /** + * Indicates whether the coordinates are georeferenced relative to the globe or the projected coordinate system. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#ungeoreference) + */ + geographic?: boolean; + } + + /** + * Represents the position and normal vertex attribute buffers of a mesh. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#VertexAttributes) + */ + export interface VertexAttributes extends Object { + /** + * The position buffer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#VertexAttributes) + */ + position: Float64Array; + /** + * The normal buffer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#VertexAttributes) + */ + normal?: Float32Array; + } interface normalizeUtils { /** * Normalizes geometries that intersect the central meridian or fall outside the world extent so they stay within the coordinate system of the view. Only supported for Web Mercator and WGS84 spatial references. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-normalizeUtils.html#normalizeCentralMeridian) - * + * * @param geometries An array of geometries to normalize. * @param geometryService A geometry service used to perform the normalization. If this value is `null` then the default geometry service in [esriConfig.geometryServiceUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#geometryServiceUrl) is used. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request. - * + * */ - normalizeCentralMeridian(geometries: Geometry[], geometryService?: GeometryService, requestOptions?: any): IPromise; + normalizeCentralMeridian( + geometries: Geometry[], + geometryService?: GeometryService, + requestOptions?: any + ): IPromise; } export const normalizeUtils: normalizeUtils; @@ -5185,23 +5339,23 @@ declare namespace __esri { interface ValueMeshColor extends Accessor { /** * For ValueMeshColor the type is always `value`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html#type) */ readonly type: "value"; /** * The color value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html#value) */ value: Color; /** * Creates a deep clone. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html#clone) - * - * + * + * */ clone(): ValueMeshColor; } @@ -5209,11 +5363,11 @@ declare namespace __esri { interface ValueMeshColorConstructor { /** * ValueMeshColor is a type of mesh color that represents a single uniform color to be applied to a mesh component. ValueMeshColor instances can be used with the [MeshComponent.material.color](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-MeshComponent.html#material) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html) */ - new(properties?: ValueMeshColorProperties): ValueMeshColor; + new (properties?: ValueMeshColorProperties): ValueMeshColor; } export const ValueMeshColor: ValueMeshColorConstructor; @@ -5221,150 +5375,198 @@ declare namespace __esri { interface ValueMeshColorProperties { /** * The color value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-ValueMeshColor.html#value) */ value?: Color | number[] | string; } - interface webMercatorUtils { /** * Returns `true` if the `source` spatial reference can be projected to the `target` spatial reference with the [project()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#project) function, or if the `source` and `target` are the same [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#canProject) - * + * * @param source The input [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) or an object with `spatialReference` property such as [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) or [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). * @param target The target [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) or an object with `spatialReference` property such as [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) or [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). - * + * */ canProject(source: SpatialReference | any, target: SpatialReference | any): boolean; /** * Converts a geometry from geographic units (wkid: 4326) to Web Mercator units (wkid: 3857). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#geographicToWebMercator) - * + * * @param geometry The input geometry to convert. - * + * */ geographicToWebMercator(geometry: Geometry): Geometry; /** * Translates the given latitude and longitude (decimal degree) values to Web Mercator XY values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#lngLatToXY) - * + * * @param long The longitude value to convert. * @param lat The latitude value to convert. - * + * */ lngLatToXY(long: number, lat: number): number[]; /** * Projects the geometry clientside (if possible). You should test the input geometry in [canProject()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#canProject) prior to using this function. If the result of [canProject()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#canProject) is `true`, then proceed to project. If [canProject()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#canProject) returns `false`, then `project()` won't return useful results. Use [GeometryService.project()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#project) instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#project) - * + * * @param geometry The input geometry. * @param spatialReference The target [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) or an object with `spatialReference` property such as [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) or [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). - * + * */ project(geometry: Geometry, spatialReference: SpatialReference | any): Geometry; /** * Converts a geometry from Web Mercator units (wkid: 3857) to geographic units (wkid: 4326). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#webMercatorToGeographic) - * + * * @param geometry The input geometry to convert. - * + * */ webMercatorToGeographic(geometry: Geometry): Geometry; /** * Translates the given Web Mercator coordinates to Longitude and Latitude values (decimal degrees). By default the returned longitude is normalized so that it is within -180 and +180. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-webMercatorUtils.html#xyToLngLat) - * + * * @param x The X coordinate value to convert. * @param y The Y coordinate value to convert. - * + * */ xyToLngLat(x: number, y: number): number[]; } export const webMercatorUtils: webMercatorUtils; + /** + * Extent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Extent) + */ + export type geometryExtent = Extent; + + /** + * Geometry types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Geometry) + */ + export type geometryGeometry = Extent | Multipoint | Point | Polygon | Polyline | Mesh; + + /** + * Mesh. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Mesh) + */ + export type geometryMesh = Mesh; + + /** + * Multipoint. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Multipoint) + */ + export type geometryMultipoint = Multipoint; + + /** + * Point. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Point) + */ + export type geometryPoint = Point; + + /** + * Polygon. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Polygon) + */ + export type geometryPolygon = Polygon; + + /** + * Polyline. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry.html#Polyline) + */ + export type geometryPolyline = Polyline; + interface Graphic extends Accessor, JSONSupport { /** * Name-value pairs of fields and field values associated with the graphic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) */ attributes: any; /** - * The geometry that defines the graphic's location. + * The geometry that defines the graphic's location. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry) */ geometry: Geometry; /** * If applicable, references the layer in which the graphic is stored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer) */ layer: Layer; /** * The template for displaying content in a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when the graphic is selected. The [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) may be used to access a graphic's [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) and display their values in the view's default popup. See the documentation for [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) for details on how to display attribute values in the popup. As of 4.8 to get the actual `popupTemplate` of the graphic, see the [getEffectivePopupTemplate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#getEffectivePopupTemplate) method that either returns this value or the `popupTemplate` of the graphic's layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#popupTemplate) */ popupTemplate: PopupTemplate; /** * The [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the graphic. Choosing a symbol for a graphic depends on the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) type (SceneView or MapView), and the [geometry type](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type) of the graphic. Each graphic may have its own symbol specified when the parent layer is a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html). For a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) the symbol of each graphic should not be set by the developer since the graphics' rendering properties are determined by the layer's [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) */ symbol: Symbol; /** * Indicates the visibility of the graphic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#visible) - * + * * @default true */ visible: boolean; /** * Creates a deep clone of the graphic object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#clone) - * - * + * + * */ clone(): Graphic; /** * Returns the value of the specified attribute. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#getAttribute) - * + * * @param name The name of the attribute. - * + * */ getAttribute(name: string): any; /** * Returns the popup template applicable for the graphic. It's either the value of [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#popupTemplate) or the `popupTemplate` from the graphic's layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#getEffectivePopupTemplate) - * - * + * + * */ getEffectivePopupTemplate(): PopupTemplate; /** * Sets a new value to the specified attribute. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#setAttribute) - * + * * @param name The name of the attribute to set. * @param newValue The new value to set on the named attribute. - * + * */ setAttribute(name: string, newValue: any): void; } @@ -5372,11 +5574,11 @@ declare namespace __esri { interface GraphicConstructor { /** * A Graphic is a vector representation of real world geographic phenomena. It can contain [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry), a [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol), and [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes). A Graphic is displayed in the [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) */ - new(properties?: GraphicProperties): Graphic; + new (properties?: GraphicProperties): Graphic; fromJSON(json: any): Graphic; } @@ -5386,40 +5588,40 @@ declare namespace __esri { interface GraphicProperties { /** * Name-value pairs of fields and field values associated with the graphic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) */ attributes?: any; /** - * The geometry that defines the graphic's location. + * The geometry that defines the graphic's location. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry) */ geometry?: GeometryProperties; /** * If applicable, references the layer in which the graphic is stored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer) */ layer?: LayerProperties; /** * The template for displaying content in a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when the graphic is selected. The [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) may be used to access a graphic's [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) and display their values in the view's default popup. See the documentation for [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) for details on how to display attribute values in the popup. As of 4.8 to get the actual `popupTemplate` of the graphic, see the [getEffectivePopupTemplate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#getEffectivePopupTemplate) method that either returns this value or the `popupTemplate` of the graphic's layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#popupTemplate) */ popupTemplate?: PopupTemplateProperties; /** * The [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the graphic. Choosing a symbol for a graphic depends on the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) type (SceneView or MapView), and the [geometry type](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type) of the graphic. Each graphic may have its own symbol specified when the parent layer is a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html). For a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) the symbol of each graphic should not be set by the developer since the graphics' rendering properties are determined by the layer's [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) */ symbol?: SymbolProperties; /** * Indicates the visibility of the graphic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#visible) - * + * * @default true */ visible?: boolean; @@ -5428,90 +5630,93 @@ declare namespace __esri { interface Ground extends Accessor, Loadable, JSONSupport { /** * A collection of [ElevationLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) that define the elevation or terrain that makes up the ground surface. When elevation layers are added to the ground, the topographical variations of the surface are rendered in 3D as they would appear in the real world. ![elev-default](https://developers.arcgis.com/javascript/assets/img/apiref/ground/elev-default.png) When the layers collection is empty, the ground surface is flat. ![no-elev](https://developers.arcgis.com/javascript/assets/img/apiref/ground/no-elev.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) */ layers: Collection; /** * Indicates whether the instance has loaded. When `true`, the properties of the object can be accessed. A Ground is considered loaded when its [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) are fully created, but not yet loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#loaded) - * + * * @default false */ readonly loaded: boolean; /** * Specifies the user navigation constraints relative to the ground surface. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) */ navigationConstraint: GroundNavigationConstraint; /** * Opacity of the ground, including surface default color and the basemap (without reference layers). This property can be used for a see-through ground effect. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#opacity) - * + * * @default 1 */ opacity: number; /** * The color of the ground surface, displayed underneath the basemap. If this is null, a grid is displayed instead. The alpha value in the color is ignored. Use the [opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#opacity) property to control the opacity of the ground. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#surfaceColor) - * + * * @default null */ surfaceColor: Color; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#clone) - * - * + * + * */ clone(): Ground; /** * Creates an elevation sampler for the given extent by querying the ground layers for elevation data and caching it so values may be sampled quickly afterwards. The sampler uses the elevation data from the first layer that has data available. For getting elevation data from a specific layer use [ElevationLayer.createElevationSampler()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#createElevationSampler). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#createElevationSampler) - * + * * @param extent The extent for which to create the sampler. * @param options Additional sampler options. * @param options.noDataValue The value to use when there is no data available. - * + * */ createElevationSampler(extent: Extent, options?: GroundCreateElevationSamplerOptions): IPromise; /** * Loads all the externally loadable resources associated with the ground. For the ground this will load all the layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#loadAll) - * - * + * + * */ loadAll(): IPromise; /** * Queries the ground layer services for elevation values for the given geometry. The returned result contains a copy of the geometry with z-values sampled from elevation data from the first layer that has data available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#queryElevation) - * + * * @param geometry The geometry to sample. * @param options Additional query options. * @param options.returnSampleInfo Indicates whether to return additional sample information for each sampled coordinate. * @param options.noDataValue The value that appears in the resulting geometry when there is no data available. - * + * */ - queryElevation(geometry: Point | Multipoint | Polyline, options?: GroundQueryElevationOptions): IPromise; + queryElevation( + geometry: Point | Multipoint | Polyline, + options?: GroundQueryElevationOptions + ): IPromise; } interface GroundConstructor { /** * The Ground class contains properties that specify how the ground surface is displayed in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It contains a [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) property, which is a collection of [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) that defines the elevation or terrain of the map's surface. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) */ - new(properties?: GroundProperties): Ground; + new (properties?: GroundProperties): Ground; fromJSON(json: any): Ground; } @@ -5521,29 +5726,29 @@ declare namespace __esri { interface GroundProperties extends LoadableProperties { /** * A collection of [ElevationLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) that define the elevation or terrain that makes up the ground surface. When elevation layers are added to the ground, the topographical variations of the surface are rendered in 3D as they would appear in the real world. ![elev-default](https://developers.arcgis.com/javascript/assets/img/apiref/ground/elev-default.png) When the layers collection is empty, the ground surface is flat. ![no-elev](https://developers.arcgis.com/javascript/assets/img/apiref/ground/no-elev.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) */ layers?: CollectionProperties; /** * Specifies the user navigation constraints relative to the ground surface. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) */ navigationConstraint?: GroundNavigationConstraintProperties; /** * Opacity of the ground, including surface default color and the basemap (without reference layers). This property can be used for a see-through ground effect. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#opacity) - * + * * @default 1 */ opacity?: number; /** * The color of the ground surface, displayed underneath the basemap. If this is null, a grid is displayed instead. The alpha value in the color is ignored. Use the [opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#opacity) property to control the opacity of the ground. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#surfaceColor) - * + * * @default null */ surfaceColor?: Color | number[] | string; @@ -5551,54 +5756,52 @@ declare namespace __esri { /** * Object returned when [queryElevation()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#queryElevation) promise resolves: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) */ export interface ElevationQueryResult extends Object { /** * The geometry with sampled z-values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) */ geometry: Point | Multipoint | Polyline; /** * Contains additional information about how the geometry was sampled. This property is present depending on whether the user set `options.returnSampleInfo = true`, for each coordinate in the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) */ sampleInfo?: ElevationQueryResultSampleInfo[]; /** * The value used when there is no data available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) */ noDataValue: number; } - export interface GroundCreateElevationSamplerOptions extends Object { /** * The value to use when there is no data available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#createElevationSampler) - * + * * @default 0 */ noDataValue?: number; } - export interface GroundNavigationConstraintProperties extends Object { /** - * The type of the constraint. It can be one of the following: - * + * The type of the constraint. It can be one of the following: + * * Value | Description * -----------|-------------------- * stay-above | User can only navigate above ground surface * none | User can navigate above and below the ground surface - * + * * Default value: stay-above - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) */ type?: string; @@ -5606,51 +5809,49 @@ declare namespace __esri { export interface GroundNavigationConstraint extends AnonymousAccessor { /** - * The type of the constraint. It can be one of the following: - * + * The type of the constraint. It can be one of the following: + * * Value | Description * -----------|-------------------- * stay-above | User can only navigate above ground surface * none | User can navigate above and below the ground surface - * + * * Default value: stay-above - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) */ type: string; } - export interface GroundQueryElevationOptions extends Object { /** * Indicates whether to return additional sample information for each sampled coordinate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#queryElevation) - * + * * @default false */ returnSampleInfo?: boolean; /** * The value that appears in the resulting geometry when there is no data available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#queryElevation) - * + * * @default 0 */ noDataValue?: number; } - export interface ElevationQueryResultSampleInfo extends Object { /** * The resolution at which the z-value was sampled. If no data was available for sampling for a given coordinate, the dem resolution value will be -1 for that coordinate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) */ demResolution: number; /** * The elevation source from which the data for the corresponding coordinate was sampled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#ElevationQueryResult) */ source: ElevationLayer; @@ -5659,69 +5860,71 @@ declare namespace __esri { interface Credential extends Accessor { /** * Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#expires) */ expires: number; /** - * Indicates whether this credential belongs to a user with admin privileges. - * + * Indicates that this credential was created to access the [ArcGIS REST Admin service](https://developers.arcgis.com/rest/services-reference/rest-api-admin.htm). + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#isAdmin) */ isAdmin: boolean; /** * The Identity Manager's [setOAuthRedirectionHandler](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthRedirectionHandler) returns an object that contains a `state` property. This information is returned for this property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#oAuthState) */ oAuthState: any; /** * The server url. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#server) */ server: string; /** * Indicates whether the resources accessed using this credential should be fetched over HTTPS protocol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#ssl) */ ssl: boolean; /** * Token generated by the token service using the specified userId and password. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#token) */ token: string; /** * User associated with the Credential object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#userId) */ userId: string; /** * Destroys the credential. When the credential is destroyed, you should remove any map layers that are using this credential. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#destroy) - * - * + * + * */ destroy(): void; /** * Generates a new token and updates the Credential's [token](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#token) property with the newly acquired token. Tokens are typically kept valid using a timer that automatically triggers a refresh before the token expires. Use this method in cases where the timer has been delayed or stopped. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#refreshToken) - * - * + * + * */ refreshToken(): void; + + on(name: "token-change", eventHandler: CredentialTokenChangeEventHandler): IHandle; + + on(name: "destroy", eventHandler: CredentialDestroyEventHandler): IHandle; } interface CredentialConstructor { - - - new(properties?: CredentialProperties): Credential; + new (properties?: CredentialProperties): Credential; } export const Credential: CredentialConstructor; @@ -5729,570 +5932,486 @@ declare namespace __esri { interface CredentialProperties { /** * Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#expires) */ expires?: number; /** - * Indicates whether this credential belongs to a user with admin privileges. - * + * Indicates that this credential was created to access the [ArcGIS REST Admin service](https://developers.arcgis.com/rest/services-reference/rest-api-admin.htm). + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#isAdmin) */ isAdmin?: boolean; /** * The Identity Manager's [setOAuthRedirectionHandler](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthRedirectionHandler) returns an object that contains a `state` property. This information is returned for this property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#oAuthState) */ oAuthState?: any; /** * The server url. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#server) */ server?: string; /** * Indicates whether the resources accessed using this credential should be fetched over HTTPS protocol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#ssl) */ ssl?: boolean; /** * Token generated by the token service using the specified userId and password. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#token) */ token?: string; /** * User associated with the Credential object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#userId) */ userId?: string; } - interface IdentityManager extends IdentityManagerBase { + export interface CredentialDestroyEvent {} + + export interface CredentialTokenChangeEvent {} + + interface IdentityManager extends Evented { /** * Dialog box widget used to challenge the user for their credentials when the application attempts to access a secure resource. This property is available after the dialog-create event has fired. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#dialog) */ dialog: any; - - /** - * Once a user successfully logs in, they are redirected back to the application. Use this method if the application needs to execute custom logic before the page is redirected. The IdentityManager calls the custom handler function with an object containing redirection properties. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthRedirectionHandler) - * - * @param handlerFunction When called, the callback passed to `setOAuthRedirectionHandler` receives an object containing the redirection properties. - * - */ - setOAuthRedirectionHandler(handlerFunction: HandlerCallback): void; - /** - * Use this method in the popup callback page to pass the token and other values back to the IdentityManager. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthResponseHash) - * - * @param hash The token information in addition to any other values needed to be passed back to the IdentityManager. - * - */ - setOAuthResponseHash(hash: string): void; - - - on(name: "credential-create", eventHandler: IdentityManagerCredentialCreateEventHandler): IHandle; - - on(name: "credentials-destroy", eventHandler: IdentityManagerCredentialsDestroyEventHandler): IHandle; - } - - interface IdentityManagerConstructor { - /** - * This object provides the framework and helper methods used in managing user credentials for the following resources: - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html) - */ - - new(): IdentityManager; - } - - export const IdentityManager: IdentityManagerConstructor; - - export interface IdentityManagerCredentialCreateEvent { - - credential: Credential; - } - - export interface IdentityManagerCredentialsDestroyEvent { - } - - export type HandlerCallback = (authorizeParams: any, authorizeUrl: string, oAuthInfo: OAuthInfo, resourceUrl: string, serverInfo: ServerInfo) => void; - - interface IdentityManagerBase extends Evented { /** * The suggested lifetime of the token in minutes. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#tokenValidity) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#tokenValidity) + * * @default 60 */ tokenValidity: number; /** - * If your application is on the same domain as *.arcgis.com or ArcGIS Enterprise Server, the IdentityManager will redirect the user to its sign-in page. For instance, let's say an application accesses secure resources from ArcGIS.com or one of its subdomains. Once the application attempts to access this resource, the IdentityManager redirects the user to the ArcGIS.com sign-in page. Once a user successfully logs in, they are redirected back to the application. The same holds true if the application accesses secure resources from ArcGIS Enterprise as the IdentityManager will redirect the user to its sign-in page. If you do not wish for the application to automatically redirect, set this property to `false`. (Please note that this is not a common scenario. For most, using the OAuth sign-in behavior should handle most of their authentication needs.) - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#useSignInPage) - * + * If your application is on the same domain as *.arcgis.com or ArcGIS Enterprise Server, the IdentityManager will redirect the user to its sign-in page. For instance, let's say an application accesses secure resources from ArcGIS.com or one of its subdomains. Once the application attempts to access this resource, the IdentityManager redirects the user to the ArcGIS.com sign-in page. Once a user successfully logs in, they are redirected back to the application. The same holds true if the application accesses secure resources from ArcGIS Enterprise as the IdentityManager will redirect the user to its sign-in page. If you do not wish for the application to automatically redirect, set this property to `false`. + * > Please note that this is not a common scenario. For most, using the OAuth sign-in behavior should handle most of their authentication needs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#useSignInPage) + * * @default true */ useSignInPage: boolean; /** - * Returns the [Credential](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html) if the user has already signed in to access the given resource. If the user has not signed in, then the promise will be rejected and its error callback will be called. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#checkSignInStatus) - * + * Returns the [Credential](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html) if the user has already signed in to access the given resource and is allowed to do so when using the given application id. If the user has not signed in or does not have access, then the promise will be rejected and its error callback will be called. + * > This scenario is generally not common unless you are building a licensed app. Also, please note that this method should only be used if your application is on the same domain as `*.arcgis.com` or ArcGIS Enterprise Server and is only applicable to applications registered as items in the `Esri` organization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#checkAppAccess) + * * @param resUrl The resource URL. - * + * @param appId The registered OAuth application id. + * + */ + checkAppAccess(resUrl: string, appId: string): IPromise; + /** + * Returns the [Credential](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html) if the user has already signed in to access the given resource. If the user has not signed in, then the promise will be rejected and its error callback will be called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#checkSignInStatus) + * + * @param resUrl The resource URL. + * */ checkSignInStatus(resUrl: string): IPromise; /** * Destroys all credentials. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#destroyCredentials) - * - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#destroyCredentials) + * + * */ destroyCredentials(): void; /** * Returns the [Credential](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html) for the resource identified by the specified url. Optionally, you can provide a userId to find credentials for a specific user. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#findCredential) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#findCredential) + * * @param url The URL to a server. * @param userId The userId for which you want to obtain credentials. - * + * */ findCredential(url: string, userId?: string): Credential; /** * Returns the [OAuthInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html) configuration for the passed in Portal server URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#findOAuthInfo) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#findOauthInfo) + * * @param url The URL to a Portal. - * + * */ - findOAuthInfo(url: string): OAuthInfo; + findOauthInfo(url: string): OAuthInfo; /** * Returns information about the server that is hosting the specified URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#findServerInfo) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#findServerinfo) + * * @param url The URL to the server - * + * */ - findServerInfo(url: string): ServerInfo; + findServerinfo(url: string): ServerInfo; /** * Returns an object containing a token and its expiration time. It is necessary to provide the [ServerInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html) object that contains a token service URL and a user info object containing username and password. This is a helper method typically called by sub-classes to generate tokens. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#generateToken) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#generateToken) + * * @param serverInfo A ServerInfo object that contains a token service URL. * @param userInfo A user info object containing a user name and password. * @param options See the table below for the structure of this object. * @param options.serverUrl The server URL. * @param options.token The server token. * @param options.ssl Indicates if the server requires SSL. - * + * */ - generateToken(serverInfo: ServerInfo, userInfo: any, options?: IdentityManagerBaseGenerateTokenOptions): IPromise; + generateToken(serverInfo: ServerInfo, userInfo: any, options?: IdentityManagerGenerateTokenOptions): IPromise; /** * Returns a [Credential](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html) object that can be used to access the secured resource identified by the input URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#getCredential) + * * @param url The URL for the secure resource * @param options See the table below for the structure of the **options** object. * @param options.error Error object returned by the server from a previous attempt to fetch the given URL. * @param options.oAuthPopupConfirmation If set to *false*, the user will not be shown a dialog before the OAuth popup window is opened. - * @param options.retry Determines if the method should make additional attempts to get the credentials after a failure. * @param options.token Token used for a previous unsuccessful attempt to fetch the given URL. - * + * */ - getCredential(url: string, options?: IdentityManagerBaseGetCredentialOptions): IPromise; + getCredential(url: string, options?: IdentityManagerGetCredentialOptions): IPromise; /** - * Call this method during application initialization with the JSON previously obtained from the [toJSON()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#toJSON) method used to re-hydrate the state of IdentityManager. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#initialize) - * - * @param json The JSON obtained from the [toJSON()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#toJSON) method. - * + * Call this method during application initialization with the JSON previously obtained from the [toJSON()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#toJSON) method used to re-hydrate the state of IdentityManager. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#initialize) + * + * @param json The JSON obtained from the [toJSON()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#toJSON) method. + * */ initialize(json: any): void; /** - * Indicates if the IdentityManager is busy accepting user input. For example, it returns `true` if the user has invoked [signIn](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#signIn) and is waiting for a response. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#isBusy) - * - * + * Indicates if the IdentityManager is busy accepting user input. For example, it returns `true` if the user has invoked [signIn](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#signIn) and is waiting for a response. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#isBusy) + * + * */ isBusy(): boolean; - /** - * Subclasses must implement this method if OAuth support is required. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#oAuthSignIn) - * - * @param resUrl The resource URL. - * @param serverInfo A ServerInfo object that contains the token service URL. - * @param oAuthInfo An OAuthInfo object that contains the authorization configuration. - * @param options See the table below for the structure of the **options** object. - * @param options.error Error object returned by the server from a previous attempt to fetch the given URL. - * @param options.oAuthPopupConfirmation Indicates whether the user will be shown a dialog before the OAuth popup window is opened. - * @param options.token Token used for previous unsuccessful attempts to fetch the given URL. - * - */ - oAuthSignIn(resUrl: string, serverInfo: ServerInfo, oAuthInfo: OAuthInfo, options?: IdentityManagerBaseOAuthSignInOptions): IPromise; /** * Registers OAuth 2.0 configurations. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#registerOAuthInfos) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerOAuthInfos) + * * @param oAuthInfos An array of OAuthInfo objects that defines the OAuth configurations. - * + * */ registerOAuthInfos(oAuthInfos: OAuthInfo[]): void; /** * Register secure servers and the token endpoints. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#registerServers) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerServers) + * * @param serverInfos An array of ServerInfos objects that defines the secure service and token endpoint. The IdentityManager makes its best guess to determine the location of the secure server and token endpoint. Therefore, in most cases calling this method is not necessary. However, if the location of your server or token endpoint is not standard, use this method to register the location. - * + * */ registerServers(serverInfos: ServerInfo[]): void; /** - * Registers the given OAuth 2.0 access token or ArcGIS Server token with the IdentityManager. See [registerOAuthInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#registerOAuthInfos) for additional information. The `registerToken` method is an advanced workflow for pre-registering long-term tokens for when you don't want users to sign in. See also [resource-proxy](https://github.com/Esri/resource-proxy) for another workflow to achieve this result. Once a user logs in, the access token is registered with the IdentityManager. Subsequently, every AJAX request made by the application forwards this token when accessing web maps and other items stored in ArcGIS Online, or resources on your server. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#registerToken) - * + * Registers the given OAuth 2.0 access token or ArcGIS Server token with the IdentityManager. See [registerOAuthInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerOAuthInfos) for additional information. The `registerToken` method is an advanced workflow for pre-registering long-term tokens for when you don't want users to sign in. See also [resource-proxy](https://github.com/Esri/resource-proxy) for another workflow to achieve this result. Once a user logs in, the access token is registered with the IdentityManager. Subsequently, every AJAX request made by the application forwards this token when accessing web maps and other items stored in ArcGIS Online, or resources on your server. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken) + * * @param properties See the table below for the structure of the **properties** object. * @param properties.expires Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC. * @param properties.server For ArcGIS Online or Portal, this is https://www.arcgis.com/sharing/rest or similar to https://www.example.com/portal/sharing/rest. For ArcGIS Server this is similar to https://www.example.com/arcgis/rest/services. * @param properties.ssl Set this to `true` if the user has an ArcGIS Online organizational account and the organization is configured to allow access to resources only through SSL. * @param properties.token The access token. * @param properties.userId The id of the user who owns the access token. - * + * */ - registerToken(properties: IdentityManagerBaseRegisterTokenProperties): void; + registerToken(properties: IdentityManagerRegisterTokenProperties): void; + /** + * Once a user successfully logs in, they are redirected back to the application. Use this method if the application needs to execute custom logic before the page is redirected. The IdentityManager calls the custom handler function with an object containing redirection properties. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthRedirectionHandler) + * + * @param handlerFunction When called, the callback passed to `setOAuthRedirectionHandler` receives an object containing the redirection properties. + * + */ + setOAuthRedirectionHandler(handlerFunction: HandlerCallback): void; + /** + * Use this method in the popup callback page to pass the token and other values back to the IdentityManager. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setOAuthResponseHash) + * + * @param hash The token information in addition to any other values needed to be passed back to the IdentityManager. + * + */ + setOAuthResponseHash(hash: string): void; /** * When accessing secured resources, the IdentityManager may prompt for username and password and send them to the server using a secure connection. Due to potential browser limitations, it may not be possible to establish a secure connection with the server if the application is being run over HTTP protocol. In such cases, the Identity Manager will abort the request to fetch the secured resource. To resolve this issue, configure your web application server with HTTPS support and run the application over HTTPS. This is the recommended solution for production environments. However, for internal development environments that don't have HTTPS support, you can define a protocol error handler that allows the Identity Manager to continue with the process over HTTP protocol. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setProtocolErrorHandler) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setProtocolErrorHandler) + * * @param handlerFunction The function to call when the protocol is mismatched. * @param handlerFunction.resourceUrl The secure resource URL. * @param handlerFunction.serverInfo ServerInfo object describing the server where the secure resource is hosted. - * + * */ - setProtocolErrorHandler(handlerFunction: IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction): void; + setProtocolErrorHandler(handlerFunction: IdentityManagerSetProtocolErrorHandlerHandlerFunction): void; /** * If your application is on the same domain as *.arcgis.com or ArcGIS Enterprise Server, the IdentityManager will redirect the user to its sign-in page. For instance, let's say an application accesses secure resources from ArcGIS.com or one of its subdomains. Once the application attempts to access this resource, the IdentityManager redirects the user to the ArcGIS.com sign-in page. Once a user successfully logs in, they are redirected back to the application. The same holds true if the application accesses secure resources from ArcGIS Enterprise as the IdentityManager will redirect the user to its sign-in page. Use this method if the application needs to execute custom logic before the page is redirected by creating a custom redirection handler. The IdentityManager calls the custom handler function with an object containing the redirection properties. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setRedirectionHandler) + * * @param handlerFunction The function passed to setRedirectionHandler receives an object containing redirection properties. These properties are listed in the table below. * @param handlerFunction.resourceUrl The URL of the secure resource that triggers the redirection to the ArcGIS.com sign-in page. * @param handlerFunction.returnUrlParamName The application URL where the sign-in page redirects after a successful login. To create the return URL, append the application's URL to signInPage as a parameter. The *returnUrlParamName* contains the name of the parameter. * @param handlerFunction.serverInfo The ServerInfo object describing the server where the secure resource is hosted. * @param handlerFunction.signInPage URL of the sign-in page where users will be redirected. - * + * */ - setRedirectionHandler(handlerFunction: IdentityManagerBaseSetRedirectionHandlerHandlerFunction): void; - /** - * Subclasses must implement this method to create and manage the user interface used to obtain a username and password from the end user. It should perform the following tasks: - * * challenge the user for a username and password, - * * generate a token and return it to the caller. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#signIn) - * - * @param url URL for the secured resource. - * @param serverInfo A ServerInfo object that contains the token service URL. - * @param options See the table below for the structure of the **options** object. - * @param options.error Error object returned by the server from a previous attempt to fetch the given URL. - * - */ - signIn(url: string, serverInfo: ServerInfo, options?: IdentityManagerBaseSignInOptions): IPromise; + setRedirectionHandler(handlerFunction: IdentityManagerSetRedirectionHandlerHandlerFunction): void; /** * Return properties of this object in JSON format. It can be stored in a cookie or persisted in HTML5 LocalStorage and later used to: * * Initialize the IdentityManager the next time a user opens your application. * * Share the state of the IdentityManager between multiple web pages of your website. This way users will not be asked to sign in repeatedly when they launch your app multiple times or when navigating between multiple web pages in your website. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#toJSON) - * - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#toJSON) + * + * */ toJSON(): any; } - interface IdentityManagerBaseConstructor { + interface IdentityManagerConstructor { /** - * This class provides the framework and helper methods required to implement a solution for managing user credentials. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html) + * This object provides the framework and helper methods used in managing user credentials for the following resources: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html) */ - new(): IdentityManagerBase; + new (): IdentityManager; } - export const IdentityManagerBase: IdentityManagerBaseConstructor; + export const IdentityManager: IdentityManagerConstructor; + export type HandlerCallback = ( + authorizeParams: any, + authorizeUrl: string, + oAuthInfo: OAuthInfo, + resourceUrl: string, + serverInfo: ServerInfo + ) => void; - export interface IdentityManagerBaseGenerateTokenOptions extends Object { + export interface IdentityManagerGenerateTokenOptions extends Object { /** * The server URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#generateToken) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#generateToken) */ serverUrl: string; /** * The server token. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#generateToken) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#generateToken) */ token: string; /** * Indicates if the server requires SSL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#generateToken) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#generateToken) */ ssl: boolean; } - - export interface IdentityManagerBaseGetCredentialOptions extends Object { + export interface IdentityManagerGetCredentialOptions extends Object { /** * Error object returned by the server from a previous attempt to fetch the given URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#getCredential) */ error?: Error; /** * If set to *false*, the user will not be shown a dialog before the OAuth popup window is opened. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#getCredential) + * * @default true */ oAuthPopupConfirmation?: boolean; - /** - * Determines if the method should make additional attempts to get the credentials after a failure. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) - */ - retry?: boolean; /** * Token used for a previous unsuccessful attempt to fetch the given URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#getCredential) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#getCredential) */ token?: string; } - - export interface IdentityManagerBaseOAuthSignInOptions extends Object { - /** - * Error object returned by the server from a previous attempt to fetch the given URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#oAuthSignIn) - */ - error?: Error; - /** - * Indicates whether the user will be shown a dialog before the OAuth popup window is opened. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#oAuthSignIn) - * - * @default true - */ - oAuthPopupConfirmation?: boolean; - /** - * Token used for previous unsuccessful attempts to fetch the given URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#oAuthSignIn) - */ - token?: string; - } - - - export interface IdentityManagerBaseRegisterTokenProperties extends Object { + export interface IdentityManagerRegisterTokenProperties extends Object { /** * Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC. - * + * * [Read more...](properties.html) */ expires?: number; /** * For ArcGIS Online or Portal, this is https://www.arcgis.com/sharing/rest or similar to https://www.example.com/portal/sharing/rest. For ArcGIS Server this is similar to https://www.example.com/arcgis/rest/services. - * + * * [Read more...](properties.html) */ server: string; /** * Set this to `true` if the user has an ArcGIS Online organizational account and the organization is configured to allow access to resources only through SSL. - * + * * [Read more...](properties.html) */ ssl?: boolean; /** * The access token. - * + * * [Read more...](properties.html) */ token: string; /** * The id of the user who owns the access token. - * + * * [Read more...](properties.html) */ userId?: string; } - - export interface IdentityManagerBaseSetProtocolErrorHandlerHandlerFunction extends Object { + export interface IdentityManagerSetProtocolErrorHandlerHandlerFunction extends Object { /** * The secure resource URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setProtocolErrorHandler) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setProtocolErrorHandler) */ resourceUrl: string; /** * ServerInfo object describing the server where the secure resource is hosted. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setProtocolErrorHandler) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setProtocolErrorHandler) */ serverInfo: ServerInfo; } - - export interface IdentityManagerBaseSetRedirectionHandlerHandlerFunction extends Object { + export interface IdentityManagerSetRedirectionHandlerHandlerFunction extends Object { /** * The URL of the secure resource that triggers the redirection to the ArcGIS.com sign-in page. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setRedirectionHandler) */ resourceUrl: string; /** * The application URL where the sign-in page redirects after a successful login. To create the return URL, append the application's URL to signInPage as a parameter. The *returnUrlParamName* contains the name of the parameter. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setRedirectionHandler) */ returnUrlParamName: string; /** * The ServerInfo object describing the server where the secure resource is hosted. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setRedirectionHandler) */ serverInfo: ServerInfo; /** * URL of the sign-in page where users will be redirected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#setRedirectionHandler) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#setRedirectionHandler) */ signInPage: string; } - - export interface IdentityManagerBaseSignInOptions extends Object { - /** - * Error object returned by the server from a previous attempt to fetch the given URL. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManagerBase.html#signIn) - */ - error: Error; - } - interface OAuthInfo extends Accessor, JSONSupport { /** * The registered application id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#appId) */ appId: string; /** * Applications with the same value will share the stored token on the same host. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#authNamespace) - * + * * @default / (forward slash) */ authNamespace: string; /** * The number of minutes that the token is valid. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#expiration) - * + * * @default 20160 (two weeks) */ expiration: number; /** * The locale for the OAuth sign in page. The default locale is based on your browser/OS and the organization locale. You can use the locale property to change this. The locale needs to follow the language dash country code syntax supported by ArcGIS.com. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#locale) - * + * * @default Based on your browser/OS and the organization locale. */ locale: string; /** * The minimum time in minutes before a saved token is due to expire that it should still be considered valid for use. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#minTimeUntilExpiration) - * + * * @default 30 */ minTimeUntilExpiration: number; /** * Set to `true` to show the OAuth sign in page in a popup window. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popup) - * + * * @default false */ popup: boolean; /** * Applicable if working with the popup user-login workflow. This is a relative page URL that redirects the user back to the secured application after successful login. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popupCallbackUrl) - * + * * @default "oauth-callback.html" */ popupCallbackUrl: string; /** * The window features passed to [window.open()](https://developer.mozilla.org/en-US/docs/Web/API/Window/open). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popupWindowFeatures) - * + * * @default height=490,width=800,resizable,scrollbars,status */ popupWindowFeatures: string; /** * The ArcGIS Enterprise portal URL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#portalUrl) - * + * * @default "https://www.arcgis.com" */ portalUrl: string; /** * Creates a copy of the OAuthInfo object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#clone) - * - * + * + * */ clone(): OAuthInfo; } interface OAuthInfoConstructor { - - - new(properties?: OAuthInfoProperties): OAuthInfo; + new (properties?: OAuthInfoProperties): OAuthInfo; fromJSON(json: any): OAuthInfo; } @@ -6302,71 +6421,71 @@ declare namespace __esri { interface OAuthInfoProperties { /** * The registered application id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#appId) */ appId?: string; /** * Applications with the same value will share the stored token on the same host. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#authNamespace) - * + * * @default / (forward slash) */ authNamespace?: string; /** * The number of minutes that the token is valid. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#expiration) - * + * * @default 20160 (two weeks) */ expiration?: number; /** * The locale for the OAuth sign in page. The default locale is based on your browser/OS and the organization locale. You can use the locale property to change this. The locale needs to follow the language dash country code syntax supported by ArcGIS.com. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#locale) - * + * * @default Based on your browser/OS and the organization locale. */ locale?: string; /** * The minimum time in minutes before a saved token is due to expire that it should still be considered valid for use. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#minTimeUntilExpiration) - * + * * @default 30 */ minTimeUntilExpiration?: number; /** * Set to `true` to show the OAuth sign in page in a popup window. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popup) - * + * * @default false */ popup?: boolean; /** * Applicable if working with the popup user-login workflow. This is a relative page URL that redirects the user back to the secured application after successful login. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popupCallbackUrl) - * + * * @default "oauth-callback.html" */ popupCallbackUrl?: string; /** * The window features passed to [window.open()](https://developer.mozilla.org/en-US/docs/Web/API/Window/open). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#popupWindowFeatures) - * + * * @default height=490,width=800,resizable,scrollbars,status */ popupWindowFeatures?: string; /** * The ArcGIS Enterprise portal URL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-OAuthInfo.html#portalUrl) - * + * * @default "https://www.arcgis.com" */ portalUrl?: string; @@ -6375,40 +6494,38 @@ declare namespace __esri { interface ServerInfo extends Accessor, JSONSupport { /** * The token service URL used to generate tokens for ArcGIS Server Admin resources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#adminTokenServiceUrl) */ adminTokenServiceUrl: string; /** * Version of the ArcGIS Server deployed on this server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#currentVersion) */ currentVersion: number; /** * The server URL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#server) */ server: string; /** * Validity of short-lived token in minutes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#shortLivedTokenValidity) */ shortLivedTokenValidity: number; /** * The token service URL used to generate tokens for the secured resources on the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#tokenServiceUrl) */ tokenServiceUrl: string; } interface ServerInfoConstructor { - - - new(properties?: ServerInfoProperties): ServerInfo; + new (properties?: ServerInfoProperties): ServerInfo; fromJSON(json: any): ServerInfo; } @@ -6418,40 +6535,39 @@ declare namespace __esri { interface ServerInfoProperties { /** * The token service URL used to generate tokens for ArcGIS Server Admin resources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#adminTokenServiceUrl) */ adminTokenServiceUrl?: string; /** * Version of the ArcGIS Server deployed on this server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#currentVersion) */ currentVersion?: number; /** * The server URL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#server) */ server?: string; /** * Validity of short-lived token in minutes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#shortLivedTokenValidity) */ shortLivedTokenValidity?: number; /** * The token service URL used to generate tokens for the secured resources on the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-ServerInfo.html#tokenServiceUrl) */ tokenServiceUrl?: string; } - interface kernel { /** - * Current version of the ArcGIS API for JavaScript. + * Current version of the ArcGIS API for JavaScript. * ```js * require([ * "esri/kernel" @@ -6459,7 +6575,7 @@ declare namespace __esri { * console.log(esriNS.version); * }); * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-kernel.html#version) */ readonly version: string; @@ -6470,37 +6586,36 @@ declare namespace __esri { interface BaseDynamicLayer extends Layer, ScaleRangeLayer, RefreshableLayer { /** * Adds a promise to the layer's [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) chain. This is typically used in the [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#load) method to ensure that all [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) resources required for the layer to function are loaded prior to this layer resolving and becoming [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#loaded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#addResolvingPromise) - * + * * @param promiseToLoad A promise that must resolve for the layer to resolve and move from the `loading` [status](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#loadStatus) to being [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#loaded). - * + * */ addResolvingPromise(promiseToLoad: IPromise): IPromise; /** * This method fetches the image for the specified extent and size. Override this method if the data returned from the server needs to be processed before it can be displayed. For example, if the server returns binary data, override this method to convert the binary data to an image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#fetchImage) - * + * * @param extent The extent of the view. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param width The width of the view in pixels. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param height The height of the view in pixels. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). - * + * */ fetchImage(extent: Extent, width: number, height: number): IPromise; /** * This method returns a URL to an image for a given extent, width, and height. Override this method to construct the URL for the image based on user interaction. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html#getImageUrl) - * + * * @param extent Extent of the view. This value is populated by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param width Width of the view in pixels. This value is populated by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param height Height of the view in pixels. This value is populated by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). - * + * */ getImageUrl(extent: Extent, width: number, height: number): IPromise | string; - on(name: "layerview-create", eventHandler: BaseDynamicLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: BaseDynamicLayerLayerviewDestroyEventHandler): IHandle; @@ -6509,28 +6624,24 @@ declare namespace __esri { interface BaseDynamicLayerConstructor { /** * This class may be extended to create dynamic map layers. Dynamic layers display an image dynamically generated on the server based on a request, including the extent and size of the image. The exported image covers the entire view extent. Each interaction on the view (e.g. panning, zooming) will result in an export of a new image on the server. Each export is unique so it cannot be cached in the browser. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseDynamicLayer.html) */ - new(properties?: BaseDynamicLayerProperties): BaseDynamicLayer; + new (properties?: BaseDynamicLayerProperties): BaseDynamicLayer; } export const BaseDynamicLayer: BaseDynamicLayerConstructor; - interface BaseDynamicLayerProperties extends LayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { - - } + interface BaseDynamicLayerProperties extends LayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties {} export interface BaseDynamicLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface BaseDynamicLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -6539,57 +6650,61 @@ declare namespace __esri { interface BaseElevationLayer extends Layer { /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#spatialReference) - * + * * @default {@link module:esri/geometry/SpatialReference#WebMercator SpatialReference.WebMercator} */ spatialReference: SpatialReference; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#tileInfo) */ tileInfo: TileInfo; /** * Adds a promise to the layer's [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) chain. This is typically used in the [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#load) method to ensure that all [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) resources required for the layer to function are loaded prior to this layer resolving and becoming [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#loaded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#addResolvingPromise) - * + * * @param promiseToLoad A promise that must resolve for the layer to resolve and move from the `loading` [status](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#loadStatus) to being [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#loaded). - * + * */ addResolvingPromise(promiseToLoad: IPromise): IPromise; /** - * Fetches a tile at the given level, row, and column present in the view. This method must be overwritten to display custom elevation values in the [Map.ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground). Note that this method must return a promise that resolves to an object with the properties defined in [ElevationTileData](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData). See the following samples for examples of how to overwrite this method: + * Fetches a tile at the given level, row, and column present in the view. This method must be overwritten to display custom elevation values in the [Map.ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground). Note that this method must return a promise that resolves to an object with the properties defined in [ElevationTileData](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData). See the following samples for examples of how to overwrite this method: * * [Sample - Custom ElevationLayer: Exaggerating elevation](https://developers.arcgis.com/javascript/latest/sample-code/layers-custom-elevation-exaggerated/index.html) * * [Sample - Custom ElevationLayer: Thematic data as elevation](https://developers.arcgis.com/javascript/latest/sample-code/layers-custom-elevation-thematic/index.html) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#fetchTile) - * + * * @param level The level of detail of the tile to fetch. * @param row The row (y) position of the tile to fetch. * @param column The column (x) position of the tile to fetch. * @param options Optional settings for the tile request. * @param options.noDataValue The value representing pixels in the tile that don't contain an elevation value. - * + * */ - fetchTile(level: number, row: number, column: number, options?: BaseElevationLayerFetchTileOptions): IPromise; + fetchTile( + level: number, + row: number, + column: number, + options?: BaseElevationLayerFetchTileOptions + ): IPromise; /** * Returns the bounds of the tile as an array of four numbers that can be readily converted to an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object. See the table in the `returns` section below for more details about the values returned by this method. This function can be used inside [fetchTile()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#fetchTile) so you can get the bounds of the current tile, convert it to an extent object, and request the desired data for the given extent. See the [Custom ElevationLayer: Thematic data as elevation](https://developers.arcgis.com/javascript/latest/sample-code/layers-custom-elevation-thematic/index.html) sample for an example of how this method works. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#getTileBounds) - * + * * @param level The level of detail (LOD) of the tile. * @param row The tile's row (y) position in the dataset. * @param column The tiles column (x) position in the dataset. * @param out Array for storing the tile bounds or extent. - * + * */ getTileBounds(level: number, row: number, column: number, out?: number[]): number[]; - on(name: "layerview-create", eventHandler: BaseElevationLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: BaseElevationLayerLayerviewDestroyEventHandler): IHandle; @@ -6598,11 +6713,11 @@ declare namespace __esri { interface BaseElevationLayerConstructor { /** * BaseElevationLayer is intended to be extended for creating custom elevation layers. You create a custom [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) by calling [createSubclass()](https://dojotoolkit.org/reference-guide/1.10/dojo/_base/declare.html#createsubclass) on the `BaseElevationLayer`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html) */ - new(properties?: BaseElevationLayerProperties): BaseElevationLayer; + new (properties?: BaseElevationLayerProperties): BaseElevationLayer; } export const BaseElevationLayer: BaseElevationLayerConstructor; @@ -6610,25 +6725,24 @@ declare namespace __esri { interface BaseElevationLayerProperties extends LayerProperties { /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#spatialReference) - * + * * @default {@link module:esri/geometry/SpatialReference#WebMercator SpatialReference.WebMercator} */ spatialReference?: SpatialReferenceProperties; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#tileInfo) */ tileInfo?: TileInfoProperties; } - export interface BaseElevationLayerFetchTileOptions extends Object { /** * The value representing pixels in the tile that don't contain an elevation value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#fetchTile) */ noDataValue?: number; @@ -6636,51 +6750,49 @@ declare namespace __esri { /** * Describes elevation contained in the pixels that comprise an elevation tile. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) */ export interface ElevationTileData extends Object { /** * The elevation values of each pixel in the tile. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) */ values: number[]; /** * The width of the tile in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) */ width: number; /** * The height of the tile in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) */ height: number; /** * The maximum allowed error of the Z-value for each value in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) */ maxZError: number; /** * Indicating the pixel values where no elevation data is present. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseElevationLayer.html#ElevationTileData) */ noDataValue: number; } export interface BaseElevationLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface BaseElevationLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -6689,73 +6801,72 @@ declare namespace __esri { interface BaseTileLayer extends Layer, ScaleRangeLayer, RefreshableLayer { /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#spatialReference) - * + * * @default {@link module:esri/geometry/SpatialReference#WebMercator SpatialReference.WebMercator} */ spatialReference: SpatialReference; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#tileInfo) */ tileInfo: TileInfo; /** * Adds a promise to the layer's [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) chain. This is typically used in the [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#load) method to ensure that all [loadable](https://developers.arcgis.com/javascript/latest/guide/loadable/index.html) resources required for the layer to function are loaded prior to this layer resolving and becoming [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#loaded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#addResolvingPromise) - * + * * @param promiseToLoad A promise that must resolve for the layer to resolve and move from the `loading` [status](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#loadStatus) to being [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#loaded). - * + * */ addResolvingPromise(promiseToLoad: IPromise): IPromise; /** * This method fetches a tile for the given level, row and column present in the view. Override this method if the data or image returned from the server needs to be processed before it can be displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#fetchTile) - * + * * @param level Level of detail of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param row The row (y) position of the tile fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param col The column (x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param options Optional settings for the tile request. The options have the following properties. - * + * */ fetchTile(level: number, row: number, col: number, options?: any): IPromise; /** - * Returns the bounds of the tile as an array of four numbers that be readily converted to an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object. The value for each item in the array is described in the following table: - * + * Returns the bounds of the tile as an array of four numbers that be readily converted to an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object. The value for each item in the array is described in the following table: + * * Index | Value * ------|------ * 0 | Minimum x-value * 1 | Minimum y-value * 2 | Maximum x-value * 3 | Maximum y-value - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#getTileBounds) - * + * * @param level The level of detail (LOD) of the tile. * @param row The tile's row (y) position in the dataset. * @param column The tiles column (x) position in the dataset. * @param out Array for storing the tile bounds or extent. - * + * */ getTileBounds(level: number, row: number, column: number, out?: number[]): number[]; /** * This method returns a URL to an image for a given level, row and column. Override this method to construct the URL for the image based on user interaction. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#getTileUrl) - * + * * @param level Level of detail. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param row Tile row. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param col Tile column. This value is provided by the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). - * + * */ getTileUrl(level: number, row: number, col: number): string; - on(name: "layerview-create", eventHandler: BaseTileLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: BaseTileLayerLayerviewDestroyEventHandler): IHandle; @@ -6764,11 +6875,11 @@ declare namespace __esri { interface BaseTileLayerConstructor { /** * This class may be extended to create a custom [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html). Tile layers are composed of images, such as satellite imagery, that are composed of square tiles mosaicked together in columns and rows, giving the layer the appearance that it is one continuous image. These layers have several levels of detail (LOD) that permit users to zoom in to any region of the map and load additional tiles that depict features in higher resolution at larger map scales. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html) */ - new(properties?: BaseTileLayerProperties): BaseTileLayer; + new (properties?: BaseTileLayerProperties): BaseTileLayer; } export const BaseTileLayer: BaseTileLayerConstructor; @@ -6776,29 +6887,27 @@ declare namespace __esri { interface BaseTileLayerProperties extends LayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#spatialReference) - * + * * @default {@link module:esri/geometry/SpatialReference#WebMercator SpatialReference.WebMercator} */ spatialReference?: SpatialReferenceProperties; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html#tileInfo) */ tileInfo?: TileInfoProperties; } export interface BaseTileLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface BaseTileLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -6807,50 +6916,55 @@ declare namespace __esri { interface BingMapsLayer extends BaseTileLayer { /** * Expose Bing logo url. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#bingLogo) */ readonly bingLogo: string; /** * Copyright information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#copyright) */ readonly copyright: string; /** * Provides culture specific map labels. For more information visit: https://msdn.microsoft.com/en-us/library/ff701709.aspx For a list of supported culture codes please visit: https://msdn.microsoft.com/en-us/library/hh441729.aspx - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#culture) - * + * * @default "en-US" */ culture: string; + /** + * Indicates if the layer has attribution data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#hasAttributionData) + */ + readonly hasAttributionData: boolean; /** * Bing Maps Key. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#key) - * + * * @default null */ key: string; /** * This will alter Geopolitical disputed borders and labels to align with the specified user region. For more information on Bing's region setting please visit: https://msdn.microsoft.com/en-us/library/ff701704.aspx For a list of supported country codes please visit: see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#region) - * + * * @default null */ region: string; /** * The three supported maps are: `road` | `aerial` | `hybrid` For more information on Bing map styles please visit: https://msdn.microsoft.com/en-us/library/ff701716.aspx - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#style) - * + * * @default "road" */ style: string; - on(name: "layerview-create", eventHandler: BingMapsLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: BingMapsLayerLayerviewDestroyEventHandler): IHandle; @@ -6859,11 +6973,11 @@ declare namespace __esri { interface BingMapsLayerConstructor { /** * This layer supports Microsoft's Bing tiled map content. Three map styles are supported - `road`, `aerial` and `hybrid`. Please note that a valid [Bing Maps key](https://msdn.microsoft.com/en-us/library/ff428642.aspx) is required to use this layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html) */ - new(properties?: BingMapsLayerProperties): BingMapsLayer; + new (properties?: BingMapsLayerProperties): BingMapsLayer; } export const BingMapsLayer: BingMapsLayerConstructor; @@ -6871,68 +6985,323 @@ declare namespace __esri { interface BingMapsLayerProperties extends BaseTileLayerProperties { /** * Provides culture specific map labels. For more information visit: https://msdn.microsoft.com/en-us/library/ff701709.aspx For a list of supported culture codes please visit: https://msdn.microsoft.com/en-us/library/hh441729.aspx - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#culture) - * + * * @default "en-US" */ culture?: string; /** * Bing Maps Key. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#key) - * + * * @default null */ key?: string; /** * This will alter Geopolitical disputed borders and labels to align with the specified user region. For more information on Bing's region setting please visit: https://msdn.microsoft.com/en-us/library/ff701704.aspx For a list of supported country codes please visit: see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#region) - * + * * @default null */ region?: string; /** * The three supported maps are: `road` | `aerial` | `hybrid` For more information on Bing map styles please visit: https://msdn.microsoft.com/en-us/library/ff701716.aspx - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BingMapsLayer.html#style) - * + * * @default "road" */ style?: string; } export interface BingMapsLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface BingMapsLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } + interface BuildingSceneLayer extends Layer, SceneService, PortalLayer { + /** + * A flat [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of all the [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#sublayers) in the BuildingSublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#allSublayers) + */ + readonly allSublayers: Collection; + /** + * Specifies how features are placed on the vertical axis (z). This property only affects [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html) when using the `absolute-height` mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#elevationInfo) + */ + elevationInfo: BuildingSceneLayerElevationInfo; + /** + * Hierarchical structure of sublayers in a BuildingSceneLayer. Usually contains an Overview [BuildingComponentSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html) and a Full Model [BuildingGroupSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingGroupSublayer.html). However, some BuildingSceneLayers can contain only the Full Model [BuildingGroupSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingGroupSublayer.html) or the discipline [BuildingGroupSublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingGroupSublayer.html) directly. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#sublayers) + */ + readonly sublayers: Collection; + + on(name: "layerview-create", eventHandler: BuildingSceneLayerLayerviewCreateEventHandler): IHandle; + + on(name: "layerview-destroy", eventHandler: BuildingSceneLayerLayerviewDestroyEventHandler): IHandle; + } + + interface BuildingSceneLayerConstructor { + /** + * The BuildingSceneLayer is designed for visualizing buildings with detailed interiors in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). These building models are usually exported from Building Information Modeling (BIM) projects. The data in a BuildingSceneLayer can represent walls, lighting fixtures, mechanical systems, furniture and so on. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html) + */ + + new (properties?: BuildingSceneLayerProperties): BuildingSceneLayer; + + fromJSON(json: any): BuildingSceneLayer; + } + + export const BuildingSceneLayer: BuildingSceneLayerConstructor; + + interface BuildingSceneLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { + /** + * Specifies how features are placed on the vertical axis (z). This property only affects [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html) when using the `absolute-height` mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#elevationInfo) + */ + elevationInfo?: BuildingSceneLayerElevationInfo; + } + + export interface BuildingSceneLayerElevationInfo extends Object { + /** + * Defines how features are placed on the vertical axis (z). Currently only `absolute-height` mode is supported. + * + * Mode | Description + * ------|------------ + * absolute-height | Features are placed at an absolute elevation (z-value) above sea level. This z-value is determined by summing up the `offset` value and the point's z-value. It doesn't take the elevation of the terrain into account. This is the only supported elevation mode for a [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#elevationInfo) + */ + mode: string; + /** + * An elevation offset, which is added to the vertical position of each feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#elevationInfo) + * + * @default 0 + */ + offset?: number; + /** + * The unit for `offset` values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html#elevationInfo) + * + * @default meters + */ + unit?: string; + } + + export interface BuildingSceneLayerLayerviewCreateEvent { + layerView: LayerView; + + view: View; + } + + export interface BuildingSceneLayerLayerviewDestroyEvent { + layerView: LayerView; + + view: View; + } + + interface BuildingComponentSublayer extends BuildingSublayer, Loadable { + /** + * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when only a subset of the data in the layer should be displayed. Setting the definition expression of a layer automatically updates all layer views. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. Important to note is that the initial loading time of the features remains unchanged, even if they are filtered. This happens because, as opposed to Feature Layers, feature filtering is done client-side. As a result all features need to be downloaded always for filter evaluation. This property is evaluated on the client using the cached attributes and it only supports [standardized SQL](http://doc.arcgis.com/en/arcgis-online/reference/sql-agol.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#definitionExpression) + */ + definitionExpression: string; + /** + * Indicates whether to display popups when features in the layer are clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#popupEnabled) + * + * @default true + */ + popupEnabled: boolean; + /** + * The popup template for the sublayer. When set, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Setting a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) on this layer type is done in the same way as a FeatureLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#popupTemplate) + */ + popupTemplate: PopupTemplate; + /** + * The renderer assigned to the sublayer. The renderer defines how to visualize each feature in the sublayer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#renderer) + */ + renderer: Renderer; + /** + * The type for this sublayer is always `building-component`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#type) + */ + readonly type: "building-component"; + } + + interface BuildingComponentSublayerConstructor { + new (properties?: BuildingComponentSublayerProperties): BuildingComponentSublayer; + + fromJSON(json: any): BuildingComponentSublayer; + } + + export const BuildingComponentSublayer: BuildingComponentSublayerConstructor; + + interface BuildingComponentSublayerProperties extends BuildingSublayerProperties, LoadableProperties { + /** + * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when only a subset of the data in the layer should be displayed. Setting the definition expression of a layer automatically updates all layer views. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. Important to note is that the initial loading time of the features remains unchanged, even if they are filtered. This happens because, as opposed to Feature Layers, feature filtering is done client-side. As a result all features need to be downloaded always for filter evaluation. This property is evaluated on the client using the cached attributes and it only supports [standardized SQL](http://doc.arcgis.com/en/arcgis-online/reference/sql-agol.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#definitionExpression) + */ + definitionExpression?: string; + /** + * Indicates whether to display popups when features in the layer are clicked. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#popupEnabled) + * + * @default true + */ + popupEnabled?: boolean; + /** + * The popup template for the sublayer. When set, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Setting a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) on this layer type is done in the same way as a FeatureLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#popupTemplate) + */ + popupTemplate?: PopupTemplateProperties; + /** + * The renderer assigned to the sublayer. The renderer defines how to visualize each feature in the sublayer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#renderer) + */ + renderer?: RendererProperties; + } + + interface BuildingGroupSublayer extends BuildingSublayer { + /** + * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of sublayers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingGroupSublayer.html#sublayers) + */ + readonly sublayers: Collection; + /** + * The type for this sublayer is always `building-group`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingGroupSublayer.html#type) + */ + readonly type: "building-group"; + } + + interface BuildingGroupSublayerConstructor { + new (properties?: BuildingGroupSublayerProperties): BuildingGroupSublayer; + + fromJSON(json: any): BuildingGroupSublayer; + } + + export const BuildingGroupSublayer: BuildingGroupSublayerConstructor; + + interface BuildingGroupSublayerProperties extends BuildingSublayerProperties {} + + interface BuildingSublayer extends Accessor { + /** + * The sublayer's layer id as defined by the Scene Service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#id) + */ + readonly id: number; + /** + * The modelName is a standard name for each sublayer. For example the sublayer containing the doors in a building has the modelName "Doors". Use this property to retrieve sublayers in a [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BuildingSceneLayer.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#modelName) + */ + readonly modelName: string; + /** + * Opacity of the sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#opacity) + * + * @default 1 + */ + opacity: number; + /** + * The title of the sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#title) + */ + title: string; + /** + * Indicates if the sublayer is visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#visible) + * + * @default true + */ + visible: boolean; + } + + interface BuildingSublayerConstructor { + new (properties?: BuildingSublayerProperties): BuildingSublayer; + + fromJSON(json: any): BuildingSublayer; + } + + export const BuildingSublayer: BuildingSublayerConstructor; + + interface BuildingSublayerProperties { + /** + * Opacity of the sublayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#opacity) + * + * @default 1 + */ + opacity?: number; + /** + * The title of the sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#title) + */ + title?: string; + /** + * Indicates if the sublayer is visible in the view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingSublayer.html#visible) + * + * @default true + */ + visible?: boolean; + } + interface CSVLayer extends Layer { /** * Copyright information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#copyright) */ copyright: string; /** * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when the dataset is large and you don't want to bring all features to the client for analysis. Definition expressions may be set when a layer is constructed prior to it loading in the view or after it has been added to the map. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#definitionExpression) */ definitionExpression: string; /** - * The column delimiter. See the table below for possible values. - * + * The column delimiter. See the table below for possible values. + * * | Value | Description| * | --- | --- | * | `,` | comma | @@ -6940,208 +7309,206 @@ declare namespace __esri { * | `;` | semicolon | * | `|` | pipe | * | `\t` | tab-delimited | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#delimiter) */ delimiter: string; /** * Specifies how graphics are placed on the vertical axis (z). This property may only be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) */ elevationInfo: CSVLayerElevationInfo; /** * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/assets/img/samples/city-points-declutter.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#featureReduction) */ featureReduction: CSVLayerFeatureReduction; /** * An array of fields in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#fields) */ fields: Field[]; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). * > **Known Limitations** Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) */ labelingInfo: LabelClass[]; /** - * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) property. - * > **Known Limitations** + * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) property. + * > **Known Limitations** * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * * Currently the `labelsVisible` property must be explicitly set to `true` for labels to be printed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) - * + * * @default true */ labelsVisible: boolean; /** * The latitude field name. If not specified, the API will look for following field names in the CSV source: "lat", "latitude", "y", "ycenter", "latitude83", "latdecdeg", "POINT-Y". - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#latitudeField) */ latitudeField: string; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * The longitude field name. If not specified, the API will look for following field names in the CSV source: "lon", "lng", "long", "longitude", "x", "xcenter", "longitude83", "longdecdeg", "POINT-X". - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#longitudeField) */ longitudeField: string; /** * The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#minScale) value, and greater than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#maxScale) - * + * * @default 0 */ maxScale: number; /** * The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#maxScale) value, and lesser than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#minScale) - * + * * @default 0 */ minScale: number; /** * An array of field names to include in the CSVLayer. If not specified, the layer will include all fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#outFields) */ outFields: string[]; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupEnabled) - * + * * @default true */ popupEnabled: boolean; /** * The popup template for the layer. When set on the layer, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupTemplate) */ popupTemplate: PopupTemplate; /** * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#renderer) */ renderer: Renderer; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#screenSizePerspectiveEnabled) - * + * * @default true */ screenSizePerspectiveEnabled: boolean; /** - * The spatial reference of the layer. The default value is WGS84. This property can be set explicitly to project the longitude and latitude coordinates when the layer parses the CSV file. While not required, explicitly setting the spatial reference of the layer will improve the performance when projecting to a spatial reference other than the one used by the coordinates in the raw data. + * The spatial reference of the layer. The default value is WGS84. This property can be set explicitly to project the longitude and latitude coordinates when the layer parses the CSV file. While not required, explicitly setting the spatial reference of the layer will improve the performance when projecting to a spatial reference other than the one used by the coordinates in the raw data. * > **Known Limitations** The browser must support [WebAssembly](https://caniuse.com/#feat=wasm) if a spatial reference other than WGS84 or Web Mercator is specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#spatialReference) - * + * * @default SpatialReference.WGS84 */ spatialReference: SpatialReference; /** * The URL of the CSV file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#url) */ url: string; /** * Creates query parameters that can be used to fetch features that satisfy the layer's current filters, and definitions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#createQuery) - * - * + * + * */ createQuery(): Query; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. If no parameters are specified, then the extent and count of all features satisfying the layer's configuration/filters are returned. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. If no parameters are specified, then the extent and count of all features satisfying the layer's configuration/filters are returned. + * > **Known Limitations** * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are currently not supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): * * GDM 2000 (4742) – Malaysia * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#queryExtent) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryExtent(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns the number of features that satisfy the query. If no parameters are specified, then the total number of features satisfying the layer's configuration/filters is returned. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns the number of features that satisfy the query. If no parameters are specified, then the total number of features satisfying the layer's configuration/filters is returned. + * > **Known Limitations** * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are currently not supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): * * GDM 2000 (4742) – Malaysia * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#queryFeatureCount) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryFeatureCount(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method once the promise resolves. A [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) contains an array of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) features, which can be added to the [view's graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics). This array will not be populated if zero results are found. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method once the promise resolves. A [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) contains an array of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) features, which can be added to the [view's graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics). This array will not be populated if zero results are found. + * > **Known Limitations** * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): * * GDM 2000 (4742) – Malaysia * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#queryFeatures) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryFeatures(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns an array of Object IDs for features that satisfy the input query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the CSV data and returns an array of Object IDs for features that satisfy the input query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. + * > **Known Limitations** * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are currently not supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): * * GDM 2000 (4742) – Malaysia * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#queryObjectIds) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryObjectIds(params?: Query | QueryProperties): IPromise; - on(name: "layerview-create", eventHandler: CSVLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: CSVLayerLayerviewDestroyEventHandler): IHandle; @@ -7150,11 +7517,11 @@ declare namespace __esri { interface CSVLayerConstructor { /** * The CSVLayer is a point layer based on a CSV file (.csv, .txt). CSV is a plain-text file format used to represent tabular data, including geographic point features (latitude, longitude). Typically the latitude coordinate is the Y value, and the longitude coordinate is the X value. Features from the CSV file are accessible via the API so you can query features and use them as input to geometry or geoprocessing services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) */ - new(properties?: CSVLayerProperties): CSVLayer; + new (properties?: CSVLayerProperties): CSVLayer; } export const CSVLayer: CSVLayerConstructor; @@ -7162,19 +7529,19 @@ declare namespace __esri { interface CSVLayerProperties extends LayerProperties { /** * Copyright information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#copyright) */ copyright?: string; /** * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when the dataset is large and you don't want to bring all features to the client for analysis. Definition expressions may be set when a layer is constructed prior to it loading in the view or after it has been added to the map. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#definitionExpression) */ definitionExpression?: string; /** - * The column delimiter. See the table below for possible values. - * + * The column delimiter. See the table below for possible values. + * * | Value | Description| * | --- | --- | * | `,` | comma | @@ -7182,200 +7549,194 @@ declare namespace __esri { * | `;` | semicolon | * | `|` | pipe | * | `\t` | tab-delimited | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#delimiter) */ delimiter?: string; /** * Specifies how graphics are placed on the vertical axis (z). This property may only be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) */ elevationInfo?: CSVLayerElevationInfo; /** * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/assets/img/samples/city-points-declutter.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#featureReduction) */ featureReduction?: CSVLayerFeatureReduction; /** * An array of fields in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#fields) */ fields?: FieldProperties[]; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) property of this layer must be set to `true`. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). * > **Known Limitations** Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) */ labelingInfo?: LabelClassProperties[]; /** - * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) property. - * > **Known Limitations** + * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelingInfo) property. + * > **Known Limitations** * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * * Currently the `labelsVisible` property must be explicitly set to `true` for labels to be printed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#labelsVisible) - * + * * @default true */ labelsVisible?: boolean; /** * The latitude field name. If not specified, the API will look for following field names in the CSV source: "lat", "latitude", "y", "ycenter", "latitude83", "latdecdeg", "POINT-Y". - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#latitudeField) */ latitudeField?: string; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * The longitude field name. If not specified, the API will look for following field names in the CSV source: "lon", "lng", "long", "longitude", "x", "xcenter", "longitude83", "longdecdeg", "POINT-X". - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#longitudeField) */ longitudeField?: string; /** * The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#minScale) value, and greater than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#maxScale) - * + * * @default 0 */ maxScale?: number; /** * The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#maxScale) value, and lesser than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#minScale) - * + * * @default 0 */ minScale?: number; /** * An array of field names to include in the CSVLayer. If not specified, the layer will include all fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#outFields) */ outFields?: string[]; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupEnabled) - * + * * @default true */ popupEnabled?: boolean; /** * The popup template for the layer. When set on the layer, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#popupTemplate) */ popupTemplate?: PopupTemplateProperties; /** * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#renderer) */ renderer?: RendererProperties; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#screenSizePerspectiveEnabled) - * + * * @default true */ screenSizePerspectiveEnabled?: boolean; /** - * The spatial reference of the layer. The default value is WGS84. This property can be set explicitly to project the longitude and latitude coordinates when the layer parses the CSV file. While not required, explicitly setting the spatial reference of the layer will improve the performance when projecting to a spatial reference other than the one used by the coordinates in the raw data. + * The spatial reference of the layer. The default value is WGS84. This property can be set explicitly to project the longitude and latitude coordinates when the layer parses the CSV file. While not required, explicitly setting the spatial reference of the layer will improve the performance when projecting to a spatial reference other than the one used by the coordinates in the raw data. * > **Known Limitations** The browser must support [WebAssembly](https://caniuse.com/#feat=wasm) if a spatial reference other than WGS84 or Web Mercator is specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#spatialReference) - * + * * @default SpatialReference.WGS84 */ spatialReference?: SpatialReferenceProperties; /** * The URL of the CSV file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#url) */ url?: string; } - export interface CSVLayerElevationInfo extends Object { /** - * Defines how the graphic is placed with respect to the terrain surface. See the table below for a list of possible values. - * + * Defines how the graphic is placed with respect to the terrain surface. See the table below for a list of possible values. + * * Mode | Description * ------|------------ * on-the-ground | Graphics are draped on the terrain surface. This is the default value for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [ObjectSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). * relative-to-ground | Graphics are placed at an elevation relative to the terrain surface. The graphic's elevation is determined by summing up the terrain elevation and the result of `featureExpressionInfo` (if defined). This is the default value for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [IconSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html). - * absolute-height | Graphics are placed at an absolute height above sea level. This height is determined by the result of `featureExpressionInfo` (if defined). This mode doesn't take the elevation of the terrain into account. + * absolute-height | Graphics are placed at an absolute elevation (z-value) above sea level. This z-value is determined by the result of `featureExpressionInfo` (if defined). This mode doesn't take the elevation of the terrain into account. * relative-to-scene | Graphics are aligned to buildings and other objects part of 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html), depending on which has higher elevation. If the graphic is not directly above a building or any other feature, it is aligned to the terrain surface elevation. If defined, the result of `featureExpressionInfo` is added to the 3D Object/terrain surface elevation. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) */ mode: string; /** * An elevation offset, which is added to the vertical position of the graphic. If `unit` is not defined, the offset is in `meters`. When `mode = "on-the-ground"`, this property has no effect. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) */ offset?: number; /** - * This object contains information about setting a custom height on the graphic. If this property is set, then z values are not considered for calculating graphic height. - * + * This object contains information about setting a custom z-value on the feature. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) */ featureExpressionInfo?: CSVLayerElevationInfoFeatureExpressionInfo; /** * The unit for `featureExpressionInfo` and `offset` values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) */ unit?: string; } - export interface CSVLayerElevationInfoFeatureExpressionInfo extends Object { /** - * An [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) evaluating to a number that determines the height of the graphic. When `mode = "on-the-ground"`, this property has no effect. For line and polygon geometries the result of the expression is the same for all vertices of a feature. - * + * An [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) evaluating to a number that determines the z-value of the feature. When `mode = "on-the-ground"`, this property has no effect. For line and polygon geometries the result of the expression is the same for all vertices of a feature. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#elevationInfo) */ expression?: string; } - export interface CSVLayerFeatureReduction extends Object { /** * Type of the decluttering method. The only supported type at the moment is `selection`. In this method, some of the overlapping features are hidden such that none of the remaining features intersect on screen. Label deconfliction also respects this option and hides labels that would overlap with the features of this layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html#featureReduction) */ type: string; } export interface CSVLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface CSVLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -7384,51 +7745,59 @@ declare namespace __esri { interface DynamicLayer { /** * The portal item from which the layer is loaded. This will load the layer along with any overridden properties (e.g. renderers, definition expressions, etc.) saved to the portal item, not the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#portalItem) */ portalItem: PortalItem; /** * The URL to the REST endpoint of the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#url) */ url: string; /** * This method fetches the image for the specified extent and size. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#fetchImage) - * + * * @param extent The extent of the view. * @param width The width of the view in pixels. * @param height The height of the view in pixels. * @param options The parameter options is an object with the following properties. * @param options.rotation The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. * @param options.pixelRatio The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at. - * + * */ - fetchImage(extent: Extent, width: number, height: number, options?: DynamicLayerFetchImageOptions): IPromise; + fetchImage( + extent: Extent, + width: number, + height: number, + options?: DynamicLayerFetchImageOptions + ): IPromise; /** * This method returns a URL to an image for a given extent, width and height. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#getImageUrl) - * + * * @param extent The extent of the exported image. * @param width The width of the view in pixels. * @param height The height of the view in pixels. * @param options The parameter options is an object with the following properties. * @param options.pixelRatio The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at. * @param options.rotation The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. - * + * */ - getImageUrl(extent: Extent, width: number, height: number, options?: DynamicLayerGetImageUrlOptions): IPromise | string; + getImageUrl( + extent: Extent, + width: number, + height: number, + options?: DynamicLayerGetImageUrlOptions + ): IPromise | string; } interface DynamicLayerConstructor { - - - new(): DynamicLayer; + new (): DynamicLayer; } export const DynamicLayer: DynamicLayerConstructor; @@ -7436,45 +7805,43 @@ declare namespace __esri { interface DynamicLayerProperties { /** * The portal item from which the layer is loaded. This will load the layer along with any overridden properties (e.g. renderers, definition expressions, etc.) saved to the portal item, not the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#portalItem) */ portalItem?: PortalItemProperties; /** * The URL to the REST endpoint of the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#url) */ url?: string; } - export interface DynamicLayerFetchImageOptions extends Object { /** * The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#fetchImage) */ rotation?: number; /** * The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#fetchImage) */ pixelRatio?: number; } - export interface DynamicLayerGetImageUrlOptions extends Object { /** * The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#getImageUrl) */ pixelRatio?: number; /** * The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-DynamicLayer.html#getImageUrl) */ rotation?: number; @@ -7483,64 +7850,67 @@ declare namespace __esri { interface ElevationLayer extends Layer, ArcGISCachedService, PortalLayer { /** * URL pointing to the Elevation layer resource on an ArcGIS Image Server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#url) */ url: string; /** * Creates an elevation sampler for the given [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) by querying the service layer for elevation data and caching it so values may be sampled quickly afterwards. The resolution of the cached data can be set using the `demResolution` option. In many cases, `auto` demResolution can be used to get high quality elevation samples without the need to know exactly where the data in the service is located. This is particularly useful for services which combine elevation data from many sources (such as the world elevation service). If more control, or higher quality samples are required, use either `finest-contiguous` or a fixed `{number}` resolution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#createElevationSampler) - * + * * @param extent The extent for which to create the sampler. * @param options Additional query options. See the table below. * @param options.demResolution Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) for more details. * @param options.noDataValue The value to use when there is no data available. - * + * */ - createElevationSampler(extent: Extent, options?: ElevationLayerCreateElevationSamplerOptions): IPromise; + createElevationSampler( + extent: Extent, + options?: ElevationLayerCreateElevationSamplerOptions + ): IPromise; /** - * Requests a tile from the service and decodes the data into a linear array of elevation values. The returned promise resolves with a plain object describing the obtained elevation data for the tile. The object has the following properties: - * + * Requests a tile from the service and decodes the data into a linear array of elevation values. The returned promise resolves with a plain object describing the obtained elevation data for the tile. The object has the following properties: + * * Property | Type | Description * ----------|--------------|------------ * values | Float32Array | The elevation values contained in the tile. * width | number | The number of elevation values in one row of the tile. * height | number | The number of elevation values in one column of the tile. * maxZError | number | The upper bound for the compression error on the elevation values. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#fetchTile) - * + * * @param level the tile level. * @param row the tile row. * @param column the tile column. * @param noDataValue the value to use when a tile is partially missing data. - * + * */ fetchTile(level: number, row: number, column: number, noDataValue?: number): IPromise; /** * This method returns a URL to a tile for a given level, row and column. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#getTileUrl) - * + * * @param level The requested tile's level. * @param row The requested tile's row. * @param col The requested tile's column. - * + * */ getTileUrl(level: number, row: number, col: number): string; /** * Queries the service layer for elevation values for the given geometry. The returned result contains a copy of the geometry with z-values sampled from elevation data from the service. The resolution from which the elevation is queried can be set using the `demResolution` option. In many cases, `auto` demResolution can be used to get high quality elevation samples without the need to know exactly where the data in the service is located. This is particularly useful for services which combine elevation data from many sources (such as the world elevation service). If more control, or higher quality samples are required, use either `finest-contiguous` or a fixed `{number}` resolution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) - * + * * @param geometry The geometry to use for sampling elevation data. * @param options Additional query options. See the table below. - * @param options.demResolution - * Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See the table below for more details on the different settings. - * + * @param options.demResolution + * Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See the table below for more details on the different settings. + * * demResolution | Description * -----------------------|------------- * `auto` | Automatically chooses an appropriate resolution for each coordinate of the input geometry. The current implementation will try to use the finest available resolution given that the total required number of tile requests does not exceed a certain maximum amount (currently 20). Note that this may result in values being sampled from different resolutions. @@ -7548,10 +7918,12 @@ declare namespace __esri { * `{number}` | Sample elevation from the resolution closest to the specified resolution (in meters). * @param options.returnSampleInfo Indicates whether to return additional sample information for each coordinate. * @param options.noDataValue The value to use when there is no data available. - * + * */ - queryElevation(geometry: Point | Multipoint | Polyline, options?: ElevationLayerQueryElevationOptions): IPromise; - + queryElevation( + geometry: Point | Multipoint | Polyline, + options?: ElevationLayerQueryElevationOptions + ): IPromise; on(name: "layerview-create", eventHandler: ElevationLayerLayerviewCreateEventHandler): IHandle; @@ -7561,11 +7933,11 @@ declare namespace __esri { interface ElevationLayerConstructor { /** * ElevationLayer is a tile layer used for rendering elevations in [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A default [world elevation layer](https://www.arcgis.com/home/item.html?id=7029fb60158543ad845c7e1527af11e4) can be added to the map by setting the [map's ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) property to `world-elevation`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) */ - new(properties?: ElevationLayerProperties): ElevationLayer; + new (properties?: ElevationLayerProperties): ElevationLayer; fromJSON(json: any): ElevationLayer; } @@ -7575,62 +7947,60 @@ declare namespace __esri { interface ElevationLayerProperties extends LayerProperties, ArcGISCachedServiceProperties, PortalLayerProperties { /** * URL pointing to the Elevation layer resource on an ArcGIS Image Server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#url) */ url?: string; } - export interface ElevationLayerCreateElevationSamplerOptions extends Object { /** * Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#createElevationSampler) - * + * * @default auto */ demResolution?: number | string; /** * The value to use when there is no data available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#createElevationSampler) - * + * * @default 0 */ noDataValue?: number; } - export interface ElevationLayerQueryElevationOptions extends Object { /** - * Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See the table below for more details on the different settings. - * + * Controls the horizontal resolution (cell size) in meters from which elevation data is sampled (defaults to `auto`). See the table below for more details on the different settings. + * * demResolution | Description * -----------------------|------------- * `auto` | Automatically chooses an appropriate resolution for each coordinate of the input geometry. The current implementation will try to use the finest available resolution given that the total required number of tile requests does not exceed a certain maximum amount (currently 20). Note that this may result in values being sampled from different resolutions. * `finest-contiguous` | Sample elevation from the finest available resolution (cell size) across the entire geometry. * `{number}` | Sample elevation from the resolution closest to the specified resolution (in meters). - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) - * + * * @default auto */ demResolution?: number | string; /** * Indicates whether to return additional sample information for each coordinate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) - * + * * @default false */ returnSampleInfo?: boolean; /** * The value to use when there is no data available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) - * + * * @default 0 */ noDataValue?: number; @@ -7638,49 +8008,46 @@ declare namespace __esri { /** * Object returned when [queryElevation()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#queryElevation) promise resolves: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) */ export interface ElevationLayerElevationQueryResult extends Object { /** * The geometry with sampled z-values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) */ geometry: Point | Multipoint | Polyline; /** * Contains additional information about how the geometry was sampled. This property is present depending on whether the user set `options.returnSampleInfo = true`, for each coordinate in the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) */ sampleInfo?: ElevationLayerElevationQueryResultSampleInfo[]; /** * The value used when there is no data available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) */ noDataValue: number; } export interface ElevationLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface ElevationLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface ElevationLayerElevationQueryResultSampleInfo extends Object { /** * The resolution at which the z-value was sampled. If no data was available for sampling for a given coordinate, the dem resolution value will be -1 for that coordinate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#ElevationQueryResult) */ demResolution: number; @@ -7688,379 +8055,379 @@ declare namespace __esri { interface FeatureLayer extends Layer, PortalLayer, ScaleRangeLayer, RefreshableLayer { /** - * Indicates the layer's supported capabilities. - * + * Describes the layer's supported capabilities. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ readonly capabilities: FeatureLayerCapabilities; /** * The copyright text as defined by the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#copyright) */ copyright: string; /** * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when the dataset is large and you don't want to bring all features to the client for analysis. Definition expressions may be set when a layer is constructed prior to it loading in the view or after it has been added to the map. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression) */ definitionExpression: string; /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#displayField) */ displayField: string; /** * An object that allows you to create a dynamic layer with data either from map service sublayers or data from a registered workspace. See [DynamicMapLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) for creating dynamic layers from map service layers for on the fly rendering, labeling, and filtering (definition expressions). To create dynamic layers from other sources in registered workspaces such as tables and table joins, see [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer). If you already have a [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) instance, you can call the [createFeatureLayer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer) method on the Sublayer to construct the layer for you. This only applies to map services with [dynamic layers](https://enterprise.arcgis.com/en/server/latest/publish-services/linux/about-dynamic-layers.htm) enabled. Therefore, the [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url) of the FeatureLayer instance must point to a map service url ending with `/dynamicLayer`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#dynamicDataSource) */ dynamicDataSource: DynamicMapLayer | DynamicDataLayer; /** * Specifies how features are placed on the vertical axis (z). This property may only be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ elevationInfo: FeatureLayerElevationInfo; /** * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/assets/img/samples/city-points-declutter.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#featureReduction) */ featureReduction: FeatureLayerFeatureReduction; /** - * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side features you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. - * + * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side features you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer), and [type](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#type) properties. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) */ fields: Field[]; /** * The version of the geodatabase of the feature service data. Read the [Overview of versioning](https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/an-overview-of-versioning.htm) topic for more details about this capability. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#gdbVersion) */ readonly gdbVersion: string; /** * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). When creating a FeatureLayer from client-side features, this property is inferred by the geometryType of the features provided in the layer's [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) property. **Possible Values:** point | multipoint | polyline | polygon | extent | mesh - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) */ geometryType: string; /** * Indicates if attachments are enabled on the feature layer. Use `FeatureLayer.capabilities.data.supportsAttachment` instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#hasAttachments) - * + * * @default false */ readonly hasAttachments: boolean; /** * Indicates whether the client-side features in the layer have `M` (measurement) values. Use the `supportsM` property in the FeatureLayer's [capabilities.data](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) object to verify if `M` values are supported on [feature service](https://developers.arcgis.com/rest/services-reference/feature-service.htm) features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#hasM) - * + * * @default undefined */ readonly hasM: boolean; /** * Indicates whether the client-side features in the layer have `Z` (elevation) values. Refer to [elevationInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) for details regarding placement and rendering of features with z-values in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Use the `supportsZ` property in the FeatureLayer's [capabilities.data](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) object to verify if `Z` values are supported on [feature service](https://developers.arcgis.com/rest/services-reference/feature-service.htm) features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#hasZ) - * + * * @default undefined */ readonly hasZ: boolean; /** * The historic moment to query. If historicMoment is not specified, the query will apply to the current features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#historicMoment) */ historicMoment: Date; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. The [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true` for labels to display in the view. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). - * > **Known Limitations** + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. The [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true` for labels to display in the view. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). + * > **Known Limitations** * * Currently only FeatureLayers with point and polygon geometries are supported. * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) */ labelingInfo: LabelClass[]; /** - * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) property. - * > **Known Limitations** - * * Currently only FeatureLayers with point and polygon geometries are supported. + * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) property. + * > **Known Limitations** * * Currently 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) only support one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) per feature. - * * Currently the `labelsVisible` property must be explicitly set to `true` for labels to be printed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) - * + * * @default true */ labelsVisible: boolean; /** - * The layer ID, or layer index, of a Feature Service layer. This is particularly useful when loading a single FeatureLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: + * The layer ID, or layer index, of a Feature Service layer. This is particularly useful when loading a single FeatureLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: * * When loading the layer via the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property. * * When pointing the layer [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url) directly to the Feature Service. - * - * + * + * * If a layerId is not specified in either of the above scenarios, then the first layer in the service (`layerId = 0`) is selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#layerId) */ layerId: number; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * The name of an `oid` [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) containing a unique value or identifier for each feature in the layer. This is required when constructing a FeatureLayer from a collection of client-side [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) */ objectIdField: string; /** * An array of field names from the service to include in the FeatureLayer. If not specified, the layer will only return the `OBJECTID` field. To fetch the values from all fields in the layer, use `["*"]`. This is particularly useful when editing features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields) */ outFields: string[]; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupEnabled) - * + * * @default true */ popupEnabled: boolean; /** * The popup template for the layer. When set on the layer, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) */ popupTemplate: PopupTemplate; /** * Array of [relationships](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html) set up for the layer. Each object in the array describes the layer's [relationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html) with another layer or table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#relationships) */ - readonly relationships: Relationship; + readonly relationships: Relationship[]; /** * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. However, when creating a FeatureLayer from client-side features, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) */ renderer: Renderer; /** * When `true`, indicates that M values will be returned. When `false`, indicates that M values will never be returned. The layer view determines whether to include M values in feature queries when the property value is `undefined`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnM) - * + * * @default undefined */ returnM: boolean; /** * When `true`, indicates that Z values will always be returned. When `false`, indicates that Z values will never be returned. The layer view determines whether to include Z values in feature queries when the property value is `undefined`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnZ) - * + * * @default undefined */ returnZ: boolean; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#screenSizePerspectiveEnabled) - * + * * @default true */ screenSizePerspectiveEnabled: boolean; /** - * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. The geometry of each feature all must have a matching [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType). This property should only be used when creating a FeatureLayer from client-side features. When creating a FeatureLayer from client-side features, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. Use [applyEdits()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) method to add, remove, and update features from a layer at runtime. Once `applyEdits()` resolves successfully, use [queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) to return updated features. The [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties are determined based on the features provided to this property. - * + * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. The geometry of each feature all must have a matching [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType). This property should only be used when creating a FeatureLayer from client-side features. When creating a FeatureLayer from client-side features, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer), and [type](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#type) properties must also be set. Use [applyEdits()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) method to add, remove, and update features from a layer at runtime. Once `applyEdits()` resolves successfully, use [queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) to return updated features. The [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties are determined based on the features provided to this property. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) */ source: Collection; /** * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. When creating a FeatureLayer from client-side features, this property is inferred from the geometries of the features provided in the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) */ spatialReference: SpatialReference; /** * An array of feature templates defined in the feature layer. See [ArcGIS Pro subtypes document](https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/an-overview-of-subtypes.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#templates) */ templates: FeatureTemplate[]; /** * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#token) */ readonly token: string; /** * The name of the field holding the type ID or subtypes for the features. See [ArcGIS Pro subtypes document](https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/an-overview-of-subtypes.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#typeIdField) */ readonly typeIdField: string; /** * An array of subtypes defined in the feature service exposed by ArcGIS REST API. Each item includes information about the type, such as the type ID, name, and definition expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#types) */ types: FeatureType[]; /** * The URL of the REST endpoint of the layer or service. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. If the url points directly to a service, then the layer must be specified in the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#layerId) property. If no [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#layerId) is given, then the first layer in the service will be loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url) */ url: string; /** * The version of ArcGIS Server in which the layer is published. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#version) */ readonly version: number; /** - * Adds an attachment to a feature. This operation is available only if the layer's [capabilities.data.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is set to `true`. - * + * Adds an attachment to a feature. This operation is available only if the layer's [capabilities.data.supportsAttachment](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is set to `true`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#addAttachment) - * + * * @param feature Feature to which the attachment is to be added. * @param attachment HTML form that contains a file upload field pointing to the file to be added as an attachment. - * + * */ addAttachment(feature: Graphic, attachment: HTMLFormElement | FormData): IPromise; /** - * Applies edits to features in a layer. New features can be created and existing features can be updated or deleted. Feature geometries and/or attributes may be modified. Only applicable to layers in a [feature service](https://developers.arcgis.com/rest/services-reference/feature-service.htm) and client-side features set through the layer's [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source). - * > **Known Limitations** FeatureLayer.applyEdits() is not supported for client-side features in [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * Applies edits to features in a layer. New features can be created and existing features can be updated or deleted. Feature geometries and/or attributes may be modified. Only applicable to layers in a [feature service](https://developers.arcgis.com/rest/services-reference/feature-service.htm) and client-side features set through the layer's [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source). If client-side features are added, removed or updated at runtime using [applyEdits()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) then use [queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) to return updated features. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) - * + * * @param edits Object containing features to be added, updated or deleted. * @param edits.addFeatures Array of features to be added. Values of non nullable fields must be provided when adding new features. Date fields must have [numeric](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) values representing universal time. * @param edits.updateFeatures Array of features to be updated. Each feature must have valid [objectId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField). Values of non nullable fields must be provided when updating features. Date fields must have [numeric](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) values representing universal time. * @param edits.deleteFeatures An array of features or objects to be deleted. When an array of features is passed, each feature must have a valid [objectId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField). When an array of objects is used, each object must have a valid `objectId` property. - * + * */ applyEdits(edits: FeatureLayerApplyEditsEdits): IPromise; /** * Creates query parameters that can be used to fetch features that satisfy the layer's current filters, and definitions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#createQuery) - * - * + * + * */ createQuery(): Query; /** - * Deletes attachments from a feature. This operation is available only if the layer's [capabilities.data.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is set to `true`. - * + * Deletes attachments from a feature. This operation is available only if the layer's [capabilities.data.supportsAttachment](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is set to `true`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#deleteAttachments) - * + * * @param feature Feature containing attachments to be deleted. * @param attachmentIds Ids of the attachments to be deleted. - * + * */ deleteAttachments(feature: Graphic, attachmentIds: number[]): IPromise; /** * Returns a [FeatureType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html) describing the feature's type. This is applicable if the layer containing the feature has a [typeIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#typeIdField). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#getFeatureType) - * + * * @param feature A feature from this layer. - * + * */ getFeatureType(feature: Graphic): FeatureType; /** * Returns the [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) associated with the given field name. The domain can be either a [CodedValueDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html) or [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#getFieldDomain) - * + * * @param fieldName Name of the field. * @param options An object specifying additional options. See the object specification table below for the required properties of this object. * @param options.feature The feature to which the [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) is assigned. - * + * */ getFieldDomain(fieldName: string, options?: FeatureLayerGetFieldDomainOptions): Domain; /** - * Query information about attachments associated with features. It will return an error if the layer's [capabilities.data.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property is `false`. Attachments for multiple features can be queried if the layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is `true`. - * > **Known Limitations** When the layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property is `false`, [AttachmentQuery.objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds) property only accepts a single `objectId`. - * + * Query information about attachments associated with features. It will return an error if the layer's [capabilities.data.supportsAttachment](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property is `false`. Attachments for multiple features can be queried if the layer's [capabilities.operations.supportsQueryAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is `true`. + * > **Known Limitations** When the layer's [capabilities.operations.supportsQueryAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property is `false`, [AttachmentQuery.objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds) property only accepts a single `objectId`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryAttachments) - * + * * @param attachmentQuery Specifies the attachment parameters for query. - * + * */ - queryAttachments(attachmentQuery: AttachmentQuery | AttachmentQueryProperties): IPromise; + queryAttachments(attachmentQuery: AttachmentQuery | AttachmentQueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. If no parameters are specified, then the extent and count of all features satisfying the layer's configuration/filters are returned. This is valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) on [arcgis.com](http://arcgis.com) and for ArcGIS Server 10.3.1 and later. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. If no parameters are specified, then the extent and count of all features satisfying the layer's configuration/filters are returned. This is valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) on [arcgis.com](http://arcgis.com) and for ArcGIS Server 10.3.1 and later. * > To query for the extent of features/graphics available to or visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) on the client rather than making a server-side query, you must use the [FeatureLayerView.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryExtent) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryExtent) - * + * * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then the extent and count of all features satisfying the layer's configuration/filters are returned. - * + * */ queryExtent(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns the number of features that satisfy the query. If no parameters are specified, the total number of features satisfying the layer's configuration/filters is returned. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns the number of features that satisfy the query. If no parameters are specified, the total number of features satisfying the layer's configuration/filters is returned. * > To query for the count of features/graphics available to or visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) on the client rather than making a server-side query, you must use the [FeatureLayerView.queryFeatureCount()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatureCount) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatureCount) - * + * * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, the total number of features satisfying the layer's configuration/filters is returned. - * + * */ queryFeatureCount(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method once the promise resolves. A [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) contains an array of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) features, which can be added to the [view's graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics). This array will not be populated if zero results are found. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method once the promise resolves. A [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) contains an array of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) features, which can be added to the [view's graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics). This array will not be populated if zero results are found. * > To query features/graphics available to or visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) on the client rather than making a server-side query, you must use the [FeatureLayerView.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) - * + * * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then all features satisfying the layer's configuration/filters are returned. - * + * */ queryFeatures(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns an array of Object IDs for features that satisfy the input query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the feature service and returns an array of Object IDs for features that satisfy the input query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. * > To query for ObjectIDs of features/graphics available to or visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) on the client rather than making a server-side query, you must use the [FeatureLayerView.queryObjectIds()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryObjectIds) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryObjectIds) - * + * * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then the Object IDs of all features satisfying the layer's configuration/filters are returned. - * + * */ queryObjectIds(params?: Query | QueryProperties): IPromise; /** * Executes a [RelationshipQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html) against the feature service and returns [FeatureSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) grouped by source layer or table objectIds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryRelatedFeatures) - * + * * @param relationshipQuery Specifies relationship parameters for querying related features or records from a layer or a table. - * + * */ queryRelatedFeatures(relationshipQuery: RelationshipQuery | RelationshipQueryProperties): IPromise; /** - * Updates an existing attachment for a feature. This operation is available only if the layer's [capabilities.data.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is set to `true`. - * + * Updates an existing attachment for a feature. This operation is available only if the layer's [capabilities.data.supportsAttachment](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is set to `true`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#updateAttachment) - * + * * @param feature The feature containing the attachment to be updated. * @param attachmentId Id of the attachment to be updated. * @param attachment HTML form that contains a file upload field pointing to the file to be added as an attachment. - * + * */ - updateAttachment(feature: Graphic, attachmentId: number, attachment: HTMLFormElement | FormData): IPromise; - + updateAttachment( + feature: Graphic, + attachmentId: number, + attachment: HTMLFormElement | FormData + ): IPromise; on(name: "layerview-create", eventHandler: FeatureLayerLayerviewCreateEventHandler): IHandle; @@ -8070,196 +8437,198 @@ declare namespace __esri { interface FeatureLayerConstructor { /** * A FeatureLayer is a single layer that can be created from a [Map Service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-map-service.htm) or [Feature Service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-feature-service-.htm); ArcGIS Online or ArcGIS Enterprise portal items; or from an array of client-side features. It is composed of discrete features, each of which has a [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered in either a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) as a [graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) with spatial context. Features also contain data [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes) that provide additional information about the real-world feature it represents; attributes may be viewed in [popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) windows and used for [rendering](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) the layer. FeatureLayers may be [queried](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures), [analyzed](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html), and [rendered](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) to visualize data in a spatial context. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) */ - new(properties?: FeatureLayerProperties): FeatureLayer; + new (properties?: FeatureLayerProperties): FeatureLayer; fromJSON(json: any): FeatureLayer; } export const FeatureLayer: FeatureLayerConstructor; - interface FeatureLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + interface FeatureLayerProperties + extends LayerProperties, + PortalLayerProperties, + ScaleRangeLayerProperties, + RefreshableLayerProperties { /** * The copyright text as defined by the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#copyright) */ copyright?: string; /** * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when the dataset is large and you don't want to bring all features to the client for analysis. Definition expressions may be set when a layer is constructed prior to it loading in the view or after it has been added to the map. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression) */ definitionExpression?: string; /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#displayField) */ displayField?: string; /** * An object that allows you to create a dynamic layer with data either from map service sublayers or data from a registered workspace. See [DynamicMapLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) for creating dynamic layers from map service layers for on the fly rendering, labeling, and filtering (definition expressions). To create dynamic layers from other sources in registered workspaces such as tables and table joins, see [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer). If you already have a [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) instance, you can call the [createFeatureLayer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer) method on the Sublayer to construct the layer for you. This only applies to map services with [dynamic layers](https://enterprise.arcgis.com/en/server/latest/publish-services/linux/about-dynamic-layers.htm) enabled. Therefore, the [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url) of the FeatureLayer instance must point to a map service url ending with `/dynamicLayer`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#dynamicDataSource) */ dynamicDataSource?: DynamicMapLayer | DynamicDataLayer; /** * Specifies how features are placed on the vertical axis (z). This property may only be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ elevationInfo?: FeatureLayerElevationInfo; /** * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. Currently this property is only supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for point features with non-draped [Icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. ![declutter](https://developers.arcgis.com/javascript/assets/img/samples/city-points-declutter.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#featureReduction) */ featureReduction?: FeatureLayerFeatureReduction; /** - * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side features you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties. - * + * An array of fields in the layer. Each field represents an attribute that may contain a value for each feature in the layer. For example, a field named `POP_2015`, stores information about total population as a numeric value for each feature; this value represents the total number of people living within the geographic bounds of the feature. This property must be set in the constructor when creating a FeatureLayer from client-side [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). To create FeatureLayers from client-side features you must also set the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference), [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType), [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer), and [type](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#type) properties. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) */ fields?: FieldProperties[]; /** * The geometry type of features in the layer. All features must be of the same type. This property is read-only when the layer is created from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url). When creating a FeatureLayer from client-side features, this property is inferred by the geometryType of the features provided in the layer's [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) property. **Possible Values:** point | multipoint | polyline | polygon | extent | mesh - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) */ geometryType?: string; /** * The historic moment to query. If historicMoment is not specified, the query will apply to the current features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#historicMoment) */ historicMoment?: DateProperties; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. The [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true` for labels to display in the view. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). - * > **Known Limitations** + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. The [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) property of this layer must be set to `true` for labels to display in the view. Multiple Label classes with different `where` clauses can be used to define several labels with varying styles on the same feature. Likewise, multiple label classes may be used to label different types of features (for example blue labels for lakes and green labels for parks). + * > **Known Limitations** * * Currently only FeatureLayers with point and polygon geometries are supported. * * Currently only one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) is supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) */ labelingInfo?: LabelClassProperties[]; /** - * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) property. - * > **Known Limitations** - * * Currently only FeatureLayers with point and polygon geometries are supported. + * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelingInfo) property. + * > **Known Limitations** * * Currently 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) only support one [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) per feature. - * * Currently the `labelsVisible` property must be explicitly set to `true` for labels to be printed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#labelsVisible) - * + * * @default true */ labelsVisible?: boolean; /** - * The layer ID, or layer index, of a Feature Service layer. This is particularly useful when loading a single FeatureLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: + * The layer ID, or layer index, of a Feature Service layer. This is particularly useful when loading a single FeatureLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: * * When loading the layer via the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#portalItem) property. * * When pointing the layer [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url) directly to the Feature Service. - * - * + * + * * If a layerId is not specified in either of the above scenarios, then the first layer in the service (`layerId = 0`) is selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#layerId) */ layerId?: number; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * The name of an `oid` [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields) containing a unique value or identifier for each feature in the layer. This is required when constructing a FeatureLayer from a collection of client-side [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) */ objectIdField?: string; /** * An array of field names from the service to include in the FeatureLayer. If not specified, the layer will only return the `OBJECTID` field. To fetch the values from all fields in the layer, use `["*"]`. This is particularly useful when editing features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields) */ outFields?: string[]; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupEnabled) - * + * * @default true */ popupEnabled?: boolean; /** * The popup template for the layer. When set on the layer, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) */ popupTemplate?: PopupTemplateProperties; /** * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. However, when creating a FeatureLayer from client-side features, this property must be specified in the layer's constructor along with the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source), [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField) properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) */ renderer?: RendererProperties; /** * When `true`, indicates that M values will be returned. When `false`, indicates that M values will never be returned. The layer view determines whether to include M values in feature queries when the property value is `undefined`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnM) - * + * * @default undefined */ returnM?: boolean; /** * When `true`, indicates that Z values will always be returned. When `false`, indicates that Z values will never be returned. The layer view determines whether to include Z values in feature queries when the property value is `undefined`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#returnZ) - * + * * @default undefined */ returnZ?: boolean; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#screenSizePerspectiveEnabled) - * + * * @default true */ screenSizePerspectiveEnabled?: boolean; /** - * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. The geometry of each feature all must have a matching [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType). This property should only be used when creating a FeatureLayer from client-side features. When creating a FeatureLayer from client-side features, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), and [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer) properties must also be set. Use [applyEdits()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) method to add, remove, and update features from a layer at runtime. Once `applyEdits()` resolves successfully, use [queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) to return updated features. The [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties are determined based on the features provided to this property. - * + * A collection of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) objects used to create a FeatureLayer. The geometry of each feature all must have a matching [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType). This property should only be used when creating a FeatureLayer from client-side features. When creating a FeatureLayer from client-side features, the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#fields), [objectIdField](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField), [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer), and [type](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#type) properties must also be set. Use [applyEdits()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) method to add, remove, and update features from a layer at runtime. Once `applyEdits()` resolves successfully, use [queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) to return updated features. The [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) and [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#geometryType) properties are determined based on the features provided to this property. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) */ source?: CollectionProperties; /** * The spatial reference of the layer. When creating the layer from a [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url), the spatial reference is read from the service. When creating a FeatureLayer from client-side features, this property is inferred from the geometries of the features provided in the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; /** * An array of feature templates defined in the feature layer. See [ArcGIS Pro subtypes document](https://pro.arcgis.com/en/pro-app/help/data/geodatabases/overview/an-overview-of-subtypes.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#templates) */ templates?: FeatureTemplateProperties[]; /** * An array of subtypes defined in the feature service exposed by ArcGIS REST API. Each item includes information about the type, such as the type ID, name, and definition expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#types) */ types?: FeatureTypeProperties[]; /** * The URL of the REST endpoint of the layer or service. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. If the url points directly to a service, then the layer must be specified in the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#layerId) property. If no [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#layerId) is given, then the first layer in the service will be loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#url) */ url?: string; @@ -8267,419 +8636,411 @@ declare namespace __esri { /** * FeatureEditResult represents the result of adding, updating or deleting a feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) */ export interface FeatureEditResult extends Object { /** * Object Id of the feature that was edited. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) */ objectId: number; /** * If the edit failed, the edit result includes an error. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) */ error: FeatureEditResultError; } - export interface FeatureLayerApplyEditsEdits extends Object { /** * Array of features to be added. Values of non nullable fields must be provided when adding new features. Date fields must have [numeric](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) values representing universal time. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) */ addFeatures?: Graphic[]; /** * Array of features to be updated. Each feature must have valid [objectId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField). Values of non nullable fields must be provided when updating features. Date fields must have [numeric](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) values representing universal time. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) */ updateFeatures?: Graphic[]; /** * An array of features or objects to be deleted. When an array of features is passed, each feature must have a valid [objectId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#objectIdField). When an array of objects is used, each object must have a valid `objectId` property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) */ deleteFeatures?: Graphic[] | any[]; } - export interface FeatureLayerCapabilities extends Object { /** - * Indicates data capabilities that can be performed on features in the layer. - * + * Describes characteristics of the data in the layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ data: FeatureLayerCapabilitiesData; /** - * Indicates editing capabilities that can be performed on the features in the layer. - * + * Describes editing capabilities that can be performed on the features in the layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ editing: FeatureLayerCapabilitiesEditing; /** - * Indicates operations that can be performed on features in the layer. - * + * Describes operations that can be performed on features in the layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ operations: FeatureLayerCapabilitiesOperations; /** - * Indicates query operations that can be performed on features in the layer. - * + * Describes [query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) operations that can be performed on features in the layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ query: FeatureLayerCapabilitiesQuery; /** * Indicates if the layer's query operation supports querying features or records related to features in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ queryRelated: FeatureLayerCapabilitiesQueryRelated; } - export interface FeatureLayerCapabilitiesData extends Object { /** * Indicates if the attachment is enabled on the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsAttachment: boolean; /** * Indicates if the features in the layer support M values. Requires ArcGIS Server service 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsM: boolean; /** * Indicates if the features in the layer support Z values. Requires ArcGIS Server service 10.1 or greater. See [elevationInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) for details regarding placement and rendering of features with z-values in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsZ: boolean; } - export interface FeatureLayerCapabilitiesEditing extends Object { /** * Indicates if anonymous users can delete features created by others. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsDeleteByAnonymous: boolean; /** * Indicates if logged in users can delete features created by others. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsDeleteByOthers: boolean; /** * Indicates if the geometry of the features in the layer can be edited. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsGeometryUpdate: boolean; /** * Indicates if the `globalid` values provided by the client are used in [applyEdits](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsGlobalId: boolean; /** * Indicates if the `rollbackOnFailure` parameter can be set to `true` or `false` when running the synchronizeReplica operation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsRollbackOnFailure: boolean; /** * Indicates if anonymous users can update features created by others. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsUpdateByAnonymous: boolean; /** * Indicates if logged in users can update features created by others. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsUpdateByOthers: boolean; /** * Indicates if `m-values` must be provided when updating features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsUpdateWithoutM: boolean; /** * Indicates if the layer supports uploading attachments by [UploadId](https://developers.arcgis.com/rest/services-reference/item.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsUploadWithItemId: boolean; } - export interface FeatureLayerCapabilitiesOperations extends Object { /** * Indicates if new features can be [added](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) to the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsAdd: boolean; /** * Indicates if features can be [deleted](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) from the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsDelete: boolean; /** * Indicates if features in the layer can be [updated](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsUpdate: boolean; /** * Indicates if features in the layer can be [edited](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits). Use `supportsAdd`, `supportsUpdate` and `supportsDelete` to determine which editing operations are supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsEditing: boolean; /** * Indicates if values of one or more field values in the layer can be updated. See the [Calculate REST operation](https://developers.arcgis.com/rest/services-reference/calculate-feature-service-layer-.htm) document for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsCalculate: boolean; /** * Indicates if features in the layer can be [queried](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsQuery: boolean; + /** + * Indicates if the layer supports [REST API queryAttachments](https://developers.arcgis.com/rest/services-reference/query-attachments-feature-service-layer-.htm) operation, which is supported with hosted feature services at version 10.5 and greater. If `false`, [queryAttachments() method](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryAttachments) can only return attachments for one feature at a time. If `true`, `queryAttachments()` can return attachments for array of [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ + supportsQueryAttachments: boolean; /** * Indicates if the layer supports a SQL-92 expression or where clause. This operation is only supported in ArcGIS Online hosted feature services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsValidateSql: boolean; /** * Indicates if resized attachments are supported in the feature layer. This is useful for showing thumbnails in [Popups](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsResizeAttachments: boolean; } - export interface FeatureLayerCapabilitiesQuery extends Object { - /** - * Indicates if the layer supports [queryAttachments()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryAttachments) operation. If `false`, [queryAttachments()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryAttachments) can only return attachments for one feature at a time. If `true`, `queryAttachments()` can return attachments for array of [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) - */ - supportsAttachments: boolean; /** * Indicates if the geometry centroid associated with each polygon feature can be returned. This operation is only supported in ArcGIS Online hosted feature services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsCentroid: boolean; /** * Indicates if the layer's query operation supports a buffer distance for input geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsDistance: boolean; /** * Indicates if the layer supports queries for distinct values based on fields specified in the [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#outFields). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsDistinct: boolean; /** * Indicates if the layer's query response includes the extent of features. At 10.3, this option is only available for hosted feature services. At 10.3.1, it is available for hosted and non-hosted feature services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsExtent: boolean; /** * Indicates if the layer's query response contains geometry attributes, including shape area and length attributes. This operation is only supported in ArcGIS Online hosted feature services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsGeometryProperties: boolean; /** * Indicates if the layer supports the [having](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#having) clause on the service. Requires an ArcGIS Server service 10.6.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsHavingClause: boolean; /** * Indicates if features returned in the query response can be ordered by one or more fields. Requires an ArcGIS Server service 10.3 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsOrderBy: boolean; /** * Indicates if the query response supports pagination. Requires an ArcGIS Server service 10.3 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsPagination: boolean; /** - * Indicates if the query operation supports the projection of geometries onto a virtual grid. Requires an ArcGIS Server service 10.3 or greater. - * + * Indicates if the query operation supports the projection of geometries onto a virtual grid. Requires an ArcGIS Server service 10.6.1 or greater. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsQuantization: boolean; + /** + * Indicates if the query operation supports quantization designed to be used in edit mode (highest resolution at the given spatial reference). Requires an ArcGIS Server service 10.6.1 or greater. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) + */ + supportsQuantizationEditMode: boolean; /** * Indicates if the number of features returned by the query operation can be controlled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsResultType: boolean; /** * Indicates if the query operation supports SQL expressions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsSqlExpression: boolean; /** * Indicates if the query operation supports using standardized queries. Learn more about [standardized queries here](http://server.arcgis.com/en/server/latest/administer/linux/about-standardized-queries.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsStandardizedQueriesOnly: boolean; /** * Indicates if the layer supports field-based statistical functions. Requires ArcGIS Server service 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsStatistics: boolean; /** * Indicates if the layer supports historic moment query. Requires ArcGIS Server service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsHistoricMoment: boolean; } - export interface FeatureLayerCapabilitiesQueryRelated extends Object { /** * Indicates if the layer's query response includes the number of features or records related to features in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsCount: boolean; /** * Indicates if the related features or records returned in the query response can be ordered by one or more fields. Requires ArcGIS Server service 10.3 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsOrderBy: boolean; /** * Indicates if the query response supports pagination for related features or records. Requires ArcGIS Server service 10.3 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) */ supportsPagination: boolean; } - export interface FeatureLayerElevationInfo extends Object { /** - * Defines how the feature is placed with respect to the terrain surface. If the geometry consists of multiple points (e.g. lines or polygons), the elevation is evaluated separately for each point. See the table below for a list of possible values. - * + * Defines how the feature is placed with respect to the terrain surface. If the geometry consists of multiple points (e.g. lines or polygons), the elevation is evaluated separately for each point. See the table below for a list of possible values. + * * Mode | Description * ------|------------ * on-the-ground | Features are draped on the terrain surface. This is the default value for features with [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) or [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries and features with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [ObjectSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). * relative-to-ground | Features are placed at an elevation relative to the terrain surface. The feature's elevation is determined by summing up the terrain elevation and the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry’s z-value. `relative-to-ground` is the default value for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [IconSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html). - * absolute-height | Features are placed at an absolute height above sea level. This height is determined by the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry’s z-value. This mode doesn't take the elevation of the terrain into account. This is the default value of features with any geometry type where [hasZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#hasZ) is `true`. + * absolute-height | Features are placed at an absolute elevation (z-value) above sea level. This z-value is determined by the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry’s z-value. This mode doesn't take the elevation of the terrain into account. This is the default value of features with any geometry type where [hasZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#hasZ) is `true`. * relative-to-scene | Features are aligned to buildings and other objects part of 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html), depending on which has higher elevation. If the feature is not directly above a building or any other feature, it is aligned to the terrain surface elevation. If defined, the result of `featureExpressionInfo` is added to the 3D Object/terrain surface elevation. In this mode z-values are ignored. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ mode: string; /** * An elevation offset, which is added to the vertical position of the feature. If `unit` is not defined, the offset is in `meters`. When `mode = "on-the-ground"`, this property has no effect. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ offset?: number; /** - * This object contains information about setting a custom height on the feature. If this property is set, then z values are not considered for calculating feature height. - * + * This object contains information about setting a custom z-value on the feature. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ featureExpressionInfo?: FeatureLayerElevationInfoFeatureExpressionInfo; /** * The unit for `featureExpressionInfo` and `offset` values. It doesn't apply to z-values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ unit?: string; } - export interface FeatureLayerElevationInfoFeatureExpressionInfo extends Object { /** - * An [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) evaluating to a number that determines the height of the feature. If the geometry has z-values, they will be ignored and only `featureExpressionInfo` is used to calculate the vertical position of the feature. When `mode = "on-the-ground"`, this property has no effect. For line and polygon geometries the result of the expression is the same for all vertices of a feature. - * + * An [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) evaluating to a number that determines the z-value of the feature. If the geometry has z-values, they will be ignored and `featureExpressionInfo` will be used to calculate the vertical position of the feature. When `mode = "on-the-ground"`, this property has no effect. For line and polygon geometries the result of the expression is the same for all vertices of a feature. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) */ expression?: string; } - export interface FeatureLayerFeatureReduction extends Object { /** * Type of the decluttering method. The only supported type at the moment is `"selection"`. In this method, some of the overlapping features are hidden such that none of the remaining features intersect on screen. Label deconfliction also respects this option and hides labels that would overlap with the features of this layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#featureReduction) */ type: string; } - export interface FeatureLayerGetFieldDomainOptions extends Object { /** * The feature to which the [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) is assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#getFieldDomain) */ feature: Graphic; } export interface FeatureLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface FeatureLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface FeatureEditResultError extends Object { /** * Error name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) */ name: string; /** * Message describing the error. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#FeatureEditResult) */ message: string; @@ -8688,30 +9049,29 @@ declare namespace __esri { interface GeoRSSLayer extends Layer, ScaleRangeLayer { /** * Symbol used to represent line features from the GeoRSS feed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#lineSymbol) */ lineSymbol: SimpleLineSymbol; /** * Symbol used to represent point features from the GeoRSS feed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#pointSymbol) */ pointSymbol: PictureMarkerSymbol; /** * Symbol used to represent polygon features from the GeoRSS feed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#polygonSymbol) */ polygonSymbol: SimpleFillSymbol; /** * The URL pointing to a GeoRSS file. This must be publicly available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#url) */ url: string; - on(name: "layerview-create", eventHandler: GeoRSSLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: GeoRSSLayerLayerviewDestroyEventHandler): IHandle; @@ -8720,11 +9080,11 @@ declare namespace __esri { interface GeoRSSLayerConstructor { /** * The GeoRSSLayer class is used to create a layer based on [GeoRSS](http://www.georss.org/). GeoRSS is a way to add geographic information to an RSS feed. The GeoRSSLayer supports both `GeoRSS-Simple` and `GeoRSS GML` encodings, and multiple geometry types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html) */ - new(properties?: GeoRSSLayerProperties): GeoRSSLayer; + new (properties?: GeoRSSLayerProperties): GeoRSSLayer; } export const GeoRSSLayer: GeoRSSLayerConstructor; @@ -8732,39 +9092,37 @@ declare namespace __esri { interface GeoRSSLayerProperties extends LayerProperties, ScaleRangeLayerProperties { /** * Symbol used to represent line features from the GeoRSS feed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#lineSymbol) */ lineSymbol?: SimpleLineSymbolProperties; /** * Symbol used to represent point features from the GeoRSS feed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#pointSymbol) */ pointSymbol?: PictureMarkerSymbolProperties; /** * Symbol used to represent polygon features from the GeoRSS feed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#polygonSymbol) */ polygonSymbol?: SimpleFillSymbolProperties; /** * The URL pointing to a GeoRSS file. This must be publicly available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html#url) */ url?: string; } export interface GeoRSSLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface GeoRSSLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -8773,78 +9131,77 @@ declare namespace __esri { interface GraphicsLayer extends Layer, ScaleRangeLayer { /** * Specifies how graphics are placed on the vertical axis (z). This property may only be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) */ elevationInfo: GraphicsLayerElevationInfo; /** * A collection of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the layer. Each graphic is a vector representation of the location of a real-world feature. Each graphic in a single GraphicsLayer may contain either a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), or [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry). In addition, each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the collection may contain its own [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes), [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html), and [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). To add a graphic to the GraphicsLayer use [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#add), or [GraphicsLayer.graphics.add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#graphics) */ graphics: Collection; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#screenSizePerspectiveEnabled) - * + * * @default true */ screenSizePerspectiveEnabled: boolean; /** * For [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) the type is `graphics`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#type) */ readonly type: "graphics"; /** * Adds a graphic to the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#add) - * + * * @param graphic The graphic to add to the layer. - * + * */ add(graphic: Graphic): void; /** * Adds an array of graphics to the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#addMany) - * + * * @param graphics The graphic(s) to add to the layer. - * + * */ addMany(graphics: Graphic[]): void; /** * Removes a graphic from the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#remove) - * + * * @param graphic The graphic to remove from the layer. - * + * */ remove(graphic: Graphic): void; /** * Clears all the graphics from the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#removeAll) - * - * + * + * */ removeAll(): void; /** * Removes an array of graphics from the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#removeMany) - * + * * @param graphics The graphics to remove from the layer. - * + * */ removeMany(graphics: Graphic[]): void; - on(name: "layerview-create", eventHandler: GraphicsLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: GraphicsLayerLayerviewDestroyEventHandler): IHandle; @@ -8853,11 +9210,11 @@ declare namespace __esri { interface GraphicsLayerConstructor { /** * A GraphicsLayer contains one or more client-side [Graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). Each [graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#graphics) in the GraphicsLayer is rendered in a [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) inside either a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). The [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#graphics) contain discrete vector [geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that represent real-world phenomena. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) */ - new(properties?: GraphicsLayerProperties): GraphicsLayer; + new (properties?: GraphicsLayerProperties): GraphicsLayer; } export const GraphicsLayer: GraphicsLayerConstructor; @@ -8865,81 +9222,77 @@ declare namespace __esri { interface GraphicsLayerProperties extends LayerProperties, ScaleRangeLayerProperties { /** * Specifies how graphics are placed on the vertical axis (z). This property may only be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) */ elevationInfo?: GraphicsLayerElevationInfo; /** * A collection of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the layer. Each graphic is a vector representation of the location of a real-world feature. Each graphic in a single GraphicsLayer may contain either a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), or [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#geometry). In addition, each [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the collection may contain its own [attributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#attributes), [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html), and [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). To add a graphic to the GraphicsLayer use [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#add), or [GraphicsLayer.graphics.add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#graphics) */ graphics?: CollectionProperties; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#screenSizePerspectiveEnabled) - * + * * @default true */ screenSizePerspectiveEnabled?: boolean; } - export interface GraphicsLayerElevationInfo extends Object { /** - * Defines how the graphic is placed with respect to the terrain surface. If the geometry consists of multiple points (e.g. lines or polygons), the elevation is evaluated separately for each point. See the table below for a list of possible values. - * + * Defines how the graphic is placed with respect to the terrain surface. If the geometry consists of multiple points (e.g. lines or polygons), the elevation is evaluated separately for each point. See the table below for a list of possible values. + * * Mode | Description * ------|------------ * on-the-ground | Graphics are placed on the terrain surface. * relative-to-ground | Graphics are placed at an elevation relative to the terrain surface. The graphic's elevation is determined by summing up * the terrain elevation, and the geometry's z-value (if present). In case `featureExpressionInfo` is defined, the result of the expression is used - * instead of the geometry’s z-value. absolute-height | Graphics are placed at an absolute height above sea level. This height is determined by the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry’s z-value. It doesn't take the elevation of the terrain into account. relative-to-scene | Graphics are aligned to buildings and other objects part of 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html), depending on which has higher elevation. If the graphic is not directly above a building or any other feature, it is aligned to the terrain surface elevation. If defined, the result of `featureExpressionInfo` is added to the 3D Object/terrain surface elevation. In this mode z-values are ignored. - * + * instead of the geometry’s z-value. absolute-height | Graphics are placed at an absolute elevation (z-value) above sea level. This z-value is determined by the geometry's z-value (if present). If `featureExpressionInfo` is defined, the result of the expression is used instead of the geometry’s z-value. It doesn't take the elevation of the terrain into account. relative-to-scene | Graphics are aligned to buildings and other objects part of 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html), depending on which has higher elevation. If the graphic is not directly above a building or any other feature, it is aligned to the terrain surface elevation. If defined, the result of `featureExpressionInfo` is added to the 3D Object/terrain surface elevation. In this mode z-values are ignored. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) */ mode: string; /** * An elevation offset, which is added to the vertical position of the graphic. If `unit` is not defined, the offset is in `meters`. When `mode = "on-the-ground"`, this property has no effect. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) */ offset?: number; /** - * This object contains information about setting a custom height on the graphic. If this property is set, then z values are not considered for calculating graphic height. - * + * This object contains information about setting a custom z-value on the feature. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) */ featureExpressionInfo?: GraphicsLayerElevationInfoFeatureExpressionInfo; /** * The unit for `featureExpressionInfo` and `offset` values. It doesn't apply to z-values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) */ unit?: string; } - export interface GraphicsLayerElevationInfoFeatureExpressionInfo extends Object { /** - * An [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) evaluating to a number that determines the height of the graphic. If the geometry has z-values, they will be ignored and only `featureExpressionInfo` is used to calculate the vertical position of the graphic. When `mode = "on-the-ground"`, this property has no effect. For line and polygon geometries the result of the expression is the same for all vertices of a feature. - * + * An [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) evaluating to a number that determines the z-value of the feature. If the geometry has z-values, they will be ignored and only `featureExpressionInfo` is used to calculate the vertical position of the graphic. When `mode = "on-the-ground"`, this property has no effect. For line and polygon geometries the result of the expression is the same for all vertices of a feature. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#elevationInfo) */ expression?: string; } export interface GraphicsLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface GraphicsLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -8947,19 +9300,27 @@ declare namespace __esri { interface GroupLayer extends Layer, LayersMixin, PortalLayer { /** - * Indicates how to manage the visibility of the children layers. Possible values are described in the table below. - * + * Indicates how to manage the visibility of the children layers. Possible values are described in the table below. + * * Value | Description * ------|------------ * independent | Each child layer manages its visibility independent from other layers. * inherited | Each child layer's visibility matches the [GroupLayer’s visibility](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visible). * exclusive | Only one child layer is visible at a time. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visibilityMode) */ visibilityMode: string; + /** + * Loads all the externally loadable resources associated with the group layer. For the group layer this will load all the layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#loadAll) + * + * + */ + loadAll(): IPromise; on(name: "layerview-create", eventHandler: GroupLayerLayerviewCreateEventHandler): IHandle; @@ -8969,11 +9330,11 @@ declare namespace __esri { interface GroupLayerConstructor { /** * GroupLayer provides the ability to organize several sublayers into one common layer. Suppose there are several [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) that all represent water features in different dimensions. For example, wells (points), streams (lines), and lakes (polygons). The GroupLayer provides the functionality to treat them as one layer called "Water Features" even though they are stored as separate feature layers. To accomplish this, create a new GroupLayer and use the [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#add) method to add each of the water layers to the GroupLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) */ - new(properties?: GroupLayerProperties): GroupLayer; + new (properties?: GroupLayerProperties): GroupLayer; fromJSON(json: any): GroupLayer; } @@ -8982,29 +9343,27 @@ declare namespace __esri { interface GroupLayerProperties extends LayerProperties, LayersMixinProperties, PortalLayerProperties { /** - * Indicates how to manage the visibility of the children layers. Possible values are described in the table below. - * + * Indicates how to manage the visibility of the children layers. Possible values are described in the table below. + * * Value | Description * ------|------------ * independent | Each child layer manages its visibility independent from other layers. * inherited | Each child layer's visibility matches the [GroupLayer’s visibility](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visible). * exclusive | Only one child layer is visible at a time. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#visibilityMode) */ visibilityMode?: string; } export interface GroupLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface GroupLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -9013,41 +9372,40 @@ declare namespace __esri { interface ImageryLayer extends Layer, ArcGISImageService, ScaleRangeLayer, RefreshableLayer { /** * A function that processes [pixelData](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData). The `pixelData` object contains a [pixelBlock](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html) property that gives you access to all of the pixels in the raster on the client. Inside the `pixelFilter` you may loop through all the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) found in the `pixelBlock` property of the `pixelData` object and process them. This function may be used to hide some pixels from the view, alter their values, and change their color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) */ pixelFilter: Function; /** * Indicates whether to display popups when the layer is clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#popupEnabled) - * + * * @default true */ popupEnabled: boolean; /** * The portal item from which the layer is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#portalItem) */ portalItem: PortalItem; /** * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#token) */ readonly token: string; /** * Executes the [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) function and redraws the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#redraw) - * - * + * + * */ redraw(): void; - on(name: "layerview-create", eventHandler: ImageryLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: ImageryLayerLayerviewDestroyEventHandler): IHandle; @@ -9056,49 +9414,51 @@ declare namespace __esri { interface ImageryLayerConstructor { /** * Represents an image service resource as a layer. An ImageryLayer retrieves and displays data from image services. ImageryLayer allows you to and apply client side [pixel filtering](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter), server defined or client-defined [rendering rules](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#renderingRule) (e.g. remap, colormap), and [mosaic rules](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#mosaicRule). This layer is particularly useful when you need to interactively change pixel manipulation criteria and get an immediate response on the client. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html) */ - new(properties?: ImageryLayerProperties): ImageryLayer; + new (properties?: ImageryLayerProperties): ImageryLayer; fromJSON(json: any): ImageryLayer; } export const ImageryLayer: ImageryLayerConstructor; - interface ImageryLayerProperties extends LayerProperties, ArcGISImageServiceProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + interface ImageryLayerProperties + extends LayerProperties, + ArcGISImageServiceProperties, + ScaleRangeLayerProperties, + RefreshableLayerProperties { /** * A function that processes [pixelData](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData). The `pixelData` object contains a [pixelBlock](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html) property that gives you access to all of the pixels in the raster on the client. Inside the `pixelFilter` you may loop through all the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) found in the `pixelBlock` property of the `pixelData` object and process them. This function may be used to hide some pixels from the view, alter their values, and change their color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) */ pixelFilter?: Function; /** * Indicates whether to display popups when the layer is clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#popupEnabled) - * + * * @default true */ popupEnabled?: boolean; /** * The portal item from which the layer is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#portalItem) */ portalItem?: PortalItemProperties; } export interface ImageryLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface ImageryLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -9107,12 +9467,11 @@ declare namespace __esri { interface IntegratedMeshLayer extends Layer, SceneService, PortalLayer { /** * Specifies how the mesh is placed on the vertical axis (z). This property only affects [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) when using the `absolute-height` mode. Integrated mesh layers always render in front of the ground surface, so setting negative offset values will not render them below the ground. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) */ elevationInfo: IntegratedMeshLayerElevationInfo; - on(name: "layerview-create", eventHandler: IntegratedMeshLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: IntegratedMeshLayerLayerviewDestroyEventHandler): IHandle; @@ -9121,11 +9480,11 @@ declare namespace __esri { interface IntegratedMeshLayerConstructor { /** * The IntegratedMeshLayer is designed for visualizing accurate representations in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) of infrastructure and natural landscapes that are difficult to access. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) */ - new(properties?: IntegratedMeshLayerProperties): IntegratedMeshLayer; + new (properties?: IntegratedMeshLayerProperties): IntegratedMeshLayer; fromJSON(json: any): IntegratedMeshLayer; } @@ -9135,52 +9494,49 @@ declare namespace __esri { interface IntegratedMeshLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { /** * Specifies how the mesh is placed on the vertical axis (z). This property only affects [IntegratedMeshLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html) when using the `absolute-height` mode. Integrated mesh layers always render in front of the ground surface, so setting negative offset values will not render them below the ground. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) */ elevationInfo?: IntegratedMeshLayerElevationInfo; } - export interface IntegratedMeshLayerElevationInfo extends Object { /** - * Defines how the mesh is placed on the vertical axis (z). Currently only `absolute-height` is supported. - * + * Defines how the mesh is placed on the vertical axis (z). Currently only `absolute-height` is supported. + * * Mode | Description * ------|------------ - * absolute-height | The mesh is placed at an absolute height above sea level. This height is determined by summing up the `offset` value and the mesh's z-value. It doesn't take the elevation of the terrain into account. This is the only supported elevation mode for an IntegratedMeshLayer. - * - * + * absolute-height | The mesh is placed at an absolute elevation (z-value) above sea level. This z-value is determined by summing up the `offset` value and the mesh's z-value. It doesn't take the elevation of the terrain into account. This is the only supported elevation mode for an IntegratedMeshLayer. + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) */ mode: string; /** * An elevation offset, which is added to the vertical position of the mesh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) - * + * * @default 0 */ offset?: number; /** * The unit for `offset` values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html#elevationInfo) - * + * * @default meters */ unit?: string; } export interface IntegratedMeshLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface IntegratedMeshLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -9189,18 +9545,17 @@ declare namespace __esri { interface KMLLayer extends Layer, PortalLayer, ScaleRangeLayer { /** * A collection of [KMLSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html#sublayers) */ sublayers: Collection; /** * The publicly accessible URL for a .kml or .kmz file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html#url) */ url: string; - on(name: "layerview-create", eventHandler: KMLLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: KMLLayerLayerviewDestroyEventHandler): IHandle; @@ -9209,11 +9564,11 @@ declare namespace __esri { interface KMLLayerConstructor { /** * The KMLLayer class is used to create a layer based on a KML file (.kml, .kmz). KML is an XML-based file format used to represent geographic features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html) */ - new(properties?: KMLLayerProperties): KMLLayer; + new (properties?: KMLLayerProperties): KMLLayer; fromJSON(json: any): KMLLayer; } @@ -9223,27 +9578,25 @@ declare namespace __esri { interface KMLLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { /** * A collection of [KMLSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html#sublayers) */ sublayers?: CollectionProperties; /** * The publicly accessible URL for a .kml or .kmz file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html#url) */ url?: string; } export interface KMLLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface KMLLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -9252,74 +9605,74 @@ declare namespace __esri { interface Layer extends Accessor, Loadable, Evented { /** * The full extent of the layer. By default, this is worldwide. This property may be used to set the extent of the view to match a layer's extent so that its features appear to fill the view. See the sample snippet below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fullExtent) */ fullExtent: Extent; /** * The unique ID assigned to the layer. If not set by the developer, it is automatically generated when the layer is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id) */ id: string; /** - * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The possible values are listed below. - * + * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The possible values are listed below. + * * Value | Description * ------|------------ * show | The layer is visible in the table of contents. * hide | The layer is hidden in the table of contents. * hide-children | If the layer is a [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html), hide the children layers from the table of contents. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode) - * + * * @default show */ listMode: string; /** * Indicates whether the layer's resources have loaded. When `true`, all the properties of the object can be accessed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#loaded) - * + * * @default false */ readonly loaded: boolean; /** * The opacity of the layer. This value can range between `1` and `0`, where `0` is 100 percent transparent and `1` is completely opaque. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#opacity) - * + * * @default 1 */ opacity: number; /** * The title of the layer used to identify it in places such as the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widgets. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#title) */ title: string; /** * The layer type provides a convenient way to check the type of the layer without the need to import specific layer modules. **Possible values:** base-dynamic | base-elevation | base-tile | bing-maps | elevation | feature | graphics | group | imagery | integrated-mesh | map-image | open-street-map | point-cloud | scene | stream | tile | unknown | unsupported | vector-tile | web-tile - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#type) */ readonly type: string; /** * Indicates if the layer is visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). When `false`, the layer may still be added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) instance that is referenced in a view, but its features will not be visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#visible) - * + * * @default true */ visible: boolean; /** * Fetches custom attribution data for the layer when it becomes available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fetchAttributionData) - * - * + * + * */ fetchAttributionData(): IPromise; } @@ -9327,32 +9680,31 @@ declare namespace __esri { interface LayerConstructor { /** * The layer is the most fundamental component of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). It is a collection of spatial data in the form of vector graphics or raster images that represent real-world phenomena. Layers may contain discrete features that store vector data or continuous cells/pixels that store raster data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) */ - new(properties?: LayerProperties): Layer; - + new (properties?: LayerProperties): Layer; /** * Creates a new layer instance from an ArcGIS Server URL. Depending on the URL, the returned layer type may be a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html), [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html), [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html), [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html) or [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html). This is useful when you work with various ArcGIS Server URLs, but you don't necessarily know which layer type(s) they create. This method creates the appropriate layer type for you. In case of a feature service or a scene service, when the URL points to the service and the service has multiple layers, the returned promise will resolve to a [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromArcGISServerUrl) - * + * * @param params Input parameters for creating the layer. * @param params.url The ArcGIS Server URL used to create the layer. * @param params.properties Set any of the layer's properties here for constructing the layer instance (e.g. popupTemplate, renderer, etc.). - * + * */ fromArcGISServerUrl(params: LayerFromArcGISServerUrlParams): IPromise; /** * Creates a new layer instance of the appropriate layer class from an ArcGIS Online or ArcGIS Enterprise [portal item](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html). If the item points to a feature service with multiple layers, then a [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) is created. If the item points to a service with a single layer, then it resolves to a layer of the same type of class as the service. See also: [isLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#isLayer) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromPortalItem) - * + * * @param params The parameters for loading the portal item. * @param params.portalItem The object representing an ArcGIS Online or ArcGIS Enterprise portal item from which to load the layer. - * + * */ fromPortalItem(params: LayerFromPortalItemParams): IPromise; } @@ -9362,95 +9714,164 @@ declare namespace __esri { interface LayerProperties extends LoadableProperties { /** * The full extent of the layer. By default, this is worldwide. This property may be used to set the extent of the view to match a layer's extent so that its features appear to fill the view. See the sample snippet below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fullExtent) */ fullExtent?: ExtentProperties; /** * The unique ID assigned to the layer. If not set by the developer, it is automatically generated when the layer is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id) */ id?: string; /** - * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The possible values are listed below. - * + * Indicates how the layer should display in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. The possible values are listed below. + * * Value | Description * ------|------------ * show | The layer is visible in the table of contents. * hide | The layer is hidden in the table of contents. * hide-children | If the layer is a [GroupLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html), hide the children layers from the table of contents. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode) - * + * * @default show */ listMode?: string; /** * The opacity of the layer. This value can range between `1` and `0`, where `0` is 100 percent transparent and `1` is completely opaque. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#opacity) - * + * * @default 1 */ opacity?: number; /** * The title of the layer used to identify it in places such as the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widgets. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#title) */ title?: string; /** * Indicates if the layer is visible in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). When `false`, the layer may still be added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) instance that is referenced in a view, but its features will not be visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#visible) - * + * * @default true */ visible?: boolean; } - export interface LayerFromArcGISServerUrlParams extends Object { /** * The ArcGIS Server URL used to create the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromArcGISServerUrl) */ url: string; /** * Set any of the layer's properties here for constructing the layer instance (e.g. popupTemplate, renderer, etc.). - * + * * [Read more...](properties.html) */ properties?: any; } - export interface LayerFromPortalItemParams extends Object { /** * The object representing an ArcGIS Online or ArcGIS Enterprise portal item from which to load the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromPortalItem) */ portalItem: PortalItem; } - interface MapImageLayer extends Layer, SublayersOwner, ArcGISMapService, ArcGISDynamicMapService, DynamicLayer, ScaleRangeLayer, RefreshableLayer { + interface MapImageLayer + extends Layer, + SublayersOwner, + ArcGISMapService, + DynamicLayer, + ScaleRangeLayer, + RefreshableLayer { /** * A flat [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of all the [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers) in the MapImageLayer including the sublayers of its sublayers. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#allSublayers) */ readonly allSublayers: Collection; + /** + * The output dots per inch (DPI) of the MapImageLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#dpi) + * + * @default 96 + */ + dpi: number; + /** + * The version of the geodatabase of the map service data. Read the [Overview of versioning](https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/an-overview-of-versioning.htm) topic for more details about this capability. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#gdbVersion) + */ + gdbVersion: string; + /** + * The output image type. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageFormat) + * + * @default png24 + */ + imageFormat: string; + /** + * Indicates the maximum height of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageMaxHeight) + * + * @default 2048 + */ + imageMaxHeight: number; + /** + * Indicates the maximum width of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageMaxWidth) + * + * @default 2048 + */ + imageMaxWidth: number; + /** + * Indicates whether the background of the image exported by the service is transparent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageTransparency) + * + * @default true + */ + imageTransparency: boolean; /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) objects that allow you to alter the properties of one or more sublayers of the MapImageLayer. If this property is not specified, all the sublayers from the service are displayed as defined in the service. If an empty array is passed to this property then none of the sublayers from the service are displayed in the layer. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). They may be [added](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add), [removed](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#remove), or [reordered](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#reorder) using the [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) methods. Because [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) extends [Accessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html), its properties may be [watched](https://developers.arcgis.com/javascript/latest/guide/working-with-props/index.html#watchProperties). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers) */ sublayers: Collection; + /** + * Gets the parameters of the exported image to use when calling the [export REST operation](https://developers.arcgis.com/rest/services-reference/export-map.htm). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#createExportImageParameters) + * + * @param extent The extent of the exported image + * @param width The width of the exported image + * @param height The height of the exported image + * @param options The parameter options is an object with the following properties. + * @param options.rotation The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. + * @param options.pixelRatio The pixel ratio to apply to the dpi of the exported image. + * + */ + createExportImageParameters( + extent: Extent, + width: number, + height: number, + options?: MapImageLayerCreateExportImageParametersOptions + ): any; on(name: "layerview-create", eventHandler: MapImageLayerLayerviewCreateEventHandler): IHandle; @@ -9460,42 +9881,105 @@ declare namespace __esri { interface MapImageLayerConstructor { /** * MapImageLayer allows you to display and analyze data from [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers) defined in a [map service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-map-service.htm), exporting images instead of features. Map service images are dynamically generated on the server based on a request, which includes an LOD (level of detail), a bounding box, dpi, spatial reference and other options. The exported image is of the entire map extent specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) */ - new(properties?: MapImageLayerProperties): MapImageLayer; + new (properties?: MapImageLayerProperties): MapImageLayer; fromJSON(json: any): MapImageLayer; } export const MapImageLayer: MapImageLayerConstructor; - interface MapImageLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISDynamicMapServiceProperties, DynamicLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + interface MapImageLayerProperties + extends LayerProperties, + ArcGISMapServiceProperties, + DynamicLayerProperties, + ScaleRangeLayerProperties, + RefreshableLayerProperties { + /** + * The output dots per inch (DPI) of the MapImageLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#dpi) + * + * @default 96 + */ + dpi?: number; + /** + * The version of the geodatabase of the map service data. Read the [Overview of versioning](https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/an-overview-of-versioning.htm) topic for more details about this capability. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#gdbVersion) + */ + gdbVersion?: string; + /** + * The output image type. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageFormat) + * + * @default png24 + */ + imageFormat?: string; + /** + * Indicates the maximum height of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageMaxHeight) + * + * @default 2048 + */ + imageMaxHeight?: number; + /** + * Indicates the maximum width of the image exported by the service. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageMaxWidth) + * + * @default 2048 + */ + imageMaxWidth?: number; + /** + * Indicates whether the background of the image exported by the service is transparent. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#imageTransparency) + * + * @default true + */ + imageTransparency?: boolean; /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) objects that allow you to alter the properties of one or more sublayers of the MapImageLayer. If this property is not specified, all the sublayers from the service are displayed as defined in the service. If an empty array is passed to this property then none of the sublayers from the service are displayed in the layer. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). They may be [added](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add), [removed](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#remove), or [reordered](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#reorder) using the [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) methods. Because [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) extends [Accessor](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html), its properties may be [watched](https://developers.arcgis.com/javascript/latest/guide/working-with-props/index.html#watchProperties). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers) */ sublayers?: CollectionProperties; } export interface MapImageLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface MapImageLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - interface MapNotesLayer extends Layer, PortalLayer, ScaleRangeLayer { + export interface MapImageLayerCreateExportImageParametersOptions extends Object { + /** + * The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#createExportImageParameters) + */ + rotation?: number; + /** + * The pixel ratio to apply to the dpi of the exported image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#createExportImageParameters) + */ + pixelRatio?: number; + } + interface MapNotesLayer extends Layer, PortalLayer, ScaleRangeLayer { on(name: "layerview-create", eventHandler: MapNotesLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: MapNotesLayerLayerviewDestroyEventHandler): IHandle; @@ -9504,30 +9988,26 @@ declare namespace __esri { interface MapNotesLayerConstructor { /** * The MapNotesLayer is used to create layers based on Map Notes within a WebMap or PortalItem. Map notes are part of web maps, and are typically created with ArcGIS Online MapViewer. For additional information, please refer to the ArcGIS Online documentation on how to [Add Map notes](http://doc.arcgis.com/en/arcgis-online/create-maps/add-layers.htm#ESRI_SECTION1_0C90A3B63ABD49D5B9535055991F4684). Within the [web map specification](https://developers.arcgis.com/web-map-specification/), map notes are a special type of [FeatureCollections](https://developers.arcgis.com/web-map-specification/objects/featureCollection/). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapNotesLayer.html) */ - new(properties?: MapNotesLayerProperties): MapNotesLayer; + new (properties?: MapNotesLayerProperties): MapNotesLayer; fromJSON(json: any): MapNotesLayer; } export const MapNotesLayer: MapNotesLayerConstructor; - interface MapNotesLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { - - } + interface MapNotesLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties {} export interface MapNotesLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface MapNotesLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -9536,28 +10016,26 @@ declare namespace __esri { interface ArcGISCachedService { /** * The copyright text as defined by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#copyright) */ copyright: string; /** * The spatial reference of the layer as defined by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#spatialReference) */ readonly spatialReference: SpatialReference; /** * Contains information about the tiling scheme for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#tileInfo) */ tileInfo: TileInfo; } interface ArcGISCachedServiceConstructor { - - - new(properties?: ArcGISCachedServiceProperties): ArcGISCachedService; + new (properties?: ArcGISCachedServiceProperties): ArcGISCachedService; fromJSON(json: any): ArcGISCachedService; } @@ -9567,315 +10045,183 @@ declare namespace __esri { interface ArcGISCachedServiceProperties { /** * The copyright text as defined by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#copyright) */ copyright?: string; /** * Contains information about the tiling scheme for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISCachedService.html#tileInfo) */ tileInfo?: TileInfoProperties; } - interface ArcGISDynamicMapService { - /** - * The output dots per inch (DPI) of the MapImageLayer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#dpi) - * - * @default 96 - */ - dpi: number; - /** - * The version of the geodatabase of the map service data. Read the [Overview of versioning](https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/an-overview-of-versioning.htm) topic for more details about this capability. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#gdbVersion) - */ - gdbVersion: string; - /** - * The output image type. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageFormat) - * - * @default png24 - */ - imageFormat: string; - /** - * Indicates the maximum height of the image exported by the service. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageMaxHeight) - * - * @default 2048 - */ - imageMaxHeight: number; - /** - * Indicates the maximum width of the image exported by the service. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageMaxWidth) - * - * @default 2048 - */ - imageMaxWidth: number; - /** - * Indicates whether the background of the image exported by the service is transparent. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageTransparency) - * - * @default true - */ - imageTransparency: boolean; - - /** - * Gets the parameters of the exported image to use when calling the [export REST operation](https://developers.arcgis.com/rest/services-reference/export-map.htm). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#createExportImageParameters) - * - * @param extent The extent of the exported image - * @param width The width of the exported image - * @param height The height of the exported image - * @param options The parameter options is an object with the following properties. - * @param options.rotation The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. - * - */ - createExportImageParameters(extent: Extent, width: number, height: number, options?: ArcGISDynamicMapServiceCreateExportImageParametersOptions): any; - } - - interface ArcGISDynamicMapServiceConstructor { - - - new(): ArcGISDynamicMapService; - } - - export const ArcGISDynamicMapService: ArcGISDynamicMapServiceConstructor; - - interface ArcGISDynamicMapServiceProperties { - /** - * The output dots per inch (DPI) of the MapImageLayer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#dpi) - * - * @default 96 - */ - dpi?: number; - /** - * The version of the geodatabase of the map service data. Read the [Overview of versioning](https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/an-overview-of-versioning.htm) topic for more details about this capability. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#gdbVersion) - */ - gdbVersion?: string; - /** - * The output image type. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg | pngjpg - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageFormat) - * - * @default png24 - */ - imageFormat?: string; - /** - * Indicates the maximum height of the image exported by the service. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageMaxHeight) - * - * @default 2048 - */ - imageMaxHeight?: number; - /** - * Indicates the maximum width of the image exported by the service. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageMaxWidth) - * - * @default 2048 - */ - imageMaxWidth?: number; - /** - * Indicates whether the background of the image exported by the service is transparent. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#imageTransparency) - * - * @default true - */ - imageTransparency?: boolean; - } - - - export interface ArcGISDynamicMapServiceCreateExportImageParametersOptions extends Object { - /** - * The rotation in degrees of the exported image. Available since ArcGIS Server 10.3. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISDynamicMapService.html#createExportImageParameters) - */ - rotation?: number; - } - interface ArcGISImageService { /** * The compression quality value. This controls how much loss the image will be subjected to. Only valid when using `jpg` [image format](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#format). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#compressionQuality) */ compressionQuality: number; /** * The output image compression tolerance value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#compressionTolerance) - * + * * @default 0.01 */ compressionTolerance: number; /** * The copyright text as defined by the image service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#copyright) */ copyright: string; /** * The SQL where clause used to filter rasters on the client. Only the rasters that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#definitionExpression) */ definitionExpression: string; /** * An array of fields in the layer for which a [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) has been defined. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#domainFields) */ domainFields: Field[]; /** * An array of fields in the layer. Each field represents an attribute that may contain a value for each raster in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fields) */ fields: Field[]; /** * The output image type. The default value is `lerc` if a [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelFilter) is set on the layer. **Possible Values:** png | png8 | png24 | png32 | jpg | bmp | gif | jpgpng | lerc - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#format) - * + * * @default jpgpng */ format: string; /** * The full extent of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fullExtent) */ fullExtent: Extent; /** * Indicates if the Image Service has [multidimensionalInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#multidimensionalInfo). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#hasMultidimensions) */ hasMultidimensions: boolean; /** * Indicates if the Image Service has a [raster attribute table](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable). If `true`, the raster attribute table can be accessed with the [rasterAttributeTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable) property after the layer has [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#loaded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#hasRasterAttributeTable) */ hasRasterAttributeTable: boolean; /** * Indicates the maximum height of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#imageMaxHeight) - * + * * @default 4100 */ imageMaxHeight: number; /** * Indicates the maximum width of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#imageMaxWidth) - * + * * @default 15000 */ imageMaxWidth: number; /** * Defines how overlapping images should be mosaicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#mosaicRule) */ mosaicRule: MosaicRule; /** * The multidimensional information associated with the service. This will have a value if `serviceInfo` has `hasMultidimensionalInfo = true`. If defined, multidimensional information contains various "dimensions" of data for a particular value, such as time, depth, altitude, etc. Defining slices of particular dimensions in the layer is handled with the [multidimensionalDefinition](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#multidimensionalDefinition) property of the [mosaicRule](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#mosaicRule). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#multidimensionalInfo) */ multidimensionalInfo: any; /** * The pixel type. **Possible Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelType) */ pixelType: string; /** * The popup template for the layer. When set on the layer, the popupTemplate allows users to access attributes and display their values using text and/or charts in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a pixel is clicked. See [this sample](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagery-popup/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with an [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#popupTemplate) */ popupTemplate: PopupTemplate; /** * The raster attribute table associated with the service. To access the raster attribute table, the layer must be [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#loaded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable) */ rasterAttributeTable: any; /** * Prefix used to define the fields from the raster attribute table. It's primarily used for [popups](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTableFieldPrefix) - * + * * @default Raster. */ rasterAttributeTableFieldPrefix: string; /** * A complete list of fields that consists of fields from the layer, pixel value fields and the attribute table fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterFields) */ rasterFields: Field[]; /** * Specifies the rule for how the requested image should be rendered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#renderingRule) */ renderingRule: RasterFunction; /** * The spatial reference of the image service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#spatialReference) */ readonly spatialReference: SpatialReference; /** * The URL to the REST endpoint of the layer. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#url) */ url: string; /** * The version of ArcGIS Server in which the image service is published. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#version) */ readonly version: number; /** * Returns an image using the [export REST operation](https://developers.arcgis.com/rest/services-reference/export-image.htm) that displays data from an [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fetchImage) - * + * * @param extent The extent of the image to export. * @param width The width of the image in pixels. * @param height The height of the image in pixels. - * + * */ fetchImage(extent: Extent, width: number, height: number): IPromise; } interface ArcGISImageServiceConstructor { - - - new(properties?: ArcGISImageServiceProperties): ArcGISImageService; + new (properties?: ArcGISImageServiceProperties): ArcGISImageService; fromJSON(json: any): ArcGISImageService; } @@ -9885,137 +10231,137 @@ declare namespace __esri { interface ArcGISImageServiceProperties { /** * The compression quality value. This controls how much loss the image will be subjected to. Only valid when using `jpg` [image format](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#format). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#compressionQuality) */ compressionQuality?: number; /** * The output image compression tolerance value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#compressionTolerance) - * + * * @default 0.01 */ compressionTolerance?: number; /** * The copyright text as defined by the image service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#copyright) */ copyright?: string; /** * The SQL where clause used to filter rasters on the client. Only the rasters that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#definitionExpression) */ definitionExpression?: string; /** * An array of fields in the layer for which a [Domain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html) has been defined. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#domainFields) */ domainFields?: FieldProperties[]; /** * An array of fields in the layer. Each field represents an attribute that may contain a value for each raster in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fields) */ fields?: FieldProperties[]; /** * The output image type. The default value is `lerc` if a [pixelFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelFilter) is set on the layer. **Possible Values:** png | png8 | png24 | png32 | jpg | bmp | gif | jpgpng | lerc - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#format) - * + * * @default jpgpng */ format?: string; /** * The full extent of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#fullExtent) */ fullExtent?: ExtentProperties; /** * Indicates if the Image Service has [multidimensionalInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#multidimensionalInfo). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#hasMultidimensions) */ hasMultidimensions?: boolean; /** * Indicates if the Image Service has a [raster attribute table](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable). If `true`, the raster attribute table can be accessed with the [rasterAttributeTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable) property after the layer has [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#loaded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#hasRasterAttributeTable) */ hasRasterAttributeTable?: boolean; /** * Indicates the maximum height of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#imageMaxHeight) - * + * * @default 4100 */ imageMaxHeight?: number; /** * Indicates the maximum width of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#imageMaxWidth) - * + * * @default 15000 */ imageMaxWidth?: number; /** * Defines how overlapping images should be mosaicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#mosaicRule) */ mosaicRule?: MosaicRuleProperties; /** * The multidimensional information associated with the service. This will have a value if `serviceInfo` has `hasMultidimensionalInfo = true`. If defined, multidimensional information contains various "dimensions" of data for a particular value, such as time, depth, altitude, etc. Defining slices of particular dimensions in the layer is handled with the [multidimensionalDefinition](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#multidimensionalDefinition) property of the [mosaicRule](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#mosaicRule). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#multidimensionalInfo) */ multidimensionalInfo?: any; /** * The pixel type. **Possible Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#pixelType) */ pixelType?: string; /** * The popup template for the layer. When set on the layer, the popupTemplate allows users to access attributes and display their values using text and/or charts in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a pixel is clicked. See [this sample](https://developers.arcgis.com/javascript/latest/sample-code/layers-imagery-popup/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with an [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#popupTemplate) */ popupTemplate?: PopupTemplateProperties; /** * The raster attribute table associated with the service. To access the raster attribute table, the layer must be [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#loaded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTable) */ rasterAttributeTable?: any; /** * Prefix used to define the fields from the raster attribute table. It's primarily used for [popups](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterAttributeTableFieldPrefix) - * + * * @default Raster. */ rasterAttributeTableFieldPrefix?: string; /** * A complete list of fields that consists of fields from the layer, pixel value fields and the attribute table fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#rasterFields) */ rasterFields?: FieldProperties[]; /** * Specifies the rule for how the requested image should be rendered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#renderingRule) */ renderingRule?: RasterFunctionProperties; /** * The URL to the REST endpoint of the layer. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISImageService.html#url) */ url?: string; @@ -10024,54 +10370,52 @@ declare namespace __esri { interface ArcGISMapService { /** * Indicates the layer's supported capabilities. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ readonly capabilities: ArcGISMapServiceCapabilities; /** * The copyright text as defined by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#copyright) */ copyright: string; /** * The full extent of the layer as defined by the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#fullExtent) */ fullExtent: Extent; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * The spatial reference of the layer as defined by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#spatialReference) */ readonly spatialReference: SpatialReference; /** * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#token) */ readonly token: string; /** * The version of ArcGIS Server in which the map service is published. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#version) */ readonly version: number; } interface ArcGISMapServiceConstructor { - - - new(properties?: ArcGISMapServiceProperties): ArcGISMapService; + new (properties?: ArcGISMapServiceProperties): ArcGISMapService; fromJSON(json: any): ArcGISMapService; } @@ -10081,109 +10425,105 @@ declare namespace __esri { interface ArcGISMapServiceProperties { /** * The copyright text as defined by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#copyright) */ copyright?: string; /** * The full extent of the layer as defined by the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#fullExtent) */ fullExtent?: ExtentProperties; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; } - export interface ArcGISMapServiceCapabilities extends Object { /** * Indicates options supported by the exportMap operation. Will be `null` if the `supportsExportMap` is `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ exportMap: ArcGISMapServiceCapabilitiesExportMap; /** * Indicates options supported by the exportTiles operation. Will be `null` if the `supportsExportTiles` is `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ exportTiles: ArcGISMapServiceCapabilitiesExportTiles; /** * Indicates operations that can be performed on the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ operations: ArcGISMapServiceCapabilitiesOperations; } - export interface ArcGISMapServiceCapabilitiesExportMap extends Object { /** * Indicates if sublayers can be added, removed, or reordered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ supportsSublayersChanges: boolean; /** * Indicates if sublayers rendering can be modified or added using dynamic layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ supportsDynamicLayers: boolean; /** * Indicates if sublayers [visibility](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#visible) can be changed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ supportsSublayerVisibility: boolean; /** * Indicates if sublayers [definition expression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression) can be set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ supportsSublayerDefinitionExpression: boolean; } - export interface ArcGISMapServiceCapabilitiesExportTiles extends Object { /** * Specifies the maximum number of tiles that can be exported to a cache dataset or a tile package. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ maxExportTilesCount: number; } - export interface ArcGISMapServiceCapabilitiesOperations extends Object { /** * Indicates if features in the sublayers can be [queried](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#queryFeatures). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ supportsQuery: boolean; /** * Indicates if the service can generate images. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ supportsExportMap: boolean; /** * Indicates if the tiles from the service can be exported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ supportsExportTiles: boolean; /** * Indicates if the service exposes a tile map that describes the presence of tiles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ArcGISMapService.html#capabilities) */ supportsTileMap: boolean; @@ -10192,16 +10532,14 @@ declare namespace __esri { interface PortalLayer { /** * The portal item from which the layer is loaded. If the portal item references a Feature Service or Scene Service, then you can specify a single layer to load with the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-PortalLayer.html#layerId) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-PortalLayer.html#portalItem) */ portalItem: PortalItem; } interface PortalLayerConstructor { - - - new(properties?: PortalLayerProperties): PortalLayer; + new (properties?: PortalLayerProperties): PortalLayer; fromJSON(json: any): PortalLayer; } @@ -10211,7 +10549,7 @@ declare namespace __esri { interface PortalLayerProperties { /** * The portal item from which the layer is loaded. If the portal item references a Feature Service or Scene Service, then you can specify a single layer to load with the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-PortalLayer.html#layerId) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-PortalLayer.html#portalItem) */ portalItem?: PortalItemProperties; @@ -10220,27 +10558,25 @@ declare namespace __esri { interface RefreshableLayer { /** * Refresh interval of the layer in minutes. Minimum refresh interval is 0.1 minute (6 seconds). Value of `0` indicates no refresh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-RefreshableLayer.html#refreshInterval) - * + * * @default 0 */ refreshInterval: number; /** * Fetches all the data for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-RefreshableLayer.html#refresh) - * - * + * + * */ refresh(): void; } interface RefreshableLayerConstructor { - - - new(): RefreshableLayer; + new (): RefreshableLayer; } export const RefreshableLayer: RefreshableLayerConstructor; @@ -10248,9 +10584,9 @@ declare namespace __esri { interface RefreshableLayerProperties { /** * Refresh interval of the layer in minutes. Minimum refresh interval is 0.1 minute (6 seconds). Value of `0` indicates no refresh. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-RefreshableLayer.html#refreshInterval) - * + * * @default 0 */ refreshInterval?: number; @@ -10259,26 +10595,24 @@ declare namespace __esri { interface ScaleRangeLayer { /** * The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#minScale) value, and greater than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#maxScale) - * + * * @default 0 */ maxScale: number; /** * The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#maxScale) value, and lesser than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#minScale) - * + * * @default 0 */ minScale: number; } interface ScaleRangeLayerConstructor { - - - new(): ScaleRangeLayer; + new (): ScaleRangeLayer; } export const ScaleRangeLayer: ScaleRangeLayerConstructor; @@ -10286,17 +10620,17 @@ declare namespace __esri { interface ScaleRangeLayerProperties { /** * The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#minScale) value, and greater than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#maxScale) - * + * * @default 0 */ maxScale?: number; /** * The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#maxScale) value, and lesser than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-ScaleRangeLayer.html#minScale) - * + * * @default 0 */ minScale?: number; @@ -10305,51 +10639,49 @@ declare namespace __esri { interface SceneService { /** * The copyright text as defined by the scene service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#copyright) */ copyright: string; /** - * The layer ID, or layer index, of a Scene Service layer. This is particularly useful when loading a single SceneLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: + * The layer ID, or layer index, of a Scene Service layer. This is particularly useful when loading a single layer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: * * When loading the layer via the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property. * * When pointing the layer [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#url) directly to the Scene Service. - * - * + * + * * If a layerId is not specified in either of the above scenarios, then the first layer in the service (`layerId = 0`) is selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) */ layerId: number; /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#spatialReference) */ spatialReference: SpatialReference; /** * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#token) */ readonly token: string; /** * The URL of the REST endpoint of the layer or scene service. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. The layer may be specified using the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) property when the url points directly to a service and not a specific layer. If [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) is not specified, then it will default to the first layer in the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#url) */ url: string; /** * The version of the scene service specification used for this service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#version) */ readonly version: SceneServiceVersion; } interface SceneServiceConstructor { - - - new(properties?: SceneServiceProperties): SceneService; + new (properties?: SceneServiceProperties): SceneService; fromJSON(json: any): SceneService; } @@ -10359,52 +10691,51 @@ declare namespace __esri { interface SceneServiceProperties { /** * The copyright text as defined by the scene service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#copyright) */ copyright?: string; /** - * The layer ID, or layer index, of a Scene Service layer. This is particularly useful when loading a single SceneLayer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: + * The layer ID, or layer index, of a Scene Service layer. This is particularly useful when loading a single layer with the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property from a service containing multiple layers. You can specify this value in one of two scenarios: * * When loading the layer via the [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#portalItem) property. * * When pointing the layer [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#url) directly to the Scene Service. - * - * + * + * * If a layerId is not specified in either of the above scenarios, then the first layer in the service (`layerId = 0`) is selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) */ layerId?: number; /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; /** * The URL of the REST endpoint of the layer or scene service. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. The layer may be specified using the [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) property when the url points directly to a service and not a specific layer. If [layerId](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#layerId) is not specified, then it will default to the first layer in the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#url) */ url?: string; } - export interface SceneServiceVersion extends Object { /** * The major version of the scene layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#version) */ major: number; /** * The minor version of the scene layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#version) */ minor: number; /** * The complete version string of the scene layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SceneService.html#version) */ versionString: string; @@ -10413,93 +10744,215 @@ declare namespace __esri { interface SublayersOwner { /** * Returns a deep clone of a map service's [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) as defined by the service. This is useful for scenarios when the developer is unfamiliar with the service sublayers and needs to "reset" the layer's sublayers to match those defined by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SublayersOwner.html#createServiceSublayers) - * - * + * + * */ createServiceSublayers(): Collection; /** * Returns the sublayer with the given layerId. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-mixins-SublayersOwner.html#findSublayerById) - * + * * @param id The [id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#id) of the sublayer. - * + * */ findSublayerById(id: number): Sublayer; } interface SublayersOwnerConstructor { - - - new(): SublayersOwner; + new (): SublayersOwner; } export const SublayersOwner: SublayersOwnerConstructor; interface OpenStreetMapLayer extends WebTileLayer { - on(name: "layerview-create", eventHandler: OpenStreetMapLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: OpenStreetMapLayerLayerviewDestroyEventHandler): IHandle; } interface OpenStreetMapLayerConstructor { - - - new(properties?: OpenStreetMapLayerProperties): OpenStreetMapLayer; + new (properties?: OpenStreetMapLayerProperties): OpenStreetMapLayer; } export const OpenStreetMapLayer: OpenStreetMapLayerConstructor; - interface OpenStreetMapLayerProperties extends WebTileLayerProperties { - - } + interface OpenStreetMapLayerProperties extends WebTileLayerProperties {} export interface OpenStreetMapLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface OpenStreetMapLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } + interface PointCloudFilter extends Accessor, JSONSupport { + /** + * The field used for applying the filter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudFilter.html#field) + */ + field: string; + /** + * The type of filter. **Possible values**: value | bitfield | return + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudFilter.html#type) + */ + readonly type: string; + } + + interface PointCloudFilterConstructor { + /** + * Point cloud filters are used to hide points that do not satisfy the filter criteria. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudFilter.html) + */ + + new (properties?: PointCloudFilterProperties): PointCloudFilter; + + fromJSON(json: any): PointCloudFilter; + } + + export const PointCloudFilter: PointCloudFilterConstructor; + + interface PointCloudFilterProperties { + /** + * The field used for applying the filter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudFilter.html#field) + */ + field?: string; + } + + interface PointCloudReturnFilter extends PointCloudFilter { + /** + * An array of return types used to filter points. Possible values for the return types are: + * * `firstOfMany`: the point was the first to be collected in a series of many returns + * * `last`: the last point in a series of many returns or a single point + * * `lastOfMany`: the last point in a series of many returns + * * `single`: all the points that were collected from laser pulses with a single return + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudReturnFilter.html#includedReturns) + */ + includedReturns: string[]; + } + + interface PointCloudReturnFilterConstructor { + /** + * Laser pulses emitted from a lidar system can have several returns depending on the surfaces that they encounter. The return number is stored within each point in the `RETURNS` field. For example, the first return is associated with the highest point in the landscape. In some cases the laser pulse returns only one point representing the ground. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudReturnFilter.html) + */ + + new (properties?: PointCloudReturnFilterProperties): PointCloudReturnFilter; + + fromJSON(json: any): PointCloudReturnFilter; + } + + export const PointCloudReturnFilter: PointCloudReturnFilterConstructor; + + interface PointCloudReturnFilterProperties extends PointCloudFilterProperties { + /** + * An array of return types used to filter points. Possible values for the return types are: + * * `firstOfMany`: the point was the first to be collected in a series of many returns + * * `last`: the last point in a series of many returns or a single point + * * `lastOfMany`: the last point in a series of many returns + * * `single`: all the points that were collected from laser pulses with a single return + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudReturnFilter.html#includedReturns) + */ + includedReturns?: string[]; + } + + interface PointCloudValueFilter extends PointCloudFilter { + /** + * Whether points should be included or excluded from the filter. **Possible values:** include | exclude + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html#mode) + * + * @default "exclude" + */ + mode: string; + /** + * An array of numeric values representing the classification codes that the filter should apply. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html#values) + */ + values: number[]; + } + + interface PointCloudValueFilterConstructor { + /** + * Every lidar point can have a classification that defines the type of surface that reflected the laser pulse. The different categories (for example building, high vegetation, ground) are defined using numeric integer codes in the LAS files. The full list of categories including the corresponding codes can be found in the LAS specification. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html) + */ + + new (properties?: PointCloudValueFilterProperties): PointCloudValueFilter; + + fromJSON(json: any): PointCloudValueFilter; + } + + export const PointCloudValueFilter: PointCloudValueFilterConstructor; + + interface PointCloudValueFilterProperties extends PointCloudFilterProperties { + /** + * Whether points should be included or excluded from the filter. **Possible values:** include | exclude + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html#mode) + * + * @default "exclude" + */ + mode?: string; + /** + * An array of numeric values representing the classification codes that the filter should apply. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html#values) + */ + values?: number[]; + } + interface PointCloudLayer extends Layer, SceneService, PortalLayer { /** * Specifies how points are placed on the vertical axis (z). This property only affects [PointCloudLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) when using the `absolute-height` mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) */ elevationInfo: PointCloudLayerElevationInfo; /** * An array of fields accessible in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#fields) */ fields: Field[]; + /** + * An array of [pointCloudFilters](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudFilter.html) used to filter points. Only the points that satisfy all the filters are displayed in the view. There are two types of filters that can be set: [PointCloudValueFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html) filters points based on classification values and [PointCloudReturnFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudReturnFilter.html) filters points based on return values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#filters) + */ + filters: PointCloudFilter[]; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * The renderer assigned to the layer. The renderer defines how to visualize each point in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#renderer) */ renderer: PointCloudRenderer; - on(name: "layerview-create", eventHandler: PointCloudLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: PointCloudLayerLayerviewDestroyEventHandler): IHandle; @@ -10508,11 +10961,11 @@ declare namespace __esri { interface PointCloudLayerConstructor { /** * The PointCloudLayer is designed for visualizing large collections of points in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) */ - new(properties?: PointCloudLayerProperties): PointCloudLayer; + new (properties?: PointCloudLayerProperties): PointCloudLayer; fromJSON(json: any): PointCloudLayer; } @@ -10522,72 +10975,75 @@ declare namespace __esri { interface PointCloudLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { /** * Specifies how points are placed on the vertical axis (z). This property only affects [PointCloudLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) when using the `absolute-height` mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) */ elevationInfo?: PointCloudLayerElevationInfo; /** * An array of fields accessible in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#fields) */ fields?: FieldProperties[]; + /** + * An array of [pointCloudFilters](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudFilter.html) used to filter points. Only the points that satisfy all the filters are displayed in the view. There are two types of filters that can be set: [PointCloudValueFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudValueFilter.html) filters points based on classification values and [PointCloudReturnFilter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-pointCloudFilters-PointCloudReturnFilter.html) filters points based on return values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#filters) + */ + filters?: PointCloudFilterProperties[]; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * The renderer assigned to the layer. The renderer defines how to visualize each point in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#renderer) */ renderer?: PointCloudRendererProperties; } export interface PointCloudLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface PointCloudLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface PointCloudLayerElevationInfo extends Object { /** - * Defines how the points are placed on the vertical axis (z). Currently only `absolute-height` mode is supported. - * + * Defines how the points are placed on the vertical axis (z). Currently only `absolute-height` mode is supported. + * * Mode | Description * ------|------------ - * absolute-height | Points are placed at an absolute height above sea level. This height is determined by summing up the `offset` value and the point's z-value. It doesn't take the elevation of the terrain into account. This is the only supported elevation mode for a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html). - * - * + * absolute-height | Points are placed at an absolute elevation (z-value) above sea level. This z-value is determined by summing up the `offset` value and the point's z-value. It doesn't take the elevation of the terrain into account. This is the only supported elevation mode for a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html). + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) */ mode: string; /** * An elevation offset, which is added to the vertical position of each point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) - * + * * @default 0 */ offset?: number; /** * The unit for `offset` values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html#elevationInfo) - * + * * @default meters */ unit?: string; @@ -10596,157 +11052,156 @@ declare namespace __esri { interface SceneLayer extends Layer, SceneService, PortalLayer { /** * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when only a subset of the data in the layer should be displayed. Setting the definition expression of a layer automatically updates all layer views. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. Important to note is that the initial loading time of the features remains unchanged, even if they are filtered. This happens because, as opposed to Feature Layers, feature filtering is done client-side. As a result all features need to be downloaded always for filter evaluation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#definitionExpression) */ definitionExpression: string; /** * Specifies how graphics are placed on the vertical axis (z). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. This property only affects 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) when using the `absolute-height` mode. [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries support all the elevation modes listed below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) */ elevationInfo: SceneLayerElevationInfo; /** - * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) * > **Known Limitation** When applying featureReduction on a point SceneLayer layer updates are slow. This will be addressed in upcoming releases. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#featureReduction) */ featureReduction: SceneLayerFeatureReduction; /** * An array of fields accessible in the layer. Depending on the scene service, fields may have limited support for certain capabilities. Use [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) to query the contexts (rendering, labeling, popups or querying) for which a particular field may be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#fields) */ fields: Field[]; /** * The geometry type of features in the layer. **Possible Values:** point | mesh - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) */ geometryType: string; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) property of this layer must be set to `true`. + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) property of this layer must be set to `true`. * > **Known Limitations** This property is only relevant to SceneLayers with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. This property has no effect on SceneLayers with other geometry types. Each point can have only one label. Multiple [Label classes](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) with different [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) clauses can be used to have different label styles on different features that belong to the same layer (for example blue labels for lakes and green labels for parks). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelingInfo) */ labelingInfo: LabelClass[]; /** * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelingInfo) property. This property is only relevant to SceneLayers with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. This property has no effect on SceneLayers with other geometry types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) - * + * * @default true */ labelsVisible: boolean; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * The name of the field containing each graphic's Object ID. If this is not explicitly specified, this is automatically derived from the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#fields) of the service by taking the first field of type `oid`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#objectIdField) */ objectIdField: string; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupEnabled) - * + * * @default true */ popupEnabled: boolean; /** * The popup template for the layer. When set on the layer, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Setting a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) on this layer type is done in the same way as a FeatureLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupTemplate) */ popupTemplate: PopupTemplate; /** * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#renderer) */ renderer: Renderer; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#screenSizePerspectiveEnabled) - * + * * @default true */ screenSizePerspectiveEnabled: boolean; /** * Creates a query object that can be used to fetch features that satisfy the layer's current definition expression. The query should only be used on the layer and not on the layer view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#createQuery) - * - * + * + * */ createQuery(): Query; /** - * Gets field usage information. The usage of a field depends on whether it is stored as part of the scene service cache. The returned object contains the following usage information: - * + * Gets field usage information. The usage of a field depends on whether it is stored as part of the scene service cache. The returned object contains the following usage information: + * * Property | Type | Description * ----------------------|---------|------------ * supportsRenderer | boolean | Indicates that a field can be used in a renderer (e.g. in visual variables), [see renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#renderer). * supportsLabelingInfo | boolean | Indicates that a field can be used for labeling, [see labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelingInfo). * supportsPopupTemplate | boolean | Indicates that a field can be used in a popup template, [see popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupTemplate). * supportsLayerQuery | boolean | Indicates that a field can be used in layer queries, [see queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatures). - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) - * + * * @param fieldName The name of the field to get usage info for. - * + * */ getFieldUsageInfo(fieldName: string): any; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the service and returns the 2D [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. At the moment the 3D Extent can be returned by using [SceneLayerView.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryExtent), but this will return the 3D extent only for features currently in the view. The query succeeds only if the layer's `supportsLayerQuery` capability is enabled. Use the [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) method to check if the layer supports queries. If querying is not enabled, then an error with the name `scenelayer:query-not-available` is thrown. Read more about queries in the Query section of the class description above. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryExtent) - * + * * @param params Specifies the query parameters. - * + * */ queryExtent(params?: Query): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the service and returns the number of the features that satisfy the query. The query succeeds only if the layer's `supportsLayerQuery` capability is enabled. Use the [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) method to check if the layer supports queries. If querying is not enabled, then an error with the name `scenelayer:query-not-available` is thrown. Read more about queries in the Query section of the class description above. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatureCount) - * + * * @param params Specifies the query parameters. - * + * */ queryFeatureCount(params?: Query): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the service and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). The query succeeds only if the layer's `supportsLayerQuery` capability is enabled. Use the [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) method to check if the layer supports queries. If querying is not enabled, then an error with the name `scenelayer:query-not-available` is thrown. Read more about queries in the Query section of the class description above. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatures) - * + * * @param params Specifies the query parameters. - * + * */ queryFeatures(params?: Query): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the service and returns an array of the ObjectIDs of features that satisfy the input query. The query succeeds only if the layer's `supportsLayerQuery` capability is enabled. Use the [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) method to check if the layer supports queries. If querying is not enabled, then an error with the name `scenelayer:query-not-available` is thrown. Read more about queries in the Query section of the class description above. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryObjectIds) - * + * * @param params Specifies the query parameters. - * + * */ queryObjectIds(params?: Query): IPromise; - on(name: "layerview-create", eventHandler: SceneLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: SceneLayerLayerviewDestroyEventHandler): IHandle; @@ -10755,11 +11210,11 @@ declare namespace __esri { interface SceneLayerConstructor { /** * The SceneLayer is a layer type designed for on-demand streaming and displaying large amounts of data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). SceneLayers support two geometry types: [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and 3D Objects (e.g. Buildings). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) */ - new(properties?: SceneLayerProperties): SceneLayer; + new (properties?: SceneLayerProperties): SceneLayer; fromJSON(json: any): SceneLayer; } @@ -10769,148 +11224,144 @@ declare namespace __esri { interface SceneLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { /** * The SQL where clause used to filter features on the client. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Setting a definition expression is useful when only a subset of the data in the layer should be displayed. Setting the definition expression of a layer automatically updates all layer views. If the definition expression is set after the layer has been added to the map, the view will automatically refresh itself to display the features that satisfy the new definition expression. Important to note is that the initial loading time of the features remains unchanged, even if they are filtered. This happens because, as opposed to Feature Layers, feature filtering is done client-side. As a result all features need to be downloaded always for filter evaluation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#definitionExpression) */ definitionExpression?: string; /** * Specifies how graphics are placed on the vertical axis (z). See the [ElevationInfo sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html) for an example of how this property may be used. This property only affects 3D Object [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) when using the `absolute-height` mode. [SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries support all the elevation modes listed below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) */ elevationInfo?: SceneLayerElevationInfo; /** - * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) + * Configures the method for decluttering overlapping features in the view. If this property is not set (or set to `null`), every feature is drawn individually. This property is only supported for point scene layers with non-draped [Icon](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) or [Text](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) symbol layers. [![declutter](https://developers.arcgis.com/javascript/assets/img/samples/city-points-declutter.gif)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-point-styles/index.html) * > **Known Limitation** When applying featureReduction on a point SceneLayer layer updates are slow. This will be addressed in upcoming releases. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#featureReduction) */ featureReduction?: SceneLayerFeatureReduction; /** * An array of fields accessible in the layer. Depending on the scene service, fields may have limited support for certain capabilities. Use [getFieldUsageInfo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#getFieldUsageInfo) to query the contexts (rendering, labeling, popups or querying) for which a particular field may be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#fields) */ fields?: FieldProperties[]; /** * The geometry type of features in the layer. **Possible Values:** point | mesh - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) */ geometryType?: string; /** - * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) property of this layer must be set to `true`. + * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html). Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) property of this layer must be set to `true`. * > **Known Limitations** This property is only relevant to SceneLayers with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. This property has no effect on SceneLayers with other geometry types. Each point can have only one label. Multiple [Label classes](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) with different [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) clauses can be used to have different label styles on different features that belong to the same layer (for example blue labels for lakes and green labels for parks). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelingInfo) */ labelingInfo?: LabelClassProperties[]; /** * Indicates whether to display labels for this layer. If `true`, labels will appear as defined in the [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelingInfo) property. This property is only relevant to SceneLayers with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. This property has no effect on SceneLayers with other geometry types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#labelsVisible) - * + * * @default true */ labelsVisible?: boolean; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * The name of the field containing each graphic's Object ID. If this is not explicitly specified, this is automatically derived from the [fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#fields) of the service by taking the first field of type `oid`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#objectIdField) */ objectIdField?: string; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupEnabled) - * + * * @default true */ popupEnabled?: boolean; /** * The popup template for the layer. When set on the layer, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when a feature is selected using text and/or charts. See the [PopupTemplate sample](https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/index.html) for an example of how [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) interacts with a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Setting a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) on this layer type is done in the same way as a FeatureLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#popupTemplate) */ popupTemplate?: PopupTemplateProperties; /** * The renderer assigned to the layer. The renderer defines how to visualize each feature in the layer. Depending on the renderer type, features may be visualized with the same symbol, or with varying symbols based on the values of provided attribute fields or functions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#renderer) */ renderer?: RendererProperties; /** - * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) + * Apply perspective scaling to screen-size point symbols in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When `true`, screen sized objects such as [icons](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [labels](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) or [callouts](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) integrate better in the 3D scene by applying a certain perspective projection to the sizing of features. This only applies when using a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). `layer.screenSizePerspectiveEnabled = true` ![screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-screenSize-perspective.png) `layer.screenSizePerspectiveEnabled = false` ![no-screen-size-perspective](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-no-screenSize-perspective.png) * > **Known Limitations** Screen size perspective is currently not optimized for situations where the camera is very near the ground, or for scenes with point features located far from the ground surface. In these cases it may be better to turn off screen size perspective. As screen size perspective changes the size based on distance to the camera, it should be set to false when using {@link module:esri/renderers/Renderer#SizeVisualVariable size visual variables}. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#screenSizePerspectiveEnabled) - * + * * @default true */ screenSizePerspectiveEnabled?: boolean; } export interface SceneLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface SceneLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface SceneLayerElevationInfo extends Object { /** - * Defines how the graphic is placed with respect to the terrain surface. See the table below for a list of possible values. - * + * Defines how the graphic is placed with respect to the terrain surface. See the table below for a list of possible values. + * * Mode | Description * ------|------------ * on-the-ground | Graphics are draped on the terrain surface. This is the default value for features with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [ObjectSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). * relative-to-ground | The graphic is placed at an elevation relative to the terrain surface. The graphic's elevation is determined by summing up the terrain elevation, the `offset` value and the geometry's z-value (if present). This is the default value for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries rendered with [IconSymbol3DLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html). - * absolute-height | Graphics are placed at an absolute height above sea level. This height is determined by summing up the `offset` value and the geometry's z-value (if present). It doesn't take the elevation of the terrain into account. This is the default value for features with 3D Object geometries and [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries where [hasZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#hasZ) is `true`. + * absolute-height | Graphics are placed at an absolute elevation (z-value) above sea level. This z-value is determined by summing up the `offset` value and the geometry's z-value (if present). It doesn't take the elevation of the terrain into account. This is the default value for features with 3D Object geometries and [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries where [hasZ](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#hasZ) is `true`. * relative-to-scene | Graphics are aligned to buildings and other objects part of 3D Object [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) or [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-IntegratedMeshLayer.html), depending on which has higher elevation. If the graphic is not directly above a building or any other feature, it is aligned to the terrain surface elevation. If present, z-values will be ignored. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) */ mode: string; /** * An elevation offset which is added to the vertical position of the graphic. When `mode = "on-the-ground"`, this property has no effect. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) - * + * * @default 0 */ offset?: number; /** * The unit for `offset` values. **Possible Values:** feet | meters | kilometers | miles | us-feet | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#elevationInfo) - * + * * @default meters */ unit?: string; } - export interface SceneLayerFeatureReduction extends Object { /** * Type of the decluttering method. The only supported type at the moment is `"selection"`. In this method, some of the overlapping features are hidden such that none of the remaining features intersect on screen. Label deconfliction also respects this option and hides labels that would overlap with the features of this layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#featureReduction) */ type: string; @@ -10919,42 +11370,41 @@ declare namespace __esri { interface StreamLayer extends FeatureLayer { /** * Contains the attribute and spatial filters used to filter messages sent to the client by a Stream Service. This property can be set in the constructor but is `read-only` after the layer is created. To change the filter after the layer is created, use the [updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) */ readonly filter: StreamLayerFilter; /** * An extent object used to filter features. Only features intersecting the extent are displayed in the view. Instead of using this property, use [StreamLayer.filter.geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) when creating the service or [StreamLayer.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) when changing the spatial filter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#geometryDefinition) */ geometryDefinition: Extent; /** * Maximum number of features to show per [trackId](https://enterprise.arcgis.com/en/geoevent/latest/get-started/essential-geoevent-server-vocabulary.htm#ESRI_SECTION1_F45BBCE9ADFA4E57AF38DD225921EFCD). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#maximumTrackPoints) */ maximumTrackPoints: number; /** * Options for purging stale features. Use these options to avoid overloading the browser with graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#purgeOptions) */ purgeOptions: StreamLayerPurgeOptions; /** * Updates the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) on the layer. The filter is updated on all views that contain the layer. If the input `filterChanges` object is `undefined` or `null`, the spatial and attribute filters are removed. To update the filter on a single layer view associated with the layer, use the [StreamLayerView.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) method after getting the layer view object. Filter changes only apply to incoming features. Features already displayed in the view will be removed automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) - * + * * @param filterChanges Updates the spatial and attribute [filters](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) on the layer and all of its associated views. If `null`, all filters are cleared. * @param filterChanges.geometry A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view(s). If `null`, the spatial filter is cleared. * @param filterChanges.where A SQL where clause used to filter features by attributes. If `null`, the attribute filter is cleared. - * + * */ updateFilter(filterChanges: StreamLayerUpdateFilterFilterChanges): IPromise; - on(name: "layerview-create", eventHandler: StreamLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: StreamLayerLayerviewDestroyEventHandler): IHandle; @@ -10963,11 +11413,11 @@ declare namespace __esri { interface StreamLayerConstructor { /** * The stream layer extends the feature layer to add the ability to connect to a stream of data using HTML5 WebSockets. It connects to a server that emits geographic features continuously. While the feature layer is used to map relatively static data, the stream layer is suitable when you would like to map dynamic streams of data that are unbounded and continuous. When a stream layer is added to a map, users are able to see real-time updates pushed out by the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) */ - new(properties?: StreamLayerProperties): StreamLayer; + new (properties?: StreamLayerProperties): StreamLayer; fromJSON(json: any): StreamLayer; } @@ -10977,121 +11427,227 @@ declare namespace __esri { interface StreamLayerProperties extends FeatureLayerProperties { /** * Contains the attribute and spatial filters used to filter messages sent to the client by a Stream Service. This property can be set in the constructor but is `read-only` after the layer is created. To change the filter after the layer is created, use the [updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) */ filter?: StreamLayerFilter; /** * An extent object used to filter features. Only features intersecting the extent are displayed in the view. Instead of using this property, use [StreamLayer.filter.geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) when creating the service or [StreamLayer.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) when changing the spatial filter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#geometryDefinition) */ geometryDefinition?: ExtentProperties; /** * Maximum number of features to show per [trackId](https://enterprise.arcgis.com/en/geoevent/latest/get-started/essential-geoevent-server-vocabulary.htm#ESRI_SECTION1_F45BBCE9ADFA4E57AF38DD225921EFCD). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#maximumTrackPoints) */ maximumTrackPoints?: number; /** * Options for purging stale features. Use these options to avoid overloading the browser with graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#purgeOptions) */ purgeOptions?: StreamLayerPurgeOptions; } export interface StreamLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface StreamLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface StreamLayerFilter extends Object { /** * A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) */ geometry?: Extent; /** * A SQL where clause used to filter features by attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#filter) */ where?: string; } - export interface StreamLayerPurgeOptions extends Object { /** * The maximum number of features to display. Excess features are purged from the beginning of the graphics array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#purgeOptions) */ displayCount: number; /** * The maximum time in minutes that a feature should be kept. After this time, the feature is removed from the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#purgeOptions) */ age: number; } - export interface StreamLayerUpdateFilterFilterChanges extends Object { /** * A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view(s). If `null`, the spatial filter is cleared. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) */ geometry: Extent; /** * A SQL where clause used to filter features by attributes. If `null`, the attribute filter is cleared. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) */ where: string; } + interface AttachmentInfo extends Accessor, JSONSupport { + /** + * The content type of the attachment. For example, `'image/jpeg'`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-attachments-feature-service-layer-.htm) for more information on supported attachment types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#contentType) + */ + contentType: string; + /** + * The identifier for the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#id) + */ + id: number; + /** + * Keywords used for the attachments. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#keywords) + */ + keywords: string; + /** + * String value indicating the name of the file attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#name) + */ + name: string; + /** + * The parent or the feature object id of the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#parentObjectId) + */ + parentObjectId: number; + /** + * The file size of the attachment. This is specified in bytes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#size) + */ + size: number; + /** + * The URL of the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#url) + */ + url: string; + + /** + * Creates a deep clone of the AttachmentInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#clone) + * + * + */ + clone(): AttachmentInfo; + } + + interface AttachmentInfoConstructor { + /** + * The AttachmentInfo class returns information about attachments associated with a feature. The contents of the attachment are streamed to the client. Attachments are available if the [FeatureLayer's capabilities.data.supportsAttachment](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html) + */ + + new (properties?: AttachmentInfoProperties): AttachmentInfo; + + fromJSON(json: any): AttachmentInfo; + } + + export const AttachmentInfo: AttachmentInfoConstructor; + + interface AttachmentInfoProperties { + /** + * The content type of the attachment. For example, `'image/jpeg'`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-attachments-feature-service-layer-.htm) for more information on supported attachment types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#contentType) + */ + contentType?: string; + /** + * The identifier for the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#id) + */ + id?: number; + /** + * Keywords used for the attachments. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#keywords) + */ + keywords?: string; + /** + * String value indicating the name of the file attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#name) + */ + name?: string; + /** + * The parent or the feature object id of the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#parentObjectId) + */ + parentObjectId?: number; + /** + * The file size of the attachment. This is specified in bytes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#size) + */ + size?: number; + /** + * The URL of the attachment. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html#url) + */ + url?: string; + } + interface CodedValueDomain extends Domain { /** * An array of the coded values in the domain. See the object specification table below for the properties each item in the array should contain. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#codedValues) */ codedValues: CodedValueDomainCodedValues[]; /** * The domain type. This value is always `coded-value`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#type) */ readonly type: "coded-value"; /** * Returns the name of the coded-value associated with the specified code. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#getName) - * + * * @param code The code associated with the desired name. - * + * */ getName(code: string | number): string; } interface CodedValueDomainConstructor { - - - new(properties?: CodedValueDomainProperties): CodedValueDomain; + new (properties?: CodedValueDomainProperties): CodedValueDomain; fromJSON(json: any): CodedValueDomain; } @@ -11101,98 +11657,125 @@ declare namespace __esri { interface CodedValueDomainProperties extends DomainProperties { /** * An array of the coded values in the domain. See the object specification table below for the properties each item in the array should contain. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#codedValues) */ codedValues?: CodedValueDomainCodedValues[]; } - export interface CodedValueDomainCodedValues extends Object { /** * The name of the coded value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#codedValues) */ name: string; /** * The value of the code. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html#codedValues) */ code: string | number; } - interface DimensionalDefinition { + interface DimensionalDefinition extends Accessor, JSONSupport { /** * The dimension associated with the variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#dimensionName) */ dimensionName: string; /** * Indicates whether the values indicate slices (rather than ranges). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#isSlice) - * + * * @default false */ isSlice: boolean; /** * An array of tuples [min, max] each defining a range of valid values along the specified dimension. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#values) */ values: any[]; /** - * The variable name by which to filter. - * + * The required variable name by which to filter. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#variableName) */ variableName: string; /** - * Returns a serialized JSON object representation of the dimensional definition in the format of the ArcGIS Platform. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#toJSON) - * - * + * Creates a clone of the DimensionalDefinition object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#clone) + * + * */ - toJSON(): any; + clone(): DimensionalDefinition; } interface DimensionalDefinitionConstructor { /** * A dimensional definition defines a filter based on one variable and one dimension. You can filter with one or multiple dimensional slices. Instances of this class are typically used when filtering data based on [slices](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#isSlice) or ranges in one or more dimensions with [MosaicRule](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html) */ + new (properties?: DimensionalDefinitionProperties): DimensionalDefinition; - new(properties?: any): DimensionalDefinition; + fromJSON(json: any): DimensionalDefinition; } export const DimensionalDefinition: DimensionalDefinitionConstructor; + interface DimensionalDefinitionProperties { + /** + * The dimension associated with the variable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#dimensionName) + */ + dimensionName?: string; + /** + * Indicates whether the values indicate slices (rather than ranges). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#isSlice) + * + * @default false + */ + isSlice?: boolean; + /** + * An array of tuples [min, max] each defining a range of valid values along the specified dimension. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#values) + */ + values?: any[]; + /** + * The required variable name by which to filter. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DimensionalDefinition.html#variableName) + */ + variableName?: string; + } + interface Domain extends Accessor, JSONSupport { /** * The domain name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html#name) */ name: string; /** * The domain type. **Possible Values:** range | coded-value | inherited - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html#type) */ type: string; } interface DomainConstructor { - - - new(properties?: DomainProperties): Domain; + new (properties?: DomainProperties): Domain; fromJSON(json: any): Domain; } @@ -11202,13 +11785,13 @@ declare namespace __esri { interface DomainProperties { /** * The domain name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html#name) */ name?: string; /** * The domain type. **Possible Values:** range | coded-value | inherited - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Domain.html#type) */ type?: string; @@ -11217,80 +11800,76 @@ declare namespace __esri { interface ElevationSampler { /** * Registers an event handler on the instance. Call this method to hook an event with a listener. See the [Events summary table](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ElevationSampler.html#events-summary) for a list of listened events. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ElevationSampler.html#on) - * + * * @param type The name of the event or the events to listen for. * @param handler? The function to call when the event is fired, if modifiers were specified. - * + * */ on(type: string | string[], handler?: Function): any; /** * Query elevation for a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) or [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html) geometry. A query will return a new geometry for which the z-values for each coordinate in the geometry are obtained from the elevation sampler. If the geometry used for the query is outside of the elevation sampler extent, then the returned geometry has `0` as z-values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ElevationSampler.html#queryElevation) - * + * * @param geometry The geometry to use for sampling elevation data. - * + * */ queryElevation(geometry: Point | Multipoint | Polyline): Point | Multipoint | Polyline; - on(name: "changed", eventHandler: ElevationSamplerChangedEventHandler): IHandle; } interface ElevationSamplerConstructor { /** * A cache of elevation values created from an elevation service or the [GroundView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-GroundView.html) used for synchronously querying elevation information for geometries. This class does not have a constructor. You can create an instance of this class by using [ElevationLayer.createElevationSampler()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#createElevationSampler) or [Ground.createElevationSampler()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#createElevationSampler) methods. The elevation sampler created from the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) will sample data from the first elevation layer that has data available. To control the layer used for elevation sampling and the sampling resolution, use [ElevationLayer.createElevationSampler()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html#createElevationSampler). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ElevationSampler.html) */ - new(): ElevationSampler; + new (): ElevationSampler; } export const ElevationSampler: ElevationSamplerConstructor; - export interface ElevationSamplerChangedEvent { - } + export interface ElevationSamplerChangedEvent {} interface FeatureTemplate extends Accessor, JSONSupport { /** * Description of the feature template. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#description) */ description: string; /** * Name of the default drawing tool defined for the template to create a feature. **Possible Values:** auto-complete-polygon | circle | ellipse | freehand | line | none | point | polygon | rectangle | arrow | triangle | left-arrow | right-arrow | up-arrow | down-arrow - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#drawingTool) */ drawingTool: string; /** * Name of the feature template. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#name) */ name: string; /** * An instance of the prototypical feature described by the [feature template](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html). It specifies default values for the attribute fields and does not contain geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#prototype) */ prototype: any; /** * An object used to create a thumbnail image that represents a feature type in the feature template. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) */ thumbnail: FeatureTemplateThumbnail; } interface FeatureTemplateConstructor { - - - new(properties?: FeatureTemplateProperties): FeatureTemplate; + new (properties?: FeatureTemplateProperties): FeatureTemplate; fromJSON(json: any): FeatureTemplate; } @@ -11300,59 +11879,58 @@ declare namespace __esri { interface FeatureTemplateProperties { /** * Description of the feature template. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#description) */ description?: string; /** * Name of the default drawing tool defined for the template to create a feature. **Possible Values:** auto-complete-polygon | circle | ellipse | freehand | line | none | point | polygon | rectangle | arrow | triangle | left-arrow | right-arrow | up-arrow | down-arrow - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#drawingTool) */ drawingTool?: string; /** * Name of the feature template. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#name) */ name?: string; /** * An instance of the prototypical feature described by the [feature template](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html). It specifies default values for the attribute fields and does not contain geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#prototype) */ prototype?: any; /** * An object used to create a thumbnail image that represents a feature type in the feature template. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) */ thumbnail?: FeatureTemplateThumbnail; } - export interface FeatureTemplateThumbnail extends Object { /** * The MIME type of the image. **Possible Values:** image | png | jpg | jpeg - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) */ contentType: any; /** * The [base64EncodedImageData](https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding) presenting the thumbnail image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) */ imageData: string; /** * The height of the thumbnail. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) */ height: number; /** * The width of the thumbnail. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail) */ width: number; @@ -11361,34 +11939,32 @@ declare namespace __esri { interface FeatureType extends Accessor, JSONSupport { /** * Domains associated with the feature type. It is an object where the name of each property corresponds with the name of a field containing a domain. If a field's domain is an instance of [InheritedDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-InheritedDomain.html), the application will use the domain defined for the field from the layer. If the domain is an instance of [CodedValueDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html) or [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html) then the domain is defined specifically for the given feature type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#domains) */ domains: any; /** * The feature type identifier. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#id) */ id: number | string; /** * The feature type name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#name) */ name: string; /** * Array of [feature templates](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) associated with the feature type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#templates) */ templates: FeatureTemplate[]; } interface FeatureTypeConstructor { - - - new(properties?: FeatureTypeProperties): FeatureType; + new (properties?: FeatureTypeProperties): FeatureType; fromJSON(json: any): FeatureType; } @@ -11398,25 +11974,25 @@ declare namespace __esri { interface FeatureTypeProperties { /** * Domains associated with the feature type. It is an object where the name of each property corresponds with the name of a field containing a domain. If a field's domain is an instance of [InheritedDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-InheritedDomain.html), the application will use the domain defined for the field from the layer. If the domain is an instance of [CodedValueDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-CodedValueDomain.html) or [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html) then the domain is defined specifically for the given feature type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#domains) */ domains?: any; /** * The feature type identifier. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#id) */ id?: number | string; /** * The feature type name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#name) */ name?: string; /** * Array of [feature templates](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) associated with the feature type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureType.html#templates) */ templates?: FeatureTemplateProperties[]; @@ -11425,74 +12001,86 @@ declare namespace __esri { interface Field extends Accessor, JSONSupport { /** * The display name for the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias) - * + * * @default null */ alias: string; /** * The default value set for the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#defaultValue) - * + * * @default undefined */ defaultValue: number | string | any | any; /** * The domain associated with the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#domain) - * + * * @default null */ domain: Domain; /** * Indicates whether the field is editable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#editable) - * + * * @default true */ editable: boolean; /** * The field length. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#length) - * + * * @default -1 */ length: number; /** * The name of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#name) - * + * * @default null */ name: string; /** * Indicates if the field can accept `null` values. *Requires ArcGIS Server version 10.1 or greater.* - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#nullable) - * + * * @default true */ nullable: boolean; /** * The data type of the field. **Possible Values:** small-integer | integer | single | double | long | string | date | oid | geometry | blob | raster | guid | global-id | xml - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#type) - * + * * @default null */ - type: string; + type: + | "small-integer" + | "integer" + | "single" + | "double" + | "long" + | "string" + | "date" + | "oid" + | "geometry" + | "blob" + | "raster" + | "guid" + | "global-id" + | "xml"; } interface FieldConstructor { - - - new(properties?: FieldProperties): Field; + new (properties?: FieldProperties): Field; fromJSON(json: any): Field; } @@ -11502,152 +12090,164 @@ declare namespace __esri { interface FieldProperties { /** * The display name for the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias) - * + * * @default null */ alias?: string; /** * The default value set for the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#defaultValue) - * + * * @default undefined */ defaultValue?: number | string | any | any; /** * The domain associated with the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#domain) - * + * * @default null */ domain?: DomainProperties; /** * Indicates whether the field is editable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#editable) - * + * * @default true */ editable?: boolean; /** * The field length. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#length) - * + * * @default -1 */ length?: number; /** * The name of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#name) - * + * * @default null */ name?: string; /** * Indicates if the field can accept `null` values. *Requires ArcGIS Server version 10.1 or greater.* - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#nullable) - * + * * @default true */ nullable?: boolean; /** * The data type of the field. **Possible Values:** small-integer | integer | single | double | long | string | date | oid | geometry | blob | raster | guid | global-id | xml - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#type) - * + * * @default null */ - type?: string; + type?: + | "small-integer" + | "integer" + | "single" + | "double" + | "long" + | "string" + | "date" + | "oid" + | "geometry" + | "blob" + | "raster" + | "guid" + | "global-id" + | "xml"; } interface ImageParameters extends Accessor { /** * Dots per inch setting for an module:esri/layersMapImageLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#dpi) - * + * * @default 96 */ dpi: number; /** * Extent of map to be exported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#extent) */ extent: Extent; /** * Map image format. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#format) - * + * * @default png8 */ format: string; /** * Requested image height in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#height) */ height: number; /** * Spatial reference of exported map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#imageSpatialReference) */ imageSpatialReference: SpatialReference; /** * Array of layer definition expressions that allows you to filter the features of individual layers in the exported map image. Layer definitions with semicolons or colons are supported if using a map service published using ArcGIS Server 10 or later. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerDefinitions) */ layerDefinitions: string[]; /** * A list of layer IDs, that represent which layers to include in the exported map. Use in combination with [layerOption](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerOption) to specify how layer visibility is handled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerIds) */ layerIds: number[]; /** * The option for displaying or hiding the layer. **Possible Values:** show | hide | include | exclude - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerOption) */ layerOption: string; /** * Indicates whether or not the background of the dynamic image is transparent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#transparent) - * + * * @default true */ transparent: boolean; /** * Requested image width in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#width) */ width: number; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface ImageParametersConstructor { - - - new(properties?: ImageParametersProperties): ImageParameters; + new (properties?: ImageParametersProperties): ImageParameters; } export const ImageParameters: ImageParametersConstructor; @@ -11655,67 +12255,67 @@ declare namespace __esri { interface ImageParametersProperties { /** * Dots per inch setting for an module:esri/layersMapImageLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#dpi) - * + * * @default 96 */ dpi?: number; /** * Extent of map to be exported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#extent) */ extent?: ExtentProperties; /** * Map image format. **Possible Values:** png | png8 | png24 | png32 | jpg | pdf | bmp | gif | svg - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#format) - * + * * @default png8 */ format?: string; /** * Requested image height in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#height) */ height?: number; /** * Spatial reference of exported map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#imageSpatialReference) */ imageSpatialReference?: SpatialReferenceProperties; /** * Array of layer definition expressions that allows you to filter the features of individual layers in the exported map image. Layer definitions with semicolons or colons are supported if using a map service published using ArcGIS Server 10 or later. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerDefinitions) */ layerDefinitions?: string[]; /** * A list of layer IDs, that represent which layers to include in the exported map. Use in combination with [layerOption](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerOption) to specify how layer visibility is handled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerIds) */ layerIds?: number[]; /** * The option for displaying or hiding the layer. **Possible Values:** show | hide | include | exclude - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#layerOption) */ layerOption?: string; /** * Indicates whether or not the background of the dynamic image is transparent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#transparent) - * + * * @default true */ transparent?: boolean; /** * Requested image width in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ImageParameters.html#width) */ width?: number; @@ -11724,75 +12324,69 @@ declare namespace __esri { interface InheritedDomain extends Domain { /** * The domain type. This value is always `inherited`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-InheritedDomain.html#type) */ readonly type: "inherited"; } interface InheritedDomainConstructor { - - - new(properties?: InheritedDomainProperties): InheritedDomain; + new (properties?: InheritedDomainProperties): InheritedDomain; fromJSON(json: any): InheritedDomain; } export const InheritedDomain: InheritedDomainConstructor; - interface InheritedDomainProperties extends DomainProperties { - - } + interface InheritedDomainProperties extends DomainProperties {} interface KMLSublayer extends Accessor, JSONSupport { /** * Description for the KML sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#description) */ description: string; /** * The id for the KML sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#id) */ id: number; /** * The [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html) to which the sublayer belongs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#layer) */ layer: KMLLayer; /** * Network link info for the current layer. A link info object with properties that describe the network link. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#networkLink) */ networkLink: any; /** * A collection of [KMLSublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#sublayers) */ sublayers: Collection; /** * The title of the KML sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#title) */ title: string; /** * Indicates if the sublayer is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#visible) */ visible: boolean; } interface KMLSublayerConstructor { - - - new(properties?: KMLSublayerProperties): KMLSublayer; + new (properties?: KMLSublayerProperties): KMLSublayer; fromJSON(json: any): KMLSublayer; } @@ -11802,43 +12396,43 @@ declare namespace __esri { interface KMLSublayerProperties { /** * Description for the KML sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#description) */ description?: string; /** * The id for the KML sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#id) */ id?: number; /** * The [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html) to which the sublayer belongs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#layer) */ layer?: KMLLayerProperties; /** * Network link info for the current layer. A link info object with properties that describe the network link. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#networkLink) */ networkLink?: any; /** * A collection of [KMLSublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#sublayers) */ sublayers?: CollectionProperties; /** * The title of the KML sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#title) */ title?: string; /** * Indicates if the sublayer is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-KMLSublayer.html#visible) */ visible?: boolean; @@ -11847,70 +12441,70 @@ declare namespace __esri { interface LabelClass extends Accessor, JSONSupport { /** * Defines the content of label text for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). If working with [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), use [labelExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) instead. Attribute values may be included in labels using SQL syntax. To include an attribute value in a label, wrap the name of the field in square brackets `[]`. See the example snippet below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) */ labelExpression: string; /** * Defines the content of label text for [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). If working with [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), use [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) */ labelExpressionInfo: LabelClassLabelExpressionInfo; /** - * The position of the label. Possible values are based on the feature type. This property requires a value. **Possible Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Possible Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Possible Values (Polygons):** always-horizontal - * > **Known Limitations** + * The position of the label. Possible values are based on the feature type. This property requires a value. **Possible Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Possible Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Possible Values (Polygons):** always-horizontal + * > **Known Limitations** * * Currently, if the label has a [line callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) in a 3D SceneView, then only `above-center` is supported. * * Label placement only applies to [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) layers in 3D SceneViews. - * * FeatureLayers only support labeling for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries. - * + * * [Polylines](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) only support `center-along` label placement in 2D MapViews. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelPlacement) - * + * * @default null */ labelPlacement: string; /** * The maximum scale (most zoomed in) at which labels are visible in the view. A value of `0` means the label's visibility does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#minScale) value, and greater than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#maxScale) - * + * * @default 0 */ maxScale: number; /** * The minimum scale (most zoomed out) at which labels are visible in the view. A value of `0` means the label's visibility does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#maxScale) value, and lesser than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#minScale) - * + * * @default 0 */ minScale: number; /** * Defines the symbol used for rendering the label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#symbol) */ symbol: TextSymbol | LabelSymbol3D; /** * Indicates whether to use domain names if the fields in the [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) or [labelExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) have domains. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#useCodedValues) */ useCodedValues: boolean; /** - * A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to `true` based on this expression will be labeled. - * > **Known Limitations** Only very basic SQL is currently supported. - * + * A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to `true` based on this expression will be labeled. + * > **Known Limitations** Only very basic SQL is currently supported. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) */ where: string; /** * Creates a deep clone of the LabelClass. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#clone) - * - * + * + * */ clone(): LabelClass; } @@ -11918,11 +12512,11 @@ declare namespace __esri { interface LabelClassConstructor { /** * Defines label expressions, symbols, scale ranges, label priorities, and label placement options for labels on a layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) */ - new(properties?: LabelClassProperties): LabelClass; + new (properties?: LabelClassProperties): LabelClass; fromJSON(json: any): LabelClass; } @@ -11932,76 +12526,75 @@ declare namespace __esri { interface LabelClassProperties { /** * Defines the content of label text for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). If working with [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), use [labelExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) instead. Attribute values may be included in labels using SQL syntax. To include an attribute value in a label, wrap the name of the field in square brackets `[]`. See the example snippet below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) */ labelExpression?: string; /** * Defines the content of label text for [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). If working with [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), use [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) */ labelExpressionInfo?: LabelClassLabelExpressionInfo; /** - * The position of the label. Possible values are based on the feature type. This property requires a value. **Possible Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Possible Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Possible Values (Polygons):** always-horizontal - * > **Known Limitations** + * The position of the label. Possible values are based on the feature type. This property requires a value. **Possible Values (Points):** above-center | above-left | above-right | below-center | below-left | below-right | center-center | center-left | center-right **Possible Values (Polylines):** above-after | above-along | above-before | above-start | above-end | below-after | below-along | below-before | below-start | below-end | center-after | center-along | center-before | center-start | center-end **Possible Values (Polygons):** always-horizontal + * > **Known Limitations** * * Currently, if the label has a [line callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) in a 3D SceneView, then only `above-center` is supported. * * Label placement only applies to [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) layers in 3D SceneViews. - * * FeatureLayers only support labeling for [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries. - * + * * [Polylines](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) only support `center-along` label placement in 2D MapViews. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelPlacement) - * + * * @default null */ labelPlacement?: string; /** * The maximum scale (most zoomed in) at which labels are visible in the view. A value of `0` means the label's visibility does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#minScale) value, and greater than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#maxScale) - * + * * @default 0 */ maxScale?: number; /** * The minimum scale (most zoomed out) at which labels are visible in the view. A value of `0` means the label's visibility does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#maxScale) value, and lesser than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#minScale) - * + * * @default 0 */ minScale?: number; /** * Defines the symbol used for rendering the label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#symbol) */ symbol?: TextSymbolProperties | LabelSymbol3DProperties; /** * Indicates whether to use domain names if the fields in the [labelExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpression) or [labelExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) have domains. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#useCodedValues) */ useCodedValues?: boolean; /** - * A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to `true` based on this expression will be labeled. - * > **Known Limitations** Only very basic SQL is currently supported. - * + * A SQL where clause used to determine the features to which the label class should be applied. When specified, only features evaluating to `true` based on this expression will be labeled. + * > **Known Limitations** Only very basic SQL is currently supported. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#where) */ where?: string; } - export interface LabelClassLabelExpressionInfo extends Object { /** * The SQL expression defining the content of the label text. **Deprecated as of v4.5. Use `expression` instead.** - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) */ value?: string; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that evaluates to a string used to label features in the layer. The most simple expressions return field values. For example, to label a layer of cities with their names, simply reference the field value with the global variable: `$feature.CITY_NAME`. Expressions can be more sophisticated and use logical functions. This may be useful if you want to use classed labels. For example, the following expression appends `city` to the end of the label if the feature's population field contains a number greater than 10,000. Otherwise, `town` is appended to the end of the label. Additionally, you can use `TextFormatting.NewLine` to add a new line to the label. `IIF($feature.POPULATION > 10000, $feature.NAME + ' city', $feature.NAME + ' town')` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html#labelExpressionInfo) */ expression: string; @@ -12010,34 +12603,32 @@ declare namespace __esri { interface LOD extends Accessor, JSONSupport { /** * ID for each level. The top most level is `0`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#level) */ level: number; /** * String to be used when constructing a URL to access a tile from this LOD. If `levelValue` is not defined, level will be used for the tile access URL. This property is useful when an LOD object represents a WMTS TileMatrix with non-numeric matrix identifiers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#levelValue) */ levelValue: string; /** * Resolution in map units of each pixel in a tile for each level. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#resolution) */ resolution: number; /** * Scale for each level. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#scale) */ scale: number; } interface LODConstructor { - - - new(properties?: LODProperties): LOD; + new (properties?: LODProperties): LOD; fromJSON(json: any): LOD; } @@ -12047,25 +12638,25 @@ declare namespace __esri { interface LODProperties { /** * ID for each level. The top most level is `0`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#level) */ level?: number; /** * String to be used when constructing a URL to access a tile from this LOD. If `levelValue` is not defined, level will be used for the tile access URL. This property is useful when an LOD object represents a WMTS TileMatrix with non-numeric matrix identifiers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#levelValue) */ levelValue?: string; /** * Resolution in map units of each pixel in a tile for each level. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#resolution) */ resolution?: number; /** * Scale for each level. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html#scale) */ scale?: number; @@ -12074,56 +12665,54 @@ declare namespace __esri { interface MapImage extends Accessor, JSONSupport { /** * The extent of the exported map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#extent) */ extent: Extent; /** * The requested image height in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#height) */ height: number; /** * URL to the returned image. The image format must be of a type supported by the HTML `` tag. **Possible Values:** gif | jpg | png | bmp - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#href) */ href: string; /** * The opacity of the image. Value can be any number between `0` and `1` where `0` is 100% transparent, `0.5` is 50% transparent and `1` is fully opaque. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#opacity) - * + * * @default 1 */ opacity: number; /** * Scale of the requested dynamic map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#scale) */ scale: number; /** * Indicates if the requested image is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#visible) - * + * * @default true */ visible: boolean; /** * The requested image width in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#width) */ width: number; } interface MapImageConstructor { - - - new(properties?: MapImageProperties): MapImage; + new (properties?: MapImageProperties): MapImage; fromJSON(json: any): MapImage; } @@ -12133,47 +12722,47 @@ declare namespace __esri { interface MapImageProperties { /** * The extent of the exported map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#extent) */ extent?: ExtentProperties; /** * The requested image height in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#height) */ height?: number; /** * URL to the returned image. The image format must be of a type supported by the HTML `` tag. **Possible Values:** gif | jpg | png | bmp - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#href) */ href?: string; /** * The opacity of the image. Value can be any number between `0` and `1` where `0` is 100% transparent, `0.5` is 50% transparent and `1` is fully opaque. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#opacity) - * + * * @default 1 */ opacity?: number; /** * Scale of the requested dynamic map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#scale) */ scale?: number; /** * Indicates if the requested image is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#visible) - * + * * @default true */ visible?: boolean; /** * The requested image width in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MapImage.html#width) */ width?: number; @@ -12182,76 +12771,85 @@ declare namespace __esri { interface MosaicRule extends Accessor, JSONSupport { /** * Indicates whether the sort should be ascending. This property applies to all mosaic [methods](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) where an ordering is defined except `seamline`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#ascending) - * + * * @default true */ ascending: boolean; /** * An array of raster Ids. All the rasters with the given list of raster Ids are selected to participate in the mosaic. The rasters will be visible at all pixel sizes regardless of the minimum and maximum pixel size range of the locked rasters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#lockRasterIds) */ lockRasterIds: number[]; /** * The mosaic method determines how the selected rasters are ordered. **Possible Values:** none | center | nadir | viewpoint | attribute | lock-raster | northwest | seamline - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) */ - method: string; + method: "none" | "center" | "nadir" | "viewpoint" | "attribute" | "lock-raster" | "northwest" | "seamline"; /** * A multiple dimensional service can have multiple dimensions for one or more variables. Use multiDimensionalDefinitions to filter data based on a slice or range of data. For example, a single ImageryLayer may have a `depth` dimension storing sea temperatures for the same pixel location at various depths. Another dimension could be `time`, where the same pixel stores multiple values based on a window of time. This property can be used to filter and display ImageryLayer pixels for specific "slices" in those dimensions (e.g. display sea temperature at 1000m below sea level for a specific week in the year). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#multidimensionalDefinition) */ multidimensionalDefinition: DimensionalDefinition[]; /** * Defines a selection using a set of ObjectIDs. This property applies to all mosaic methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#objectIds) */ objectIds: number[]; /** * Defines the mosaic operation used to resolve overlapping pixels. **Possible Values:** first | last | min | max | mean | blend - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#operation) */ - operation: string; + operation: "first" | "last" | "min" | "max" | "mean" | "blend"; /** * The name of the attribute field that is used with a constant sortValue to define the mosaicking order when the mosaic [method](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) is set to `attribute`. The ordering is defined by the absolute value of the difference between the specified sort field value and the sort base value. For example, if the sort field is `Month` and the sort value is `7 (July)`, then the ordering is defined by `ABS(Month -7)`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#sortField) */ sortField: string; /** * A constant value defining a reference or base value for the sort field when the mosaic [method](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) is set to `attribute`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#sortValue) */ sortValue: string; /** * Defines the viewpoint location on which the ordering is defined based on the distance from the viewpoint and the nadir of rasters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#viewpoint) */ viewpoint: Point; /** * The where clause determines which rasters will participate in the mosaic. This property applies to all mosaic methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#where) */ where: string; + + /** + * Creates a clone of the MosaicRule object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#clone) + * + * + */ + clone(): MosaicRule; } interface MosaicRuleConstructor { /** * Specifies the mosaic rule when defining how individual images should be mosaicked. It specifies selection, mosaic method, sort order, overlapping pixel resolution, etc. Mosaic rules are for mosaicking rasters in the mosaic dataset. A mosaic rule is used to define: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html) */ - new(properties?: MosaicRuleProperties): MosaicRule; + new (properties?: MosaicRuleProperties): MosaicRule; fromJSON(json: any): MosaicRule; } @@ -12261,63 +12859,63 @@ declare namespace __esri { interface MosaicRuleProperties { /** * Indicates whether the sort should be ascending. This property applies to all mosaic [methods](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) where an ordering is defined except `seamline`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#ascending) - * + * * @default true */ ascending?: boolean; /** * An array of raster Ids. All the rasters with the given list of raster Ids are selected to participate in the mosaic. The rasters will be visible at all pixel sizes regardless of the minimum and maximum pixel size range of the locked rasters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#lockRasterIds) */ lockRasterIds?: number[]; /** * The mosaic method determines how the selected rasters are ordered. **Possible Values:** none | center | nadir | viewpoint | attribute | lock-raster | northwest | seamline - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) */ - method?: string; + method?: "none" | "center" | "nadir" | "viewpoint" | "attribute" | "lock-raster" | "northwest" | "seamline"; /** * A multiple dimensional service can have multiple dimensions for one or more variables. Use multiDimensionalDefinitions to filter data based on a slice or range of data. For example, a single ImageryLayer may have a `depth` dimension storing sea temperatures for the same pixel location at various depths. Another dimension could be `time`, where the same pixel stores multiple values based on a window of time. This property can be used to filter and display ImageryLayer pixels for specific "slices" in those dimensions (e.g. display sea temperature at 1000m below sea level for a specific week in the year). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#multidimensionalDefinition) */ - multidimensionalDefinition?: DimensionalDefinition[]; + multidimensionalDefinition?: DimensionalDefinitionProperties[]; /** * Defines a selection using a set of ObjectIDs. This property applies to all mosaic methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#objectIds) */ objectIds?: number[]; /** * Defines the mosaic operation used to resolve overlapping pixels. **Possible Values:** first | last | min | max | mean | blend - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#operation) */ - operation?: string; + operation?: "first" | "last" | "min" | "max" | "mean" | "blend"; /** * The name of the attribute field that is used with a constant sortValue to define the mosaicking order when the mosaic [method](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) is set to `attribute`. The ordering is defined by the absolute value of the difference between the specified sort field value and the sort base value. For example, if the sort field is `Month` and the sort value is `7 (July)`, then the ordering is defined by `ABS(Month -7)`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#sortField) */ sortField?: string; /** * A constant value defining a reference or base value for the sort field when the mosaic [method](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#method) is set to `attribute`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#sortValue) */ sortValue?: string; /** * Defines the viewpoint location on which the ordering is defined based on the distance from the viewpoint and the nadir of rasters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#viewpoint) */ viewpoint?: PointProperties; /** * The where clause determines which rasters will participate in the mosaic. This property applies to all mosaic methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-MosaicRule.html#where) */ where?: string; @@ -12326,46 +12924,44 @@ declare namespace __esri { interface PixelBlock extends Accessor { /** * The height (or number of rows) of the PixelBlock in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) */ height: number; /** * An array of numbers representing pixels to show and pixels to hide from the view. The length of this array is [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) * [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width). It's arranged row by row in this format: `[p_00, p_10, p_20, ... p_10, p_11, .....]` where `p_xy` is the pixel value at the column `x` and row `y`. The mask is per pixel, not per band. Items in the mask array with a value of `0` indicates [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) to not display in the view at that index. Items with a value of `1` indicate to display the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) at there corresponding indices. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#mask) */ mask: number[]; /** * A two dimensional array representing the pixels from the Image Service displayed on the client. The length of the first dimension is the same as the number of bands in the layer. The length of the second dimension is [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) * [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width). The length of each band is the same. The pixels in each band are arranged row by row in this format: `[p_00, p_10, p_20, ... p_10, p_11, ...]` where `p_xy` is the pixel value at the column `x` and row `y`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) */ pixels: number[][]; /** * The pixel type. **Possible Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixelType) */ pixelType: string; /** * An array of objects containing numeric statistical properties. Each object has the following specification if defined: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) */ statistics: PixelBlockStatistics[]; /** * The width (or number of columns) of the PixelBlock in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width) */ width: number; } interface PixelBlockConstructor { - - - new(properties?: PixelBlockProperties): PixelBlock; + new (properties?: PixelBlockProperties): PixelBlock; } export const PixelBlock: PixelBlockConstructor; @@ -12373,59 +12969,58 @@ declare namespace __esri { interface PixelBlockProperties { /** * The height (or number of rows) of the PixelBlock in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) */ height?: number; /** * An array of numbers representing pixels to show and pixels to hide from the view. The length of this array is [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) * [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width). It's arranged row by row in this format: `[p_00, p_10, p_20, ... p_10, p_11, .....]` where `p_xy` is the pixel value at the column `x` and row `y`. The mask is per pixel, not per band. Items in the mask array with a value of `0` indicates [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) to not display in the view at that index. Items with a value of `1` indicate to display the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) at there corresponding indices. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#mask) */ mask?: number[]; /** * A two dimensional array representing the pixels from the Image Service displayed on the client. The length of the first dimension is the same as the number of bands in the layer. The length of the second dimension is [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#height) * [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width). The length of each band is the same. The pixels in each band are arranged row by row in this format: `[p_00, p_10, p_20, ... p_10, p_11, ...]` where `p_xy` is the pixel value at the column `x` and row `y`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) */ pixels?: number[][]; /** * The pixel type. **Possible Values:** s8 | s16 | s32 | u8 | u16 | u32 | f32 | f64 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixelType) */ pixelType?: string; /** * An array of objects containing numeric statistical properties. Each object has the following specification if defined: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) */ statistics?: PixelBlockStatistics[]; /** * The width (or number of columns) of the PixelBlock in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#width) */ width?: number; } - export interface PixelBlockStatistics extends Object { /** * The maximum pixel value in the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) */ maxValue?: number; /** * The minimum pixel value in the [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) */ minValue?: number; /** * Value representing areas of no data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#statistics) */ noDataValue?: number; @@ -12434,28 +13029,26 @@ declare namespace __esri { interface RangeDomain extends Domain { /** * The maximum valid value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html#maxValue) */ maxValue: number; /** * The minimum valid value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html#minValue) */ minValue: number; /** * The domain type. This value is always `range`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html#type) */ readonly type: "range"; } interface RangeDomainConstructor { - - - new(properties?: RangeDomainProperties): RangeDomain; + new (properties?: RangeDomainProperties): RangeDomain; fromJSON(json: any): RangeDomain; } @@ -12465,13 +13058,13 @@ declare namespace __esri { interface RangeDomainProperties extends DomainProperties { /** * The maximum valid value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html#maxValue) */ maxValue?: number; /** * The minimum valid value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html#minValue) */ minValue?: number; @@ -12480,27 +13073,27 @@ declare namespace __esri { interface RasterFunction extends Accessor, JSONSupport { /** * The arguments for the raster function. The structure depends on the function specified. See [raster functions](https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm) for a list of functions and their arguments. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionArguments) */ functionArguments: any; /** * The raster function name. See [raster functions](https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm) for a list of functions and their arguments. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionName) */ functionName: string; /** * Defines the pixel type of the output image. **Possible Values:** c128 | c64 | f32 | f64 | s16 | s32 | s8 | u1 | u16 | u2 | u32 | u4 | u8 | unknown - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#outputPixelType) - * + * * @default unknown */ outputPixelType: string; /** * The variable name for the raster function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#variableName) */ variableName: any; @@ -12509,11 +13102,11 @@ declare namespace __esri { interface RasterFunctionConstructor { /** * Specifies processing to be done to the image service. See [raster functions](https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm) for a list of functions and their [arguments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionArguments). The following image shows a landcover ImageryLayer rendered with two chained client-side raster functions used to reclass pixel values (Remap) and assign each pixel a new color (Colormap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html) */ - new(properties?: RasterFunctionProperties): RasterFunction; + new (properties?: RasterFunctionProperties): RasterFunction; fromJSON(json: any): RasterFunction; } @@ -12523,27 +13116,27 @@ declare namespace __esri { interface RasterFunctionProperties { /** * The arguments for the raster function. The structure depends on the function specified. See [raster functions](https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm) for a list of functions and their arguments. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionArguments) */ functionArguments?: any; /** * The raster function name. See [raster functions](https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm) for a list of functions and their arguments. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#functionName) */ functionName?: string; /** * Defines the pixel type of the output image. **Possible Values:** c128 | c64 | f32 | f64 | s16 | s32 | s8 | u1 | u16 | u2 | u32 | u4 | u8 | unknown - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#outputPixelType) - * + * * @default unknown */ outputPixelType?: string; /** * The variable name for the raster function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RasterFunction.html#variableName) */ variableName?: any; @@ -12552,40 +13145,38 @@ declare namespace __esri { interface Relationship extends Accessor { /** * The cardinality which specifies the number of objects in the origin [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) related to the number of objects in the destination [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Please see the [Desktop help](http://desktop.arcgis.com/en/arcmap/10.3/manage-data/relationships/relationship-class-properties.htm#GUID-989CB1D1-AC51-4A4C-8D9D-0AB9E647FFFD) for additional information on cardinality. **Possible values:** one-to-one | one-to-many | many-to-many - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#cardinality) */ cardinality: string; /** * The unique ID for the relationship. These ids for the relationships the [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) participates in are listed in the ArcGIS Services directory. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#id) */ id: number; /** * The field used to establish the relate within the [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#keyField) */ keyField: string; /** * The name of the relationship. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#name) */ name: string; /** * The unique ID of the related [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#relatedTableId) */ relatedTableId: number; } interface RelationshipConstructor { - - - new(properties?: RelationshipProperties): Relationship; + new (properties?: RelationshipProperties): Relationship; } export const Relationship: RelationshipConstructor; @@ -12593,31 +13184,31 @@ declare namespace __esri { interface RelationshipProperties { /** * The cardinality which specifies the number of objects in the origin [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) related to the number of objects in the destination [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Please see the [Desktop help](http://desktop.arcgis.com/en/arcmap/10.3/manage-data/relationships/relationship-class-properties.htm#GUID-989CB1D1-AC51-4A4C-8D9D-0AB9E647FFFD) for additional information on cardinality. **Possible values:** one-to-one | one-to-many | many-to-many - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#cardinality) */ cardinality?: string; /** * The unique ID for the relationship. These ids for the relationships the [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) participates in are listed in the ArcGIS Services directory. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#id) */ id?: number; /** * The field used to establish the relate within the [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#keyField) */ keyField?: string; /** * The name of the relationship. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#name) */ name?: string; /** * The unique ID of the related [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Relationship.html#relatedTableId) */ relatedTableId?: number; @@ -12626,149 +13217,149 @@ declare namespace __esri { interface Sublayer extends Accessor { /** * A SQL where clause used to filter features in the image. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Definition expressions may be set when a sublayer is constructed prior to it loading in the view or after it has been added to the MapImageLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression) */ definitionExpression: string; /** * The sublayer's layer ID. When a [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) is not defined on the layer, this value represents the id of the sublayer defined by the map service. If creating a [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) or a [MapDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#MapDataLayer) and adding it to the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) property of the sublayer, the value of this property can be anything set by the developer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#id) */ id: number; /** * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) objects. Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) property of the sublayer must be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelingInfo) */ labelingInfo: LabelClass[]; /** * Indicates if labels for the sublayer will be visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) - * + * * @default true */ labelsVisible: boolean; /** * The [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) or [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html) to which the sublayer belongs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#layer) */ layer: MapImageLayer | TileLayer; /** * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#minScale) value, and greater than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#maxScale) */ maxScale: number; /** * The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#maxScale) value, and lesser than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#minScale) */ minScale: number; /** * The level of opacity to set on the sublayer on a scale from 0.0 - 1.0 where `0` is fully transparent and `1.0` is fully opaque. If the [MapImageLayer.opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#opacity) is set, the actual opacity value of the sublayer will be the value of [MapImageLayer.opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#opacity) multiplied by the sublayer's opacity. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#opacity) */ opacity: number; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupEnabled) - * + * * @default true */ popupEnabled: boolean; /** - * The popup template for the sublayer. When set, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when the user clicks the image. Sublayers with a [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) cannot be queried and therefore do not support [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). - * > **Known Limitations** + * The popup template for the sublayer. When set, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when the user clicks the image. Sublayers with a [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) cannot be queried and therefore do not support [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). + * > **Known Limitations** * * [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in PopupTemplates set on MapImageLayer sublayers or TileLayer sublayers unless they reference ArcGIS Enterprise 10.6 map services (or later) created from ArcGIS Pro. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupTemplate) */ popupTemplate: PopupTemplate; /** - * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. - * > **Known Limitations** + * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. + * > **Known Limitations** * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not currently supported in renderers set on sublayers. * * [Visual variables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) and [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in renderers set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6 map services (or later) created from ArcGIS Pro. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#renderer) */ renderer: Renderer; /** * An object that allows you to create a dynamic layer with data either from the map service sublayers or data from a registered workspace. See [DynamicMapLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) for creating dynamic layers from map service layers for on the fly rendering, labeling, and filtering (definition expressions). To create dynamic layers from other sources in registered workspaces such as tables and table joins, see [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) */ source: DynamicMapLayer | DynamicDataLayer; /** * If a sublayer contains sublayers, this property is a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) objects belonging to the given sublayer with sublayers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#sublayers) */ sublayers: Collection; /** * The title of the sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This value can be defined in the map service or programmatically by the developer. It can also be useful for finding a specific sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#title) */ title: string; /** * The URL to the REST endpoint of the sublayer. This allows you to view the schema of fields and query tables located in registered workspaces. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#url) */ readonly url: string; /** * Indicates if the layer is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#visible) */ visible: boolean; /** * Creates a deep clone of the sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#clone) - * - * + * + * */ clone(): Sublayer; /** * A convenient method for creating a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) instance based on the Sublayer's configuration, including [dynamic sources](https://enterprise.arcgis.com/en/server/latest/publish-services/linux/about-dynamic-layers.htm). This allows you to take advantage of FeatureLayer capabilities not supported in Sublayer, such as the [Smart Mapping creator functions](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer) - * - * + * + * */ createFeatureLayer(): FeatureLayer; /** * Creates a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) object with default values representing the layer's state, including filters (definition expression) on the layer's features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createQuery) - * - * + * + * */ createQuery(): Query; /** * Executes a [query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html) against features in the sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#queryFeatures) - * + * * @param params Specifies the attributes and spatial filter of the query. If no parameters are specified, then all features satisfying the layer's configuration/filters are returned. - * + * */ queryFeatures(params?: Query | QueryProperties): IPromise; } @@ -12776,11 +13367,11 @@ declare namespace __esri { interface SublayerConstructor { /** * Represents a sublayer in a [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) or a [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html). MapImageLayer allows you to display, query, and analyze layers from data defined in a [map service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-map-service.htm). Map services contain sublayers with properties such as [renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#renderer), [labelingInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelingInfo), and [definitionExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression), and others that are defined on the server. The properties of each MapImageLayer sublayer on the map service may be dynamically changed by the user or developer. The properties of each TileLayer sublayer are read-only, and cannot be modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) */ - new(properties?: SublayerProperties): Sublayer; + new (properties?: SublayerProperties): Sublayer; } export const Sublayer: SublayerConstructor; @@ -12788,142 +13379,142 @@ declare namespace __esri { interface SublayerProperties { /** * A SQL where clause used to filter features in the image. Only the features that satisfy the definition expression are displayed in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Definition expressions may be set when a sublayer is constructed prior to it loading in the view or after it has been added to the MapImageLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#definitionExpression) */ definitionExpression?: string; /** * The sublayer's layer ID. When a [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) is not defined on the layer, this value represents the id of the sublayer defined by the map service. If creating a [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) or a [MapDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#MapDataLayer) and adding it to the [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) property of the sublayer, the value of this property can be anything set by the developer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#id) */ id?: number; /** * The label definition for this layer, specified as an array of [LabelClass](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LabelClass.html) objects. Use this property to specify labeling properties for the layer such as label expression, placement, and size. For labels to display in the view, the [labelsVisible](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) property of the sublayer must be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelingInfo) */ labelingInfo?: LabelClassProperties[]; /** * Indicates if labels for the sublayer will be visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#labelsVisible) - * + * * @default true */ labelsVisible?: boolean; /** * The [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) or [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html) to which the sublayer belongs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#layer) */ layer?: MapImageLayerProperties | TileLayerProperties; /** * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * The maximum scale (most zoomed in) at which the layer is visible in the view. If the map is zoomed in beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a maximum scale. The maxScale value should always be smaller than the [minScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#minScale) value, and greater than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#maxScale) */ maxScale?: number; /** * The minimum scale (most zoomed out) at which the layer is visible in the view. If the map is zoomed out beyond this scale, the layer will not be visible. A value of `0` means the layer does not have a minimum scale. The minScale value should always be larger than the [maxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#maxScale) value, and lesser than or equal to the service specification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#minScale) */ minScale?: number; /** * The level of opacity to set on the sublayer on a scale from 0.0 - 1.0 where `0` is fully transparent and `1.0` is fully opaque. If the [MapImageLayer.opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#opacity) is set, the actual opacity value of the sublayer will be the value of [MapImageLayer.opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#opacity) multiplied by the sublayer's opacity. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#opacity) */ opacity?: number; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupEnabled) - * + * * @default true */ popupEnabled?: boolean; /** - * The popup template for the sublayer. When set, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when the user clicks the image. Sublayers with a [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) cannot be queried and therefore do not support [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). - * > **Known Limitations** + * The popup template for the sublayer. When set, the `popupTemplate` allows users to access attributes and display their values in the [view's popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#popup) when the user clicks the image. Sublayers with a [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) cannot be queried and therefore do not support [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). + * > **Known Limitations** * * [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in PopupTemplates set on MapImageLayer sublayers or TileLayer sublayers unless they reference ArcGIS Enterprise 10.6 map services (or later) created from ArcGIS Pro. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupTemplate) */ popupTemplate?: PopupTemplateProperties; /** - * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. - * > **Known Limitations** + * The renderer to apply to the sublayer. This value overrides the renderer read from the map service. + * > **Known Limitations** * * [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) are not currently supported in renderers set on sublayers. * * [Visual variables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) and [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions are not supported in renderers set on MapImageLayer sublayers unless they reference ArcGIS Enterprise 10.6 map services (or later) created from ArcGIS Pro. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#renderer) */ renderer?: RendererProperties; /** * An object that allows you to create a dynamic layer with data either from the map service sublayers or data from a registered workspace. See [DynamicMapLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) for creating dynamic layers from map service layers for on the fly rendering, labeling, and filtering (definition expressions). To create dynamic layers from other sources in registered workspaces such as tables and table joins, see [DynamicDataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#source) */ source?: DynamicMapLayer | DynamicDataLayer; /** * If a sublayer contains sublayers, this property is a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html) objects belonging to the given sublayer with sublayers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#sublayers) */ sublayers?: CollectionProperties; /** * The title of the sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This value can be defined in the map service or programmatically by the developer. It can also be useful for finding a specific sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#title) */ title?: string; /** * Indicates if the layer is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#visible) */ visible?: boolean; } /** - * A dynamic data layer is a layer created on-the-fly with data stored in a [registered workspace](https://server.arcgis.com/en/server/latest/publish-services/windows/overview-register-data-with-arcgis-server.htm). This is data that can be rendered and queried on the fly, but that isn't explicitly exposed as a service sublayer. Depending on the type of data source, these layers are classified as one of the following: - * + * A dynamic data layer is a layer created on-the-fly with data stored in a [registered workspace](https://server.arcgis.com/en/server/latest/publish-services/windows/overview-register-data-with-arcgis-server.htm). This is data that can be rendered and queried on the fly, but that isn't explicitly exposed as a service sublayer. Depending on the type of data source, these layers are classified as one of the following: + * * Data source | Description * ------------|------------ * [TableDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) | A feature class with geometries or table without geometries. When a table data source does not contain geometries, it may be used as one of the sources in a [join operation](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource). Feature class tables may be used on their own since they contain a geometry field. * [QueryTableDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) | A feature class or table that may be queried on the fly with a SQL where clause. This data source is useful for scenarios where you have a table containing unique geometries and another table with multiple records that match to each geometry. You can use the QueryTableDataSource to select only a subset of those matching records (so records in both tables have a one-to-one relationship with each other) and join them to the table with geometries. * [RasterDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) | A raster dataset used for visualization purposes only. * [JoinTableDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) | This data source consists of two data sources joined by a common attribute or key. The left table data source typically contains geometries, while the right source may be a table or query table without geometries. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) */ export interface DynamicDataLayer extends Object { /** * This value is always `data-layer` and is inferred when the `dataSource` property is set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) */ type: string; /** * A table, feature class, or raster that resides in a registered workspace (either a folder or geodatabase). The data sources are not visible in the Services Directory by default. They may be viewed, published, and configured using the ArcGIS Server Manager. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) */ dataSource: TableDataSource | QueryTableDataSource | RasterDataSource | JoinTableDataSource; /** * Controls field visibility in the layer. Only specified fields will be visible. If `null`, all fields are visible in the dynamic layer. The specification for a field object is provided below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) */ fields: DynamicDataLayerFields[]; @@ -12931,25 +13522,25 @@ declare namespace __esri { /** * A dynamic map layer refers to a layer published in a map service that has dynamic layers enabled. This layer type may be used to create multiple [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#sublayers) that point to the same service layer, but are assigned different definition expressions, renderers, and other properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) */ export interface DynamicMapLayer extends Object { /** * This value is always `map-layer` and is inferred when the `mapLayerId` property is set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) */ type: string; /** * The [id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#id) of the service sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) */ mapLayerId: number; /** * An optional property for specifying the GDB version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicMapLayer) */ gdbVersion: string; @@ -12957,49 +13548,49 @@ declare namespace __esri { /** * The result of an on-the-fly join operation at runtime. Nested joins are supported. To use nested joins, set either `leftTableSource` or `rightTableSource` to `join-table`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) */ export interface JoinTableDataSource extends Object { /** * This value is always `join-table` and is inferred when other join table properties of this object are set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) */ type: string; /** * The field name used for joining or matching records in the left table to records in the right table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) */ leftTableKey: string; /** * The field name used for joining or matching records in the right table to records in the left table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) */ rightTableKey: string; /** * The left table for joining to the right table source. This can either be a dynamic map layer or a dynamic data layer. The dynamic data layer may contain another join data source used for nested joining. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) */ leftTableSource: DynamicMapLayer | DynamicDataLayer; /** * The right table for joining to the left table source. This can either be a dynamic map layer or a dynamic data layer. The dynamic data layer may contain another join data source used for nested joining. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) */ rightTableSource: DynamicMapLayer | DynamicDataLayer; /** - * The type of join that will be performed. - * + * The type of join that will be performed. + * * Possible Value | Description * ---------------|------------ * left-outer-join | Unmatched records in the left table source are preserved and joined with `null` values in the right table source. * left-inner-join | Records in the left table source are discarded if they are unmatched with records in the right table source. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinTableDataSource) */ joinType: string; @@ -13007,43 +13598,43 @@ declare namespace __esri { /** * A query table is a feature class or table defined by a SQL query on the fly. Query layers allow both spatial and nonspatial information stored in a database to be easily integrated into map service operations. Since a query table uses SQL to directly query database tables and views, spatial information used by a query table is not required to be in a geodatabase. This data source is useful for scenarios where you have a table containing multiple records that match to a single geometry in either another table or a map service layer. You can use the QueryTableDataSource to select only a subset of those matching records and join them to the table with geometries so records in both tables have a one-to-one relationship with each other. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) */ export interface QueryTableDataSource extends Object { /** * This value is always `query-table` and is inferred when the `query` property of this object is set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) */ type: string; /** * The workspace where the data resides (defined in ArcGIS Server Manager). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) */ workspaceId: string; /** * The SQL query used to filter records. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) */ query: string; /** * The field name(s) containing the unique IDs for each record in the table. This can be a comma separated list if the query table is used in a [JoinTableDataSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#JoinDataTableSource). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) */ oidFields: string; /** * The spatial reference of the geometry of each feature in the table source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) */ spatialReference: SpatialReference; /** * The geometry type of each record in the table. **Possible Values:** point | multipoint | polyline | polygon | multipatch - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#QueryTableDataSource) */ geometryType: string; @@ -13051,25 +13642,25 @@ declare namespace __esri { /** * A file-based raster that resides in a registered raster workspace. The raster may only be displayed in the view, not queried or assigned a renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) */ export interface RasterDataSource extends Object { /** * This value is always `raster`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) */ type: string; /** * The workspace where the raster resides as defined in the ArcGIS Server Manager. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) */ workspaceId: string; /** * The name of the raster in the registered workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#RasterDataSource) */ dataSourceName: string; @@ -13077,47 +13668,46 @@ declare namespace __esri { /** * A table or feature class that resides in a registered workspace (either a folder or geodatabase). In the case of a geodatabase, if versioned, use `version` to switch to an alternate geodatabase version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) */ export interface TableDataSource extends Object { /** * This value is always `table`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) */ type: string; /** * The workspace where the table resides as defined in the ArcGIS Server Manager. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) */ workspaceId: string; /** * The name of the table in the registered workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) */ dataSourceName: string; /** * References the geodatabase version if multiple versions exist in the geodatabase. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#TableDataSource) */ gdbVersion: string; } - export interface DynamicDataLayerFields extends Object { /** * The name of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) */ name: string; /** * The alias of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#DynamicDataLayer) */ alias: string; @@ -13126,83 +13716,80 @@ declare namespace __esri { interface TileInfo extends Accessor, JSONSupport { /** * The dots per inch (DPI) of the tiling scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#dpi) */ dpi: number; /** * Image format of the cached tiles. **Possible Values:** png | png24 | png32 | jpg | dib | tiff | emf | ps | pdf | gif | svg | svgz | mixed | lerc - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#format) */ format: string; /** * Indicates if the tiling scheme supports wrap around. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#isWrappable) */ isWrappable: boolean; /** * An array of levels of detail that define the tiling scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#lods) */ lods: LOD[]; /** * The tiling scheme origin. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#origin) */ origin: Point; /** * Size of tiles in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#size) */ size: number[]; /** * The spatial reference of the tiling schema. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#spatialReference) */ spatialReference: SpatialReference; /** * Utility method used to convert a scale value to its corresponding zoom value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#scaleToZoom) - * + * * @param scale The scale value to convert. - * + * */ scaleToZoom(scale: number): number; /** * Utility method used to convert a zoom value to its corresponding scale value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#zoomToScale) - * + * * @param zoom The zoom value to convert. - * + * */ zoomToScale(zoom: number): number; } interface TileInfoConstructor { - - - new(properties?: TileInfoProperties): TileInfo; - + new (properties?: TileInfoProperties): TileInfo; /** * A convenience method used to create a new TileInfo instance with preset properties like [LODs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#lods). Optionally, properties such as `size`, `scales[]`, and a `[SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html)` can also be set to calculate [LODs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#lods) for each TileInfo. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#create) - * + * * @param options An object that contains the size, scales, and/or [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) used to compute the new TileInfo instance. * @param options.size The size of each tile in pixels. * @param options.spatialReference The spatial reference for the new TileInfo instance. If the spatial reference is not WGS84 nor WebMercator, the origin of the TileInfo is `0.0`. * @param options.scales An array of scale values to use for the TileInfo. If none are specified, the scales from the [ArcGIS Online basemaps](https://www.arcgis.com/home/group.html?id=702026e41f6641fb85da88efe79dc166#overview) are used from level 0 through 24. - * + * */ create(options?: TileInfoCreateOptions): TileInfo; @@ -13214,71 +13801,70 @@ declare namespace __esri { interface TileInfoProperties { /** * The dots per inch (DPI) of the tiling scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#dpi) */ dpi?: number; /** * Image format of the cached tiles. **Possible Values:** png | png24 | png32 | jpg | dib | tiff | emf | ps | pdf | gif | svg | svgz | mixed | lerc - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#format) */ format?: string; /** * Indicates if the tiling scheme supports wrap around. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#isWrappable) */ isWrappable?: boolean; /** * An array of levels of detail that define the tiling scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#lods) */ lods?: LODProperties[]; /** * The tiling scheme origin. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#origin) */ origin?: PointProperties; /** * Size of tiles in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#size) */ size?: number[]; /** * The spatial reference of the tiling schema. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; } - export interface TileInfoCreateOptions extends Object { /** * The size of each tile in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#create) - * + * * @default 256 */ size?: number; /** * The spatial reference for the new TileInfo instance. If the spatial reference is not WGS84 nor WebMercator, the origin of the TileInfo is `0.0`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#create) - * + * * @default WebMercator */ spatialReference?: SpatialReference; /** * An array of scale values to use for the TileInfo. If none are specified, the scales from the [ArcGIS Online basemaps](https://www.arcgis.com/home/group.html?id=702026e41f6641fb85da88efe79dc166#overview) are used from level 0 through 24. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileInfo.html#create) - * + * * @default The scales provided by ArcGIS Online basemaps */ scales?: number[]; @@ -13287,37 +13873,35 @@ declare namespace __esri { interface TileMatrixSet extends Accessor, JSONSupport { /** * The full extent of the TileMatrixSet. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#fullExtent) */ fullExtent: Extent; /** * The unique ID assigned to the TileMatrixSet. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#id) */ id: string; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#tileInfo) */ tileInfo: TileInfo; /** * Creates a deep clone of this TileMatrixSet. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#clone) - * - * + * + * */ clone(): TileMatrixSet; } interface TileMatrixSetConstructor { - - - new(properties?: TileMatrixSetProperties): TileMatrixSet; + new (properties?: TileMatrixSetProperties): TileMatrixSet; fromJSON(json: any): TileMatrixSet; } @@ -13327,19 +13911,19 @@ declare namespace __esri { interface TileMatrixSetProperties { /** * The full extent of the TileMatrixSet. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#fullExtent) */ fullExtent?: ExtentProperties; /** * The unique ID assigned to the TileMatrixSet. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#id) */ id?: string; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html#tileInfo) */ tileInfo?: TileInfoProperties; @@ -13348,103 +13932,101 @@ declare namespace __esri { interface WMSSublayer extends Accessor { /** * Description for the WMS sublayer. This defaults to the value of the Abstract property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#description) */ description: string; /** * The full extent of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#fullExtent) */ fullExtent: Extent; /** * The id for the WMS sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#id) */ id: number; /** * The [WMSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html) to which the sublayer belongs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#layer) */ layer: WMSLayer; /** * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * A string url pointing to a legend image for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#legendUrl) */ legendUrl: string; /** * Name of the WMS sublayer. This defaults to the value of the Name property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#name) */ name: string; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#popupEnabled) - * + * * @default false */ popupEnabled: boolean; /** * Indicates if the layer can be queried, i.e. the service supports GetFeatureInfo with either text/html or text/plain formats. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#queryable) - * + * * @default false */ queryable: boolean; /** * List of spatialReferences (WKID) derived from the CRS elements of the first layer in the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#spatialReferences) */ spatialReferences: number[]; /** * A collection of [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#sublayers) */ sublayers: Collection; /** * The title of the WMS sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This defaults to the value of the Title property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#title) */ title: string; /** * Indicates if the layer is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#visible) */ visible: boolean; /** * Creates a deep clone of the WMS sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#clone) - * - * + * + * */ clone(): WMSSublayer; } interface WMSSublayerConstructor { - - - new(properties?: WMSSublayerProperties): WMSSublayer; + new (properties?: WMSSublayerProperties): WMSSublayer; } export const WMSSublayer: WMSSublayerConstructor; @@ -13452,85 +14034,85 @@ declare namespace __esri { interface WMSSublayerProperties { /** * Description for the WMS sublayer. This defaults to the value of the Abstract property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#description) */ description?: string; /** * The full extent of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#fullExtent) */ fullExtent?: ExtentProperties; /** * The id for the WMS sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#id) */ id?: number; /** * The [WMSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html) to which the sublayer belongs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#layer) */ layer?: WMSLayerProperties; /** * Indicates whether the layer will be included in the legend. When `false`, the layer will be excluded from the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * A string url pointing to a legend image for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#legendUrl) */ legendUrl?: string; /** * Name of the WMS sublayer. This defaults to the value of the Name property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#name) */ name?: string; /** * Indicates whether to display popups when features in the layer are clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#popupEnabled) - * + * * @default false */ popupEnabled?: boolean; /** * Indicates if the layer can be queried, i.e. the service supports GetFeatureInfo with either text/html or text/plain formats. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#queryable) - * + * * @default false */ queryable?: boolean; /** * List of spatialReferences (WKID) derived from the CRS elements of the first layer in the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#spatialReferences) */ spatialReferences?: number[]; /** * A collection of [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#sublayers) */ sublayers?: CollectionProperties; /** * The title of the WMS sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This defaults to the value of the Title property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#title) */ title?: string; /** * Indicates if the layer is visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#visible) */ visible?: boolean; @@ -13539,43 +14121,41 @@ declare namespace __esri { interface WMTSStyle extends Accessor, JSONSupport { /** * Description for the WMTS style. This defaults to the value of the Abstract property from the WMTS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#description) */ description: string; /** * The unique ID assigned to the style. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#id) */ id: string; /** * The URL to the legend which gets used in [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. This defaults to the value of the LegendURL property from the WMTS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#legendUrl) */ legendUrl: string; /** * The title of the WMTS style. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#title) */ title: string; /** * Creates a deep clone of the WMTSStyle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#clone) - * - * + * + * */ clone(): WMTSStyle; } interface WMTSStyleConstructor { - - - new(properties?: WMTSStyleProperties): WMTSStyle; + new (properties?: WMTSStyleProperties): WMTSStyle; fromJSON(json: any): WMTSStyle; } @@ -13585,25 +14165,25 @@ declare namespace __esri { interface WMTSStyleProperties { /** * Description for the WMTS style. This defaults to the value of the Abstract property from the WMTS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#description) */ description?: string; /** * The unique ID assigned to the style. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#id) */ id?: string; /** * The URL to the legend which gets used in [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. This defaults to the value of the LegendURL property from the WMTS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#legendUrl) */ legendUrl?: string; /** * The title of the WMTS style. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html#title) */ title?: string; @@ -13612,91 +14192,89 @@ declare namespace __esri { interface WMTSSublayer extends Accessor, JSONSupport { /** * Description for the WMTS sublayer. This defaults to the value of the Abstract property from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#description) */ description: string; /** * The full extent of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#fullExtent) */ fullExtent: Extent; /** * The unique ID assigned to the sublayer. If not set by the developer, it is automatically generated when the layer is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#id) */ id: string; /** * The map image format (MIME type) to request. Defaults to the first item in [imageFormats](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats). Must be one of the supported [imageFormats](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormat) */ imageFormat: string; /** * Supported image formats as retrieved from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats) */ imageFormats: string[]; /** * The [WMTSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html) to which the sublayer belongs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#layer) */ layer: WMTSLayer; /** * The [WMTSStyle](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html) to request. Defaults to the id of the first item in [styles](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles). Should be one of the supported [styles](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styleId) */ styleId: string; /** * A collection of supported [WMTSStyle](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html)s as retrieved from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles) */ styles: Collection; /** * The [TileMatrixSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html) to request. Defaults to the first item in [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) that matches the spatialReference of the view. Must be one of the supported [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) */ tileMatrixSet: TileMatrixSet; /** * The id of the [TileMatrixSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html) to request. Defaults to the id of the first item in [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) that matches the spatialReference of the view. Must be one of the supported [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSetId) */ tileMatrixSetId: string; /** * A collection of supported [TileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSets) */ tileMatrixSets: Collection; /** * The title of the WMTS sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This defaults to the value of the Title property from the WMTS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#title) */ title: string; /** * Creates a deep clone of the WMTS sublayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#clone) - * - * + * + * */ clone(): WMTSSublayer; } interface WMTSSublayerConstructor { - - - new(properties?: WMTSSublayerProperties): WMTSSublayer; + new (properties?: WMTSSublayerProperties): WMTSSublayer; fromJSON(json: any): WMTSSublayer; } @@ -13706,94 +14284,101 @@ declare namespace __esri { interface WMTSSublayerProperties { /** * Description for the WMTS sublayer. This defaults to the value of the Abstract property from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#description) */ description?: string; /** * The full extent of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#fullExtent) */ fullExtent?: ExtentProperties; /** * The unique ID assigned to the sublayer. If not set by the developer, it is automatically generated when the layer is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#id) */ id?: string; /** * The map image format (MIME type) to request. Defaults to the first item in [imageFormats](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats). Must be one of the supported [imageFormats](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormat) */ imageFormat?: string; /** * Supported image formats as retrieved from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#imageFormats) */ imageFormats?: string[]; /** * The [WMTSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html) to which the sublayer belongs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#layer) */ layer?: WMTSLayerProperties; /** * The [WMTSStyle](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html) to request. Defaults to the id of the first item in [styles](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles). Should be one of the supported [styles](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styleId) */ styleId?: string; /** * A collection of supported [WMTSStyle](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSStyle.html)s as retrieved from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#styles) */ styles?: CollectionProperties; /** * The [TileMatrixSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html) to request. Defaults to the first item in [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) that matches the spatialReference of the view. Must be one of the supported [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) */ tileMatrixSet?: TileMatrixSetProperties; /** * The id of the [TileMatrixSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html) to request. Defaults to the id of the first item in [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet) that matches the spatialReference of the view. Must be one of the supported [tileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSet). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSetId) */ tileMatrixSetId?: string; /** * A collection of supported [TileMatrixSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-TileMatrixSet.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#tileMatrixSets) */ tileMatrixSets?: CollectionProperties; /** * The title of the WMTS sublayer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) and [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widgets. This defaults to the value of the Title property from the WMTS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#title) */ title?: string; } - interface TileLayer extends Layer, SublayersOwner, ArcGISMapService, ArcGISCachedService, RefreshableLayer, ScaleRangeLayer, PortalLayer { + interface TileLayer + extends Layer, + SublayersOwner, + ArcGISMapService, + ArcGISCachedService, + RefreshableLayer, + ScaleRangeLayer, + PortalLayer { /** * A flat [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of all the [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#sublayers) in the TileLayer including the sublayers of its sublayers. All sublayers are referenced in the order in which they are drawn in the view (bottom to top). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#allSublayers) */ readonly allSublayers: Collection; /** * The URL that points to the location of the layer's attribution data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#attributionDataUrl) */ readonly attributionDataUrl: string; /** * Indicates if the layer has attribution data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#hasAttributionData) */ readonly hasAttributionData: boolean; @@ -13803,55 +14388,54 @@ declare namespace __esri { * * [popupEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupEnabled) * * [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#popupTemplate) * * [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#title) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#sublayers) */ readonly sublayers: Collection; /** * An array of tile servers used for changing map tiles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#tileServers) */ tileServers: string[]; /** * For [TileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html) the type is `tile`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#type) */ readonly type: "tile"; /** * The URL of the REST endpoint of the layer. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#url) */ url: string; /** * This method fetches a tile for the given level, row and column present in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#fetchTile) - * + * * @param level Level of detail of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param row The row(y) position of the tile fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param col The column(x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param options Optional settings for the tile request. The options have the following properties. * @param options.timestamp Number to append to the tile request to prevent fetching the tile from the browser cache. - * + * */ fetchTile(level: number, row: number, col: number, options?: TileLayerFetchTileOptions): IPromise; /** * This method returns a URL to a tile for a given level, row and column. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#getTileUrl) - * + * * @param level The requested tile's level. * @param row The requested tile's row. * @param col The requested tile's column. - * + * */ getTileUrl(level: number, row: number, col: number): string; - on(name: "layerview-create", eventHandler: TileLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: TileLayerLayerviewDestroyEventHandler): IHandle; @@ -13860,58 +14444,60 @@ declare namespace __esri { interface TileLayerConstructor { /** * The TileLayer allows you work with a cached [map service](http://server.arcgis.com/en/server/latest/publish-services/windows/what-is-a-map-service.htm) exposed by the ArcGIS Server REST API and add it to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) as a tile layer. A cached service accesses tiles from a cache instead of dynamically rendering images. Because they are cached, tiled layers render faster than [MapImageLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). To create an instance of TileLayer, you must reference the URL of the cached map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html) */ - new(properties?: TileLayerProperties): TileLayer; + new (properties?: TileLayerProperties): TileLayer; fromJSON(json: any): TileLayer; } export const TileLayer: TileLayerConstructor; - interface TileLayerProperties extends LayerProperties, ArcGISMapServiceProperties, ArcGISCachedServiceProperties, RefreshableLayerProperties, ScaleRangeLayerProperties, PortalLayerProperties { + interface TileLayerProperties + extends LayerProperties, + ArcGISMapServiceProperties, + ArcGISCachedServiceProperties, + RefreshableLayerProperties, + ScaleRangeLayerProperties, + PortalLayerProperties { /** * An array of tile servers used for changing map tiles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#tileServers) */ tileServers?: string[]; /** * The URL of the REST endpoint of the layer. The URL may either point to a resource on ArcGIS Enterprise or ArcGIS Online. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#url) */ url?: string; } export interface TileLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface TileLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface TileLayerFetchTileOptions extends Object { /** * Number to append to the tile request to prevent fetching the tile from the browser cache. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-TileLayer.html#fetchTile) */ timestamp?: boolean; } interface UnknownLayer extends Layer { - on(name: "layerview-create", eventHandler: UnknownLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: UnknownLayerLayerviewDestroyEventHandler): IHandle; @@ -13920,61 +14506,50 @@ declare namespace __esri { interface UnknownLayerConstructor { /** * Represents a layer whose type could not be determined. For example, when loading a layer from a URL and the layer type cannot be determined, then it is represented as an instance of this class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-UnknownLayer.html) */ - new(properties?: UnknownLayerProperties): UnknownLayer; + new (properties?: UnknownLayerProperties): UnknownLayer; } export const UnknownLayer: UnknownLayerConstructor; - interface UnknownLayerProperties extends LayerProperties { - - } + interface UnknownLayerProperties extends LayerProperties {} export interface UnknownLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface UnknownLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } interface UnsupportedLayer extends Layer { - on(name: "layerview-create", eventHandler: UnsupportedLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: UnsupportedLayerLayerviewDestroyEventHandler): IHandle; } interface UnsupportedLayerConstructor { - - - new(properties?: UnsupportedLayerProperties): UnsupportedLayer; + new (properties?: UnsupportedLayerProperties): UnsupportedLayer; } export const UnsupportedLayer: UnsupportedLayerConstructor; - interface UnsupportedLayerProperties extends LayerProperties { - - } + interface UnsupportedLayerProperties extends LayerProperties {} export interface UnsupportedLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface UnsupportedLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -13983,69 +14558,117 @@ declare namespace __esri { interface VectorTileLayer extends Layer, ScaleRangeLayer { /** * The URL that points to the location of the layer's attribution data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#attributionDataUrl) */ readonly attributionDataUrl: string; /** * Indicates the layer's supported capabilities. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) */ readonly capabilities: VectorTileLayerCapabilities; /** * The current style information of the VectorTileLayer. See the object specification below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ readonly currentStyleInfo: VectorTileLayerCurrentStyleInfo; /** * The portal item from which the layer is loaded. This will load the layer from the portal item, not the vector tile service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#portalItem) */ portalItem: PortalItem; /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#spatialReference) */ spatialReference: SpatialReference; /** * A style JSON object of vector tiles that will be used to render the layer. If initializing the layer with a style JSON object, the tiles are fetched from the tile servers specified in the style object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#style) */ style: any; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#tileInfo) */ tileInfo: TileInfo; /** * Token generated by the token service using the specified userId and password. The recommended approach to pass a token on a layer is to use [IdentityManager.registerToken()](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#registerToken). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#token) */ readonly token: string; /** * The URL to the vector tile service, or the URL to the style resource of vector tiles that will be used to render the layer. If specifying a URL to a style, the tiles are fetched from the tile servers specified in the style object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#url) */ url: string; + /** + * Returns an instance of [layout](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-layout) properties for the specified [style-layer](https://www.mapbox.com/mapbox-gl-js/style-spec/#layers). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#getLayoutProperties) + * + * @param layer The style-layer [id](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-id) in the VectorTileLayer's [currentStyleInfo.style](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo). + * + */ + getLayoutProperties(layer: string): any; + /** + * Returns an instance of [paint](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-paint) properties for the specified [style-layer](https://www.mapbox.com/mapbox-gl-js/style-spec/#layers). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#getPaintProperties) + * + * @param layer The style-layer [id](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-id) in the VectorTileLayer's [currentStyleInfo.style](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo). + * + */ + getPaintProperties(layer: string): any; + /** + * Returns the [id](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-id) of the [style-layer](https://www.mapbox.com/mapbox-gl-js/style-spec/#layers) based on its index. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#getStyleLayerId) + * + * @param index Index of the style-layer in the VectorTileLayer's [currentStyleInfo.style](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo). + * + */ + getStyleLayerId(index: number): string; /** * Loads a style to render a layer from the specified URL to a style resource or style JSON object. It is equivalent of changing the entire CSS style sheet for web page. When loading a style, it is the developer's responsibility to make sure that any relative urls in the style resolve correctly. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#loadStyle) - * + * * @param style The URL to a style of vector tiles or style JSON object. - * + * */ loadStyle(style: string | any): IPromise; - + /** + * Assigns new [layout](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-layout) properties to the specified [style-layer](https://www.mapbox.com/mapbox-gl-js/style-spec/#layers). + * > **Known Limitations** This method is only supported in 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#setLayoutProperties) + * + * @param layer The style-layer [id](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-id) in the VectorTileLayer's [currentStyleInfo.style](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo). + * @param layout An instance of layout properties to assign to the style-layer. + * + */ + setLayoutProperties(layer: string, layout: any): void; + /** + * Assigns new [paint](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-paint) properties to the specified [style-layer](https://www.mapbox.com/mapbox-gl-js/style-spec/#layers). + * > **Known Limitations** This method is only supported in 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#setPaintProperties) + * + * @param layer The style-layer [id](https://www.mapbox.com/mapbox-gl-js/style-spec/#layer-id) in the VectorTileLayer's [currentStyleInfo.style](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo). + * @param painter An instance of paint properties to assign to the specified style-layer. + * + */ + setPaintProperties(layer: string, painter: any): void; on(name: "layerview-create", eventHandler: VectorTileLayerLayerviewCreateEventHandler): IHandle; @@ -14054,12 +14677,12 @@ declare namespace __esri { interface VectorTileLayerConstructor { /** - * A VectorTileLayer accesses cached tiles of data and renders it in vector format. It is similar to a [WebTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) in the context of caching; however, a [WebTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) renders as a series of images, not vector data. - * + * VectorTileLayer accesses cached tiles of data and renders it in vector format. It is similar to a [WebTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) in the context of caching; however, a [WebTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) renders as a series of images, not vector data. Unlike raster tiles, they can adapt to the resolution of their display device and can be restyled for multiple uses. VectorTileLayer delivers styled maps while taking advantage of cached raster map tiles with vector map data. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html) */ - new(properties?: VectorTileLayerProperties): VectorTileLayer; + new (properties?: VectorTileLayerProperties): VectorTileLayer; fromJSON(json: any): VectorTileLayer; } @@ -14069,55 +14692,52 @@ declare namespace __esri { interface VectorTileLayerProperties extends LayerProperties, ScaleRangeLayerProperties { /** * The portal item from which the layer is loaded. This will load the layer from the portal item, not the vector tile service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#portalItem) */ portalItem?: PortalItemProperties; /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; /** * A style JSON object of vector tiles that will be used to render the layer. If initializing the layer with a style JSON object, the tiles are fetched from the tile servers specified in the style object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#style) */ style?: any; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#tileInfo) */ tileInfo?: TileInfoProperties; /** * The URL to the vector tile service, or the URL to the style resource of vector tiles that will be used to render the layer. If specifying a URL to a style, the tiles are fetched from the tile servers specified in the style object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#url) */ url?: string; } export interface VectorTileLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface VectorTileLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface VectorTileLayerCapabilities extends Object { /** * Indicates options supported by the exportTiles operation. Will be `null` if the `supportsExportTiles` is `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) */ exportTiles: any; @@ -14125,73 +14745,70 @@ declare namespace __esri { exportMap: VectorTileLayerCapabilitiesExportMap; /** * Indicates operations that can be performed on the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) */ operations: VectorTileLayerCapabilitiesOperations; } - export interface VectorTileLayerCapabilitiesExportMap extends Object { /** * Specifies the maximum number of tiles that can be exported to a cache dataset or a tile package. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) */ maxExportTilesCount: number; } - export interface VectorTileLayerCapabilitiesOperations extends Object { /** * Indicates if the tiles from the service can be exported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) */ supportsExportTiles: boolean; /** * Indicates if the service exposes a tile map that describes the presence of tiles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#capabilities) */ supportsTileMap: boolean; } - export interface VectorTileLayerCurrentStyleInfo extends Object { /** * Absolute URL for a vector tile service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ serviceUrl: string; /** * Absolute URL for vector tile service style. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ styleUrl: string; /** * Absolute URL for sprites included in a style. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ spriteUrl: string; /** * Absolute template URL for font sets included in a style. The URL includes `{fontstack}` and `{range}` tokens. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ glyphsUrl: string; /** - * Style JSON object for vector tiles. Style object includes `version` of the style specification, `sprite` and `glyphs` properties. - * + * Style JSON object for vector tiles. Style object includes `version` of the style specification, `sprite` and `glyphs` properties. It adheres to [version 8 of the Mapbox GL style specification](https://www.mapbox.com/mapbox-gl-js/style-spec/). + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ style: any; /** * Vector tile service information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html#currentStyleInfo) */ layerDefinition: any; @@ -14200,75 +14817,79 @@ declare namespace __esri { interface WebTileLayer extends Layer, ScaleRangeLayer, RefreshableLayer { /** * The attribution information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#copyright) */ copyright: string; /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#spatialReference) - * + * * @default Web Mercator Auxiliary Sphere (wkid: 3857) */ readonly spatialReference: SpatialReference; /** * A string of subDomain names where tiles are served to speed up tile retrieval. If subDomains are specified, the [urlTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) should include a `{subDomain}` place holder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) */ subDomains: string[]; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#tileInfo) */ tileInfo: TileInfo; /** * The list of tile server urls for the layer. It's computed from the [urlTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) and the list of [subDomains](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#tileServers) */ readonly tileServers: string[]; /** * For [WebTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) the type is `web-tile`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#type) */ readonly type: "web-tile"; /** * URL template for the hosted tiles. The `urlTemplate` should contain a `{subDomain}` place holder if [subDomains](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) are specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) */ urlTemplate: string; /** * This method fetches a tile for the given level, row and column present in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#fetchTile) - * + * * @param level Level of detail of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param row The row(y) position of the tile fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param column The column(x) position of the tile to fetch. This value is provided by [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html). * @param options Optional settings for the tile request. The options have the following properties. * @param options.timestamp A timestamp to append to the tile url to avoid loading a cached version of the tile. - * + * */ - fetchTile(level: number, row: number, column: number, options?: WebTileLayerFetchTileOptions): IPromise; + fetchTile( + level: number, + row: number, + column: number, + options?: WebTileLayerFetchTileOptions + ): IPromise; /** * This method returns a URL to a tile for a given level, row and column. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#getTileUrl) - * + * * @param level The requested tile's level. * @param row The requested tile's row. * @param column The requested tile's column. - * + * */ getTileUrl(level: number, row: number, column: number): string; - on(name: "layerview-create", eventHandler: WebTileLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: WebTileLayerLayerviewDestroyEventHandler): IHandle; @@ -14277,11 +14898,11 @@ declare namespace __esri { interface WebTileLayerConstructor { /** * WebTileLayer provides a simple way to add non-ArcGIS Server map tiles as a layer to a map. The constructor takes a URL template that usually follows a pattern of `http://some.domain.com/{level}/{col}/{row}/` where `level` corresponds to a zoom level, and `column` and `row` represent tile column and row, respectively. This pattern is not required, but is the most common one currently on the web. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) */ - new(properties?: WebTileLayerProperties): WebTileLayer; + new (properties?: WebTileLayerProperties): WebTileLayer; } export const WebTileLayer: WebTileLayerConstructor; @@ -14289,49 +14910,46 @@ declare namespace __esri { interface WebTileLayerProperties extends LayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { /** * The attribution information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#copyright) */ copyright?: string; /** * A string of subDomain names where tiles are served to speed up tile retrieval. If subDomains are specified, the [urlTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) should include a `{subDomain}` place holder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) */ subDomains?: string[]; /** * The tiling scheme information for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#tileInfo) */ tileInfo?: TileInfoProperties; /** * URL template for the hosted tiles. The `urlTemplate` should contain a `{subDomain}` place holder if [subDomains](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#subDomains) are specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate) */ urlTemplate?: string; } export interface WebTileLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface WebTileLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface WebTileLayerFetchTileOptions extends Object { /** * A timestamp to append to the tile url to avoid loading a cached version of the tile. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#fetchTile) */ timestamp?: boolean; @@ -14340,293 +14958,291 @@ declare namespace __esri { interface WMSLayer extends Layer, PortalLayer, ScaleRangeLayer, RefreshableLayer { /** * Copyright information for the WMS service. This defaults to the value of the AccessConstraints property from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#copyright) */ copyright: string; /** * Use this to append different custom parameters to the WMS map requests. The custom layer parameters are applied to GetMap and GetFeatureInfo. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#customLayerParameters) */ customLayerParameters: any; /** * Use this to append custom parameters to all WMS requests. The custom parameters are applied to GetCapabilities, GetMap and GetFeatureInfo. For example, if an access key is required, the key can be configured as a custom parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#customParameters) */ customParameters: any; /** * Description for the WMS layer. This defaults to the value of the Abstract property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#description) */ description: string; /** * Return format of feature information (MIME type). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#featureInfoFormat) */ featureInfoFormat: string; /** * The URL for the WMS GetFeatureInfo call. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#featureInfoUrl) */ featureInfoUrl: string; /** * All bounding boxes defined for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fullExtents) */ fullExtents: Extent[]; /** * The map image format (MIME type) to request. Defaults to `image/png` if the WMS service supports it. If not, it defaults to the value of the first `` in `` in the GetCapabilities response. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageFormat) */ imageFormat: string; /** * Indicates the maximum height of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageMaxHeight) - * + * * @default 2048 */ imageMaxHeight: number; /** * Indicates the maximum height of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageMaxWidth) - * + * * @default 2048 */ imageMaxWidth: number; /** * Indicates whether the background of the image exported by the service is transparent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageTransparency) - * + * * @default true */ imageTransparency: boolean; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#spatialReference) */ spatialReference: SpatialReference; /** * List of spatialReference well known ids derived from the CRS elements of the first layer in the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#spatialReferences) */ spatialReferences: number[]; /** * A collection of [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#sublayers) */ sublayers: Collection; /** * The URL of the WMS service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#url) */ url: string; /** * Version of the [WMS specification](http://www.opengeospatial.org/standards/wms) to use. For example, `1.3.0`, `1.1.1`, `1.1` or `1.0`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#version) */ version: string; /** * Fetching the WMS image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fetchImage) - * + * * @param extent The extent of the view. * @param width The width of the view in pixels. * @param height The height of the view in pixels. * @param options The parameter options is an object with the following properties. * @param options.pixelRatio The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at. * @param options.rotation The rotation in degrees of the exported image. - * + * */ fetchImage(extent: Extent, width: number, height: number, options?: WMSLayerFetchImageOptions): IPromise; /** * Returns a [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html) based on the given sublayer id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#findSublayerById) - * + * * @param id The [id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html#id) of the WMS sublayer. - * + * */ findSublayerById(id: number): WMSSublayer; - on(name: "layerview-create", eventHandler: WMSLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: WMSLayerLayerviewDestroyEventHandler): IHandle; } interface WMSLayerConstructor { - - - new(properties?: WMSLayerProperties): WMSLayer; + new (properties?: WMSLayerProperties): WMSLayer; fromJSON(json: any): WMSLayer; } export const WMSLayer: WMSLayerConstructor; - interface WMSLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + interface WMSLayerProperties + extends LayerProperties, + PortalLayerProperties, + ScaleRangeLayerProperties, + RefreshableLayerProperties { /** * Copyright information for the WMS service. This defaults to the value of the AccessConstraints property from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#copyright) */ copyright?: string; /** * Use this to append different custom parameters to the WMS map requests. The custom layer parameters are applied to GetMap and GetFeatureInfo. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#customLayerParameters) */ customLayerParameters?: any; /** * Use this to append custom parameters to all WMS requests. The custom parameters are applied to GetCapabilities, GetMap and GetFeatureInfo. For example, if an access key is required, the key can be configured as a custom parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#customParameters) */ customParameters?: any; /** * Description for the WMS layer. This defaults to the value of the Abstract property from the WMS GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#description) */ description?: string; /** * Return format of feature information (MIME type). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#featureInfoFormat) */ featureInfoFormat?: string; /** * The URL for the WMS GetFeatureInfo call. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#featureInfoUrl) */ featureInfoUrl?: string; /** * All bounding boxes defined for the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fullExtents) */ fullExtents?: ExtentProperties[]; /** * The map image format (MIME type) to request. Defaults to `image/png` if the WMS service supports it. If not, it defaults to the value of the first `` in `` in the GetCapabilities response. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageFormat) */ imageFormat?: string; /** * Indicates the maximum height of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageMaxHeight) - * + * * @default 2048 */ imageMaxHeight?: number; /** * Indicates the maximum height of the image exported by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageMaxWidth) - * + * * @default 2048 */ imageMaxWidth?: number; /** * Indicates whether the background of the image exported by the service is transparent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#imageTransparency) - * + * * @default true */ imageTransparency?: boolean; /** * Indicates whether the layer will be included in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * The spatial reference of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; /** * List of spatialReference well known ids derived from the CRS elements of the first layer in the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#spatialReferences) */ spatialReferences?: number[]; /** * A collection of [WMSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMSSublayer.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#sublayers) */ sublayers?: CollectionProperties; /** * The URL of the WMS service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#url) */ url?: string; /** * Version of the [WMS specification](http://www.opengeospatial.org/standards/wms) to use. For example, `1.3.0`, `1.1.1`, `1.1` or `1.0`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#version) */ version?: string; } export interface WMSLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface WMSLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; } - export interface WMSLayerFetchImageOptions extends Object { /** * The ratio of the resolution in physical pixels of the image to the resolution it will be displayed at. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fetchImage) */ pixelRatio?: number; /** * The rotation in degrees of the exported image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMSLayer.html#fetchImage) */ rotation?: number; @@ -14635,143 +15251,142 @@ declare namespace __esri { interface WMTSLayer extends Layer, PortalLayer, ScaleRangeLayer, RefreshableLayer { /** * Currently active sublayer. Defaults to the first sublayer in [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#sublayers). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#activeLayer) */ activeLayer: WMTSSublayer; /** * Copyright information for the WMTS service. This defaults to the value of the AccessConstraints property from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#copyright) */ copyright: string; /** * Use this to append different custom parameters to the WMTS tile requests. The custom layer parameters are applied to GetTile. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#customLayerParameters) */ customLayerParameters: any; /** * Use this to append custom parameters to all WMTS requests. The custom parameters are applied to GetCapabilities and GetTile. For example, if an access key is required, the key can be configured as a custom parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#customParameters) */ customParameters: any; /** * The service mode for the WMTS layer. If not specified, the API will first make a getCapabilities request using `RESTful`. If that fails, it will try using `KVP`. **Possible Values:** RESTful | KVP - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#serviceMode) - * + * * @default RESTful */ serviceMode: string; /** * A collection of [WMTSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html) objects. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#sublayers) */ sublayers: Collection; /** * The URL of the WMTS service. The URL for the GetCapabilities is created based on the url and serviceMode properties. For example https://gibs.earthdata.nasa.gov/wmts/epsg4326/best. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#url) */ url: string; /** * Version of the [WMTS specification](http://www.opengeospatial.org/standards/wmts) to use. Probably `1.0.0`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#version) */ version: string; /** * Returns a [WMTSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html) based on the given sublayer id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#findSublayerById) - * + * * @param id The [id](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html#id) of the WMTS sublayer. - * + * */ findSublayerById(id: string): WMTSSublayer; - on(name: "layerview-create", eventHandler: WMTSLayerLayerviewCreateEventHandler): IHandle; on(name: "layerview-destroy", eventHandler: WMTSLayerLayerviewDestroyEventHandler): IHandle; } interface WMTSLayerConstructor { - - - new(properties?: WMTSLayerProperties): WMTSLayer; + new (properties?: WMTSLayerProperties): WMTSLayer; fromJSON(json: any): WMTSLayer; } export const WMTSLayer: WMTSLayerConstructor; - interface WMTSLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties { + interface WMTSLayerProperties + extends LayerProperties, + PortalLayerProperties, + ScaleRangeLayerProperties, + RefreshableLayerProperties { /** * Currently active sublayer. Defaults to the first sublayer in [sublayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#sublayers). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#activeLayer) */ activeLayer?: WMTSSublayerProperties; /** * Copyright information for the WMTS service. This defaults to the value of the AccessConstraints property from the GetCapabilities request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#copyright) */ copyright?: string; /** * Use this to append different custom parameters to the WMTS tile requests. The custom layer parameters are applied to GetTile. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#customLayerParameters) */ customLayerParameters?: any; /** * Use this to append custom parameters to all WMTS requests. The custom parameters are applied to GetCapabilities and GetTile. For example, if an access key is required, the key can be configured as a custom parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#customParameters) */ customParameters?: any; /** * The service mode for the WMTS layer. If not specified, the API will first make a getCapabilities request using `RESTful`. If that fails, it will try using `KVP`. **Possible Values:** RESTful | KVP - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#serviceMode) - * + * * @default RESTful */ serviceMode?: string; /** * A collection of [WMTSSublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-WMTSSublayer.html) objects. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#sublayers) */ sublayers?: CollectionProperties; /** * The URL of the WMTS service. The URL for the GetCapabilities is created based on the url and serviceMode properties. For example https://gibs.earthdata.nasa.gov/wmts/epsg4326/best. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#url) */ url?: string; /** * Version of the [WMTS specification](http://www.opengeospatial.org/standards/wmts) to use. Probably `1.0.0`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WMTSLayer.html#version) */ version?: string; } export interface WMTSLayerLayerviewCreateEvent { - layerView: LayerView; view: View; } export interface WMTSLayerLayerviewDestroyEvent { - layerView: LayerView; view: View; @@ -14780,13 +15395,13 @@ declare namespace __esri { interface Map extends Accessor, LayersMixin { /** * A flat collection of all the [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) in the map. This collection contains [basemap layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap), [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) and [ground layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground). [Group Layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) and their [children layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html#layers) are also part of this collection. Reference layers in the basemap will always be included at the end of the collection. Layers should not be added directly to this collection. They must only be added via the [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers), [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or [ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#allLayers) */ readonly allLayers: Collection; /** - * Specifies a basemap for the map. The basemap is a set of tile layers that give geographic context to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the other [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. - * + * Specifies a basemap for the map. The basemap is a set of tile layers that give geographic context to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the other [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. + * * Value | Description * ------|------------ * streets | ![basemap-streets](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) @@ -14806,8 +15421,8 @@ declare namespace __esri { * streets-night-vector | ![streets-night-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-night.jpg) * streets-relief-vector | ![streets-relief-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-relief.jpg) * streets-navigation-vector | ![streets-navigation-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-navigation.jpg) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) */ basemap: Basemap; @@ -14815,10 +15430,10 @@ declare namespace __esri { * Specifies the surface properties for the map. This property is only relevant when adding the map to a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It renders the terrain or topographical variations in the real world on the map's surface with a collection of [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html). This value can be an instance of [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html), or one of the following strings: * * `world-elevation` for a default instance of ground using the [Terrain3D Service](https://www.arcgis.com/home/item.html?id=7029fb60158543ad845c7e1527af11e4). * * `world-topobathymetry` for an instance of ground that combines surface elevation and bathymetry using the [TopoBathy3D Service](https://www.arcgis.com/home/item.html?id=0c69ba5a5d254118841d43f03aa3e97d). - * - * + * + * * The ground may not be set to `null` or `undefined`, it is guaranteed to always contain an instance of type [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html). The elevation can be removed from the ground by setting the ground property to a new empty [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) instance or by removing all the ground layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) */ ground: Ground; @@ -14827,19 +15442,19 @@ declare namespace __esri { interface MapConstructor { /** * The Map class contains properties and methods for storing, managing, and overlaying [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) common to both 2D and 3D viewing. Layers can be added and removed from the map, but are rendered via a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) (for viewing data in 2D) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) (for viewing data in 3D). Thus a map instance is a simple container that holds the layers, while the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is the means of displaying and interacting with a map's layers and basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) */ - new(properties?: MapProperties): Map; + new (properties?: MapProperties): Map; } export const Map: MapConstructor; interface MapProperties extends LayersMixinProperties { /** - * Specifies a basemap for the map. The basemap is a set of tile layers that give geographic context to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the other [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. - * + * Specifies a basemap for the map. The basemap is a set of tile layers that give geographic context to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the other [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. + * * Value | Description * ------|------------ * streets | ![basemap-streets](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) @@ -14859,8 +15474,8 @@ declare namespace __esri { * streets-night-vector | ![streets-night-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-night.jpg) * streets-relief-vector | ![streets-relief-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-relief.jpg) * streets-navigation-vector | ![streets-navigation-vector](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets-navigation.jpg) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) */ basemap?: BasemapProperties | string; @@ -14868,10 +15483,10 @@ declare namespace __esri { * Specifies the surface properties for the map. This property is only relevant when adding the map to a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It renders the terrain or topographical variations in the real world on the map's surface with a collection of [ElevationLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html). This value can be an instance of [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html), or one of the following strings: * * `world-elevation` for a default instance of ground using the [Terrain3D Service](https://www.arcgis.com/home/item.html?id=7029fb60158543ad845c7e1527af11e4). * * `world-topobathymetry` for an instance of ground that combines surface elevation and bathymetry using the [TopoBathy3D Service](https://www.arcgis.com/home/item.html?id=0c69ba5a5d254118841d43f03aa3e97d). - * - * + * + * * The ground may not be set to `null` or `undefined`, it is guaranteed to always contain an instance of type [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html). The elevation can be removed from the ground by setting the ground property to a new empty [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) instance or by removing all the ground layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#ground) */ ground?: GroundProperties | string; @@ -14879,99 +15494,199 @@ declare namespace __esri { /** * A convenience module for importing [PointCloudRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing renderers one at a time like this: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html) */ - interface pointCloudRenderers { + namespace pointCloudRenderers { + /** + * Renderer types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudRenderer) + */ + export type PointCloudRenderer = + | __esri.PointCloudClassBreaksRenderer + | __esri.PointCloudRGBRenderer + | __esri.PointCloudStretchRenderer + | __esri.PointCloudUniqueValueRenderer; + + /** + * PointCloudClassBreaksRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudClassBreaksRenderer) + */ + export type PointCloudClassBreaksRenderer = __esri.PointCloudClassBreaksRenderer; + export const PointCloudClassBreaksRenderer: typeof __esri.PointCloudClassBreaksRenderer; + + /** + * PointCloudRGBRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudRGBRenderer) + */ + export type PointCloudRGBRenderer = __esri.PointCloudRGBRenderer; + export const PointCloudRGBRenderer: typeof __esri.PointCloudRGBRenderer; + + /** + * PointCloudStretchRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudStretchRenderer) + */ + export type PointCloudStretchRenderer = __esri.PointCloudStretchRenderer; + export const PointCloudStretchRenderer: typeof __esri.PointCloudStretchRenderer; + + /** + * PointCloudUniqueValueRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudUniqueValueRenderer) + */ + export type PointCloudUniqueValueRenderer = __esri.PointCloudUniqueValueRenderer; + export const PointCloudUniqueValueRenderer: typeof __esri.PointCloudUniqueValueRenderer; } - export const pointCloudRenderers: pointCloudRenderers; + /** + * PointCloudClassBreaksRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudClassBreaksRenderer) + */ + export type pointCloudRenderersPointCloudClassBreaksRenderer = PointCloudClassBreaksRenderer; + + /** + * Renderer types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudRenderer) + */ + export type pointCloudRenderersPointCloudRenderer = + | PointCloudClassBreaksRenderer + | PointCloudRGBRenderer + | PointCloudStretchRenderer + | PointCloudUniqueValueRenderer; + + /** + * PointCloudRGBRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudRGBRenderer) + */ + export type pointCloudRenderersPointCloudRGBRenderer = PointCloudRGBRenderer; + + /** + * PointCloudStretchRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudStretchRenderer) + */ + export type pointCloudRenderersPointCloudStretchRenderer = PointCloudStretchRenderer; + + /** + * PointCloudUniqueValueRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-pointCloudRenderers.html#PointCloudUniqueValueRenderer) + */ + export type pointCloudRenderersPointCloudUniqueValueRenderer = PointCloudUniqueValueRenderer; interface PopupTemplate extends Accessor, JSONSupport { /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#actions) */ actions: Collection; /** - * The template for defining and formatting a popup's content. Content may be defined with one of four types of values. - * * **String** - A popup's content can be a simple text or string value referencing field values or [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. Expressions must be defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. These values are referenced via placeholders. Within the string, placeholders are denoted by `{fieldName}` or `{expression/expressionName}` which are used to specify which values from field attributes or expressions to display within certain locations in the string. When the application runs, substitution occurs and the placeholder is replaced with the actual attribute or expression value for the selected feature. The string can also include HTML markup and formatting functions. - * * **Popup elements** - You can also display content as popup elements defined as an array of Objects. These elements can be used individually or combined. The order in which they are set determines how they display within the popup. See the items below describing each element. - * * **text** - Object that provides descriptive text as content. This object must be defined using the [text popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text). - * * **media** - Array of objects used to display media such as charts and/or images. This object must be defined using the [media popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media). - * * **fields** - Array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) objects. If `fieldInfos` is not set directly within the `content` property, the popup will display whatever is set in the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. This must be defined using the [fields popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields). - * * **attachments** - Array of attachmentInfos objects listed in the popup. This object must be defined using the [attachments popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#attachments). + * The template for defining and formatting a popup's content. Content may be defined with one of four types of values. + * * **String** - A popup's content can be a simple text or string value referencing field values or [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. Expressions must be defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. + * * **Popup elements** - You can also display content as popup elements. These elements can be used individually or combined. The order in which they are set determines how they display within the popup. See the items below describing each element. + * * **text** - A [TextContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Text.html) that provides descriptive text as content. + * * **media** - A [MediaContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media.html) that is used to display media such as [charts](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart.html) and/or [images](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html). + * * **fields** - A [FieldsContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Fields.html). that contains the fields to display within the content. If this is not set directly within the `content` property, the popup will display whatever is set in the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. + * * **attachments** - A [AttachmentsContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html) that contains attachments associated with the feature. * * **promise** - The PopupTemplate's content may also be defined with a promise that resolves to any of the above-mentioned elements. This is useful for cases when you run a task or execute a query and want to display the results in the popup. Simply pass the promise to the popupTemplate's content and ensure that it resolves to a string or other popup element. * * **function** - Content may be defined with a JavaScript function that returns any of the above-mentioned elements. This is handy when your popup requires additional processing or functionality than what is provided with the four content types listed above. For example, let’s assume that you would like to display charts using third-party JavaScript libraries or categorize information into separate tabs. In these cases, you can use a function that returns either a string, a reference to an HTML element, a popup element, or a promise. When the feature is clicked, the feature is passed as an argument to the function and provides access to the feature’s graphic and attributes. The function then executes and returns a value to display in the popup template. It is also possible to check a specific feature attribute and determine whether to apply a function based on its value. Out-of-the-box formatting functions can be used to format date, time, and number values. The syntax for using an out-of-the-box formatting function is: `{field-name:format-function-name(option-a: value, option-b: value)}` - * - * - * The formatter functions are described below: - * + * + * + * The formatter functions are described below: + * * Type | Description * ----- | ----------- * DateString | Formats the date into a human-readable format. Supports the following options: `hideTime: false` - When `true` shows time. Default value is `false`. `local: false` - Displays date and time in the local time zone. Default value is `false`. When `false` the date will display in UTC. `systemLocale: false` - Displays date and time in the system locale (local time zone). Default value is `false`. * DateFormat | Converts date fields into a human-readable format using [dojo/date/locale.format](https://dojotoolkit.org/reference-guide/1.10/dojo/date/locale/format.html) method. Supports the same options as [dojo/date/locale.format](https://dojotoolkit.org/reference-guide/1.10/dojo/date/locale/format.html). The following snippets show some usage examples: `{DATE_FIELD:DateFormat}` produces `3/8/08 4:00 PM`. `{DATE_FIELD:DateFormat(selector: 'date', fullYear: true)}` produces `4/8/2009`. * NumberFormat | Formats numbers into various formats using the [dojo/number.format](https://dojotoolkit.org/reference-guide/1.10/dojo/number.html#format) method. Supports the same set of options as [dojo/number.format](https://dojotoolkit.org/reference-guide/1.10/dojo/number.html#format). The following snippets show examples of usage pattern examples: `{Magnitude:NumberFormat}` produces `4.23456`. `{Magnitude:NumberFormat(places:2)}` produces `4.23`. - * + * * Out-of-the-box formatting functions and custom functions are supported as of version 4.1. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) */ - content: string | any[] | Function | IPromise; + content: ContentElementContentElement | ContentElementContentElement[] | string | Function | IPromise; /** - * An array of objects that reference [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. These expressions evaluate to either a number or a string value on a feature-by-feature basis at runtime. The values display within the view's popup as if they are field values. They can be displayed in a table using the `fieldInfos` of the popupTemplate's content or referenced within a simple string. See the object specification table below for a description of the properties that may be set in each object. - * + * An array of objects or [ExpressionInfo[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html) that reference [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) */ - expressionInfos: PopupTemplateExpressionInfos[]; + expressionInfos: ExpressionInfo[]; /** - * An array of objects that defines how fields in the dataset or values from [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions participate in a popup. Each object contains properties for a single field or expression. See the object specification table below for available options to set on each field. - * + * An array of [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) that defines how fields in the dataset or values from [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions participate in a popup. Each object [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) contains properties for a single field or expression. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) */ - fieldInfos: PopupTemplateFieldInfos[]; + fieldInfos: FieldInfo[]; /** - * Additional options that can be defined for the popup layer. Currently supports one property, `showNoDataRecords`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#layerOptions) - * - * @default null + * Indicates whether or not editor tracking should display. ![popupTemplate-showLastEditInfo](https://developers.arcgis.com/javascript/assets/img/guide/whats-new/410/showlasteditinfo.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#lastEditInfoEnabled) + * + * @default true */ - layerOptions: PopupTemplateLayerOptions; + lastEditInfoEnabled: boolean; + /** + * Additional options that can be defined for the popup layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#layerOptions) + */ + layerOptions: LayerOptions; /** * An array of fields used in the PopupTemplate. Use this property to indicate what fields are required to fully render the PopupTemplate. To fetch the values from all fields, use `["*"]`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#outFields) - * + * * @default null */ outFields: string[]; /** * Indicates whether actions should replace existing [popup actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions) - * + * * @default false */ overwriteActions: boolean; + /** + * The `RelatedRecordsInfo` class provides additional sorting options when working with related records in a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#relatedRecordsInfo) + */ + relatedRecordsInfo: RelatedRecordsInfo; /** * The template for defining how to format the title used in a popup. You can format the title by specifying either a string value or a function that returns a simple string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#title) */ title: string | Function; + + /** + * Creates a deep clone of the PopupTemplate object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#clone) + * + * + */ + clone(): PopupTemplate; } interface PopupTemplateConstructor { /** * A PopupTemplate formats and defines the content of a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for a specific [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) or [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). A PopupTemplate allows the user to access values from feature attributes and values returned from [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions when a feature in the view is selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) */ - new(properties?: PopupTemplateProperties): PopupTemplate; + new (properties?: PopupTemplateProperties): PopupTemplate; fromJSON(json: any): PopupTemplate; } @@ -14981,779 +15696,554 @@ declare namespace __esri { interface PopupTemplateProperties { /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each object represents an action or function that may be executed by clicking the icon or image symbolizing them in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). By default, every [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. PopupTemplates do not have default actions. To override actions on the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) using PopupTemplate see [overwriteActions](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions). Actions defined in a PopupTemplate will only appear in the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) for features or layers that apply that particular PopupTemplate. The order of each action in the popup is the same order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the PopupTemplate that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#actions) */ actions?: CollectionProperties; /** - * The template for defining and formatting a popup's content. Content may be defined with one of four types of values. - * * **String** - A popup's content can be a simple text or string value referencing field values or [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. Expressions must be defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. These values are referenced via placeholders. Within the string, placeholders are denoted by `{fieldName}` or `{expression/expressionName}` which are used to specify which values from field attributes or expressions to display within certain locations in the string. When the application runs, substitution occurs and the placeholder is replaced with the actual attribute or expression value for the selected feature. The string can also include HTML markup and formatting functions. - * * **Popup elements** - You can also display content as popup elements defined as an array of Objects. These elements can be used individually or combined. The order in which they are set determines how they display within the popup. See the items below describing each element. - * * **text** - Object that provides descriptive text as content. This object must be defined using the [text popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text). - * * **media** - Array of objects used to display media such as charts and/or images. This object must be defined using the [media popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media). - * * **fields** - Array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) objects. If `fieldInfos` is not set directly within the `content` property, the popup will display whatever is set in the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. This must be defined using the [fields popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields). - * * **attachments** - Array of attachmentInfos objects listed in the popup. This object must be defined using the [attachments popup element specification table](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#attachments). + * The template for defining and formatting a popup's content. Content may be defined with one of four types of values. + * * **String** - A popup's content can be a simple text or string value referencing field values or [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. Expressions must be defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. + * * **Popup elements** - You can also display content as popup elements. These elements can be used individually or combined. The order in which they are set determines how they display within the popup. See the items below describing each element. + * * **text** - A [TextContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Text.html) that provides descriptive text as content. + * * **media** - A [MediaContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media.html) that is used to display media such as [charts](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart.html) and/or [images](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html). + * * **fields** - A [FieldsContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Fields.html). that contains the fields to display within the content. If this is not set directly within the `content` property, the popup will display whatever is set in the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. + * * **attachments** - A [AttachmentsContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html) that contains attachments associated with the feature. * * **promise** - The PopupTemplate's content may also be defined with a promise that resolves to any of the above-mentioned elements. This is useful for cases when you run a task or execute a query and want to display the results in the popup. Simply pass the promise to the popupTemplate's content and ensure that it resolves to a string or other popup element. * * **function** - Content may be defined with a JavaScript function that returns any of the above-mentioned elements. This is handy when your popup requires additional processing or functionality than what is provided with the four content types listed above. For example, let’s assume that you would like to display charts using third-party JavaScript libraries or categorize information into separate tabs. In these cases, you can use a function that returns either a string, a reference to an HTML element, a popup element, or a promise. When the feature is clicked, the feature is passed as an argument to the function and provides access to the feature’s graphic and attributes. The function then executes and returns a value to display in the popup template. It is also possible to check a specific feature attribute and determine whether to apply a function based on its value. Out-of-the-box formatting functions can be used to format date, time, and number values. The syntax for using an out-of-the-box formatting function is: `{field-name:format-function-name(option-a: value, option-b: value)}` - * - * - * The formatter functions are described below: - * + * + * + * The formatter functions are described below: + * * Type | Description * ----- | ----------- * DateString | Formats the date into a human-readable format. Supports the following options: `hideTime: false` - When `true` shows time. Default value is `false`. `local: false` - Displays date and time in the local time zone. Default value is `false`. When `false` the date will display in UTC. `systemLocale: false` - Displays date and time in the system locale (local time zone). Default value is `false`. * DateFormat | Converts date fields into a human-readable format using [dojo/date/locale.format](https://dojotoolkit.org/reference-guide/1.10/dojo/date/locale/format.html) method. Supports the same options as [dojo/date/locale.format](https://dojotoolkit.org/reference-guide/1.10/dojo/date/locale/format.html). The following snippets show some usage examples: `{DATE_FIELD:DateFormat}` produces `3/8/08 4:00 PM`. `{DATE_FIELD:DateFormat(selector: 'date', fullYear: true)}` produces `4/8/2009`. * NumberFormat | Formats numbers into various formats using the [dojo/number.format](https://dojotoolkit.org/reference-guide/1.10/dojo/number.html#format) method. Supports the same set of options as [dojo/number.format](https://dojotoolkit.org/reference-guide/1.10/dojo/number.html#format). The following snippets show examples of usage pattern examples: `{Magnitude:NumberFormat}` produces `4.23456`. `{Magnitude:NumberFormat(places:2)}` produces `4.23`. - * + * * Out-of-the-box formatting functions and custom functions are supported as of version 4.1. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) */ - content?: string | any[] | Function | IPromise; + content?: + | ContentElementContentElementProperties + | ContentElementContentElementProperties[] + | string + | Function + | IPromise; /** - * An array of objects that reference [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. These expressions evaluate to either a number or a string value on a feature-by-feature basis at runtime. The values display within the view's popup as if they are field values. They can be displayed in a table using the `fieldInfos` of the popupTemplate's content or referenced within a simple string. See the object specification table below for a description of the properties that may be set in each object. - * + * An array of objects or [ExpressionInfo[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html) that reference [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) */ - expressionInfos?: PopupTemplateExpressionInfos[]; + expressionInfos?: ExpressionInfoProperties[]; /** - * An array of objects that defines how fields in the dataset or values from [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions participate in a popup. Each object contains properties for a single field or expression. See the object specification table below for available options to set on each field. - * + * An array of [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) that defines how fields in the dataset or values from [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expressions participate in a popup. Each object [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) contains properties for a single field or expression. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) */ - fieldInfos?: PopupTemplateFieldInfos[]; + fieldInfos?: FieldInfoProperties[]; /** - * Additional options that can be defined for the popup layer. Currently supports one property, `showNoDataRecords`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#layerOptions) - * - * @default null + * Indicates whether or not editor tracking should display. ![popupTemplate-showLastEditInfo](https://developers.arcgis.com/javascript/assets/img/guide/whats-new/410/showlasteditinfo.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#lastEditInfoEnabled) + * + * @default true */ - layerOptions?: PopupTemplateLayerOptions; + lastEditInfoEnabled?: boolean; + /** + * Additional options that can be defined for the popup layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#layerOptions) + */ + layerOptions?: LayerOptionsProperties; /** * An array of fields used in the PopupTemplate. Use this property to indicate what fields are required to fully render the PopupTemplate. To fetch the values from all fields, use `["*"]`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#outFields) - * + * * @default null */ outFields?: string[]; /** * Indicates whether actions should replace existing [popup actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#overwriteActions) - * + * * @default false */ overwriteActions?: boolean; + /** + * The `RelatedRecordsInfo` class provides additional sorting options when working with related records in a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#relatedRecordsInfo) + */ + relatedRecordsInfo?: RelatedRecordsInfoProperties; /** * The template for defining how to format the title used in a popup. You can format the title by specifying either a string value or a function that returns a simple string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#title) */ title?: string | Function; } - /** - * Attachments are a type of popup element. Similar to text and media elements, attachments can only be set within the content. ![popuptemplate-attachments-element](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-attachments-element.png) The object specification for the fields popup element is provided below. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#attachments) - */ - export interface Attachments extends Object { - /** - * **Required.** The type of popup element to display. To list attachments, set this to `attachments`. The attachmentInfos are queried from the service and will list within the popup. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#attachments) - */ - type: string; - } - - /** - * It is possible to set the fieldInfos directly within the PopupTemplate's content. If the fieldInfos is not set within the content, it will revert to whatever may be set within the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. ![popuptemplate-fields-element](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-fields-element.png) The object specification for the fields popup element is provided below. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields) - */ - export interface Fields extends Object { - /** - * **Required.** The type of popup element to display. To display tabular field data, set this to `fields`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields) - */ - type: string; - /** - * Object array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos). If the `fieldInfos` property is not provided directly within the content, the popup will display whatever is set directly in the `PopupTemplate.fieldInfos`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fields) - */ - fieldInfos: any[]; - } - - /** - * It is possible to set media elements such as charts and/or images within the PopupTemplate's content. This content is set within the mediaInfos. ![popuptemplate-media-element](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-media-element.png) The object specification for the media popup element is provided below. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - export interface Media extends Object { - /** - * **Required.** The type of popup element to display. To display charts or images, set this to `media`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - type: string; - /** - * **Required.** Object array of mediaInfos representing images or charts for display. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - mediaInfos: MediaMediaInfos[]; - } - - - export interface PopupTemplateExpressionInfos extends Object { - /** - * The name of the expression. This is used to reference the value of the given `expression` in the popupTemplate's [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) property by wrapping it in curly braces and prefacing it with `expression/` (e.g. `{expression/expressionName}`). See the code snippets below for more examples. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) - */ - name: string; - /** - * The title used to describe the value returned by the expression in the popup. This will display if the value is referenced in a `fieldInfos` table. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) - */ - title?: string; - /** - * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to either a string or a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) - */ - expression: string; - /** - * Indicates the return type of the Arcade expression. This is an optional property. **Possible Values:** string | number - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) - */ - returnType?: string; - } - - - export interface PopupTemplateFieldInfos extends Object { - /** - * **Required.** The field name as defined by the service or the `name` of an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression. Arcade expression names are defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#expressionInfos) property. When referencing Arcade expressions, you must preface the name with `expression/`, such as `expression/percent-total`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - fieldName: string; - /** - * An object used with numerical or date fields to provide more detail about how the value should be displayed in a popup. When formatting Number fields, you must set both the `digitSeparator` and `places` properties for the formatting to take effect. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - format?: PopupTemplateFieldInfosFormat; - /** - * The field alias to display in place of the `fieldName` in the popup. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - label?: string; - /** - * For editable popups, defines the text box format. **Possible Values:** rich-text | text-area | text-box - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - stringFieldOption?: string; - /** - * Defines a tooltip for editable popup fields. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - tooltip?: string; - /** - * Defines whether the field is visible in the popup. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - visible?: boolean; - } - - - export interface PopupTemplateFieldInfosFormat extends Object { - /** - * Used only with Date fields. Specifies how the date should appear in a popup. **Possible Values:** short-date | short-date-le | long-date | day-short-month-year | long-month-day-year | short-date-long-time | short-date-le-long-time | short-date-short-time | short-date-le-short-time | short-date-short-time-24 | short-date-le-short-time-24 | short-date-short-time-24 | short-date-le-short-time-24 | long-month-year | short-month-year | year - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - dateFormat?: string; - /** - * Used only with Number fields. A value of `true` indicates the number should have a digit (or thousands) separator when the value appears in popups. A value of `false` means that no separator will be used. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - digitSeparator?: boolean; - /** - * Used only with Number fields to specify the number of supported decimal places that should appear in popups. Any places beyond this value are rounded. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) - */ - places?: number; - } - - - export interface PopupTemplateLayerOptions extends Object { - /** - * Applicable to [Imagery Layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). Indicates whether records without data should display within the popup. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#layerOptions) - */ - showNoDataRecords: boolean; - } - - /** - * An object used to define descriptive text as an element within the PopupTemplate's content. The text may reference values returned from a field attribute or an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression. ![popuptemplate-text-element](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-text-element.png) The object specification for the text popup element is provided below. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text) - */ - export interface Text extends Object { - /** - * **Required.** The type of popup element to display. For descriptive text, set this to `text`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text) - */ - type: string; - /** - * **Required.** The formatted string content to display. This may contain a field name enclosed in `{}`, such as `{FIELDNAME}`, or an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression name, referenced as `{expression/EXPRESSIONNAME}`. Text content may also leverage HTML tags such as ``, `

`, and `
` for formatting the look and feel of the content. To use this element, set the `type` property to `text`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#text) - */ - text: string; - } - - - export interface MediaMediaInfos extends Object { - /** - * Defines the media title. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - title: string; - /** - * Defines a caption for the media. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - caption: string; - /** - * **Since: 4.5** Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. Value of `0` indicates auto refresh is not enabled. If the property does not exist, it is equivalent to having a value of `0`. Only applicable when `type` is set to `image`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - refreshInterval: number; - /** - * Defines the media type. **Possible Values:** image | pie-chart | bar-chart | column-chart | line-chart - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - type: string; - /** - * Defines the value format. This depends on the media type. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - value: MediaMediaInfosValue; - } - - - export interface MediaMediaInfosValue extends Object { - /** - * Use this for image values. It defines the sourceURL pointing to the image. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - sourceURL: string; - /** - * Used for chart values. An array of strings indicating field names from the specified layer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - fields: string[]; - /** - * Used for chart values. A field used to normalize data. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - normalizationField: string; - /** - * Used for chart values. Defines a new dojo theme, only valid for chart types. View the [Dojox Charting Theme Preview](https://download.dojotoolkit.org/release-1.10.0/dojo-release-1.10.0/dojox/charting/tests/theme_preview.html) to see some of the theme options. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - theme: string; - /** - * Used for chart values. Defines the tooltip display field that displays when hovering over the chart. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#media) - */ - tooltipField: string; - } - interface Portal extends Accessor, Loadable { /** * The access level of the organization. When public, anonymous users can access the organization. When private, access is restricted to only members of the organization. **Possible Values:** public | private - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#access) */ access: string; /** * When `true`, access to the organization's Portal resources must occur over SSL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#allSSL) */ allSSL: boolean; /** - * The authentication mode for handling authentication when the user attempts to access a secure resource. - * + * The authentication mode for handling authentication when the user attempts to access a secure resource. + * * Possible Value | Description * ---------------|------------ * anonymous | An error will be returned when a secure resource is requested. * auto | The user will be signed in when a secure resource is requested. * immediate | The user will be signed in when the Portal is loaded. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#authMode) - * + * * @default auto */ authMode: string; /** * Array of trusted servers to send credentials to when making Cross-Origin Resource Sharing (CORS) requests to access services secured with web-tier authentication. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#authorizedCrossOriginDomains) */ authorizedCrossOriginDomains: string[]; /** * The query that defines the basemaps that should be displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is not true. The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery) */ basemapGalleryGroupQuery: string; /** * The Bing key to use for web maps using Bing Maps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#bingKey) */ bingKey: string; /** * Indicates whether an organization can list applications in the marketplace . - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListApps) */ canListApps: boolean; /** * Indicates whether an organization can list data services in the marketplace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListData) */ canListData: boolean; /** * Indicates whether an organization can list pre-provisioned items in the marketplace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListPreProvisionedItems) */ canListPreProvisionedItems: boolean; /** * Indicates whether an organization can provision direct purchases in the marketplace without customer request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canProvisionDirectPurchase) */ canProvisionDirectPurchase: boolean; /** * When `true`, the organization's public items, groups and users are included in search queries. When `false`, no public items outside of the organization are included. However, public items which are part of the organization are included. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSearchPublic) - * + * * @default true */ canSearchPublic: boolean; /** * The Bing key can be shared to the public and is returned as part of a portal's description call (`/sharing/rest/portals/`). This requires the access of the portal to be set to public. The canShareBingPublic property is not returned publicly but only shown to users within the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canShareBingPublic) - * + * * @default false */ canShareBingPublic: boolean; /** * When `true`, members of the organization can share resources outside the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSharePublic) - * + * * @default false */ canSharePublic: boolean; /** * Indicates whether to allow an organization with an enterprise IDP configured to be able to turn on or off the ArcGIS sign in. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSignInArcGIS) - * + * * @default false */ canSignInArcGIS: boolean; /** * Indicates whether to allow an organization with an enterprise IDP configured to be able to turn on or off the enterprise sign in. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSignInIDP) - * + * * @default false */ canSignInIDP: boolean; /** * The query that identifies the group containing the color sets used for rendering in the map viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#colorSetsGroupQuery) */ colorSetsGroupQuery: string; /** * Indicates whether to allow the organization to disable commenting. When commentsEnabled is false, comments are hidden and not removed. numComments are set to zero for all items in the organization. Calls to add a comment and view comments will fail. If the organization re-enables comments, the comments display and numComments are restored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#commentsEnabled) - * + * * @default false */ commentsEnabled: boolean; /** * Date the organization was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#created) */ created: Date; /** * The default locale (language and country) information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#culture) */ culture: string; /** * The custom base URL for the portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#customBaseUrl) */ customBaseUrl: string; /** * The default basemap to use for the portal. Used in the map viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultBasemap) */ defaultBasemap: Basemap; /** * The default extent to use for the portal. Used in the map viewer. The extent will be in the default basemap's spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultExtent) */ defaultExtent: Extent; /** * The default vector basemap to use for the portal. Used in the map viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultVectorBasemap) */ defaultVectorBasemap: Basemap; /** * A description of the organization/portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#description) */ description: string; /** * Boolean value indicating whether to opt-in to the [Esri User Experience Improvement (EUEI) program](https://doc.arcgis.com/en/arcgis-online/reference/faq.htm#ESRI_QUESTIONANSWER_AED97F28DCD84F7682623C2FA9E5CE49). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#eueiEnabled) - * + * * @default false */ eueiEnabled: boolean; /** * The featured groups for the portal. Returns an array of objects that provide access to the owner and title for each featured group. Each item in this array has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredGroups) */ featuredGroups: PortalFeaturedGroups[]; /** * The query that defines the featured group. If null, then the most viewed items in the organization will be the featured items. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredItemsGroupQuery) */ featuredItemsGroupQuery: string; /** * The query that identifies the group containing features items for the gallery. Set a Group ID or, if null, then the most viewed items in your organization are displayed in the gallery. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#galleryTemplatesGroupQuery) */ galleryTemplatesGroupQuery: string; /** * Indicates whether the organization has content categories. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#hasCategorySchema) - * + * * @default false */ hasCategorySchema: boolean; /** * Helper services provided by the portal. For the detailed information about these services, see the [about utility services](https://server.arcgis.com/en/portal/latest/administer/windows/about-utility-services.htm) topic from the ArcGIS Server documentation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#helperServices) */ helperServices: any; /** * The group that contains featured content to be displayed on the home page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#homePageFeaturedContent) */ homePageFeaturedContent: string; /** * The number of featured items that can be displayed on the home page. The max is 100. Accepts integers only. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#homePageFeaturedContentCount) */ homePageFeaturedContentCount: number; /** * The port used by the portal for HTTP communication. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#httpPort) */ httpPort: number; /** * The port used by the portal for HTTPS communication. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#httpsPort) */ httpsPort: number; /** * The id of the organization that owns this portal. If `null` then this is the default portal for anonymous and non-organizational users. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#id) */ id: string; /** * The country code of the calling IP (ArcGIS Online only). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#ipCntryCode) */ ipCntryCode: string; /** * Indicates whether the portal is an organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#isOrganization) */ readonly isOrganization: boolean; /** * Indicates if the portal is on-premises. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#isPortal) */ isPortal: boolean; /** * The query that identifies the group containing editing templates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#layerTemplatesGroupQuery) */ layerTemplatesGroupQuery: string; /** * Indicates whether the portal's resources have loaded. When `true`, all the properties of the object can be accessed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#loaded) - * + * * @default false */ readonly loaded: boolean; /** * The maximum validity in minutes of tokens issued for users of the organization. -1 is the default and is a special value that indicates infinite timeout or permanent tokens. For tokens granted using OAuth 2.0 authorization grant, it represents the maximum validity of refresh tokens. For access tokens, the maximum validity is the lower of two weeks or this value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#maxTokenExpirationMinutes) */ maxTokenExpirationMinutes: number; /** * Date the organization was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#modified) */ modified: Date; /** * Name of the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#name) */ name: string; /** * URL of the portal host. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalHostname) */ portalHostname: string; /** * The portal mode. **Possible Values:** multitenant | singletenant - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalMode) */ portalMode: string; /** * Properties specific to the organization, for example the "contact us" link. If the organization is public, the properties are visible to the anonymous user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalProperties) */ portalProperties: any; /** * The region for the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region) */ region: string; /** * The REST URL for the portal, for example "https://www.arcgis.com/sharing/rest" for ArcGIS Online and "https://www.example.com/arcgis/sharing/rest" for your in-house portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#restUrl) */ readonly restUrl: string; /** * Custom HTML for the home page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#rotatorPanels) */ rotatorPanels: any[]; /** * Indicates whether the description of your organization displays on the home page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#showHomePageDescription) */ showHomePageDescription: boolean; /** * Indicates whether hosted services are supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#supportsHostedServices) - * + * * @default false */ supportsHostedServices: boolean; /** * The query that defines the symbols sets. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#symbolSetsGroupQuery) */ symbolSetsGroupQuery: string; /** * The query that defines the collection of templates that will appear in the template gallery. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#templatesGroupQuery) */ templatesGroupQuery: string; /** * The URL to the thumbnail of the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#thumbnailUrl) */ readonly thumbnailUrl: string; /** * Sets the units of measure for the organization's users. The user default is derived from the organization's [region](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region). **Possible Values:** english | metric - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#units) */ units: string; /** * The URL to the portal instance. Setting the location of the portal instance via [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) should be used in favor of setting it directly on this property. If using an on-premise portal, the syntax should look similar to: `https://www.example.com/arcgis` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#url) - * + * * @default {@link module:esri/config#portalUrl esriConfig.portalUrl} */ url: string; /** * The prefix selected by the organization's administrator to be used with the customBaseURL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#urlKey) */ urlKey: string; /** * Information representing a registered user of the portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#user) */ user: PortalUser; /** * When `true`, only simple where clauses that are compliant with SQL92 can be used when querying layers and tables. The recommended security setting is true. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useStandardizedQuery) */ useStandardizedQuery: boolean; /** * When `true`, the organization has opted in to use the vector tile basemaps, and (a) [vectorBasemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery) should be used instead of [basemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery), while (b) [defaultVectorBasemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultVectorBasemap) should be used instead of [defaultBasemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultBasemap). The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method automatically uses vectorBasemapGalleryGroupQuery. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) */ useVectorBasemaps: boolean; /** * The query that defines the vector tiles basemaps that should be displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is true. The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery) */ vectorBasemapGalleryGroupQuery: string; /** * Fetches the [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) that are displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html). When [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is `true`, the basemaps will be based on [vectorBasemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery), and otherwise on [basemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) - * + * * @param basemapGalleryGroupQuery When provided, this argument is used to fetch basemaps based on input query parameters. - * + * */ fetchBasemaps(basemapGalleryGroupQuery?: string): IPromise; /** * If present, fetches the organization's category schema. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchCategorySchema) - * - * + * + * */ fetchCategorySchema(): IPromise; /** * Fetches the featured groups in the Portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchFeaturedGroups) - * - * + * + * */ fetchFeaturedGroups(): IPromise; /** * Fetches and returns the associated regions with the portal instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchRegions) - * - * + * + * */ fetchRegions(): IPromise; /** * Executes a query against the Portal to return an array of [PortalGroup](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html) objects that match the input query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryGroups) - * + * * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). - * + * */ queryGroups(queryParams: PortalQueryParams | PortalQueryParamsProperties): IPromise; /** * Executes a query against the Portal to return an array of [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html) objects that match the input query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryItems) - * + * * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). - * + * */ queryItems(queryParams: PortalQueryParams | PortalQueryParamsProperties): IPromise; /** * Executes a query against the Portal to return an array of [PortalUser](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html) objects that match the input query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryUsers) - * + * * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). - * + * */ queryUsers(queryParams: PortalQueryParams | PortalQueryParamsProperties): IPromise; } @@ -15761,19 +16251,18 @@ declare namespace __esri { interface PortalConstructor { /** * The Portal class is part of the [ArcGIS Enterprise portal](https://enterprise.arcgis.com/en/portal/) that provides a way to build applications that work with content from [ArcGIS Online](http://www.arcgis.com/home/) or an [ArcGIS Enterprise portal](https://enterprise.arcgis.com/en/portal/). [ArcGIS Enterprise](https://enterprise.arcgis.com/en/portal/) is software from Esri that customers can deploy either on-premises or in the cloud. [ArcGIS Online](http://www.arcgis.com/home/) is Esri's Software as a Service offering that represents GIS as a Service and is implemented using the same technology as ArcGIS Enterprise. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) */ - new(properties?: PortalProperties): Portal; - + new (properties?: PortalProperties): Portal; /** * Returns a cached default Portal instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#getDefault) - * - * + * + * */ getDefault(): Portal; } @@ -15783,388 +16272,387 @@ declare namespace __esri { interface PortalProperties extends LoadableProperties { /** * The access level of the organization. When public, anonymous users can access the organization. When private, access is restricted to only members of the organization. **Possible Values:** public | private - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#access) */ access?: string; /** * When `true`, access to the organization's Portal resources must occur over SSL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#allSSL) */ allSSL?: boolean; /** - * The authentication mode for handling authentication when the user attempts to access a secure resource. - * + * The authentication mode for handling authentication when the user attempts to access a secure resource. + * * Possible Value | Description * ---------------|------------ * anonymous | An error will be returned when a secure resource is requested. * auto | The user will be signed in when a secure resource is requested. * immediate | The user will be signed in when the Portal is loaded. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#authMode) - * + * * @default auto */ authMode?: string; /** * Array of trusted servers to send credentials to when making Cross-Origin Resource Sharing (CORS) requests to access services secured with web-tier authentication. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#authorizedCrossOriginDomains) */ authorizedCrossOriginDomains?: string[]; /** * The query that defines the basemaps that should be displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is not true. The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery) */ basemapGalleryGroupQuery?: string; /** * The Bing key to use for web maps using Bing Maps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#bingKey) */ bingKey?: string; /** * Indicates whether an organization can list applications in the marketplace . - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListApps) */ canListApps?: boolean; /** * Indicates whether an organization can list data services in the marketplace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListData) */ canListData?: boolean; /** * Indicates whether an organization can list pre-provisioned items in the marketplace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canListPreProvisionedItems) */ canListPreProvisionedItems?: boolean; /** * Indicates whether an organization can provision direct purchases in the marketplace without customer request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canProvisionDirectPurchase) */ canProvisionDirectPurchase?: boolean; /** * When `true`, the organization's public items, groups and users are included in search queries. When `false`, no public items outside of the organization are included. However, public items which are part of the organization are included. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSearchPublic) - * + * * @default true */ canSearchPublic?: boolean; /** * The Bing key can be shared to the public and is returned as part of a portal's description call (`/sharing/rest/portals/`). This requires the access of the portal to be set to public. The canShareBingPublic property is not returned publicly but only shown to users within the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canShareBingPublic) - * + * * @default false */ canShareBingPublic?: boolean; /** * When `true`, members of the organization can share resources outside the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSharePublic) - * + * * @default false */ canSharePublic?: boolean; /** * Indicates whether to allow an organization with an enterprise IDP configured to be able to turn on or off the ArcGIS sign in. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSignInArcGIS) - * + * * @default false */ canSignInArcGIS?: boolean; /** * Indicates whether to allow an organization with an enterprise IDP configured to be able to turn on or off the enterprise sign in. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#canSignInIDP) - * + * * @default false */ canSignInIDP?: boolean; /** * The query that identifies the group containing the color sets used for rendering in the map viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#colorSetsGroupQuery) */ colorSetsGroupQuery?: string; /** * Indicates whether to allow the organization to disable commenting. When commentsEnabled is false, comments are hidden and not removed. numComments are set to zero for all items in the organization. Calls to add a comment and view comments will fail. If the organization re-enables comments, the comments display and numComments are restored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#commentsEnabled) - * + * * @default false */ commentsEnabled?: boolean; /** * Date the organization was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#created) */ created?: DateProperties; /** * The default locale (language and country) information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#culture) */ culture?: string; /** * The custom base URL for the portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#customBaseUrl) */ customBaseUrl?: string; /** * The default basemap to use for the portal. Used in the map viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultBasemap) */ defaultBasemap?: BasemapProperties; /** * The default extent to use for the portal. Used in the map viewer. The extent will be in the default basemap's spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultExtent) */ defaultExtent?: ExtentProperties; /** * The default vector basemap to use for the portal. Used in the map viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultVectorBasemap) */ defaultVectorBasemap?: BasemapProperties; /** * A description of the organization/portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#description) */ description?: string; /** * Boolean value indicating whether to opt-in to the [Esri User Experience Improvement (EUEI) program](https://doc.arcgis.com/en/arcgis-online/reference/faq.htm#ESRI_QUESTIONANSWER_AED97F28DCD84F7682623C2FA9E5CE49). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#eueiEnabled) - * + * * @default false */ eueiEnabled?: boolean; /** * The featured groups for the portal. Returns an array of objects that provide access to the owner and title for each featured group. Each item in this array has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredGroups) */ featuredGroups?: PortalFeaturedGroups[]; /** * The query that defines the featured group. If null, then the most viewed items in the organization will be the featured items. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredItemsGroupQuery) */ featuredItemsGroupQuery?: string; /** * The query that identifies the group containing features items for the gallery. Set a Group ID or, if null, then the most viewed items in your organization are displayed in the gallery. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#galleryTemplatesGroupQuery) */ galleryTemplatesGroupQuery?: string; /** * Indicates whether the organization has content categories. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#hasCategorySchema) - * + * * @default false */ hasCategorySchema?: boolean; /** * Helper services provided by the portal. For the detailed information about these services, see the [about utility services](https://server.arcgis.com/en/portal/latest/administer/windows/about-utility-services.htm) topic from the ArcGIS Server documentation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#helperServices) */ helperServices?: any; /** * The group that contains featured content to be displayed on the home page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#homePageFeaturedContent) */ homePageFeaturedContent?: string; /** * The number of featured items that can be displayed on the home page. The max is 100. Accepts integers only. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#homePageFeaturedContentCount) */ homePageFeaturedContentCount?: number; /** * The port used by the portal for HTTP communication. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#httpPort) */ httpPort?: number; /** * The port used by the portal for HTTPS communication. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#httpsPort) */ httpsPort?: number; /** * The id of the organization that owns this portal. If `null` then this is the default portal for anonymous and non-organizational users. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#id) */ id?: string; /** * The country code of the calling IP (ArcGIS Online only). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#ipCntryCode) */ ipCntryCode?: string; /** * Indicates if the portal is on-premises. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#isPortal) */ isPortal?: boolean; /** * The query that identifies the group containing editing templates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#layerTemplatesGroupQuery) */ layerTemplatesGroupQuery?: string; /** * The maximum validity in minutes of tokens issued for users of the organization. -1 is the default and is a special value that indicates infinite timeout or permanent tokens. For tokens granted using OAuth 2.0 authorization grant, it represents the maximum validity of refresh tokens. For access tokens, the maximum validity is the lower of two weeks or this value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#maxTokenExpirationMinutes) */ maxTokenExpirationMinutes?: number; /** * Date the organization was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#modified) */ modified?: DateProperties; /** * Name of the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#name) */ name?: string; /** * URL of the portal host. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalHostname) */ portalHostname?: string; /** * The portal mode. **Possible Values:** multitenant | singletenant - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalMode) */ portalMode?: string; /** * Properties specific to the organization, for example the "contact us" link. If the organization is public, the properties are visible to the anonymous user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#portalProperties) */ portalProperties?: any; /** * The region for the organization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region) */ region?: string; /** * Custom HTML for the home page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#rotatorPanels) */ rotatorPanels?: any[]; /** * Indicates whether the description of your organization displays on the home page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#showHomePageDescription) */ showHomePageDescription?: boolean; /** * Indicates whether hosted services are supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#supportsHostedServices) - * + * * @default false */ supportsHostedServices?: boolean; /** * The query that defines the symbols sets. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#symbolSetsGroupQuery) */ symbolSetsGroupQuery?: string; /** * The query that defines the collection of templates that will appear in the template gallery. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#templatesGroupQuery) */ templatesGroupQuery?: string; /** * Sets the units of measure for the organization's users. The user default is derived from the organization's [region](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region). **Possible Values:** english | metric - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#units) */ units?: string; /** * The URL to the portal instance. Setting the location of the portal instance via [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) should be used in favor of setting it directly on this property. If using an on-premise portal, the syntax should look similar to: `https://www.example.com/arcgis` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#url) - * + * * @default {@link module:esri/config#portalUrl esriConfig.portalUrl} */ url?: string; /** * The prefix selected by the organization's administrator to be used with the customBaseURL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#urlKey) */ urlKey?: string; /** * Information representing a registered user of the portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#user) */ user?: PortalUserProperties; /** * When `true`, only simple where clauses that are compliant with SQL92 can be used when querying layers and tables. The recommended security setting is true. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useStandardizedQuery) */ useStandardizedQuery?: boolean; /** * When `true`, the organization has opted in to use the vector tile basemaps, and (a) [vectorBasemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery) should be used instead of [basemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery), while (b) [defaultVectorBasemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultVectorBasemap) should be used instead of [defaultBasemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultBasemap). The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method automatically uses vectorBasemapGalleryGroupQuery. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) */ useVectorBasemaps?: boolean; /** * The query that defines the vector tiles basemaps that should be displayed in the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is true. The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery) */ vectorBasemapGalleryGroupQuery?: string; } - export interface PortalFeaturedGroups extends Object { /** * Name of the group owner. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredGroups) */ owner: string; /** * Group title. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#featuredGroups) */ title: string; @@ -16173,40 +16661,38 @@ declare namespace __esri { interface PortalFolder extends Accessor { /** * The date the folder was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#created) */ created: Date; /** * The unique id of the folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#id) */ id: string; /** * The portal associated with the folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#portal) */ portal: Portal; /** * The title of the folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#title) */ title: string; /** * The URL to the folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#url) */ readonly url: string; } interface PortalFolderConstructor { - - - new(properties?: PortalFolderProperties): PortalFolder; + new (properties?: PortalFolderProperties): PortalFolder; } export const PortalFolder: PortalFolderConstructor; @@ -16214,25 +16700,25 @@ declare namespace __esri { interface PortalFolderProperties { /** * The date the folder was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#created) */ created?: DateProperties; /** * The unique id of the folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#id) */ id?: string; /** * The portal associated with the folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#portal) */ portal?: PortalProperties; /** * The title of the folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalFolder.html#title) */ title?: string; @@ -16241,125 +16727,123 @@ declare namespace __esri { interface PortalGroup extends Accessor { /** * The access privileges on the group which determines who can see and access the group. **Possible Values:** private | org | public - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#access) */ access: string; /** * The date the group was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#created) */ created: Date; /** * A detailed description of the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#description) */ description: string; /** * The unique id for the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#id) */ id: string; /** * If set to `true`, then users will not be able to apply to join the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#isInvitationOnly) - * + * * @default false */ isInvitationOnly: boolean; /** * The date the group was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#modified) */ modified: Date; /** * The username of the group's owner. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#owner) */ owner: string; /** * The portal associated with the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#portal) */ portal: Portal; /** * A short summary that describes the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#snippet) */ snippet: string; /** * User defined tags that describe the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#tags) */ tags: string[]; /** * The URL to the thumbnail used for the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#thumbnailUrl) */ readonly thumbnailUrl: string; /** * The title of the group. This is the name that is displayed to users. It is also used to refer to the group. Every group must have a title and it must be unique. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#title) */ title: string; /** * The URL to the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#url) */ readonly url: string; /** * If present, fetches the group's category schema. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#fetchCategorySchema) - * - * + * + * */ fetchCategorySchema(): IPromise; /** * Fetches the current members of the group. This method is only available to members or administrators of the group. View the ArcGIS REST API documentation for the [Group Users](https://developers.arcgis.com/rest/users-groups-and-items/group-users.htm) for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#fetchMembers) - * - * + * + * */ fetchMembers(): IPromise; /** * Get the URL to the thumbnail image for the group. Available width sizes: 150, 300 and 600. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#getThumbnailUrl) - * + * * @param width The desired image width. - * + * */ getThumbnailUrl(width?: number): string; /** * Executes a query against the group to return an array of [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html) objects that match the input query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems) - * + * * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). - * + * */ queryItems(queryParams?: PortalQueryParams | PortalQueryParamsProperties): IPromise; } interface PortalGroupConstructor { - - - new(properties?: PortalGroupProperties): PortalGroup; + new (properties?: PortalGroupProperties): PortalGroup; } export const PortalGroup: PortalGroupConstructor; @@ -16367,69 +16851,69 @@ declare namespace __esri { interface PortalGroupProperties { /** * The access privileges on the group which determines who can see and access the group. **Possible Values:** private | org | public - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#access) */ access?: string; /** * The date the group was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#created) */ created?: DateProperties; /** * A detailed description of the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#description) */ description?: string; /** * The unique id for the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#id) */ id?: string; /** * If set to `true`, then users will not be able to apply to join the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#isInvitationOnly) - * + * * @default false */ isInvitationOnly?: boolean; /** * The date the group was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#modified) */ modified?: DateProperties; /** * The username of the group's owner. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#owner) */ owner?: string; /** * The portal associated with the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#portal) */ portal?: PortalProperties; /** * A short summary that describes the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#snippet) */ snippet?: string; /** * User defined tags that describe the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#tags) */ tags?: string[]; /** * The title of the group. This is the name that is displayed to users. It is also used to refer to the group. Every group must have a title and it must be unique. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#title) */ title?: string; @@ -16438,288 +16922,286 @@ declare namespace __esri { interface PortalItem extends Accessor, Loadable, JSONSupport { /** * Indicates the level of access to this item: `private`, `shared`, `org`, or `public`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#access) */ access: string; /** * Information on the source of the item and its copyright status. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#accessInformation) */ accessInformation: string; /** * Contains an array of objects containing proxy information for premium platform services. This is most widely seen in registered applications that work with premium and subscriber services, e.g. routing and analysis services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies) */ readonly applicationProxies: PortalItemApplicationProxies[]; /** * Average rating. Uses a weighted average called "Bayesian average." - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#avgRating) */ avgRating: number; /** * An array of organization categories that are set on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#categories) */ categories: string[]; /** * The date the item was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#created) */ created: Date; /** * The item's locale information (language and country). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#culture) */ culture: string; /** * The detailed description of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#description) */ description: string; /** * The geographic extent, or bounding rectangle, of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#extent) */ extent: Extent; /** * An array of group categories set on the item. This varies slightly from `categories` as it only returns categories in the group content returned from [PortalGroup.queryItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#groupCategories) */ groupCategories: string[]; /** * The unique id for the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#id) */ id: string; /** * Indicates whether a layer can be created from this item using [Layer.fromPortalItem()](esri-layers-Layer.html#fromPortalItem). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#isLayer) */ readonly isLayer: boolean; /** - * Indicates whether an item can be updated and deleted. - * + * Indicates whether an item can be updated and deleted. + * * Possible Value | Description * ---------------|------------ * admin | The item can be updated or deleted. * update | The item can be updated, but not deleted. * null | The item cannot be updated nor deleted. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#itemControl) */ readonly itemControl: string; /** * The URL to the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#itemUrl) */ readonly itemUrl: string; /** * Information on license or restrictions related to the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#licenseInfo) */ licenseInfo: string; /** * Indicates whether the item's resources have loaded from the portal. When `true`, all the properties of the object can be accessed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#loaded) - * + * * @default false */ readonly loaded: boolean; /** * The date the item was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#modified) */ modified: Date; /** * The name of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#name) */ name: string; /** * Number of comments on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numComments) */ numComments: number; /** * Number of ratings on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numRatings) */ numRatings: number; /** * Number of views on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numViews) */ numViews: number; /** * The username of the user who owns this item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#owner) */ owner: string; /** * The portal that contains the item. Defaults to the value in [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) (e.g. https://www.arcgis.com). Suggested to use [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) instead of this property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#portal) */ portal: Portal; /** * An array of string URLs. These URLs should point to screenshots (i.e. screen captures) associated with an application. An example value could be something similar to `"screenshots/Basic.png"`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#screenshots) - * + * * @default null */ screenshots: string[]; /** * The size of the item (in bytes). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#size) */ size: number; /** * A summary description of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#snippet) */ snippet: string; /** * User defined tags that describe the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#tags) */ tags: string[]; /** * The URL to the thumbnail used for the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#thumbnailUrl) */ readonly thumbnailUrl: string; /** * The title for the item. This is the name that is displayed to users and used to refer to the item. Every item must have a title. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#title) */ title: string; /** * The GIS content type of this item. Example types include Web Map, Map Service, Shapefile, and Web Mapping Application. See the [ArcGIS REST API Items and Items Types Reference](https://developers.arcgis.com/rest/users-groups-and-items/items-and-item-types.htm) to get an understanding of the item type hierarchy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#type) */ type: string; /** * Type keywords that describe the type of content of this item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#typeKeywords) */ typeKeywords: string[]; /** * The service URL of this item. Only certain layer item types such as "Feature Service", "Map Service", "Image Service", "Scene Service", "WMS" and "KML" have service URLs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#url) */ url: string; /** * Adds a rating to an accessible item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#addRating) - * + * * @param rating Rating to set for the item. Rating must be a number between 1.0 and 5.0. - * + * */ addRating(rating: number | PortalRating): IPromise; /** * Deletes a rating for the specified item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#deleteRating) - * - * + * + * */ deleteRating(): IPromise; /** * Requests a PortalItem in the format specified in `responseType`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchData) - * + * * @param responseType The format of the response. **Possible Values:** json | xml | text | blob | array-buffer | document - * + * */ fetchData(responseType?: string): IPromise; /** * Returns the rating (if any) given to the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchRating) - * - * + * + * */ fetchRating(): IPromise; /** * Gets all the related items of a certain relationship type for the portal item. An optional direction can be specified if the direction of the relationship is ambiguous. Otherwise, the service will try to infer it. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchRelatedItems) - * + * * @param params See the object specifications table below for the parameters that may be passed as properties in this object. * @param params.relationshipType The type of relationship between the two items. See [Relationship types](https://developers.arcgis.com/rest/users-groups-and-items/relationship-types.htm) for a complete listing of types. * @param params.direction The direction of the relationship. Can either be `forward` (from origin to destination) or `reverse` (from destination to origin). **Possible Values:** forward | reverse - * + * */ fetchRelatedItems(params: PortalItemFetchRelatedItemsParams): IPromise; /** * Get the URL to the thumbnail image for the item. Available width sizes: 200, 400, 800 and 2400. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#getThumbnailUrl) - * + * * @param width The desired image width. - * + * */ getThumbnailUrl(width?: number): string; /** * Updates the item's properties to the portal, and optionally its data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#update) - * + * * @param params See the object specifications table below for the parameters that may be passed as properties in this object. * @param params.data **Optional**. The component used to stream the data represented by the item to the client. - * + * */ update(params?: PortalItemUpdateParams): IPromise; /** * Updates the item's thumbnail on the portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#updateThumbnail) - * + * * @param params See the object specification table below for the parameters that may be passed as properties in this object. * @param params.thumbnail A URL, Data URI, Blob, or File. The accepted formats are `GIF`, `JPG`, and `PNG`. - * + * */ updateThumbnail(params: PortalItemUpdateThumbnailParams): IPromise; } interface PortalItemConstructor { - - - new(properties?: PortalItemProperties): PortalItem; + new (properties?: PortalItemProperties): PortalItem; fromJSON(json: any): PortalItem; } @@ -16729,217 +17211,213 @@ declare namespace __esri { interface PortalItemProperties extends LoadableProperties { /** * Indicates the level of access to this item: `private`, `shared`, `org`, or `public`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#access) */ access?: string; /** * Information on the source of the item and its copyright status. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#accessInformation) */ accessInformation?: string; /** * Average rating. Uses a weighted average called "Bayesian average." - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#avgRating) */ avgRating?: number; /** * An array of organization categories that are set on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#categories) */ categories?: string[]; /** * The date the item was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#created) */ created?: DateProperties; /** * The item's locale information (language and country). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#culture) */ culture?: string; /** * The detailed description of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#description) */ description?: string; /** * The geographic extent, or bounding rectangle, of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#extent) */ extent?: ExtentProperties; /** * An array of group categories set on the item. This varies slightly from `categories` as it only returns categories in the group content returned from [PortalGroup.queryItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#groupCategories) */ groupCategories?: string[]; /** * The unique id for the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#id) */ id?: string; /** * Information on license or restrictions related to the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#licenseInfo) */ licenseInfo?: string; /** * The date the item was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#modified) */ modified?: DateProperties; /** * The name of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#name) */ name?: string; /** * Number of comments on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numComments) */ numComments?: number; /** * Number of ratings on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numRatings) */ numRatings?: number; /** * Number of views on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#numViews) */ numViews?: number; /** * The username of the user who owns this item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#owner) */ owner?: string; /** * The portal that contains the item. Defaults to the value in [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) (e.g. https://www.arcgis.com). Suggested to use [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) instead of this property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#portal) */ portal?: PortalProperties; /** * An array of string URLs. These URLs should point to screenshots (i.e. screen captures) associated with an application. An example value could be something similar to `"screenshots/Basic.png"`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#screenshots) - * + * * @default null */ screenshots?: string[]; /** * The size of the item (in bytes). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#size) */ size?: number; /** * A summary description of the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#snippet) */ snippet?: string; /** * User defined tags that describe the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#tags) */ tags?: string[]; /** * The title for the item. This is the name that is displayed to users and used to refer to the item. Every item must have a title. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#title) */ title?: string; /** * The GIS content type of this item. Example types include Web Map, Map Service, Shapefile, and Web Mapping Application. See the [ArcGIS REST API Items and Items Types Reference](https://developers.arcgis.com/rest/users-groups-and-items/items-and-item-types.htm) to get an understanding of the item type hierarchy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#type) */ type?: string; /** * Type keywords that describe the type of content of this item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#typeKeywords) */ typeKeywords?: string[]; /** * The service URL of this item. Only certain layer item types such as "Feature Service", "Map Service", "Image Service", "Scene Service", "WMS" and "KML" have service URLs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#url) */ url?: string; } - export interface PortalItemApplicationProxies extends Object { /** * The URL of the premium map service layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies) */ sourceUrl: string; /** * The proxy URL for the source URL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies) */ proxyUrl: string; /** * The proxy ID registered in ArcGIS Online or ArcGIS Enterprise Portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#applicationProxies) */ proxyId: string; } - export interface PortalItemFetchRelatedItemsParams extends Object { /** * The type of relationship between the two items. See [Relationship types](https://developers.arcgis.com/rest/users-groups-and-items/relationship-types.htm) for a complete listing of types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchRelatedItems) */ relationshipType: string; /** * The direction of the relationship. Can either be `forward` (from origin to destination) or `reverse` (from destination to origin). **Possible Values:** forward | reverse - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#fetchRelatedItems) */ direction?: string; } - export interface PortalItemUpdateParams extends Object { /** * **Optional**. The component used to stream the data represented by the item to the client. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#update) */ data: string | any; } - export interface PortalItemUpdateThumbnailParams extends Object { /** * A URL, Data URI, Blob, or File. The accepted formats are `GIF`, `JPG`, and `PNG`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#updateThumbnail) */ thumbnail: Blob | string; @@ -16950,37 +17428,37 @@ declare namespace __esri { * An array of categories stored within the item. Use this property to filter the results from [Portal.queryItems()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryItems) and [PortalGroup.queryItems()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems). It accepts an array of: * * individual string elements or * * an array of strings. - * - * - * The query looks at each element within the array and performs a SQL `AND` operation on them. If the element is an array instead of a single string element, the elements within this array are read as `OR`. See the snippet below: + * + * + * The query looks at each element within the array and performs a SQL `AND` operation on them. If the element is an array instead of a single string element, the elements within this array are read as `OR`. See the snippet below: * > Note: String[] elements are only supported by [ArcGIS Online](http://doc.arcgis.com/en/arcgis-online/reference/what-is-agol.htm) and version 10.6.1 of [Portal for ArcGIS Enterprise](https://enterprise.arcgis.com/en/portal/). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#categories) */ categories: (string | string[])[]; /** * Only relevant when querying for [PortalItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html). When specified, restricts the results of the query to the extent defined here. The [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#spatialReference) of the given extent must be WGS84 (wkid 4326) or Web Mercator (wkid 3857). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#extent) */ extent: Extent; /** * The maximum number of results to be included in the [result](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#results) set response. The maximum value allowed is `100`. The [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) property combined with the `num` property can be used to paginate the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#num) - * + * * @default 10 */ num: number; /** * The query string used for the search. View the [ArcGIS REST API Search Reference](https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm) for details on constructing a valid query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#query) */ query: string; /** - * A comma-delimited list of fields to sort. Field names may vary depending on what is being queried. For example, the fields allowed for a user query are much more limited than if performing a basic search query for portal items. A list of possible field names is listed below. These names correspond to either item (search), group, and/or user queries. - * + * A comma-delimited list of fields to sort. Field names may vary depending on what is being queried. For example, the fields allowed for a user query are much more limited than if performing a basic search query for portal items. A list of possible field names is listed below. These names correspond to either item (search), group, and/or user queries. + * * Field name | Query functionality * ---------------|------------ * title | search, group @@ -16994,48 +17472,46 @@ declare namespace __esri { * num-ratings | search * num-comments | search * num-views | search - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#sortField) */ sortField: string; /** - * The order in which to sort the results. - * + * The order in which to sort the results. + * * Possible Value | Description * ---------------|------------ * asc | Sort the results in ascending order. * desc | Sort the results in descending order. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#sortOrder) - * + * * @default asc */ sortOrder: string; /** * The index of the first entry in the result set response. The index is 1-based. The [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) property, along with the [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#num) property can be used to paginate the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) - * + * * @default 1 */ start: number; /** * Creates a deep clone of the instance of PortalQueryParams that calls this method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#clone) - * - * + * + * */ clone(): PortalQueryParams; } interface PortalQueryParamsConstructor { - - - new(properties?: PortalQueryParamsProperties): PortalQueryParams; + new (properties?: PortalQueryParamsProperties): PortalQueryParams; } export const PortalQueryParams: PortalQueryParamsConstructor; @@ -17045,37 +17521,37 @@ declare namespace __esri { * An array of categories stored within the item. Use this property to filter the results from [Portal.queryItems()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#queryItems) and [PortalGroup.queryItems()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html#queryItems). It accepts an array of: * * individual string elements or * * an array of strings. - * - * - * The query looks at each element within the array and performs a SQL `AND` operation on them. If the element is an array instead of a single string element, the elements within this array are read as `OR`. See the snippet below: + * + * + * The query looks at each element within the array and performs a SQL `AND` operation on them. If the element is an array instead of a single string element, the elements within this array are read as `OR`. See the snippet below: * > Note: String[] elements are only supported by [ArcGIS Online](http://doc.arcgis.com/en/arcgis-online/reference/what-is-agol.htm) and version 10.6.1 of [Portal for ArcGIS Enterprise](https://enterprise.arcgis.com/en/portal/). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#categories) */ categories?: (string | string[])[]; /** * Only relevant when querying for [PortalItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html). When specified, restricts the results of the query to the extent defined here. The [spatial reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#spatialReference) of the given extent must be WGS84 (wkid 4326) or Web Mercator (wkid 3857). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#extent) */ extent?: ExtentProperties; /** * The maximum number of results to be included in the [result](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#results) set response. The maximum value allowed is `100`. The [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) property combined with the `num` property can be used to paginate the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#num) - * + * * @default 10 */ num?: number; /** * The query string used for the search. View the [ArcGIS REST API Search Reference](https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm) for details on constructing a valid query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#query) */ query?: string; /** - * A comma-delimited list of fields to sort. Field names may vary depending on what is being queried. For example, the fields allowed for a user query are much more limited than if performing a basic search query for portal items. A list of possible field names is listed below. These names correspond to either item (search), group, and/or user queries. - * + * A comma-delimited list of fields to sort. Field names may vary depending on what is being queried. For example, the fields allowed for a user query are much more limited than if performing a basic search query for portal items. A list of possible field names is listed below. These names correspond to either item (search), group, and/or user queries. + * * Field name | Query functionality * ---------------|------------ * title | search, group @@ -17089,30 +17565,30 @@ declare namespace __esri { * num-ratings | search * num-comments | search * num-views | search - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#sortField) */ sortField?: string; /** - * The order in which to sort the results. - * + * The order in which to sort the results. + * * Possible Value | Description * ---------------|------------ * asc | Sort the results in ascending order. * desc | Sort the results in descending order. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#sortOrder) - * + * * @default asc */ sortOrder?: string; /** * The index of the first entry in the result set response. The index is 1-based. The [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) property, along with the [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#num) property can be used to paginate the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#start) - * + * * @default 1 */ start?: number; @@ -17121,34 +17597,32 @@ declare namespace __esri { interface PortalQueryResult extends Accessor { /** * The query parameters for the next set of results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#nextQueryParams) */ nextQueryParams: PortalQueryParams; /** * The query parameters for the first set of results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#queryParams) */ queryParams: PortalQueryParams; /** * An array of result item objects. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#results) */ results: any[]; /** * The total number of results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#total) */ total: number; } interface PortalQueryResultConstructor { - - - new(properties?: PortalQueryResultProperties): PortalQueryResult; + new (properties?: PortalQueryResultProperties): PortalQueryResult; } export const PortalQueryResult: PortalQueryResultConstructor; @@ -17156,25 +17630,25 @@ declare namespace __esri { interface PortalQueryResultProperties { /** * The query parameters for the next set of results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#nextQueryParams) */ nextQueryParams?: PortalQueryParamsProperties; /** * The query parameters for the first set of results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#queryParams) */ queryParams?: PortalQueryParamsProperties; /** * An array of result item objects. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#results) */ results?: any[]; /** * The total number of results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html#total) */ total?: number; @@ -17183,22 +17657,20 @@ declare namespace __esri { interface PortalRating extends Accessor { /** * Date the rating was added to the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalRating.html#created) */ created: Date; /** * A rating between 1.0 and 5.0 for the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalRating.html#rating) */ rating: number; } interface PortalRatingConstructor { - - - new(properties?: PortalRatingProperties): PortalRating; + new (properties?: PortalRatingProperties): PortalRating; } export const PortalRating: PortalRatingConstructor; @@ -17206,13 +17678,13 @@ declare namespace __esri { interface PortalRatingProperties { /** * Date the rating was added to the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalRating.html#created) */ created?: DateProperties; /** * A rating between 1.0 and 5.0 for the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalRating.html#rating) */ rating?: number; @@ -17221,189 +17693,187 @@ declare namespace __esri { interface PortalUser extends Accessor { /** * Indicates the level of access of the user. If private, the user descriptive information will not be available to others nor will the username be searchable. **Possible Values:** private | org | public - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#access) */ access: string; /** * The date the user was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#created) */ created: Date; /** * The culture information for the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#culture) */ culture: string; /** * A description of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#description) */ description: string; /** * The user's e-mail address. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#email) */ email: string; /** * The user's full name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fullName) */ fullName: string; /** * The date the user was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#modified) */ modified: Date; /** * The ID of the organization the user belongs to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#orgId) */ orgId: string; /** * The portal associated with the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#portal) */ portal: Portal; /** * The user's preferred view for content, either web or GIS. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#preferredView) */ preferredView: string; /** * The user preferred region, used to set the featured maps on the home page, content in the gallery, and the default extent of new maps in the Viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#region) */ region: string; /** * Defines the user's role in the organization. See [roleId](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) for more details about when user has a custom role. **Possible Values:** org_admin | org_publisher | org_user - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) */ role: string; /** * The ID of the user's role. Only set if the user is assigned a custom role. When present, the [role](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) will indicate the "base" role of the custom role based on the privileges the custom role contains. For example, if the custom role contains some publisher privileges, the [role](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) will be set to `org_publisher`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) */ roleId: string; /** * The URL to the thumbnail image for the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#thumbnailUrl) */ readonly thumbnailUrl: string; /** * The user's personal units of measure setting. **Possible Values:** english | metric - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#units) */ units: string; /** * The URL for the user's content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#userContentUrl) */ readonly userContentUrl: string; /** * The username of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#username) */ username: string; /** * Adds an item to the user's portal content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) - * + * * @param params See the object specifications table below for the parameters that may be passed as properties in this object. * @param params.item The item to add to the user's content. * @param params.data The component used to stream the data represented by the item to the client. * @param params.folder The portal folder in which to store the item. - * + * */ addItem(params: PortalUserAddItemParams): IPromise; /** * Deletes an item from the user's portal content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#deleteItem) - * + * * @param item The portal item to remove. - * + * */ deleteItem(item: PortalItem): IPromise; /** * Deletes items from the user's portal content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#deleteItems) - * + * * @param items The portal items to remove. - * + * */ deleteItems(items: PortalItem[]): IPromise; /** * Fetches all of the user's folders used to organize portal content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchFolders) - * - * + * + * */ fetchFolders(): IPromise; /** * Fetches all the groups that the portal user has permission to access. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchGroups) - * - * + * + * */ fetchGroups(): IPromise; /** * Retrieves all the items in the specified folder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchItems) - * + * * @param params See the object specifications table below for the parameters that may be passed as properties in this object. * @param params.folder The folder to retrieve items from. * @param params.num The maximum number of results to be included in the result set response. The maximum value allowed is 100. The start property combined with the num property can be used to paginate the search results. * @param params.start The index of the first entry in the result set response. The index is 1-based. - * + * */ fetchItems(params?: PortalUserFetchItemsParams): IPromise; /** * Get the URL to the thumbnail image for the user. Available width sizes: 150, 300 and 600. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#getThumbnailUrl) - * + * * @param width The desired image width. - * + * */ getThumbnailUrl(width?: number): string; /** * Executes a query against the user's favorite group to return an array of [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html) objects that match the input query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#queryFavorites) - * + * * @param queryParams The input query parameters defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html). This object may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/). - * + * */ queryFavorites(queryParams?: PortalQueryParams): IPromise; } interface PortalUserConstructor { - - - new(properties?: PortalUserProperties): PortalUser; + new (properties?: PortalUserProperties): PortalUser; } export const PortalUser: PortalUserConstructor; @@ -17411,139 +17881,137 @@ declare namespace __esri { interface PortalUserProperties { /** * Indicates the level of access of the user. If private, the user descriptive information will not be available to others nor will the username be searchable. **Possible Values:** private | org | public - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#access) */ access?: string; /** * The date the user was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#created) */ created?: DateProperties; /** * The culture information for the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#culture) */ culture?: string; /** * A description of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#description) */ description?: string; /** * The user's e-mail address. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#email) */ email?: string; /** * The user's full name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fullName) */ fullName?: string; /** * The date the user was last modified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#modified) */ modified?: DateProperties; /** * The ID of the organization the user belongs to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#orgId) */ orgId?: string; /** * The portal associated with the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#portal) */ portal?: PortalProperties; /** * The user's preferred view for content, either web or GIS. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#preferredView) */ preferredView?: string; /** * The user preferred region, used to set the featured maps on the home page, content in the gallery, and the default extent of new maps in the Viewer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#region) */ region?: string; /** * Defines the user's role in the organization. See [roleId](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) for more details about when user has a custom role. **Possible Values:** org_admin | org_publisher | org_user - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) */ role?: string; /** * The ID of the user's role. Only set if the user is assigned a custom role. When present, the [role](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) will indicate the "base" role of the custom role based on the privileges the custom role contains. For example, if the custom role contains some publisher privileges, the [role](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#role) will be set to `org_publisher`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#roleId) */ roleId?: string; /** * The user's personal units of measure setting. **Possible Values:** english | metric - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#units) */ units?: string; /** * The username of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#username) */ username?: string; } - export interface PortalUserAddItemParams extends Object { /** * The item to add to the user's content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) */ item: PortalItem; /** * The component used to stream the data represented by the item to the client. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) */ data?: string | any; /** * The portal folder in which to store the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) */ folder?: PortalFolder; } - export interface PortalUserFetchItemsParams extends Object { /** * The folder to retrieve items from. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchItems) */ folder?: PortalFolder; /** * The maximum number of results to be included in the result set response. The maximum value allowed is 100. The start property combined with the num property can be used to paginate the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchItems) - * + * * @default 10 */ num?: number; /** * The index of the first entry in the result set response. The index is 1-based. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#fetchItems) - * + * * @default 1 */ start?: number; @@ -17551,250 +18019,261 @@ declare namespace __esri { /** * A convenience module for importing [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing renderers one at a time like this: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html) */ - interface renderers { + namespace renderers { + /** + * Renderer types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#Renderer) + */ + export type Renderer = + | __esri.ClassBreaksRenderer + | __esri.SimpleRenderer + | __esri.UniqueValueRenderer + | __esri.HeatmapRenderer; + + /** + * ClassBreaksRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#ClassBreaksRenderer) + */ + export type ClassBreaksRenderer = __esri.ClassBreaksRenderer; + export const ClassBreaksRenderer: typeof __esri.ClassBreaksRenderer; + + /** + * SimpleRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#SimpleRenderer) + */ + export type SimpleRenderer = __esri.SimpleRenderer; + export const SimpleRenderer: typeof __esri.SimpleRenderer; + + /** + * UniqueValueRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#UniqueValueRenderer) + */ + export type UniqueValueRenderer = __esri.UniqueValueRenderer; + export const UniqueValueRenderer: typeof __esri.UniqueValueRenderer; + + /** + * HeatmapRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#HeatmapRenderer) + */ + export type HeatmapRenderer = __esri.HeatmapRenderer; + export const HeatmapRenderer: typeof __esri.HeatmapRenderer; } - export const renderers: renderers; - - interface ClassBreaksRenderer extends Renderer, VisualVariablesMixin { + interface ClassBreaksRenderer extends Renderer, VisualVariablesRenderer { /** * When symbolizing polygon features with graduated symbols, set a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) on this property to visualize the boundaries of each feature. Use a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) of varying sizes in the [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) to indicate the quantity. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#backgroundFillSymbol) */ backgroundFillSymbol: FillSymbol | PolygonSymbol3D; /** * Each element in the array is an object that provides information about a class break associated with the renderer. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) */ classBreakInfos: ClassBreaksRendererClassBreakInfos[]; /** - * The default symbol assigned to features with a value not matched to a given break. If `null`, unmatched features will not be assigned a symbol. + * Label used in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) to describe features assigned the [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultSymbol). The [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultSymbol) is used to draw all features with unspecified, unmatched values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultLabel) + */ + defaultLabel: string; + /** + * The default symbol assigned to features with a value not matched to a given break. If `null`, unmatched features will not be assigned a symbol. * > **Known Limitations** SceneLayers with a `mesh` [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) will display unmatching features with a generic symbol even if the `defaultSymbol` is `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultSymbol) */ defaultSymbol: Symbol; /** * The name of a numeric attribute field whose data determines the symbol of each feature based on the class breaks defined in [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field) */ field: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) */ legendOptions: ClassBreaksRendererLegendOptions; /** * When [normalizationType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) is `field`, this property contains the attribute field name used for normalization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) */ normalizationField: string; /** * When [normalizationType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) is `percent-of-total`, this property contains the total of all data values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) */ normalizationTotal: number; /** - * Indicates how the data is normalized. If this property is defined, then the class breaks contain a normalized min/max value instead of the value in the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field). The data value obtained from the field is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. - * + * Indicates how the data is normalized. If this property is defined, then the class breaks contain a normalized min/max value instead of the value in the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field). The data value obtained from the field is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * field | Divides the data value using the attribute value of the field specified in the [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) property. This value is set by default if the [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) is provided. * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use [normalizationTotal](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) to define the total value by which to normalize. This value is set by default if the [normalizationTotal](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) is provided. - * + * * With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) */ normalizationType: string; /** * The type of renderer. For ClassBreaksRenderer this value is always `class-breaks`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#type) */ readonly type: "class-breaks"; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. This property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field) for data-driven visualizations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpression) */ valueExpression: string; /** * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpression) property. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the [legendOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpressionTitle) */ valueExpressionTitle: string; - - /** - * Adds a class break to the renderer. You can provide the minimum, maximum and symbol values as individual arguments or by using the info object. The range of the break is greater than or equal to the minimum value and less than the maximum value. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#addClassBreakInfo) - * - * @param min The minimum value to use in the break. This can be a number or an info object as defined in [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos). - * @param max The maximum value to use in the break. - * @param symbol Symbol to use for the break. - * - */ - addClassBreakInfo(min: number | any, max: number, symbol: Symbol): void; - /** - * Creates a deep clone of the renderer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#clone) - * - * - */ - clone(): ClassBreaksRenderer; - /** - * Returns the [classBreakInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) information (as defined by the renderer) associated with the given graphic. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#getClassBreakInfo) - * - * @param graphic The graphic whose rendering information will be returned. - * - */ - getClassBreakInfo(graphic: Graphic): any; - /** - * Removes a break from the renderer. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#removeClassBreakInfo) - * - * @param min Minimum value in the break to remove - * @param max Maximum value in the break to remove. - * - */ - removeClassBreakInfo(min: number, max: number): void; } interface ClassBreaksRendererConstructor { /** * ClassBreaksRenderer defines the symbol of each feature in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) based on the value of a numeric attribute. Symbols are assigned based on classes or ranges of data. Each feature is assigned a symbol based on the class break in which the value of the attribute falls. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html) */ - new(properties?: ClassBreaksRendererProperties): ClassBreaksRenderer; + new (properties?: ClassBreaksRendererProperties): ClassBreaksRenderer; fromJSON(json: any): ClassBreaksRenderer; } export const ClassBreaksRenderer: ClassBreaksRendererConstructor; - interface ClassBreaksRendererProperties extends RendererProperties, VisualVariablesMixinProperties { + interface ClassBreaksRendererProperties extends RendererProperties, VisualVariablesRendererProperties { /** * When symbolizing polygon features with graduated symbols, set a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) on this property to visualize the boundaries of each feature. Use a [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) of varying sizes in the [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) to indicate the quantity. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#backgroundFillSymbol) */ backgroundFillSymbol?: FillSymbolProperties | PolygonSymbol3DProperties; /** * Each element in the array is an object that provides information about a class break associated with the renderer. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) */ classBreakInfos?: ClassBreaksRendererClassBreakInfos[]; /** - * The default symbol assigned to features with a value not matched to a given break. If `null`, unmatched features will not be assigned a symbol. + * Label used in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) to describe features assigned the [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultSymbol). The [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultSymbol) is used to draw all features with unspecified, unmatched values. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultLabel) + */ + defaultLabel?: string; + /** + * The default symbol assigned to features with a value not matched to a given break. If `null`, unmatched features will not be assigned a symbol. * > **Known Limitations** SceneLayers with a `mesh` [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) will display unmatching features with a generic symbol even if the `defaultSymbol` is `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#defaultSymbol) */ defaultSymbol?: SymbolProperties; /** * The name of a numeric attribute field whose data determines the symbol of each feature based on the class breaks defined in [classBreakInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field) */ field?: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) */ legendOptions?: ClassBreaksRendererLegendOptions; /** * When [normalizationType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) is `field`, this property contains the attribute field name used for normalization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) */ normalizationField?: string; /** * When [normalizationType](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) is `percent-of-total`, this property contains the total of all data values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) */ normalizationTotal?: number; /** - * Indicates how the data is normalized. If this property is defined, then the class breaks contain a normalized min/max value instead of the value in the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field). The data value obtained from the field is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. - * + * Indicates how the data is normalized. If this property is defined, then the class breaks contain a normalized min/max value instead of the value in the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field). The data value obtained from the field is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * field | Divides the data value using the attribute value of the field specified in the [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) property. This value is set by default if the [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationField) is provided. * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use [normalizationTotal](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) to define the total value by which to normalize. This value is set by default if the [normalizationTotal](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationTotal) is provided. - * + * * With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#normalizationType) */ normalizationType?: string; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. This property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#field) for data-driven visualizations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpression) */ valueExpression?: string; /** * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpression) property. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the [legendOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpressionTitle) */ valueExpressionTitle?: string; } - export interface ClassBreaksRendererClassBreakInfos extends Object { /** * The minimum value of the break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) */ minValue: number; /** * The maximum value of the break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) */ maxValue: number; /** * The symbol used to style features whose values are between the `minValue` and `maxValue` of the break. This value may be autocast by specifying the symbol `type`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) */ symbol: Symbol; /** * The label used to describe features in the break in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#classBreakInfos) */ label?: string; } - export interface ClassBreaksRendererLegendOptions extends Object { /** * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias) or [valueExpressionTitle](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#valueExpressionTitle). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html#legendOptions) */ title: string; @@ -17803,14 +18282,14 @@ declare namespace __esri { interface HeatmapRenderer extends Renderer { /** * The area of influence for each point in the layer. This is defined as a radius in pixels. The default is `10`, which means the pixels within a 10-pixel radius of the point's location are assigned an intensity value corresponding to their distance from the nearby point. Increasing this value creates a larger heatmap with more hotspots. Decreasing it makes a smaller heatmap with fewer hotspots. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#blurRadius) - * + * * @default 10 */ blurRadius: number; /** - * An array of objects describing the renderer's color ramp. The ratio of a pixel's intensity value to the [maxPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) of the renderer is mapped to a corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#color) along a continuous ramp. The color of the first stop (i.e. the stop with the lowest `ratio` value) must have an alpha value of `0` for the underlying basemap to be visible in the app. The default value is the following: + * An array of objects describing the renderer's color ramp. The ratio of a pixel's intensity value to the [maxPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) of the renderer is mapped to a corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#color) along a continuous ramp. The color of the first stop (i.e. the stop with the lowest `ratio` value) must have an alpha value of `0` for the underlying basemap to be visible in the app. The default value is the following: * ```js * [ * { ratio: 0, color: "rgba(255, 140, 0, 0)" }, @@ -17818,45 +18297,45 @@ declare namespace __esri { * { ratio: 0.9, color: "rgba(255, 0, 0, 1)" } * ] * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops) */ colorStops: HeatmapColorStop[]; /** * The name of the attribute field used to weight the intensity of each heatmap point. For example, suppose you have a layer of points representing buildings containing a field `num_units` for the number of units in the building (if it's an apartment complex). You could weight the heatmap renderer based on the `num_units` field to create a heatmap representing the density of housing units in a city. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#field) */ field: string; /** * The pixel intensity value that determines which pixels are assigned the final color in the [colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops). Pixelx with intensity values above this number will be assigned the final (or hottest) color in the color ramp. Typically, `minPixelIntensity` will be zero and `maxPixelIntensity` will be set to a high value appropriate for the dataset. The default may not be ideal for your dataset, so this value will likely need to change. Determining the best values for `minPixelIntensity` and `maxPixelIntensity` is an exercise left up to the developer since different types, scales, densities, and distributions of data will require different values for these properties to create a visually pleasing separation of high and low intensity areas appropriate for the data and the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) - * + * * @default 100 */ maxPixelIntensity: number; /** * The pixel intensity value used to determine which pixels will be assigned the initial color in the [colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops). Pixels with intensity values below this number will be excluded from the visualization. When using a [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#field) to weight the points, setting `minPixelIntensity` above zero might help to visually deemphasize frequently occurring but low value point clusters. This property does not actually filter the data or modify the calculated intensity value. Rather, it scales the color ramp such that a higher intensity value is required for a pixel to get a noticeable color. Determining the best values for `minPixelIntensity` and `maxPixelIntensity` is an exercise left up to the developer since different types, scales, densities, and distributions of data will require different values for these properties to create a visually pleasing separation of high and low intensity areas appropriate for the data and the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#minPixelIntensity) - * + * * @default 0 */ minPixelIntensity: number; /** * The type of renderer. For HeatmapRenderer this value is always `heatmap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#type) */ readonly type: "heatmap"; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#clone) - * - * + * + * */ clone(): HeatmapRenderer; } @@ -17864,11 +18343,11 @@ declare namespace __esri { interface HeatmapRendererConstructor { /** * The HeatmapRenderer renders point [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) as a raster surface, emphasizing areas with a high density of points. This renderer uses a [Gaussian Blur](https://en.wikipedia.org/wiki/Gaussian_blur) to determine the strength of the influence of each point over an area determined by the [blurRadius](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#blurRadius). A Gaussian, or normal, distribution is used to spread the color of the point so it appears to be a fuzzy circle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html) */ - new(properties?: HeatmapRendererProperties): HeatmapRenderer; + new (properties?: HeatmapRendererProperties): HeatmapRenderer; fromJSON(json: any): HeatmapRenderer; } @@ -17878,14 +18357,14 @@ declare namespace __esri { interface HeatmapRendererProperties extends RendererProperties { /** * The area of influence for each point in the layer. This is defined as a radius in pixels. The default is `10`, which means the pixels within a 10-pixel radius of the point's location are assigned an intensity value corresponding to their distance from the nearby point. Increasing this value creates a larger heatmap with more hotspots. Decreasing it makes a smaller heatmap with fewer hotspots. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#blurRadius) - * + * * @default 10 */ blurRadius?: number; /** - * An array of objects describing the renderer's color ramp. The ratio of a pixel's intensity value to the [maxPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) of the renderer is mapped to a corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#color) along a continuous ramp. The color of the first stop (i.e. the stop with the lowest `ratio` value) must have an alpha value of `0` for the underlying basemap to be visible in the app. The default value is the following: + * An array of objects describing the renderer's color ramp. The ratio of a pixel's intensity value to the [maxPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) of the renderer is mapped to a corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#color) along a continuous ramp. The color of the first stop (i.e. the stop with the lowest `ratio` value) must have an alpha value of `0` for the underlying basemap to be visible in the app. The default value is the following: * ```js * [ * { ratio: 0, color: "rgba(255, 140, 0, 0)" }, @@ -17893,74 +18372,194 @@ declare namespace __esri { * { ratio: 0.9, color: "rgba(255, 0, 0, 1)" } * ] * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops) */ colorStops?: HeatmapColorStopProperties[]; /** * The name of the attribute field used to weight the intensity of each heatmap point. For example, suppose you have a layer of points representing buildings containing a field `num_units` for the number of units in the building (if it's an apartment complex). You could weight the heatmap renderer based on the `num_units` field to create a heatmap representing the density of housing units in a city. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#field) */ field?: string; /** * The pixel intensity value that determines which pixels are assigned the final color in the [colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops). Pixelx with intensity values above this number will be assigned the final (or hottest) color in the color ramp. Typically, `minPixelIntensity` will be zero and `maxPixelIntensity` will be set to a high value appropriate for the dataset. The default may not be ideal for your dataset, so this value will likely need to change. Determining the best values for `minPixelIntensity` and `maxPixelIntensity` is an exercise left up to the developer since different types, scales, densities, and distributions of data will require different values for these properties to create a visually pleasing separation of high and low intensity areas appropriate for the data and the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#maxPixelIntensity) - * + * * @default 100 */ maxPixelIntensity?: number; /** * The pixel intensity value used to determine which pixels will be assigned the initial color in the [colorStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#colorStops). Pixels with intensity values below this number will be excluded from the visualization. When using a [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#field) to weight the points, setting `minPixelIntensity` above zero might help to visually deemphasize frequently occurring but low value point clusters. This property does not actually filter the data or modify the calculated intensity value. Rather, it scales the color ramp such that a higher intensity value is required for a pixel to get a noticeable color. Determining the best values for `minPixelIntensity` and `maxPixelIntensity` is an exercise left up to the developer since different types, scales, densities, and distributions of data will require different values for these properties to create a visually pleasing separation of high and low intensity areas appropriate for the data and the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#minPixelIntensity) - * + * * @default 0 */ minPixelIntensity?: number; } + interface VisualVariablesRenderer { + /** + * An array of [VisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html) objects. Each object must indicate the type of visual variable to apply (e.g. [ColorVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html), [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html), [OpacityVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html), [RotationVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html)), the numeric field or expression from which to drive the visualization, and the visual values to map to the data. The following list identifies each visual variable type and provides a link to the specification table of each. + * + * Type | Object Specification | Legend Example + * -----|----------------------|--------------- + * color | [ColorVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-color-vv.png) + * size | [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-size-vv.png) + * opacity | [OpacityVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-opacity-vv.png) + * rotation | [RotationVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html) | - + * + * Visual variables are primarily be used in two ways. **1**. Thematic mapping In most cases, visual variables are used to create visualizations based on a thematic attribute (e.g. population, education, rank, money, magnitude, etc.) in either 2D or 3D. + * ```js + * renderer.visualVariables = [{ + * type: "size", + * field: "POP_POVERTY", + * normalizationField: "TOTPOP_CY", + * legendOptions: { + * title: "% population in poverty by county" + * }, + * stops: [ + * { value: 0.15, size: 4, label: "<15%" }, + * { value: 0.25, size: 12, label: "25%" }, + * { value: 0.35, size: 24, label: ">35%" } + * ] + * }]; + * ``` + * + * [![size-image-here](https://developers.arcgis.com/javascript/assets/img/samples/8-vv-size.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-size/index.html) + * + * You can take the visualization a step further and use multiple visual variables in the same renderer. + * The sample below uses + * three visual variables (size, color, and opacity). + * + * [![visualization-multivariate-2d](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/renderer-unique-vv.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-2d/index.html) + * + * **2**. Mapping real-world sizes + * + * The [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) visual variable can be used to + * visualize the true sizes of features (e.g. tree canopy, road width, building height, etc.) + * based on their size in the real world. This can be particularly powerful when working in a 3D + * [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). The image below shows a layer of trees + * that uses visual variables to size each feature to the true dimensions of each tree + * based on data stored in multiple attribute fields. + * + * [![renderer-vv-rw](https://developers.arcgis.com/javascript/assets/img/samples/3-trees-3d.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) + * + * See the [Thematic visualization with realistic 3D symbols](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) + * for an example of using multiple visual variables to visualize your data. + * + * > **Known Limitations** Color and opacity visual variables must not have more than 8 stops and size visual variables must not have more than 6 stops. This does not apply to variables driven by view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-mixins-VisualVariablesRenderer.html#visualVariables) + */ + visualVariables: VisualVariable[]; + } + + interface VisualVariablesRendererConstructor { + new (): VisualVariablesRenderer; + } + + export const VisualVariablesRenderer: VisualVariablesRendererConstructor; + + interface VisualVariablesRendererProperties { + /** + * An array of [VisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html) objects. Each object must indicate the type of visual variable to apply (e.g. [ColorVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html), [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html), [OpacityVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html), [RotationVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html)), the numeric field or expression from which to drive the visualization, and the visual values to map to the data. The following list identifies each visual variable type and provides a link to the specification table of each. + * + * Type | Object Specification | Legend Example + * -----|----------------------|--------------- + * color | [ColorVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-color-vv.png) + * size | [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-size-vv.png) + * opacity | [OpacityVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-opacity-vv.png) + * rotation | [RotationVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html) | - + * + * Visual variables are primarily be used in two ways. **1**. Thematic mapping In most cases, visual variables are used to create visualizations based on a thematic attribute (e.g. population, education, rank, money, magnitude, etc.) in either 2D or 3D. + * ```js + * renderer.visualVariables = [{ + * type: "size", + * field: "POP_POVERTY", + * normalizationField: "TOTPOP_CY", + * legendOptions: { + * title: "% population in poverty by county" + * }, + * stops: [ + * { value: 0.15, size: 4, label: "<15%" }, + * { value: 0.25, size: 12, label: "25%" }, + * { value: 0.35, size: 24, label: ">35%" } + * ] + * }]; + * ``` + * + * [![size-image-here](https://developers.arcgis.com/javascript/assets/img/samples/8-vv-size.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-size/index.html) + * + * You can take the visualization a step further and use multiple visual variables in the same renderer. + * The sample below uses + * three visual variables (size, color, and opacity). + * + * [![visualization-multivariate-2d](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/renderer-unique-vv.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-2d/index.html) + * + * **2**. Mapping real-world sizes + * + * The [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) visual variable can be used to + * visualize the true sizes of features (e.g. tree canopy, road width, building height, etc.) + * based on their size in the real world. This can be particularly powerful when working in a 3D + * [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). The image below shows a layer of trees + * that uses visual variables to size each feature to the true dimensions of each tree + * based on data stored in multiple attribute fields. + * + * [![renderer-vv-rw](https://developers.arcgis.com/javascript/assets/img/samples/3-trees-3d.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) + * + * See the [Thematic visualization with realistic 3D symbols](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) + * for an example of using multiple visual variables to visualize your data. + * + * > **Known Limitations** Color and opacity visual variables must not have more than 8 stops and size visual variables must not have more than 6 stops. This does not apply to variables driven by view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-mixins-VisualVariablesRenderer.html#visualVariables) + */ + visualVariables?: VisualVariableProperties[]; + } + interface PointCloudClassBreaksRenderer extends PointCloudRenderer { /** * Each element in the array is an object that provides information about a class break associated with the renderer. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) */ colorClassBreakInfos: PointCloudClassBreaksRendererColorClassBreakInfos[]; /** * The name of the field that is used to drive the color visualization for the renderer. The value of this field determines which class break each point is assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#field) */ field: string; /** * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#fieldTransformType) - * + * * @default null */ fieldTransformType: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#legendOptions) */ legendOptions: PointCloudClassBreaksRendererLegendOptions; /** * The type of renderer. For PointCloudClassBreaksRenderer this value is always `point-cloud-class-breaks`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#type) */ readonly type: "point-cloud-class-breaks"; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#clone) - * - * + * + * */ clone(): PointCloudClassBreaksRenderer; } @@ -17968,11 +18567,11 @@ declare namespace __esri { interface PointCloudClassBreaksRendererConstructor { /** * This class defines the color of each point in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) based on the value of a numeric attribute. Colors are assigned based on classes or ranges of data. Each point is assigned a symbol based on the class break in which the value of the attribute falls. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html) */ - new(properties?: PointCloudClassBreaksRendererProperties): PointCloudClassBreaksRenderer; + new (properties?: PointCloudClassBreaksRendererProperties): PointCloudClassBreaksRenderer; fromJSON(json: any): PointCloudClassBreaksRenderer; } @@ -17982,65 +18581,63 @@ declare namespace __esri { interface PointCloudClassBreaksRendererProperties extends PointCloudRendererProperties { /** * Each element in the array is an object that provides information about a class break associated with the renderer. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) */ colorClassBreakInfos?: PointCloudClassBreaksRendererColorClassBreakInfos[]; /** * The name of the field that is used to drive the color visualization for the renderer. The value of this field determines which class break each point is assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#field) */ field?: string; /** * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#fieldTransformType) - * + * * @default null */ fieldTransformType?: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#legendOptions) */ legendOptions?: PointCloudClassBreaksRendererLegendOptions; } - export interface PointCloudClassBreaksRendererColorClassBreakInfos extends Object { /** * The minimum value of the break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) */ minValue: number; /** * The maximum value of the break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) */ maxValue: number; /** * The color used to colorize the points where values are between the `minValue` and `maxValue` of the break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) */ color: Color; /** * The label used to describe point in the break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#colorClassBreakInfos) */ label?: string; } - export interface PointCloudClassBreaksRendererLegendOptions extends Object { /** * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudClassBreaksRenderer.html#legendOptions) */ title?: string; @@ -18049,45 +18646,43 @@ declare namespace __esri { interface PointCloudRenderer extends Accessor, JSONSupport { /** * Reduces the brightness of the point's color, based on the value of another field, usually `intensity`. High values leave the color unchanged, while low values darken the color of the point. This helps to display the scanned surface in a more realistic way. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) */ colorModulation: PointCloudRendererColorModulation; /** * Specifies how the size of the points in the point cloud is computed for rendering. The splat algorithm automatically computes a size based on the density, which varies with the Level of Detail that is currently displayed. The fixed size algorithm displays all points with the same size, either in screen space or real world units. When `pointSizeAlgorithm` is not set, the default is `splat`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) */ pointSizeAlgorithm: PointCloudRendererPointSizeAlgorithm; /** * The number of points to draw per display inch. This property determines the level of detail in the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointsPerInch) - * + * * @default 10 */ pointsPerInch: number; /** * The point cloud renderer type. **Possible values:** point-cloud-class-breaks | point-cloud-rgb | point-cloud-stretch | point-cloud-unique-value - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#type) */ readonly type: string; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#clone) - * - * + * + * */ clone(): PointCloudRenderer; } interface PointCloudRendererConstructor { - - - new(properties?: PointCloudRendererProperties): PointCloudRenderer; + new (properties?: PointCloudRendererProperties): PointCloudRenderer; fromJSON(json: any): PointCloudRenderer; } @@ -18097,77 +18692,75 @@ declare namespace __esri { interface PointCloudRendererProperties { /** * Reduces the brightness of the point's color, based on the value of another field, usually `intensity`. High values leave the color unchanged, while low values darken the color of the point. This helps to display the scanned surface in a more realistic way. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) */ colorModulation?: PointCloudRendererColorModulation; /** * Specifies how the size of the points in the point cloud is computed for rendering. The splat algorithm automatically computes a size based on the density, which varies with the Level of Detail that is currently displayed. The fixed size algorithm displays all points with the same size, either in screen space or real world units. When `pointSizeAlgorithm` is not set, the default is `splat`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) */ pointSizeAlgorithm?: PointCloudRendererPointSizeAlgorithm; /** * The number of points to draw per display inch. This property determines the level of detail in the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointsPerInch) - * + * * @default 10 */ pointsPerInch?: number; } - export interface PointCloudRendererColorModulation extends Object { /** * Field to use for the color modulation. Commonly modulation is used with the `intensity` field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) */ field: string; /** * Field value at which the point color becomes darkest. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) - * + * * @default 0 */ minValue?: number; /** * Field value at which the point color will be left unchanged. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#colorModulation) - * + * * @default 255 */ maxValue?: number; } - export interface PointCloudRendererPointSizeAlgorithm extends Object { /** * `fixed-size` or `splat`. Choosing `fixed-size` implies setting `size` and `useRealWorldSymbolSizes`. If `splat` is chosen then `scaleFactor` should be set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) */ type: string; /** * Specifies whether `size` is in real world units or screen-space units. Applies to `fixed-size` only. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) */ useRealWorldSymbolSizes?: boolean; /** * Point size in meters (`useRealWorldSymbolSizes = true`) or points. Applies to `fixed-size` only. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) */ size?: number; /** * Specifies the scale factor that is applied to the size estimated by the density. Applies to `splat` only. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRenderer.html#pointSizeAlgorithm) - * + * * @default 1 */ scaleFactor?: number; @@ -18176,23 +18769,23 @@ declare namespace __esri { interface PointCloudRGBRenderer extends PointCloudRenderer { /** * The name of the field containing RGB values used to drive the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html#field) */ field: string; /** * The type of Renderer. For PointCloudRGBRenderer this value is always `point-cloud-rgb`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html#type) */ readonly type: "point-cloud-rgb"; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html#clone) - * - * + * + * */ clone(): PointCloudRGBRenderer; } @@ -18200,11 +18793,11 @@ declare namespace __esri { interface PointCloudRGBRendererConstructor { /** * PointCloudRGBRenderer defines the color of each point in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) based on the value of a color attribute. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html) */ - new(properties?: PointCloudRGBRendererProperties): PointCloudRGBRenderer; + new (properties?: PointCloudRGBRendererProperties): PointCloudRGBRenderer; fromJSON(json: any): PointCloudRGBRenderer; } @@ -18214,7 +18807,7 @@ declare namespace __esri { interface PointCloudRGBRendererProperties extends PointCloudRendererProperties { /** * The name of the field containing RGB values used to drive the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html#field) */ field?: string; @@ -18223,43 +18816,43 @@ declare namespace __esri { interface PointCloudStretchRenderer extends PointCloudRenderer { /** * The name of the number field whose values are used to drive the continuous color visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#field) */ field: string; /** * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#fieldTransformType) - * + * * @default null */ fieldTransformType: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#legendOptions) */ legendOptions: PointCloudStretchRendererLegendOptions; /** * An array of color value pairs. Points with values between the specified stops are colorized with linearly interpolated colors. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) */ stops: PointCloudStretchRendererStops[]; /** * The type of Renderer. For PointCloudStretchRenderer this value is always `point-cloud-stretch`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#type) */ readonly type: "point-cloud-stretch"; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#clone) - * - * + * + * */ clone(): PointCloudStretchRenderer; } @@ -18267,11 +18860,11 @@ declare namespace __esri { interface PointCloudStretchRendererConstructor { /** * PointCloudStretchRenderer defines the color of each point in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) based on the value of a numeric attribute. It allows you to easily map continuous color ramps to minimum and maximum data values of one of the layer's numeric attribute fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html) */ - new(properties?: PointCloudStretchRendererProperties): PointCloudStretchRenderer; + new (properties?: PointCloudStretchRendererProperties): PointCloudStretchRenderer; fromJSON(json: any): PointCloudStretchRenderer; } @@ -18281,59 +18874,57 @@ declare namespace __esri { interface PointCloudStretchRendererProperties extends PointCloudRendererProperties { /** * The name of the number field whose values are used to drive the continuous color visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#field) */ field?: string; /** * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#fieldTransformType) - * + * * @default null */ fieldTransformType?: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#legendOptions) */ legendOptions?: PointCloudStretchRendererLegendOptions; /** * An array of color value pairs. Points with values between the specified stops are colorized with linearly interpolated colors. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) */ stops?: PointCloudStretchRendererStops[]; } - export interface PointCloudStretchRendererLegendOptions extends Object { /** * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#legendOptions) */ title?: string; } - export interface PointCloudStretchRendererStops extends Object { /** * The value for this stop. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) */ value: number; /** * The label for this stop. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) */ label?: string; /** * The color value for this stop. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html#stops) */ color: Color; @@ -18342,43 +18933,43 @@ declare namespace __esri { interface PointCloudUniqueValueRenderer extends PointCloudRenderer { /** * Each element in the array is an object that matches a unique value with a specific color. Features with equal values to those specified here will be assigned the associated color. For example, you may choose to visualize points representing low vegetation with a green color and points representing power lines with a gray color. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) */ colorUniqueValueInfos: PointCloudUniqueValueRendererColorUniqueValueInfos[]; /** * The name of the field whose values are used to drive the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#field) */ field: string; /** * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#fieldTransformType) - * + * * @default null */ fieldTransformType: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#legendOptions) */ legendOptions: PointCloudUniqueValueRendererLegendOptions; /** * The type of Renderer. For PointCloudUniqueValueRenderer this value is always `point-cloud-unique-value`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#type) */ readonly type: "point-cloud-unique-value"; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#clone) - * - * + * + * */ clone(): PointCloudUniqueValueRenderer; } @@ -18386,11 +18977,11 @@ declare namespace __esri { interface PointCloudUniqueValueRendererConstructor { /** * PointCloudUniqueValueRenderer allows you to colorize points in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html) based on an attribute value. This is done by assigning unique colors to represent points with equal attribute values. This renderer is used to visualize points of the same type, not interpolate colors along a continuous ramp mapped to numbers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html) */ - new(properties?: PointCloudUniqueValueRendererProperties): PointCloudUniqueValueRenderer; + new (properties?: PointCloudUniqueValueRendererProperties): PointCloudUniqueValueRenderer; fromJSON(json: any): PointCloudUniqueValueRenderer; } @@ -18400,59 +18991,57 @@ declare namespace __esri { interface PointCloudUniqueValueRendererProperties extends PointCloudRendererProperties { /** * Each element in the array is an object that matches a unique value with a specific color. Features with equal values to those specified here will be assigned the associated color. For example, you may choose to visualize points representing low vegetation with a green color and points representing power lines with a gray color. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) */ colorUniqueValueInfos?: PointCloudUniqueValueRendererColorUniqueValueInfos[]; /** * The name of the field whose values are used to drive the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#field) */ field?: string; /** * A transform that is applied to the field value before evaluating the renderer. **Possible Values:** none | low-four-bit | high-four-bit | absolute-value | modulo-ten - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#fieldTransformType) - * + * * @default null */ fieldTransformType?: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#legendOptions) */ legendOptions?: PointCloudUniqueValueRendererLegendOptions; } - export interface PointCloudUniqueValueRendererColorUniqueValueInfos extends Object { /** * A unique combination of values that will be represented with the given `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) */ values: string[]; /** * The color used to represent points whose value matches `values`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) */ color: Color; /** * Label used to describe points matched to the unique value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#colorUniqueValueInfos) */ label?: string; } - export interface PointCloudUniqueValueRendererLegendOptions extends Object { /** * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html#legendOptions) */ title?: string; @@ -18461,13 +19050,13 @@ declare namespace __esri { interface Renderer extends Accessor, JSONSupport { /** * Authoring metadata only included in renderers generated from one of the Smart Mapping creator methods, such as [sizeRendererCreator.createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) or [colorRendererCreator.createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer). This includes information from UI elements such as sliders and selected classification methods and themes. This allows the authoring clients to save specific overridable settings so that next time it is accessed via the UI, their selections can be remembered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#authoringInfo) */ authoringInfo: AuthoringInfo; /** * The renderer type. **Possible values:** class-breaks | heatmap | simple | unique-value - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#type) */ readonly type: string; @@ -18476,11 +19065,11 @@ declare namespace __esri { interface RendererConstructor { /** * Renderers define how to visually represent each feature in one of the following layer types: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) */ - new(properties?: RendererProperties): Renderer; + new (properties?: RendererProperties): Renderer; fromJSON(json: any): Renderer; } @@ -18490,740 +19079,38 @@ declare namespace __esri { interface RendererProperties { /** * Authoring metadata only included in renderers generated from one of the Smart Mapping creator methods, such as [sizeRendererCreator.createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) or [colorRendererCreator.createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer). This includes information from UI elements such as sliders and selected classification methods and themes. This allows the authoring clients to save specific overridable settings so that next time it is accessed via the UI, their selections can be remembered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#authoringInfo) */ authoringInfo?: AuthoringInfoProperties; } - /** - * Defines a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) with minimum and maximum bounds. When an object with this specification is applied to the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) property of a renderer, then feature sizes are bounded by min and max data values. Features with values greater than the provided max value are assigned the specified maximum size. Likewise, features with values less than the provied min value are assigned the specified minimum size. Features with values between the min and the max are assigned a corresponding size that is linearly interpolated between the provided min and max size values. The object specification for this object is provided below. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - export interface BoundedMinMax extends Object { - /** - * The size used to render a feature containing the maximum data value. - * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. - * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - maxSize: string | number; - /** - * Value must be `size`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - type: string; - /** - * The name of the numeric attribute field used to normalize the data in `field`. If this field is used, then the values in `maxDataValue` and `minDataValue` should be normalized as percentages or ratios. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - normalizationField?: string; - /** - * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - valueExpression?: string; - /** - * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the `valueExpression` property. This is displayed as the title of the corresponding size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the `legendOptions` property. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - valueExpressionTitle?: string; - /** - * The maximum data value used in the size ramp. Features with this value or higher will be rendered at the size defined in `maxSize`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - maxDataValue: number; - /** - * The name of the numeric attribute field that contains the data values used to determine the size of each feature. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - field?: string; - /** - * The minimum data value used in the size ramp. Features with this value or lower will be rendered at the size defined in `minSize`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - minDataValue: number; - /** - * The size used to render a feature containing the minimum data value. - * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. - * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - minSize: string | number; - /** - * An object providing options for displaying the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - legendOptions?: BoundedMinMaxLegendOptions; - /** - * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the size visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). See the [local scene sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-local/index.html) for an example of this. - * - * Possible Value | Description - * ----------------|----------- - * width | The diameter of the symbol from east to west. - * depth | The diameter of the symbol from north to south. - * height | The height of the symbol. - * width-and-depth | Applies the size visual variable to both width and depth axes. - * all | Applies the size visual variable to all axes. - * - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - axis?: string; - /** - * When setting a size visual variable on a renderer using an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), this property indicates whether to apply the value defined by the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width), or [depth](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) properties to the corresponding axis of this visual variable instead of proportionally scaling this axis' value after other axes. [View an example](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-3d/index.html) of this. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - useSymbolValue?: boolean; - } - - /** - * The **color** visual variable defines how a continuous color ramp is applied to features based on the values of a numeric attribute field. The minimum and maximum values of the data should be indicated along with their respective color values. You must specify `stops` to construct the color ramp, and either `field` or `valueExpression` to define the driving value. [![renderer-vv-color](https://developers.arcgis.com/javascript/assets/img/samples/7-vv-color.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-color/index.html) The object specification for color is provided below. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - export interface ColorVisualVariable extends Object { - /** - * **Required.** Value must be `color`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - type: string; - /** - * The name of the numeric attribute field that contains the data values used to determine the color of each feature. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - field?: string; - /** - * Name of the numeric attribute field by which to normalize the data. If this field is used, then the values in `stops` should be normalized as percentages or ratios. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - normalizationField?: string; - /** - * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - valueExpression?: string; - /** - * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the `valueExpression` property. This is displayed as the title of the corresponding color ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the `legendOptions` property. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - valueExpressionTitle?: string; - /** - * An object providing options for displaying the color ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - legendOptions?: ColorVisualVariableLegendOptions; - /** - * An array of objects that defines the color ramp in a sequence of stops. At least two stops are required. Features with values between the given stops will be assigned colors along the ramp proportional to the minimum and maximum values used. The stops must be listed in ascending order based on the value of the `value` property in each stop. Each stop object has the following specification: - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - stops: ColorVisualVariableStops[]; - } - - /** - * The **opacity** visual variable defines the opacity of each feature's symbol based on a numeric attribute field value. The minimum and maximum values of the data should be indicated along with their respective opacity values. The specification for this object is provided below. You must specify `stops` to construct the opacity ramp, and either `field` or `valueExpression` to define the driving value. [![renderer-vv-opacity](https://developers.arcgis.com/javascript/assets/img/samples/12-vv-transparency.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-opacity/index.html) - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - export interface OpacityVisualVariable extends Object { - /** - * **Required.** Value must be `opacity`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - type: string; - /** - * The name of the numeric attribute field that contains the data values used to determine the opacity of each feature. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - field?: string; - /** - * Name of the attribute field by which to normalize the data. If this field is used, then the values in `stops` should be normalized as percentages or ratios. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - normalizationField?: string; - /** - * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - valueExpression?: string; - /** - * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the `valueExpression` property. This is displayed as the title of the corresponding opacity ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the `legendOptions` property. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - valueExpressionTitle?: string; - /** - * An object providing options for displaying the opacity ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - legendOptions?: OpacityVisualVariableLegendOptions; - /** - * An array of objects that defines the thematic opacity ramp in a sequence of stops. At least two stops are required. The stops must be listed in ascending order based on the value of the `value` property in each stop. Each stop object has the following specification: - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - stops: OpacityVisualVariableStops[]; - } - - /** - * Defines a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) where data values are interpreted as real-world sizes based on a given unit. Features are then sized according to the real-world measurements, not thematic values and screen units. [![renderer-vv-rw](https://developers.arcgis.com/javascript/assets/img/samples/2-extrude-height.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-buildings-3d/index.html) The object specification for this object is provided below. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - export interface RealWorldSize extends Object { - /** - * Value must be `size`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - type: string; - /** - * The name of the numeric attribute field that contains the data values used to determine the size of each feature. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - field?: string; - /** - * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - valueExpression?: string; - /** - * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the `valueExpression` property. This is displayed as the title of the corresponding size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the `legendOptions` property. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - valueExpressionTitle?: string; - /** - * Indicates the unit of measurement used to interpret the value returned by `field` or `valueExpression`. For 3D volumetric symbols the default is `meters`. This property should not be used if the data value represents a thematic quantity (e.g. traffic count, census data, etc.). **Possible Values:** unknown | inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - valueUnit: string; - /** - * Specifies how to apply the data value when mapping real-world sizes. See table below for supported values. - * - * Value | Description - * ------|----------- - * radius | The point data value represents the radius of a circular feature. - * diameter | The point data value represents the diameter of a circular feature. - * area | The point data value represents the area of a feature. - * width | The polyline data value represents the width of a line. - * distance | The polyline data value represents the distance from the center line (one half of the width). - * - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - valueRepresentation?: string; - /** - * An object providing options for displaying the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - legendOptions?: RealWorldSizeLegendOptions; - /** - * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the size visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). See the [local scene sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-local/index.html) for an example of this. - * - * Possible Value | Description - * ----------------|----------- - * width | The diameter of the symbol from east to west. - * depth | The diameter of the symbol from north to south. - * height | The height of the symbol. - * width-and-depth | Applies the size visual variable to both width and depth axes. - * all | Applies the size visual variable to all axes. - * - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - axis?: string; - /** - * When setting a size visual variable on a renderer using an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), this property indicates whether to apply the value defined by the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width), or [depth](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) properties to the corresponding axis of this visual variable instead of proportionally scaling this axis' value after other axes. [View an example](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-3d/index.html) of this. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - useSymbolValue?: boolean; - } - - /** - * The **rotation** visual variable defines how features rendered with [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html) or [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) in a MapView or [3D object symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html) in a SceneView are rotated. The rotation value is determined by mapping the values to data in a field, or by other arithmetic means with an Arcade expression. This object may be used to depict variables such as wind direction, vehicle heading, etc. [![renderer-vv-rotation](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/renderer-vv-rotation.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-vv-rotation/index.html) - * > **Known Limitations** In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) rotation visual variables are not currently supported with [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html), [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html), [3D icon symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) and [3D text symbol layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) - */ - export interface RotationVisualVariable extends Object { - /** - * **Required.** Value must be `rotation`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) - */ - type: string; - /** - * The name of the numeric attribute field that contains the rotation angle of each feature. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) - */ - field?: string; - /** - * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) - */ - valueExpression?: string; - /** - * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the rotation visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then the following rotation axis will rotate the symbol as indicated by their name. - * - * Possible Value | Description - * ----------------|----------- - * heading | The rotation of the symbol in the horizontal plane (i.e., around the z axis). - * tilt | The rotation of the symbol in the longitudinal vertical plane (i.e., around the x axis). - * roll | The rotation of the symbol in the lateral vertical plane (i.e., around the y axis). - * - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) - */ - axis?: string; - /** - * Defines the origin and direction of rotation depending on how the angle of rotation was measured. See the table below for a list of possible values. This property only applies to rotations around the `heading` axis. - * - * Value | Description - * ------|------------ - * geographic | Rotates the symbol from the north in a clockwise direction. - * arithmetic | Rotates the symbol from the east in a counter-clockwise direction. - * - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) - */ - rotationType?: string; - } - - /** - * **Only applicable to [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html)**. Defines icon sizes in a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) based on minimum and maximum bounds similar to the [BoundedMinMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) case. However, this specification allows the developer to specify various min and max sizes based on the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale). Features with values greater than the provided max value are assigned the specified maximum size for the given view scale. Likewise, features with values less than the provied min value are assigned the specified minumum size for the given view scale. Features with values between the min and the max are assigned a corresponding size that is linearly interpolated between the provided min and max size values for the given scale value. The object specification for this object is provided below. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - export interface ScaleDependentIcons extends Object { - /** - * Value must be `size`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - type: string; - /** - * The name of the numeric attribute field that contains the data values used to determine the size of each feature. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - field?: string; - /** - * The name of the numeric attribute field used to normalize the data in `field`. If this field is used, then the values in `maxDataValue` and `minDataValue` should be normalized as percentages or ratios. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - normalizationField?: string; - /** - * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - valueExpression?: string; - /** - * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the `valueExpression` property. This is displayed as the title of the corresponding size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the `legendOptions` property. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - valueExpressionTitle?: string; - /** - * The maximum data value used in the size ramp. Features with this value or higher will be rendered at the size defined in `maxSize`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - maxDataValue: number; - /** - * An object defining the size of features whose data value (defined in `field` or `valueExpression`) is greater than or equal to the `maxDataValue` for the given view scale. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - maxSize: ScaleDependentStops; - /** - * The minimum data value used in the size ramp. Features with this value or lower will be rendered at the size defined in `minSize`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - minDataValue: number; - /** - * An object defining the size of features whose data value (defined in `field` or `valueExpression`) is less than or equal to the `minDataValue` for the given view scale. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - minSize: ScaleDependentStops; - /** - * An object providing options for displaying the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - legendOptions?: ScaleDependentIconsLegendOptions; - } - - /** - * **Only applicable to [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html)**. Defines feature sizes and outline widths in a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) based on the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale). It also provides the specification of the `minSize` and `maxSize` properties in a [ScaleDependentIcons](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) size visual variable. The object specification for this object is provided below. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - export interface ScaleDependentStops extends Object { - /** - * Value must be `size`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - type: string; - /** - * This value must be `$view.scale`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - valueExpression: string; - /** - * **Deprecated since version 4.2. Use `valueExpression` instead**. The only supported expression is `view.scale`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - expression?: string; - /** - * This value must be `outline` when scaling polygon outline widths based on the view scale. If scale-dependent icons are desired, then this property should be ignored. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - target?: string; - /** - * An array of objects that define the size of the icon (or alternatively the width of the polygon outline) at the given scale `value`. At least two stops are required. The stops must be listed in ascending order based on the value of the `value` property in each stop. Each stop object has the following specification: - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - stops: ScaleDependentStopsStops[]; - } - - /** - * The **size** visual variable defines the size of individual features in a layer based on a numeric (often thematic) value. This value comes from one of the following: - * * An attribute `field` - * * The value of an attribute `field` divided by a `normalizationField` - * * A value returned from an [Arcade expression](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) specified in `valueExpression`. - * - * - * Size is defined in the form of a continuous ramp, which may be applied to renderers in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Symbol size may be applied either thematically, or literally using real-world units. See the following object specification tables for details about each potential use of a size visual variable: - * * **[BoundedMinMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax)** - Feature sizes are bounded by min and max data values. - * * **[ThematicStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops)** - Defines two or more stops at which feature sizes are mapped to data values. - * * **[ScaleDependentIcons](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons)** - Icons sizes are bounded by min and max data values, but the min and max sizes (and interpolated sizes) change based on the scale of the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * * **[ScaleDependentStops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops)** - Defines the width of polygon outlines at various view scales. - * * **[RealWorldSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize)** - Feature sizes are determined based on real-world measurements and units, not thematic values and screen units. - * - * - * [![renderer-unique-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/renderer-unique-vv.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-2d/index.html) - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) - */ - export interface SizeVisualVariable extends Object { - } - - /** - * Defines two or more stops at which feature sizes are mapped to data values in a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable). Setting two stops will have the same effect as creating a [BoundedMinMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) size visual variable. Adding additional stops allows you to map specific sizes with data values. Sizes are interpolated linearly between stop values. The object specification for this object is provided below. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - export interface ThematicStops extends Object { - /** - * Value must be `size`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - type: string; - /** - * The name of the numeric attribute field that contains the data values used to determine the size of each feature. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - field?: string; - /** - * The name of the numeric attribute field used to normalize the data in `field`. If this field is used, then the values in `stops` should be normalized as percentages or ratios. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - normalizationField?: string; - /** - * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over `field`. Therefore, this property is typically used as an alternative to `field` in visual variables. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - valueExpression?: string; - /** - * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the `valueExpression` property. This is displayed as the title of the corresponding size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the `legendOptions` property. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - valueExpressionTitle?: string; - /** - * An array of objects that defines the thematic size ramp in a sequence of data or expression stops. At least two stops are required. The stops must be listed in ascending order based on the value of the `value` property in each stop. Each stop object has the following specification: - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - stops: ThematicStopsStops[]; - /** - * An object providing options for displaying the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - legendOptions?: ThematicStopsLegendOptions; - /** - * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the size visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). See the [local scene sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-local/index.html) for an example of this. - * - * Possible Value | Description - * ----------------|----------- - * width | The diameter of the symbol from east to west. - * depth | The diameter of the symbol from north to south. - * height | The height of the symbol. - * width-and-depth | Applies the size visual variable to both width and depth axes. - * all | Applies the size visual variable to all axes. - * - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - axis?: string; - /** - * When setting a size visual variable on a renderer using an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), this property indicates whether to apply the value defined by the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width), or [depth](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) properties to the corresponding axis of this visual variable instead of proportionally scaling this axis' value after other axes. [View an example](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-3d/index.html) of this. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - useSymbolValue?: boolean; - } - - - export interface BoundedMinMaxLegendOptions extends Object { - /** - * The title describing the visualization of the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - title?: string; - /** - * Indicates whether to show the size ramp in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#BoundedMinMax) - */ - showLegend?: boolean; - } - - - export interface ColorVisualVariableLegendOptions extends Object { - /** - * The title describing the visualization of the color ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - title?: string; - /** - * Indicates whether to show the color ramp in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - showLegend?: boolean; - } - - - export interface ColorVisualVariableStops extends Object { - /** - * **Required**. Specifies the data value to map with the given `color`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - value: number; - /** - * **Required**. The [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) used to render features with the given `value`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - color: Color; - /** - * A string value used to label the stop in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) - */ - label?: string; - } - - - export interface OpacityVisualVariableLegendOptions extends Object { - /** - * The title describing the visualization of the opacity ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - title?: string; - /** - * Indicates whether to show the opacity ramp in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - showLegend?: boolean; - } - - - export interface OpacityVisualVariableStops extends Object { - /** - * **Required**. Specifies the data value to map with the given `opacity`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - value: number; - /** - * **Required**. The opacity value used to render features containing the specified `value`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - opacity: number; - /** - * A string value used to label the stop in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) - */ - label?: string; - } - - - export interface RealWorldSizeLegendOptions extends Object { - /** - * The title describing the visualization of the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - title?: string; - /** - * Indicates whether to show the size ramp in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RealWorldSize) - */ - showLegend?: boolean; - } - - - export interface ScaleDependentIconsLegendOptions extends Object { - /** - * The title describing the visualization of the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - title?: string; - /** - * Indicates whether to show the size ramp in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentIcons) - */ - showLegend?: boolean; - } - - - export interface ScaleDependentStopsStops extends Object { - /** - * Specifies the scale value to map with the given `size`. When the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) equals the given number then icons (or outlines) will be rendered with the given size. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - value: number; - /** - * The size at which to render features at the specified scale `value`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ScaleDependentStops) - */ - size: string | number; - } - - - export interface ThematicStopsLegendOptions extends Object { - /** - * The title describing the visualization of the size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or `valueExpressionTitle`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - title?: string; - /** - * Indicates whether to show the size ramp in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - showLegend?: boolean; - } - - - export interface ThematicStopsStops extends Object { - /** - * Specifies the data or expression value to map with the given `size`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - value: number; - /** - * The size at which to render features containing the specified `value`. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - size: number | string; - /** - * A string value used to label the stop in the legend. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ThematicStops) - */ - label?: string; - } - - interface SimpleRenderer extends Renderer, VisualVariablesMixin { + interface SimpleRenderer extends Renderer, VisualVariablesRenderer { /** * The label for the renderer. This describes what features with the given [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) represent in the real world. This will display next to the layer's [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) inside the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. This text is not displayed in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) when [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) are used. When the renderer contains [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables), you should set the `title` property in `legendOptions` on each visual variable to describe the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#label) */ label: string; /** * The symbol used by the renderer to visualize all features in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) */ symbol: Symbol; /** * The type of renderer. For SimpleRenderer this value is always `simple`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#type) */ readonly type: "simple"; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#clone) - * - * + * + * */ clone(): SimpleRenderer; } @@ -19231,27 +19118,27 @@ declare namespace __esri { interface SimpleRendererConstructor { /** * SimpleRenderer renders all features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) with one [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html). This renderer may be used to simply visualize the location of geographic features. For example, layers representing political boundaries, cities, buildings, rivers, etc. that are typically used for providing geographic context in an application may be defined with a single symbol per layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html) */ - new(properties?: SimpleRendererProperties): SimpleRenderer; + new (properties?: SimpleRendererProperties): SimpleRenderer; fromJSON(json: any): SimpleRenderer; } export const SimpleRenderer: SimpleRendererConstructor; - interface SimpleRendererProperties extends RendererProperties, VisualVariablesMixinProperties { + interface SimpleRendererProperties extends RendererProperties, VisualVariablesRendererProperties { /** * The label for the renderer. This describes what features with the given [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) represent in the real world. This will display next to the layer's [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) inside the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. This text is not displayed in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) when [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) are used. When the renderer contains [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables), you should set the `title` property in `legendOptions` on each visual variable to describe the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#label) */ label?: string; /** * The symbol used by the renderer to visualize all features in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#symbol) */ symbol?: SymbolProperties; @@ -19259,25 +19146,25 @@ declare namespace __esri { /** * This object contains helper methods for generating data-driven visualizations with continuous color or class breaks based on a field value or expression from features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The methods in this module generate renderer or visual variable objects that may be applied directly to a supported layer. The renderers specify how features should be visualized based on data values and colors optimized based on the indicated basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html) */ interface color { /** * Generates a continuous color [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) representing the age of features based on one or more fields. The age of a feature is calculated based on a given `startTime` and `endTime`, one of which must be a date field in the input `layer`. This method generates an Arcade expression and calculates statistics on the output of the expression to accomplish this. The resulting renderer contains a continuous color visual variable that maps optimal colors based on the indicated basemap to data values based on the resulting statistics of the expression. You are required to provide a `layer`, `view`, `startTime`, and `endTime` to generate this renderer. Optionally, you can set a `unit` and a `theme` for the visualization. Other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the statistics object to the `statistics` parameter to avoid making an extra call to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) - * + * * @param params Input parameters for generating a continuous color visualization of age for time data returned from start and/or end date field(s). See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.view The view instance in which the visualization will be rendered. - * @param params.startTime The name of the field, or a date value representing the start time in the age calculation. If a date value is specified, then the `endTime` paramter must reference a Date field in the layer. - * @param params.endTime The name of the field, or a date value representing the end time in the age calculation. If a date value is specified, then the `startTime` paramter must reference a Date field in the layer. + * @param params.startTime The name of the field, or a date value representing the start time in the age calculation. If a date value is specified, then the `endTime` parameter must reference a Date field in the layer. + * @param params.endTime The name of the field, or a date value representing the end time in the age calculation. If a date value is specified, then the `startTime` parameter must reference a Date field in the layer. * @param params.unit The time unit used to calculate the difference between `endTime` and `startTime`. If a unit is not specified, then a suggested unit is determined based on the spread and distribution of the data. **Possible Values:** years | months | days | hours | minutes | seconds * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * @param params.theme + * @param params.theme * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. - * + * * | Value | Description | Example | * | ----- | ----------- | ------- | * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | @@ -19287,49 +19174,49 @@ declare namespace __esri { * @param params.legendOptions Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. The `createAgeRenderer()` method generates an Arcade expression and executes a statistics query against the layer for the result of the expression. If statistics for the expression have already been generated, then pass the object here to avoid making a second statistics query. * @param params.colorScheme In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. - * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. - * + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value. - * @param params.colorMixMode - * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. - * + * @param params.colorMixMode + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * * Value | Description * ------|------------ * tint | Applies the symbol `color` to the desaturated geometry/texture color. * replace | Removes the geometry/texture color and applies the symbol `color`. * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. - * + * */ createAgeRenderer(params: colorCreateAgeRendererParams): IPromise; /** * Generates a [ClassBreaksRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html) that may be applied directly to the layer used to call this method. The resulting renderer defines the symbol color of each feature based on the value of the given `field` value. A default color scheme is determined based on the given `basemap`. Depending on the `classificationMethod`, class breaks (or data ranges) are generated based on the statistics of the data. Each feature is assigned a color based on the class break in which the value of the `field` falls. In most cases you will provide a `layer`, `basemap`, `field`, and `classificationMethod` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what colors to use in the visualization. You can also use a `valueExpression` instead of a `field` to visualize features based on a value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) - * + * * @param params Input parameters for generating a classed color visualization based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.field The name of the field whose data will be queried for statistics and classified. This property is ignored if a `valueExpression` is used. * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. * @param params.normalizationType With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. - * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. - * + * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * field | Divides the `field` value by the value of `normalizationField`. This value is set by default if the `normalizationField` is provided. * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use `normalizationTotal` to define the total value by which to normalize. This value is set by default if the `normalizationTotal` is provided. - * + * * @param params.normalizationTotal When `normalizationType` is `percent-of-total`, this property contains the total of all data values. * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * @param params.classificationMethod - * The classification method used for generating breaks. See the table below for a list of possible values. - * + * @param params.classificationMethod + * The classification method used for generating breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * equal-interval | Divides the range of attribute values into equal-sized subranges. For example, if you specify three classes for a field whose values range from 0 to 300, this method will create three classes with ranges of 0–100, 101–200, and 201–300. Equal interval is best applied to familiar data ranges, such as percentages and temperature. This method emphasizes the amount of an attribute value relative to other values. For example, it could show if a store is part of the group of stores that make up the top one-third of all sales. @@ -19348,38 +19235,38 @@ declare namespace __esri { * @param params.maxValue A maximum value set by the user. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. This will be the upper bound of the highest class break. * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. - * + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | - * @param params.colorMixMode - * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. - * + * @param params.colorMixMode + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * * Value | Description * ------|------------ * tint | Applies the symbol `color` to the desaturated geometry/texture color. * replace | Removes the geometry/texture color and applies the symbol `color`. * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. - * + * */ createClassBreaksRenderer(params: colorCreateClassBreaksRendererParams): IPromise; /** * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to the layer used to call this method. The renderer contains a continuous color visual variable that maps optimal colors based on the indicated basemap to specific stop values based on queried statistics from the indicated field or expression. In most cases you will provide a `layer`, `basemap`, `field`, and `theme` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what colors to use in the visualization. You can also use a `valueExpression` instead of a `field` to visualize features based on a value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the statistics object to the `statistics` parameter to avoid making an extra call to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) - * + * * @param params Input parameters for generating a continuous color visualization based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * @param params.theme + * @param params.theme * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. - * + * * | Value | Description | Example | * | ----- | ----------- | ------- | * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | @@ -19397,30 +19284,30 @@ declare namespace __esri { * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned color visual variable. * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. - * + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | - * @param params.colorMixMode - * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. - * + * @param params.colorMixMode + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * * Value | Description * ------|------------ * tint | Applies the symbol `color` to the desaturated geometry/texture color. * replace | Removes the geometry/texture color and applies the symbol `color`. * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. - * + * */ createContinuousRenderer(params: colorCreateContinuousRendererParams): IPromise; /** * Generates a [PointCloudStretchRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudStretchRenderer.html) with a color scheme best-suited for the given basemap based on statistics returned from a given field of a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html). All that's required is a layer instance, field name, and basemap ID. You can optionally set the size and density of the points to suit the needs of the desired visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) - * + * * @param params Input parameters for generating a renderer based on the given field of the input layer. See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. The only field names used for this renderer type are `elevation` and `intensity`. @@ -19429,34 +19316,34 @@ declare namespace __esri { * @param params.density The number of points per inch in the view. * @param params.colorScheme In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the stats object here to avoid making a second statistics query to the server. - * + * */ createPCContinuousRenderer(params: colorCreatePCContinuousRendererParams): IPromise; /** * Generates a [PointCloudRGBRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html) based on the `RGB` field of a given [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html). This method simplifies the experience of creating a [PointCloudRGBRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudRGBRenderer.html) manually. All that's required is a layer instance. You can optionally set the size and density of the points to suit the needs of the desired visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCTrueColorRenderer) - * + * * @param params Input parameters for generating a true color visualization based on the `RGB` field of the input layer. See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.size The size of each point expressed as a percentage. This value will determine point sizes scaled based on the given `density` of points. When the value is `100%`, the size of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%` will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point sizes smaller so there appear to be more gaps between points. * @param params.density The number of points per inch in the view. - * + * */ createPCTrueColorRenderer(params: colorCreatePCTrueColorRendererParams): IPromise; /** * This method generates a color visual variable with default stops that are optimally chosen based on the statistics queried for the indicated field or expression and colors based on the input basemap. There are two different ways this method may be called. The most common case is by providing a `layer`, `basemap`, `field`, and `theme`. This is the scenario where the statistics of the data aren't well known and the user doesn't know what colors to use. You can optionally use a `valueExpression` instead of a field to visualize features based on a numeric value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the object in the `statistics` parameter to avoid making an extra call to the server. You can also provide a `colorScheme` if you don't want one picked for you. In this case the `basemap` and `theme` options would be ignored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) - * + * * @param params Input parameters for generating a color visual variable based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the visual variable is generated. * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * @param params.theme + * @param params.theme * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. - * + * * | Value | Description | Example | * | ----- | ----------- | ------- | * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | @@ -19474,7 +19361,7 @@ declare namespace __esri { * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned color visual variable. * @param params.view When generating 3D symbols (except for layers with a `mesh` geometry type), a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * @param params.worldScale Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology, except for layers with a `mesh` geometry type. A `view` must be provided if this property is set to `true`. - * + * */ createVisualVariable(params: colorCreateVisualVariableParams): IPromise; } @@ -19483,49 +19370,49 @@ declare namespace __esri { /** * The result object of the [createAgeRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) */ export interface AgeRendererResult extends Object { /** * The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) */ renderer: ClassBreaksRenderer; /** * A color visual variable configured based on the statistics of the data and the given basemap and scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) */ - visualVariable: ColorVisualVariable; + visualVariable: ColorVariable; /** * The time unit used to represent age in the output `renderer`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) */ unit: string; /** * The color scheme used by the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) */ colorScheme: ColorScheme; /** * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) */ defaultValuesUsed: boolean; /** * Basic statistics returned from a query to the service for data from the given field name or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) */ statistics: SummaryStatisticsResult; /** * The ID of the basemap used to determine the optimal fill color of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#AgeRendererResult) */ basemapId: string; @@ -19533,711 +19420,701 @@ declare namespace __esri { /** * The result object of the [createClassBreaksRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) */ export interface ClassBreaksRendererResult extends Object { /** * The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) */ renderer: ClassBreaksRenderer; /** * This object describes class breaks generated from data in a layer for a given field with a specified classification method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) */ classBreaksResult: ClassBreaksResult; /** * The color scheme used for the class breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) */ colorScheme: ColorScheme; /** * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) */ defaultValuesUsed: boolean; /** * The ID of the basemap used to determine the optimal fill color of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ClassBreaksRendererResult) */ basemapId: string; } - export interface colorCreateAgeRendererParams extends Object { /** * The layer for which the visualization is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The view instance in which the visualization will be rendered. - * + * * [Read more...](global.html) */ view: View; /** - * The name of the field, or a date value representing the start time in the age calculation. If a date value is specified, then the `endTime` paramter must reference a Date field in the layer. - * + * The name of the field, or a date value representing the start time in the age calculation. If a date value is specified, then the `endTime` parameter must reference a Date field in the layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) */ startTime: Date | string | number; /** - * The name of the field, or a date value representing the end time in the age calculation. If a date value is specified, then the `startTime` paramter must reference a Date field in the layer. - * + * The name of the field, or a date value representing the end time in the age calculation. If a date value is specified, then the `startTime` parameter must reference a Date field in the layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) */ endTime: Date | string | number; /** * The time unit used to calculate the difference between `endTime` and `startTime`. If a unit is not specified, then a suggested unit is determined based on the spread and distribution of the data. **Possible Values:** years | months | days | hours | minutes | seconds - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) */ unit?: string; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. - * + * * | Value | Description | Example | * | ----- | ----------- | ------- | * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) */ theme?: string; /** * Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) */ legendOptions?: colorCreateAgeRendererParamsLegendOptions; /** * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. The `createAgeRenderer()` method generates an Arcade expression and executes a statistics query against the layer for the result of the expression. If statistics for the expression have already been generated, then pass the object here to avoid making a second statistics query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) */ statistics?: SummaryStatisticsResult; /** * In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) */ colorScheme?: ColorScheme; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) - * + * * @default 2d */ symbolType?: string; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) - * + * * @default true */ defaultSymbolEnabled?: boolean; /** - * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. - * + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * * Value | Description * ------|------------ * tint | Applies the symbol `color` to the desaturated geometry/texture color. * replace | Removes the geometry/texture color and applies the symbol `color`. * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) - * + * * @default replace */ colorMixMode?: string; } - export interface colorCreateAgeRendererParamsLegendOptions extends Object { /** * The title used to represent the age color ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) */ title?: string; /** * Indicates whether to include the age renderer in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createAgeRenderer) */ showLegend?: boolean; } - export interface colorCreateClassBreaksRendererParams extends Object { /** * The layer for which the visualization is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The name of the field whose data will be queried for statistics and classified. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ field?: string; /** * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ normalizationField?: string; /** - * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. - * + * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * field | Divides the `field` value by the value of `normalizationField`. This value is set by default if the `normalizationField` is provided. * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use `normalizationTotal` to define the total value by which to normalize. This value is set by default if the `normalizationTotal` is provided. - * + * * With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ normalizationType?: string; /** * When `normalizationType` is `percent-of-total`, this property contains the total of all data values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ normalizationTotal?: number; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** - * The classification method used for generating breaks. See the table below for a list of possible values. - * + * The classification method used for generating breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * equal-interval | Divides the range of attribute values into equal-sized subranges. For example, if you specify three classes for a field whose values range from 0 to 300, this method will create three classes with ranges of 0–100, 101–200, and 201–300. Equal interval is best applied to familiar data ranges, such as percentages and temperature. This method emphasizes the amount of an attribute value relative to other values. For example, it could show if a store is part of the group of stores that make up the top one-third of all sales. * natural-breaks | Groups similar values that maximize the differences between classes. Features are divided into classes whose boundaries are set where there are relatively big differences in the data values. Natural breaks are data-specific classifications and not useful for comparing multiple maps built from different underlying information. * quantile | Assigns the same number of data values to each class. This is well suited to linearly distributed data. Because features are grouped in equal numbers in each class, the resulting map can often be misleading. Similar features can potentially be placed in adjacent classes, or features with widely different values can be put in the same class. You can minimize this distortion by increasing the number of classes. * standard-deviation | Creates class breaks with equal value ranges that are a proportion of the standard deviation. This is usually done at intervals of one, one-half, one-third, or one-fourth standard deviations from the mean. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) - * + * * @default equal-interval */ classificationMethod?: string; /** * If a `standard-deviation` classification method is used, then this indicates the interval by which to generate class breaks. **Possible Values:** 1 | 0.5 | 0.33 | 0.25 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) - * + * * @default 1 */ standardDeviationInterval?: number; /** * The number of class breaks to generate. This is ignored if a `standard-deviation` classification method is specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) - * + * * @default 5 */ numClasses?: number; /** * In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ colorScheme?: ColorScheme; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ valueExpression?: string; /** * Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ sqlExpression?: string; /** * A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ sqlWhere?: string; /** * Provides options for setting a title to describe a field instead of using the field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ legendOptions?: colorCreateClassBreaksRendererParamsLegendOptions; /** * A minimum value set by the user. Use this in conjunction with `maxValue` to generate class breaks between lower and upper bounds. This will be the lower bound of the lowest class break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ minValue?: number; /** * A maximum value set by the user. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. This will be the upper bound of the highest class break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ maxValue?: number; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) - * + * * @default true */ defaultSymbolEnabled?: boolean; /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) - * + * * @default 2d */ symbolType?: string; /** - * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. - * + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * * Value | Description * ------|------------ * tint | Applies the symbol `color` to the desaturated geometry/texture color. * replace | Removes the geometry/texture color and applies the symbol `color`. * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) - * + * * @default replace */ colorMixMode?: string; } - export interface colorCreateClassBreaksRendererParamsLegendOptions extends Object { /** * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer) */ title?: string; } - export interface colorCreateContinuousRendererParams extends Object { /** * The layer for which the visualization is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ field?: string; /** * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ normalizationField?: string; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. - * + * * | Value | Description | Example | * | ----- | ----------- | ------- | * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ theme?: string; /** * In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ colorScheme?: ColorScheme; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ valueExpression?: string; /** * Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ sqlExpression?: string; /** * A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ sqlWhere?: string; /** * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ legendOptions?: colorCreateContinuousRendererParamsLegendOptions; /** * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ statistics?: SummaryStatisticsResult; /** * A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ minValue?: number; /** * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ maxValue?: number; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) - * + * * @default true */ defaultSymbolEnabled?: boolean; /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) - * + * * @default 2d */ symbolType?: string; /** - * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. - * + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * * Value | Description * ------|------------ * tint | Applies the symbol `color` to the desaturated geometry/texture color. * replace | Removes the geometry/texture color and applies the symbol `color`. * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) - * + * * @default replace */ colorMixMode?: string; } - export interface colorCreateContinuousRendererParamsLegendOptions extends Object { /** * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ title?: string; /** * Indicates whether to describe the renderer in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) */ showLegend?: boolean; } - export interface colorCreatePCContinuousRendererParams extends Object { /** * The layer for which the visualization is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) */ layer: PointCloudLayer; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. The only field names used for this renderer type are `elevation` and `intensity`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) */ field: string; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * The size of each point expressed as a percentage. This value will determine point sizes scaled based on the given `density` of points. When the value is `100%`, the size of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%` will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point sizes smaller so there appear to be more gaps between points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) - * + * * @default 100% */ size?: string; /** * The number of points per inch in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) - * + * * @default 25 */ density?: number; /** * In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) */ colorScheme?: ColorScheme; /** * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the stats object here to avoid making a second statistics query to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) */ statistics?: SummaryStatisticsResult; } - export interface colorCreatePCTrueColorRendererParams extends Object { /** * The layer for which the visualization is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCTrueColorRenderer) */ layer: PointCloudLayer; /** * The size of each point expressed as a percentage. This value will determine point sizes scaled based on the given `density` of points. When the value is `100%`, the size of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%` will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point sizes smaller so there appear to be more gaps between points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCTrueColorRenderer) - * + * * @default 100% */ size?: string; /** * The number of points per inch in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCTrueColorRenderer) - * + * * @default 25 */ density?: number; } - export interface colorCreateVisualVariableParams extends Object { /** * The layer for which the visual variable is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ field?: string; /** * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ normalizationField?: string; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) - * + * * @default gray */ basemap?: string | Basemap; /** * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. - * + * * | Value | Description | Example | * | ----- | ----------- | ------- | * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ theme?: string; /** * In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ colorScheme?: ColorScheme; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ valueExpression?: string; /** * Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ sqlExpression?: string; /** * A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ sqlWhere?: string; /** * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ legendOptions?: colorCreateVisualVariableParamsLegendOptions; /** * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ statistics?: SummaryStatisticsResult; /** * A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ minValue?: number; /** * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ maxValue?: number; /** * When generating 3D symbols (except for layers with a `mesh` geometry type), a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** * Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology, except for layers with a `mesh` geometry type. A `view` must be provided if this property is set to `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ worldScale?: boolean; } - export interface colorCreateVisualVariableParamsLegendOptions extends Object { /** * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ title?: string; /** * Indicates whether to describe the renderer in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) */ showLegend?: boolean; @@ -20245,43 +20122,43 @@ declare namespace __esri { /** * The result object of the [createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createContinuousRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) */ export interface ContinuousRendererResult extends Object { /** * The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) */ renderer: ClassBreaksRenderer; /** * A color visual variable configured based on the statistics of the data and the given basemap and scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) */ - visualVariable: ColorVisualVariable; + visualVariable: ColorVariable; /** * The color scheme used by the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) */ colorScheme: ColorScheme; /** * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) */ defaultValuesUsed: boolean; /** * Basic statistics returned from a query to the service for data from the given field name or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) */ statistics: SummaryStatisticsResult; /** * The ID of the basemap used to determine the optimal fill color of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#ContinuousRendererResult) */ basemapId: string; @@ -20289,37 +20166,37 @@ declare namespace __esri { /** * The result object of the [createPCContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCContinuousRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) */ export interface PCContinuousRendererResult extends Object { /** * The renderer object configured to best match the given basemap and the spread of the data. Set this object on the input layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) */ renderer: PointCloudStretchRenderer; /** * The color scheme used by the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) */ colorScheme: ColorScheme; /** * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) */ defaultValuesUsed: boolean; /** * Basic statistics returned from a query to the service for data from the given field name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) */ statistics: SummaryStatisticsResult; /** * The ID of the basemap used to determine the optimal color scheme for the output renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCContinuousRendererResult) */ basemapId: string; @@ -20327,13 +20204,13 @@ declare namespace __esri { /** * The result object of the [createPCTrueColorRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createPCTrueColorRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCTrueColorRendererResult) */ export interface PCTrueColorRendererResult extends Object { /** * The renderer object configured to represent the true color of each point in the point cloud. This gives the PointCloudLayer a realistic visualization of how it looks in the real world. Set this object on the input layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#PCTrueColorRendererResult) */ renderer: PointCloudRGBRenderer; @@ -20341,43 +20218,43 @@ declare namespace __esri { /** * The result object of the [createVisualVariable()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createVisualVariable) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) */ export interface VisualVariableResult extends Object { /** * A color visual variable configured based on the statistics of the data and the given basemap and scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) */ - visualVariable: ColorVisualVariable; + visualVariable: ColorVariable; /** * The color scheme used by the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) */ colorScheme: ColorScheme; /** * Basic statistics returned from a query to the service for the given field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) */ statistics: SummaryStatisticsResult; /** * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) */ defaultValuesUsed: boolean; /** * The ID of the basemap used to determine the optimal fill color of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) */ basemapId: string; /** * Authoring information related to the creation of the visual variable. This includes information related to UI inputs from sliders and selected themes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#VisualVariableResult) */ authoringInfo: AuthoringInfo; @@ -20385,98 +20262,97 @@ declare namespace __esri { /** * This object contains helper methods for generating location-only visualizations (not data-driven) in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) method generates a [SimpleRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html) object that may be applied directly to the layer. This renderer contains a single symbol with a color optimally selected based on the indicated basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html) */ interface location { /** * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to a supported [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The renderer contains a single symbol with a color optimally chosen based on the indicated basemap. In most cases you will provide a `layer` and `basemap` to generate this renderer. If working in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), then the `view` and `symbolType` options should be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) - * + * * @param params Input parameters for generating a location-based visualization. See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. * @param params.locationScheme In authoring apps, the user may select a pre-defined location scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. * @param params.view The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric"`, except for layers with a `mesh` geometryType. - * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. - * + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | - * @param params.colorMixMode - * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. - * + * @param params.colorMixMode + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * * Value | Description * ------|------------ * tint | Applies the symbol `color` to the desaturated geometry/texture color. * replace | Removes the geometry/texture color and applies the symbol `color`. * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. - * + * */ createRenderer(params: locationCreateRendererParams): IPromise; } export const location: location; - export interface locationCreateRendererParams extends Object { /** * The layer for which the visualization is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * In authoring apps, the user may select a pre-defined location scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) */ locationScheme?: LocationScheme; /** * The SceneView instance in which the visualization will be rendered. This parameter is required if `symbolType = "3d-volumetric"`, except for layers with a `mesh` geometryType. - * + * * [Read more...](global.html) */ view?: SceneView; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) - * + * * @default 2d */ symbolType?: string; /** - * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. - * + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * * Value | Description * ------|------------ * tint | Applies the symbol `color` to the desaturated geometry/texture color. * replace | Removes the geometry/texture color and applies the symbol `color`. * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) - * + * * @default replace */ colorMixMode?: string; @@ -20484,25 +20360,25 @@ declare namespace __esri { /** * The result object of the [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#createRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#RendererResult) */ export interface RendererResult extends Object { /** * A simple renderer configured with a single color best suited to match the given basemap. Set this to a layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#RendererResult) */ renderer: SimpleRenderer; /** * The location scheme used by the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#RendererResult) */ locationScheme: LocationScheme; /** * The ID of the basemap used to determine the optimal fill color of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-location.html#RendererResult) */ basemapId: string; @@ -20510,15 +20386,15 @@ declare namespace __esri { /** * This object contains a helper method for generating data-driven visualizations with continuous opacity based on data returned from a field value or expression in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html) */ interface opacity { /** * This method generates an opacity visual variable with default alpha values optimally mapped to data values based on the statistics queried for the indicated field or expression. There are several ways this method may be called. The most common case is by providing a `layer` and a `field`. This is the scenario where the statistics of the data aren't well known and the user doesn't know the which alpha values to map to data values. You can optionally use a `valueExpression` instead of a field to visualize features based on a numeric value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the stats in the `statistics` parameter to avoid making an extra call to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) - * + * * @param params Input parameters for generating an opacity visual variable based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the visual variable is generated. * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. @@ -20532,94 +20408,92 @@ declare namespace __esri { * @param params.minValue A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned visual variable. * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned visual variable. * @param params.view A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. - * + * */ createVisualVariable(params: opacityCreateVisualVariableParams): IPromise; } export const opacity: opacity; - export interface opacityCreateVisualVariableParams extends Object { /** * The layer for which the visual variable is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ field?: string; /** * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ normalizationField?: string; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ valueExpression?: string; /** * Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ sqlExpression?: string; /** * A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ sqlWhere?: string; /** * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ legendOptions?: opacityCreateVisualVariableParamsLegendOptions; /** * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ statistics?: SummaryStatisticsResult; /** * A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ minValue?: number; /** * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ maxValue?: number; /** * A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; } - export interface opacityCreateVisualVariableParamsLegendOptions extends Object { /** * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) */ title?: string; @@ -20627,31 +20501,31 @@ declare namespace __esri { /** * The result object of the [createVisualVariable()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#createVisualVariable) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#VisualVariableResult) */ export interface opacityVisualVariableResult extends Object { /** * An opacity visual variable configured based on the statistics of the data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#VisualVariableResult) */ - visualVariable: OpacityVisualVariable; + visualVariable: OpacityVariable; /** * Basic statistics returned from a query to the service for the given field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#VisualVariableResult) */ statistics: SummaryStatisticsResult; /** * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#VisualVariableResult) */ defaultValuesUsed: boolean; /** * Authoring information related to the creation of the visual variable. This includes information related to UI inputs from sliders and selected themes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-opacity.html#VisualVariableResult) */ authoringInfo: AuthoringInfo; @@ -20659,13 +20533,13 @@ declare namespace __esri { /** * This object contains a helper method for generating a predominance visualization. Visualizing predominance involves coloring a [layer’s](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) features based on which attribute among a set of competing numeric attributes wins or beats the others in total count. Common applications of this include visualizing election results, survey results, and demographic majorities. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html) */ interface predominance { /** - * Generates a predominance renderer based on a set of competing numeric fields. Visualizing predominance involves coloring a [layer’s](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) features based on which attribute among a set of competing numeric attributes wins or beats the others in total count. Common applications of this include visualizing election results, survey results, and demographic majorities. For example, suppose you have a layer of U.S. counties with fields containing the total sales of various crops: wheat, soybeans, corn, cotton, and vegetables. If a feature has the following values for each field: - * + * Generates a predominance renderer based on a set of competing numeric fields. Visualizing predominance involves coloring a [layer’s](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) features based on which attribute among a set of competing numeric attributes wins or beats the others in total count. Common applications of this include visualizing election results, survey results, and demographic majorities. For example, suppose you have a layer of U.S. counties with fields containing the total sales of various crops: wheat, soybeans, corn, cotton, and vegetables. If a feature has the following values for each field: + * * Field Name | Count | Color * -----------|-------|------ * Wheat | 130 | purple @@ -20673,11 +20547,11 @@ declare namespace __esri { * Corn | 0 | yellow * Cotton | 300 | green * Vegetables | 120 | red - * + * * Then the renderer symbolizes the feature with a blue color since Soybeans is the predominant crop. The predominant field of a feature is determined based on the result of an Arcade expression generated by this method. You are required to provide a `layer`, `view`, and list of `fields` to generate this renderer. Optionally, you can set `includeSizeVariable` to `true` to change the size of each feature to indicate how influential the feature is compared to the entire layer as a whole. You can also set `includeOpacityVariable` to `true` to add opacity to each feature depending on how strong the predominant field is compared to all the other fields. For the example above, the feature would likely be opaque since Soybeans beats all other features combined by a wide margin. If the Soybean total were still the highest, but only 301, then the feature would be very transparent, indicating the Soybean total wins, but not by a wide margin. Other options are provided for convenience for more involved custom visualization authoring applications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) - * + * * @param params Input parameters for generating a predominance visualization based on a set of competing field(s). See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.view The view instance in which the visualization will be rendered. @@ -20687,181 +20561,178 @@ declare namespace __esri { * @param params.includeSizeVariable Indicates whether to include data-driven size in the final renderer. If `true`, features will be assigned a sized based on the sum of all competing values in the `fields` param. Features with small total counts will be sized with small icons or lines depending on the geometry type of the layer, and features with large total counts will be sized with large icons or lines. Enabling this option is good for visualizing how influential a particular feature is compared to the dataset as a whole. It removes bias introduced by features with large geographic areas, but relatively small data values. ![predominance-size](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/predominance-size.png) * @param params.legendOptions Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. The `createAgeRenderer()` method generates an Arcade expression and executes a statistics query against the layer for the result of the expression. If statistics for the expression have already been generated, then pass the object here to avoid making a second statistics query. - * @param params.sortBy + * @param params.sortBy * Indicates how values should be sorted in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). See the table below for information about values that may be passed to this parameter. - * + * * Possible Value | Description * ---------------|------------ * count | Unique values/types will be sorted from highest to lowest based on the count of features that fall in each category. * value | Unique values/types will be sorted in the order they were specified in the `fields` parameter. - * + * * **Possible Values:** count | value * @param params.predominanceScheme In authoring apps, the user may select a pre-defined predominance scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. - * + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value. - * @param params.colorMixMode - * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. - * + * @param params.colorMixMode + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * * Value | Description * ------|------------ * tint | Applies the symbol `color` to the desaturated geometry/texture color. * replace | Removes the geometry/texture color and applies the symbol `color`. * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. - * + * */ createRenderer(params: predominanceCreateRendererParams): IPromise; } export const predominance: predominance; - export interface predominanceCreateRendererParams extends Object { /** * The layer for which the visualization is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The view instance in which the visualization will be rendered. - * + * * [Read more...](global.html) */ view: View; /** * A set of competing numeric fields used as the basis of the predominance visualization. For example, if creating an election map, you would indicate the names of each field representing the candidate or political party where total votes are stored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) */ fields: predominanceCreateRendererParamsFields[]; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * Indicates whether to include data-driven opacity in the final renderer. If `true`, features where the predominant value beats all others by a large margin are given a high opacity. Features where the predominant value beats others by a small margin will be assigned a low opacity, indicating that while the feature has a winning value, it doesn't win by much. ![predominance-opacity](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/predominance-opacity.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) */ includeOpacityVariable?: boolean; /** * Indicates whether to include data-driven size in the final renderer. If `true`, features will be assigned a sized based on the sum of all competing values in the `fields` param. Features with small total counts will be sized with small icons or lines depending on the geometry type of the layer, and features with large total counts will be sized with large icons or lines. Enabling this option is good for visualizing how influential a particular feature is compared to the dataset as a whole. It removes bias introduced by features with large geographic areas, but relatively small data values. ![predominance-size](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/predominance-size.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) */ includeSizeVariable?: boolean; /** * Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) */ legendOptions?: predominanceCreateRendererParamsLegendOptions; /** * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. The `createAgeRenderer()` method generates an Arcade expression and executes a statistics query against the layer for the result of the expression. If statistics for the expression have already been generated, then pass the object here to avoid making a second statistics query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) */ statistics?: SummaryStatisticsResult; /** * Indicates how values should be sorted in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). See the table below for information about values that may be passed to this parameter. - * + * * Possible Value | Description * ---------------|------------ * count | Unique values/types will be sorted from highest to lowest based on the count of features that fall in each category. * value | Unique values/types will be sorted in the order they were specified in the `fields` parameter. - * + * * **Possible Values:** count | value - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) - * + * * @default count */ sortBy?: string; /** * In authoring apps, the user may select a pre-defined predominance scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) */ predominanceScheme?: PredominanceScheme; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) - * + * * @default 2d */ symbolType?: string; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) - * + * * @default true */ defaultSymbolEnabled?: boolean; /** - * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. - * + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * * Value | Description * ------|------------ * tint | Applies the symbol `color` to the desaturated geometry/texture color. * replace | Removes the geometry/texture color and applies the symbol `color`. * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) - * + * * @default replace */ colorMixMode?: string; } - export interface predominanceCreateRendererParamsFields extends Object { /** * The name of a numeric field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) */ name: string; /** * The label describing the field name (or category) in the legend. This is should be used if the given field doesn't have an intuitive field name. For example, for a field named `dem` representing the total vote count for the Democratic party, you can set the label to `Democrat` to clarify the name of the category in the final visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) */ label?: string; } - export interface predominanceCreateRendererParamsLegendOptions extends Object { /** * The title used to describe the renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) */ title?: string; /** * Indicates whether to include the renderer in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) */ showLegend?: boolean; @@ -20869,49 +20740,49 @@ declare namespace __esri { /** * The result object of the [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#createRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) */ export interface predominanceRendererResult extends Object { /** * The unique value renderer object representing the predominance visualization. Set this on a layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) */ renderer: UniqueValueRenderer; /** * An array of objects describing the value, symbol, and count of each unique type or category represented in the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) */ predominantCategoryInfos: UniqueValueInfo[]; /** * An array of objects describing the values or categories excluded from consideration in visualizing data from the given fields. The specification of each object matches that of the objects specified in the `predominantCategoryInfos` property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) */ excludedCategoryInfos: any[]; /** * A size visual variable representing the total count of all fields included in the predominance visualization. This is included if the `includeSizeVariable` parameter is true. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) */ size?: sizeVisualVariableResult; /** * An opacity visual variable representing the percentage of the total count comprised by the predominant value of all fields. This variable indicates the strength of a particular value's predominance compared to the other values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) */ opacity?: opacityVisualVariableResult; /** * The predominance scheme used by the renderer based on the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) */ predominanceScheme: PredominanceScheme; /** * The ID of the basemap used to determine the optimal fill color of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html#RendererResult) */ basemapId: string; @@ -20919,24 +20790,24 @@ declare namespace __esri { /** * This object contains a helper method for creating a renderer for exploring the relationship between two numeric attributes. This is commonly known as a [bivariate choropleth](http://www.joshuastevens.net/cartography/make-a-bivariate-choropleth-map/) visualization. This renderer classifies each variable in either 2, 3, or 4 classes along separate color ramps. One of those ramps is rotated 90 degrees and overlaid on the other to create a 2x2, 3x3, or 4x4 square grid. The x-axis indicates the range of values for one variable, and the y-axis indicates the range for the second variable. The squares running diagonal from the lower left corner to the upper right corner indicate features where the two variables may be related or in agreement with one another. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html) */ interface relationship { /** * Generates a relationship renderer (bivariate choropleth) based on a set of competing numeric fields. Each feature's category is determined based on the result of an Arcade expression generated internally by this method. You are required provide a `layer`, `view`, `field1` name, and `field2` name to generate this renderer. Optionally, you can set the `focus` to change the rotation of the legend and the `numClasses` parameter to change the grid size of the legend. Other options are provided for convenience for more involved custom visualization authoring applications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) - * + * * @param params Input parameters for generating a relationship visualization based on a pair of numeric field(s). See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.view The view instance in which the visualization will be rendered. * @param params.field1 A numeric field that will be used to explore its relationship with `field2`. In the default visualization, the values of this field are rendered along the vertical axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * @param params.field2 A numeric field that will be used to explore its relationship with `field1`. In the default visualization, the values of this field are rendered along the horizontal axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * @param params.classificationMethod The method for classifying each field's data values. See [classBreaks](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) for more information about each classification type. **Possible Values:** quantile | equal-interval | natural-breaks - * @param params.focus - * Determines the orientation of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This value does not change the renderer or symbology of any features in the layer. This affects the legend only. See the table below for a description of the possible values. See the class description at the top of this page for a more thorough explanation of how to read the legend. - * + * @param params.focus + * Determines the orientation of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This value does not change the renderer or symbology of any features in the layer. This affects the legend only. See the table below for a description of the possible values. See the class description at the top of this page for a more thorough explanation of how to read the legend. + * * Value | Example | Description * ------|-------------|-------- * null | ![relationship-legend-null](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-null.png) | The legend renders as a square. The top right corner of the legend indicates that values from both `field1` and `field2` are considered high. | @@ -20944,78 +20815,77 @@ declare namespace __esri { * HL | ![relationship-legend-hl](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-hl.png) | The legend renders as a diamond with the focus on the top corner where values from `field1` are high and values from `field2` are low. | * LH | ![relationship-legend-lh](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-lh.png) | The legend renders as a diamond with the focus on the top corner where values from `field1` are low and values from `field2` are high. | * LL | ![relationship-legend-ll](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-ll.png) | The legend renders as a diamond with the focus on the top corner where values from both `field1` and `field2` are considered low. | - * @param params.numClasses - * Indicates the number of classes by which to break up the values of each field. More classes give you more detail, but more colors, making the visualization more difficult to understand. There are only three possible values. - * + * @param params.numClasses + * Indicates the number of classes by which to break up the values of each field. More classes give you more detail, but more colors, making the visualization more difficult to understand. There are only three possible values. + * * 2 classes | 3 classes | 4 classes * --|--|--- * ![relationship-breaks-2](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-2.png) | ![relationship-breaks-3](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-3.png) | ![relationship-breaks-4](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-4.png) - * + * * **Possible Values:** 2 | 3 | 4 * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. * @param params.legendOptions Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. * @param params.relationshipScheme In authoring apps, the user may select a pre-defined relationship scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. - * + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value or that fall outside of the prescribed class breaks. - * @param params.colorMixMode - * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. - * + * @param params.colorMixMode + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * * Value | Description * ------|------------ * tint | Applies the symbol `color` to the desaturated geometry/texture color. * replace | Removes the geometry/texture color and applies the symbol `color`. * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. - * + * */ createRenderer(params: relationshipCreateRendererParams): IPromise; } export const relationship: relationship; - export interface relationshipCreateRendererParams extends Object { /** * The layer for which the visualization is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The view instance in which the visualization will be rendered. - * + * * [Read more...](global.html) */ view: View; /** * A numeric field that will be used to explore its relationship with `field2`. In the default visualization, the values of this field are rendered along the vertical axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ field1: relationshipCreateRendererParamsField1; /** * A numeric field that will be used to explore its relationship with `field1`. In the default visualization, the values of this field are rendered along the horizontal axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ field2: relationshipCreateRendererParamsField2; /** * The method for classifying each field's data values. See [classBreaks](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) for more information about each classification type. **Possible Values:** quantile | equal-interval | natural-breaks - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) - * + * * @default quantile */ classificationMethod?: string; /** - * Determines the orientation of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This value does not change the renderer or symbology of any features in the layer. This affects the legend only. See the table below for a description of the possible values. See the class description at the top of this page for a more thorough explanation of how to read the legend. - * + * Determines the orientation of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This value does not change the renderer or symbology of any features in the layer. This affects the legend only. See the table below for a description of the possible values. See the class description at the top of this page for a more thorough explanation of how to read the legend. + * * Value | Example | Description * ------|-------------|-------- * null | ![relationship-legend-null](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-null.png) | The legend renders as a square. The top right corner of the legend indicates that values from both `field1` and `field2` are considered high. | @@ -21023,153 +20893,150 @@ declare namespace __esri { * HL | ![relationship-legend-hl](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-hl.png) | The legend renders as a diamond with the focus on the top corner where values from `field1` are high and values from `field2` are low. | * LH | ![relationship-legend-lh](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-lh.png) | The legend renders as a diamond with the focus on the top corner where values from `field1` are low and values from `field2` are high. | * LL | ![relationship-legend-ll](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-legend-ll.png) | The legend renders as a diamond with the focus on the top corner where values from both `field1` and `field2` are considered low. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ focus?: string; /** - * Indicates the number of classes by which to break up the values of each field. More classes give you more detail, but more colors, making the visualization more difficult to understand. There are only three possible values. - * + * Indicates the number of classes by which to break up the values of each field. More classes give you more detail, but more colors, making the visualization more difficult to understand. There are only three possible values. + * * 2 classes | 3 classes | 4 classes * --|--|--- * ![relationship-breaks-2](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-2.png) | ![relationship-breaks-3](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-3.png) | ![relationship-breaks-4](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/smartmapping/relationship-breaks-4.png) - * + * * **Possible Values:** 2 | 3 | 4 - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) - * + * * @default 3 */ numClasses?: number; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ legendOptions?: relationshipCreateRendererParamsLegendOptions; /** * In authoring apps, the user may select a pre-defined relationship scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ relationshipScheme?: RelationshipScheme; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) - * + * * @default 2d */ symbolType?: string; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value or that fall outside of the prescribed class breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) - * + * * @default true */ defaultSymbolEnabled?: boolean; /** - * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. - * + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * * Value | Description * ------|------------ * tint | Applies the symbol `color` to the desaturated geometry/texture color. * replace | Removes the geometry/texture color and applies the symbol `color`. * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) - * + * * @default replace */ colorMixMode?: string; } - export interface relationshipCreateRendererParamsField1 extends Object { /** * The name of a numeric field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ field: string; /** * The name of a numeric field used to normalize the given `field`. In choropleth visualizations it is best practice to normalize your data values if they haven't already been normalized. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ normalizationField?: string; /** * The maximum bound of values to visualize in the given field. If a feature's value is greater than this value, then it will be assigned the default symbol of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ maxValue?: number; /** * The minimum bound of values to visualize in the given field. If a feature's value is less than this value, then it will be assigned the default symbol of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ minValue?: number; } - export interface relationshipCreateRendererParamsField2 extends Object { /** * The name of a numeric field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ field: string; /** * The name of a numeric field used to normalize the given `field`. In choropleth visualizations it is best practice to normalize your data values if they haven't already been normalized. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ normalizationField?: string; /** * The maximum bound of values to visualize in the given field. If a feature's value is greater than this value, then it will be assigned the default symbol of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ maxValue?: number; /** * The minimum bound of values to visualize in the given field. If a feature's value is less than this value, then it will be assigned the default symbol of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ minValue?: number; } - export interface relationshipCreateRendererParamsLegendOptions extends Object { /** * The title used to describe the renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ title?: string; /** * Indicates whether to include the renderer in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) */ showLegend?: boolean; @@ -21177,53 +21044,52 @@ declare namespace __esri { /** * The result object of the [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#createRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) */ export interface relationshipRendererResult extends Object { /** * The renderer object representing the relationship visualization. Set this on a layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) */ renderer: UniqueValueRenderer; /** * Describes each class break for both fields considered in the relationship visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) */ classBreaks: RendererResultClassBreaks; /** * Describes each container or bin used in the visualization. Each unique value info object describes a class break for `field1` and `field2`. Therefore, features with the same color fall share will have values that fall in the same class break for `field1` and the same class break for `field2`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) */ uniqueValueInfos: UniqueValueInfo[]; /** * The relationship scheme used by the renderer based on the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) */ relationshipScheme: RelationshipScheme; /** * The ID of the basemap used to determine the optimal fill colors of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) */ basemapId: string; } - export interface RendererResultClassBreaks extends Object { /** * The class breaks generated for values in the `field1` parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) */ field1: ClassBreaksResult; /** * The class breaks generated for values in the `field2` parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html#RendererResult) */ field2: ClassBreaksResult; @@ -21231,60 +21097,60 @@ declare namespace __esri { /** * This object contains helper methods for generating data-driven visualizations with continuous size or class breaks based on a field value or expression from features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The methods in this module generate renderer or visual variable objects that may be applied directly to a supported layer. The renderers specify how features should be visualized based on data values and sizes optimized based on the indicated basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html) */ interface size { /** * Generates a continuous size [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) representing the age of features based on one or more fields. The age of a feature is calculated based on a given `startTime` and `endTime`, one of which must be a date field in the input `layer`. This method generates an Arcade expression and calculates statistics on the output of the expression to accomplish this. The resulting renderer contains a continuous size visual variable that maps optimal sizes based on the indicated basemap to data values based on the resulting statistics of the expression. You are required to provide a `layer`, `view`, `startTime`, and `endTime` to generate this renderer. Optionally, you can set a `unit` for the visualization. Other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the statistics object to the `statistics` parameter to avoid making an extra call to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) - * + * * @param params Input parameters for generating a continuous size visualization of age for time data returned from start and/or end date field(s). See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.view The view instance in which the visualization will be rendered. - * @param params.startTime The name of the field, or a date value representing the start time in the age calculation. If a date value is specified, then the `endTime` paramter must reference a Date field in the layer. - * @param params.endTime The name of the field, or a date value representing the end time in the age calculation. If a date value is specified, then the `startTime` paramter must reference a Date field in the layer. + * @param params.startTime The name of the field, or a date value representing the start time in the age calculation. If a date value is specified, then the `endTime` parameter must reference a Date field in the layer. + * @param params.endTime The name of the field, or a date value representing the end time in the age calculation. If a date value is specified, then the `startTime` parameter must reference a Date field in the layer. * @param params.unit The time unit used to calculate the difference between `endTime` and `startTime`. If a unit is not specified, then a suggested unit is determined based on the spread and distribution of the data. **Possible Values:** years | months | days | hours | minutes | seconds * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. * @param params.legendOptions Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. * @param params.statistics A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. The `createAgeRenderer()` method generates an Arcade expression and executes a statistics query against the layer for the result of the expression. If statistics for the expression have already been generated, then pass the object here to avoid making a second statistics query. * @param params.sizeScheme In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. - * + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value. - * + * */ createAgeRenderer(params: sizeCreateAgeRendererParams): IPromise; /** * Generates a [ClassBreaksRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-ClassBreaksRenderer.html) that may be applied directly to the layer used to call this method. The resulting renderer defines the symbol size of each feature based on the value of the given `field` value. A default size scheme is determined based on the given `basemap`. Depending on the `classificationMethod`, class breaks (or data ranges) are generated based on the statistics of the data. Each feature is assigned a size based on the class break in which the value of the `field` falls. In most cases you will provide a `layer`, `basemap`, `field`, and `classificationMethod` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what sizes to use in the visualization. You can also use a `valueExpression` instead of a `field` to visualize features based on a value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) - * + * * @param params Input parameters for generating a classed size visualization based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. * @param params.field The name of the field whose data will be queried for statistics and classified. This property is ignored if a `valueExpression` is used. * @param params.normalizationField The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. * @param params.normalizationType With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. - * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. - * + * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * field | Divides the `field` value by the value of `normalizationField`. This value is set by default if the `normalizationField` is provided. * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use `normalizationTotal` to define the total value by which to normalize. This value is set by default if the `normalizationTotal` is provided. - * + * * @param params.normalizationTotal When `normalizationType` is `percent-of-total`, this property contains the total of all data values. - * @param params.classificationMethod - * The classification method used for generating breaks. See the table below for a list of possible values. - * + * @param params.classificationMethod + * The classification method used for generating breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * equal-interval | Divides the range of attribute values into equal-sized subranges. For example, if you specify three classes for a field whose values range from 0 to 300, this method will create three classes with ranges of 0–100, 101–200, and 201–300. Equal interval is best applied to familiar data ranges, such as percentages and temperature. This method emphasizes the amount of an attribute value relative to other values. For example, it could show if a store is part of the group of stores that make up the top one-third of all sales. @@ -21303,23 +21169,23 @@ declare namespace __esri { * @param params.maxValue A maximum value set by the user. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. This will be the upper bound of the highest class break. * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. - * + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | - * + * */ createClassBreaksRenderer(params: sizeCreateClassBreaksRendererParams): IPromise; /** * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to the layer used to call this method. The renderer contains a continuous size visual variable that maps marker sizes to specific stop values based on queried statistics from the indicated field or expression. In most cases you will provide a `layer`, `basemap`, and `field` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what sizes to use in the visualization. You can also use a `valueExpression` instead of a `field` to visualize features based on a value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the statistics object to the `statistics` parameter to avoid making an extra call to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) - * + * * @param params Input parameters for generating size visual variables based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the renderer is generated. * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. @@ -21336,23 +21202,23 @@ declare namespace __esri { * @param params.maxValue A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned size visual variable. * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. - * + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | - * + * */ createContinuousRenderer(params: sizeCreateContinuousRendererParams): IPromise; /** * This method generates an array of size visual variables with default stops that are optimally chosen based on the statistics queried for the indicated field or expression and mapped to appropriate sizes. There are two different ways this method may be called. The most common case is by providing a `layer`, `basemap`, and `field`. This is the scenario where the statistics of the data aren't well known and the user doesn't know what sizes to use. You can optionally use a `valueExpression` instead of a field to visualize features based on a numeric value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the object in the `statistics` parameter to avoid making an extra call to the server. You can also provide a `sizeScheme` if you don't want one picked for you. In this case the `basemap` and `theme` options would be ignored. The resulting array of visual variables will contain exactly one size visual variable unless the `axis` parameter is set to "height". - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) - * + * * @param params Input parameters for generating size visual variables based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the visual variables are generated. * @param params.field The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. @@ -21370,7 +21236,7 @@ declare namespace __esri { * @param params.view When generating 3D symbols, a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * @param params.worldScale Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology. A `view` must be provided if this property is set to `true`. * @param params.axis When set to `all`, a single size variable that scales uniformly in all dimensions is generated. When set to `height`, the result contains two size visual variables: the first one sizes the height according to the field statistics, while the second defines a constant size for width and depth. **Possible Values:** all | height - * + * */ createVisualVariables(params: sizeCreateVisualVariablesParams): IPromise; } @@ -21379,49 +21245,49 @@ declare namespace __esri { /** * The result object of the [createAgeRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) */ export interface sizeAgeRendererResult extends Object { /** * The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) */ renderer: ClassBreaksRenderer; /** * Size visual variables configured based on the statistics of the data and the given basemap and scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) */ - visualVariables: SizeVisualVariable[]; + visualVariables: SizeVariable[]; /** * The time unit used to represent age in the output `renderer`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) */ unit: string; /** * The size scheme used by the visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) */ sizeScheme: SizeScheme; /** * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) */ defaultValuesUsed: boolean; /** * Basic statistics returned from a query for the generated expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) */ statistics: SummaryStatisticsResult; /** * The ID of the basemap used to determine the optimal fill color of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#AgeRendererResult) */ basemapId: string; @@ -21429,37 +21295,37 @@ declare namespace __esri { /** * The result object of the [createClassBreaksRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) */ export interface sizeClassBreaksRendererResult extends Object { /** * The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) */ renderer: ClassBreaksRenderer; /** * This object describes class breaks generated from data in a layer for a given field with a specified classification method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) */ classBreaksResult: ClassBreaksResult; /** * The size scheme used by the visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) */ sizeScheme: SizeScheme; /** * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) */ defaultValuesUsed: boolean; /** * The ID of the basemap used to determine the optimal fill color of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ClassBreaksRendererResult) */ basemapId: string; @@ -21467,562 +21333,554 @@ declare namespace __esri { /** * The result object of the [createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) */ export interface sizeContinuousRendererResult extends Object { /** * The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) */ renderer: ClassBreaksRenderer; /** * Size visual variables configured based on the statistics of the data and the given basemap and scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) */ - visualVariables: SizeVisualVariable[]; + visualVariables: SizeVariable[]; /** * The size scheme used by the visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) */ sizeScheme: SizeScheme; /** * Indicates whether default values are used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) */ defaultValuesUsed: boolean; /** * Basic statistics returned from a query to the service for data from the given field name or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) */ statistics: SummaryStatisticsResult; /** * The ID of the basemap used to determine the optimal fill color of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#ContinuousRendererResult) */ basemapId: string; } - export interface sizeCreateAgeRendererParams extends Object { /** * The layer for which the visualization is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The view instance in which the visualization will be rendered. - * + * * [Read more...](global.html) */ view: View; /** - * The name of the field, or a date value representing the start time in the age calculation. If a date value is specified, then the `endTime` paramter must reference a Date field in the layer. - * + * The name of the field, or a date value representing the start time in the age calculation. If a date value is specified, then the `endTime` parameter must reference a Date field in the layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) */ startTime: Date | string | number; /** - * The name of the field, or a date value representing the end time in the age calculation. If a date value is specified, then the `startTime` paramter must reference a Date field in the layer. - * + * The name of the field, or a date value representing the end time in the age calculation. If a date value is specified, then the `startTime` parameter must reference a Date field in the layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) */ endTime: Date | string | number; /** * The time unit used to calculate the difference between `endTime` and `startTime`. If a unit is not specified, then a suggested unit is determined based on the spread and distribution of the data. **Possible Values:** years | months | days | hours | minutes | seconds - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) */ unit?: string; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * Provides options for modifying [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) properties describing the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) */ legendOptions?: sizeCreateAgeRendererParamsLegendOptions; /** * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. The `createAgeRenderer()` method generates an Arcade expression and executes a statistics query against the layer for the result of the expression. If statistics for the expression have already been generated, then pass the object here to avoid making a second statistics query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) */ statistics?: SummaryStatisticsResult; /** * In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) */ sizeScheme?: SizeScheme; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter does not need to be specified for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). A SceneView instance must be provided to the `view` parameter if this option is used. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) - * + * * @default 2d */ symbolType?: string; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) - * + * * @default true */ defaultSymbolEnabled?: boolean; } - export interface sizeCreateAgeRendererParamsLegendOptions extends Object { /** * The title used to represent the age size ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) */ title?: string; /** * Indicates whether to include the age renderer in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createAgeRenderer) */ showLegend?: boolean; } - export interface sizeCreateClassBreaksRendererParams extends Object { /** * The layer for which the visualization is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * The name of the field whose data will be queried for statistics and classified. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ field: string; /** * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ normalizationField?: string; /** - * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. - * + * Indicates how the data is normalized. The data value obtained from the `field` is normalized in one of the following ways before it is compared with the class breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * field | Divides the `field` value by the value of `normalizationField`. This value is set by default if the `normalizationField` is provided. * log | Computes the base 10 logarithm of the data value. This can be a useful approach for some data distributions because it reduces the influence of very large data values. * percent-of-total | Divides the data value by the sum of all data values then multiplies by 100. Use `normalizationTotal` to define the total value by which to normalize. This value is set by default if the `normalizationTotal` is provided. - * + * * With the exception of `log` normalization, data normalization creates a ratio by dividing two values. When comparing attribute values between features, normalization minimizes the effect of varying map areas and the number of observations. For example, dividing the 18 to 30 year old population by the area of a polygon feature yields a density value that can be compared evenly with other features, regardless of their size. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ normalizationType?: string; /** * When `normalizationType` is `percent-of-total`, this property contains the total of all data values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ normalizationTotal?: number; /** - * The classification method used for generating breaks. See the table below for a list of possible values. - * + * The classification method used for generating breaks. See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------ * equal-interval | Divides the range of attribute values into equal-sized subranges. For example, if you specify three classes for a field whose values range from 0 to 300, this method will create three classes with ranges of 0–100, 101–200, and 201–300. Equal interval is best applied to familiar data ranges, such as percentages and temperature. This method emphasizes the amount of an attribute value relative to other values. For example, it could show if a store is part of the group of stores that make up the top one-third of all sales. * natural-breaks | Groups similar values that maximize the differences between classes. Features are divided into classes whose boundaries are set where there are relatively big differences in the data values. Natural breaks are data-specific classifications and not useful for comparing multiple maps built from different underlying information. * quantile | Assigns the same number of data values to each class. This is well suited to linearly distributed data. Because features are grouped in equal numbers in each class, the resulting map can often be misleading. Similar features can potentially be placed in adjacent classes, or features with widely different values can be put in the same class. You can minimize this distortion by increasing the number of classes. * standard-deviation | Creates class breaks with equal value ranges that are a proportion of the standard deviation. This is usually done at intervals of one, one-half, one-third, or one-fourth standard deviations from the mean. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) - * + * * @default equal-interval */ classificationMethod?: string; /** * If a `standard-deviation` classification method is used, then this indicates the interval by which to generate class breaks. **Possible Values:** 1 | 0.5 | 0.33 | 0.25 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) - * + * * @default 1 */ standardDeviationInterval?: number; /** * The number of class breaks to generate. This is ignored if a `standard-deviation` classification method is specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) - * + * * @default 5 */ numClasses?: number; /** * In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ sizeScheme?: SizeScheme; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ valueExpression?: string; /** * Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ sqlExpression?: string; /** * A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ sqlWhere?: string; /** * Provides options for setting a title to describe a field instead of using the field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ legendOptions?: sizeCreateClassBreaksRendererParamsLegendOptions; /** * A minimum value set by the user. Use this in conjunction with `maxValue` to generate class breaks between lower and upper bounds. This will be the lower bound of the lowest class break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ minValue?: number; /** * A maximum value set by the user. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. This will be the upper bound of the highest class break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ maxValue?: number; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) - * + * * @default true */ defaultSymbolEnabled?: boolean; /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) - * + * * @default 2d */ symbolType?: string; } - export interface sizeCreateClassBreaksRendererParamsLegendOptions extends Object { /** * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createClassBreaksRenderer) */ title?: string; } - export interface sizeCreateContinuousRendererParams extends Object { /** * The layer for which the renderer is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ field?: string; /** * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ normalizationField?: string; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ sizeScheme?: SizeScheme; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ valueExpression?: string; /** * Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ sqlExpression?: string; /** * A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ sqlWhere?: string; /** * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ legendOptions?: sizeCreateContinuousRendererParamsLegendOptions; /** * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ statistics?: SummaryStatisticsResult; /** * A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned size visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ minValue?: number; /** * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned size visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ maxValue?: number; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) - * + * * @default true */ defaultSymbolEnabled?: boolean; /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) - * + * * @default 2d */ symbolType?: string; } - export interface sizeCreateContinuousRendererParamsLegendOptions extends Object { /** * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ title?: string; /** * Indicates whether to describe the renderer in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createContinuousRenderer) */ showLegend?: boolean; } - export interface sizeCreateVisualVariablesParams extends Object { /** * The layer for which the visual variables are generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ field: string; /** * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ normalizationField?: string; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) - * + * * @default gray */ basemap?: string | Basemap; /** * In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ sizeScheme?: SizeScheme; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ valueExpression?: string; /** * Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ sqlExpression?: string; /** * A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ sqlWhere?: string; /** * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ legendOptions?: sizeCreateVisualVariablesParamsLegendOptions; /** * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ statistics?: SummaryStatisticsResult; /** * A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned size visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ minValue?: number; /** * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned size visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ maxValue?: number; /** * When generating 3D symbols, a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** * Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology. A `view` must be provided if this property is set to `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ worldScale?: boolean; /** * When set to `all`, a single size variable that scales uniformly in all dimensions is generated. When set to `height`, the result contains two size visual variables: the first one sizes the height according to the field statistics, while the second defines a constant size for width and depth. **Possible Values:** all | height - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) - * + * * @default all */ axis?: string; } - export interface sizeCreateVisualVariablesParamsLegendOptions extends Object { /** * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ title?: string; /** * Indicates whether to describe the renderer in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) */ showLegend?: boolean; @@ -22030,43 +21888,43 @@ declare namespace __esri { /** * The result object of the [createVisualVariables()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#createVisualVariables) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) */ export interface sizeVisualVariableResult extends Object { /** * An array of size visual variables configured based on the statistics of the data and the view scale. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) */ - visualVariables: SizeVisualVariable[]; + visualVariables: SizeVariable[]; /** * The size scheme used by the main visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) */ sizeScheme: SizeScheme; /** * Indicates whether default values were used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) */ defaultValuesUsed: boolean; /** * Basic statistics returned from a query to the service for the given field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) */ statistics: SummaryStatisticsResult; /** * The ID of the basemap used to determine the optimal fill color of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) */ basemapId: string; /** * Authoring information related to the creation of the visual variable. This includes information related to UI inputs from sliders and selected themes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-size.html#VisualVariableResult) */ authoringInfo: AuthoringInfo; @@ -22074,15 +21932,15 @@ declare namespace __esri { /** * This object contains helper methods for generating data-driven visualizations with unique types (or categories) based on a field value from features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) method generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) object that may be applied directly to the layer used to generate it. This renderer contains unique values with colors best suited to the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html) */ interface type { /** * Generates a [PointCloudUniqueValueRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-PointCloudUniqueValueRenderer.html) based on a given field of a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html). This renderer visualizes points of the same type, usually from the `CLASS_CODE` field or an equivalent field that stores information related to the classification of the data (e.g. low vegetation, high vegetation, ground, etc.). The generated renderer visualizes each point with a standard predefined color matching the class code of the point. All that's required is a layer instance and field name. You can optionally set the size and density of the points to suit the needs of the desired visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) - * + * * @param params Input parameters for generating a renderer based on the given field of the input layer. See the table below for details of each parameter. * @param params.layer The layer for which the visualization is generated. * @param params.field The name of the field containing classification data for the given layer. A common field name used for this renderer type is `CLASS_CODE`, though other fields can be used. @@ -22090,27 +21948,27 @@ declare namespace __esri { * @param params.density The number of points per inch in the view. * @param params.typeScheme In authoring apps, the user may select a pre-defined type scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. * @param params.statistics A statistics object generated from the [uniqueValues](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. - * + * */ createPCClassRenderer(params: typeCreatePCClassRendererParams): IPromise; /** * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) that supports renderers. The renderer contains unique symbols representing a string or a numeric value returned from the indicated field. In most cases you will provide a `layer`, `basemap`, and `field` to generate this renderer. This is a scenario in which the values of the field aren't well known and the user doesn't know which colors to use in the visualization. You can also use a `valueExpression` instead of a `field` to visualize features based on a value returned from a script executed at runtime. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) - * + * * @param params Input parameters for generating symbols to represent unique types based on data returned from a given field. See the table below for details of each parameter. * @param params.layer The layer for which the renderer is generated. * @param params.field The name of the field from which to extract unique values that will be used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. * @param params.numTypes The number of types (or categories) displayed by the renderer. Use `-1` to display all returned types. - * @param params.sortBy + * @param params.sortBy * Indicates how values should be sorted in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). See the table below for information about values that may be passed to this parameter. - * + * * Possible Value | Description * ---------------|------------ * count | Unique values/types will be sorted from highest to lowest based on the count of features that fall in each category. * value | Unique values/types will be sorted in alphabetical order. - * + * * **Possible Values:** count | value * @param params.typeScheme In authoring apps, the user may select a pre-defined type scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. * @param params.valueExpression An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number or a string. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. @@ -22118,9 +21976,9 @@ declare namespace __esri { * @param params.legendOptions Provides options for setting a title to a field that will override the field alias defined in the service. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). * @param params.defaultSymbolEnabled Enables the `defaultSymbol` on the renderer and assigns it to features with no value. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter can be ignored for layers with a `mesh` geometry type. Possible values are described below. - * + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter can be ignored for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | @@ -22128,15 +21986,15 @@ declare namespace __esri { * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly-sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | * @param params.statistics A statistics object generated from the [uniqueValues](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. - * @param params.colorMixMode - * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. - * + * @param params.colorMixMode + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * * Value | Description * ------|------------ * tint | Applies the symbol `color` to the desaturated geometry/texture color. * replace | Removes the geometry/texture color and applies the symbol `color`. * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. - * + * */ createRenderer(params: typeCreateRendererParams): IPromise; } @@ -22145,13 +22003,13 @@ declare namespace __esri { /** * The result object of the [createPCClassRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#PCClassRendererResult) */ export interface PCClassRendererResult extends Object { /** * The renderer object configured to represent the class codes in the point cloud. Set this object on the input layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#PCClassRendererResult) */ renderer: PointCloudUniqueValueRenderer; @@ -22159,212 +22017,209 @@ declare namespace __esri { /** * The result object of the [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) */ export interface typeRendererResult extends Object { /** * The renderer object configured to best match the given basemap. Set this on a layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) */ renderer: UniqueValueRenderer; /** * An array of objects describing the value, symbol, and count of each unique type or category represented in the renderer. See the table below describing each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) */ uniqueValueInfos: UniqueValueInfo[]; /** * An array of objects describing the values or categories excluded from consideration in visualizing data from the given field. The specification of each object matches that of the objects specified in the `uniqueValueInfos` property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) */ excludedUniqueValueInfos: any[]; /** * The scheme used to represent each category within the `uniqueValueInfos`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) */ typeScheme: TypeScheme; /** * The ID of the basemap used to determine the optimal color scheme to represent the categorical variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#RendererResult) */ basemapId: string; } - export interface typeCreatePCClassRendererParams extends Object { /** * The layer for which the visualization is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) */ layer: PointCloudLayer; /** * The name of the field containing classification data for the given layer. A common field name used for this renderer type is `CLASS_CODE`, though other fields can be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) */ field: string; /** * The size of each point expressed as a percentage. This value will determine point sizes scaled based on the given `density` of points. When the value is `100%`, the size of each point is set so that it minimizes the number of gaps between neighboring points. Any value above `100%` will allow for points to overlap neighboring points scaled to the given value. Values below `100%` scale point sizes smaller so there appear to be more gaps between points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) - * + * * @default 100% */ size?: string; /** * The number of points per inch in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) - * + * * @default 25 */ density?: number; /** * In authoring apps, the user may select a pre-defined type scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) */ typeScheme?: TypeSchemeForPoint; /** * A statistics object generated from the [uniqueValues](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createPCClassRenderer) */ statistics?: UniqueValuesResult; } - export interface typeCreateRendererParams extends Object { /** * The layer for which the renderer is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The name of the field from which to extract unique values that will be used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ field?: string; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * The number of types (or categories) displayed by the renderer. Use `-1` to display all returned types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) - * + * * @default 10 */ numTypes?: number; /** * Indicates how values should be sorted in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). See the table below for information about values that may be passed to this parameter. - * + * * Possible Value | Description * ---------------|------------ * count | Unique values/types will be sorted from highest to lowest based on the count of features that fall in each category. * value | Unique values/types will be sorted in alphabetical order. - * + * * **Possible Values:** count | value - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) - * + * * @default count */ sortBy?: string; /** * In authoring apps, the user may select a pre-defined type scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ typeScheme?: TypeScheme; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number or a string. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ valueExpression?: string; /** * Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ valueExpressionTitle?: string; /** * Provides options for setting a title to a field that will override the field alias defined in the service. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ legendOptions?: typeCreateRendererParamsLegendOptions; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ defaultSymbolEnabled?: boolean; /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter can be ignored for layers with a `mesh` geometry type. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. This parameter can be ignored for layers with a `mesh` geometry type. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly-sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sized uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) - * + * * @default 2d */ symbolType?: string; /** * A statistics object generated from the [uniqueValues](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ statistics?: UniqueValuesResult; /** - * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. - * + * **This option only applies to generating renderers for mesh SceneLayers**. Specifies how the symbol's color is applied to the geometry color/texture. See the documentation in [FillSymbol3DLayer.material](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#material) for more context. See the table below for possible values. + * * Value | Description * ------|------------ * tint | Applies the symbol `color` to the desaturated geometry/texture color. * replace | Removes the geometry/texture color and applies the symbol `color`. * multiply | Multiplies geometry/texture color value with the symbol `color` value. The result is a darker color. Multiplying with white keeps the geometry color the same. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) - * + * * @default replace */ colorMixMode?: string; } - export interface typeCreateRendererParamsLegendOptions extends Object { /** * The title used to represent the given field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) */ title: string; @@ -22372,31 +22227,31 @@ declare namespace __esri { /** * Describes the symbol, label, and value of a unique value generated by the [createRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#createRenderer) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#UniqueValueInfo) */ export interface UniqueValueInfo extends Object { /** * A unique value representing a type or category of features in a layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#UniqueValueInfo) */ value: string | number; /** * The number of features with the given `value` (or belonging to the given category). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#UniqueValueInfo) */ count: number; /** * The label describing the value or category in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#UniqueValueInfo) */ label: string; /** * The symbol used to represent features belonging to the given category. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-type.html#UniqueValueInfo) */ symbol: Symbol; @@ -22404,15 +22259,15 @@ declare namespace __esri { /** * This object contains helper methods for generating data-driven univariate visualizations using both continuous color and continuous size based on a field value or expression from features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The [createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) method generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) object that may be applied directly to a supported layer. This renderer contains a continuous color and size ramp with optimal colors based on the indicated basemap and mapped to specific break values based on the statistics of the indicated field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html) */ interface univariateColorSize { /** * Generates a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that may be applied directly to a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The renderer contains continuous color and size visual variables that map symbols with optimal colors and sizes based on the indicated basemap to specific stop values based on queried statistics from the indicated field or expression. In most cases you will provide a `layer`, `basemap`, `field`, and `theme` to generate this renderer. This is a scenario in which the statistics of the data aren't well known and the user doesn't know what colors and sizes to use in the visualization. You can also use a `valueExpression` instead of a `field` to visualize features based on a value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the statistics object to the `statistics` parameter to avoid making an extra call to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) - * + * * @param params See the table below for details of each parameter that may be passed to this method. * @param params.layer The layer for which the visual variable is generated. * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. @@ -22429,23 +22284,25 @@ declare namespace __esri { * @param params.colorOptions Options for configuring the color portion of the visualization. * @param params.sizeOptions Options for configuring the size portion of the visualization. * @param params.view The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * @param params.symbolType - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. - * + * @param params.symbolType + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sizes uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | - * + * */ - createContinuousRenderer(params: univariateColorSizeCreateContinuousRendererParams): IPromise; + createContinuousRenderer( + params: univariateColorSizeCreateContinuousRendererParams + ): IPromise; /** * This method generates color and size visual variables, both based on the same given field or expression. These visual variables are generated with default stops that are optimally chosen based on the statistics queried for the indicated field or expression and colors based on the input basemap. There are two different ways this method may be called. The most common case is by providing a `layer`, `basemap`, and `field`. This is the scenario where the statistics of the data aren't well known and the user doesn't know what colors to use. You can optionally use a `valueExpression` instead of a field to visualize features based on a numeric value returned from a script executed at runtime. The other options are provided for convenience for more involved custom visualization authoring applications. For example, if you already generated statistics in another operation, you can pass the object in the `statistics` parameter to avoid making an extra call to the server. You can also provide a `colorScheme` and/or a `sizeScheme` if you don't want one picked for you. In this case the `basemap` and `theme` options would be ignored. The resulting array of visual variables will contain one color visual variable, and one or two size visual variables depending on the value of the `sizeOptions.axis` parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) - * + * * @param params Input parameters for generating color and size visual variables based on data returned from a given field or expression. See the table below for details of each parameter. * @param params.layer The layer for which the visual variable is generated. * @param params.basemap The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. @@ -22462,7 +22319,7 @@ declare namespace __esri { * @param params.sizeOptions Options for configuring the size portion of the visualization. * @param params.view When generating 3D symbols, a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. * @param params.worldScale Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology. A `view` must be provided if this property is set to `true`. - * + * */ createVisualVariables(params: univariateColorSizeCreateVisualVariablesParams): IPromise; } @@ -22471,391 +22328,381 @@ declare namespace __esri { /** * The result object of the [createContinuousRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ export interface univariateColorSizeContinuousRendererResult extends Object { /** * The renderer object configured to best match the given basemap and the spread of the data. Set this on a layer's `renderer` property to update its visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ renderer: ClassBreaksRenderer; /** * Object containing visual variable and scheme information for the color portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ color: ContinuousRendererResultColor; /** * Object containing visual variable and scheme information for the size portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ size: ContinuousRendererResultSize; /** * Indicates whether default values were used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ defaultValuesUsed: boolean; /** * Basic statistics returned from a query to the service for the given field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ statistics: SummaryStatisticsResult; /** * The ID of the basemap used to determine the optimal fill color of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ basemapId: string; } - export interface univariateColorSizeCreateContinuousRendererParams extends Object { /** * The layer for which the visual variable is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) - * + * * @default gray */ basemap?: string | Basemap; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ field?: string; /** * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ normalizationField?: string; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ valueExpression?: string; /** * Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ sqlExpression?: string; /** * A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ sqlWhere?: string; /** * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ statistics?: SummaryStatisticsResult; /** * A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ minValue?: number; /** * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ maxValue?: number; /** * Enables the `defaultSymbol` on the renderer and assigns it to features with no value and features that do not fall within the configured data range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ defaultSymbolEnabled?: boolean; /** * Options for configuring the color portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ colorOptions?: univariateColorSizeCreateContinuousRendererParamsColorOptions; /** * Options for configuring the size portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ sizeOptions?: univariateColorSizeCreateContinuousRendererParamsSizeOptions; /** * The view instance in which the visualization will be rendered. A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is required if `symbolType = "3d-volumetric"` or `3d-volumetric-uniform`. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** - * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. - * + * The type of symbol to generate. This depends on the view in which you are working and the desired visualization. Possible values are described below. + * * | Value | Description | * | ----- | ----------- | * | 2d | Generates a visualization using 2D symbols such as [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html), or [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html). Use this option if generating a visualization for data in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). | * | 3d-flat | Generates a visualization using 3D symbols with flat symbol layers such as [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html), [LineSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html), or [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html). Use this option if generating a 2D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). | * | 3d-volumetric | Generates a visualization using 3D symbols with volumetric symbol layers such as [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), [PathSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html), or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html). Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and only the symbol's height should be variable, for example with cylinders. A SceneView instance must be provided to the `view` parameter if this option is used. | * | 3d-volumetric-uniform | Generates a visualization using uniformly sized 3D symbols with volumetric symbol layers. Use this option if generating a 3D visualization for data in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) and the symbol should be sizes uniformly, for example with spheres. A SceneView instance must be provided to the `view` parameter if this option is used. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) - * + * * @default 2d */ symbolType?: string; } - export interface univariateColorSizeCreateContinuousRendererParamsColorOptions extends Object { /** * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. - * + * * | Value | Description | Example | * | ----- | ----------- | ------- | * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ theme?: string; /** * In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ colorScheme?: ColorScheme; /** * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ legendOptions?: univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions; } - export interface univariateColorSizeCreateContinuousRendererParamsColorOptionsLegendOptions extends Object { /** * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ title: string; } - export interface univariateColorSizeCreateContinuousRendererParamsSizeOptions extends Object { /** * In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ sizeScheme?: SizeScheme; /** * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ legendOptions?: univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions; } - export interface univariateColorSizeCreateContinuousRendererParamsSizeOptionsLegendOptions extends Object { /** * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createContinuousRenderer) */ title: string; } - export interface univariateColorSizeCreateVisualVariablesParams extends Object { /** * The layer for which the visual variable is generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ layer: FeatureLayer | SceneLayer | CSVLayer; /** * The [named string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or basemap object of the Esri basemap that will be paired with the output visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) - * + * * @default gray */ basemap?: string | Basemap; /** * The name of the field whose data will be queried for statistics and used for the basis of the data-driven visualization. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ field?: string; /** * The name of the field to normalize the values of the given `field`. Providing a normalization field helps minimize some visualization errors and standardizes the data so all features are visualized with minimal bias due to area differences or count variation. This option is commonly used when visualizing densities. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ normalizationField?: string; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ valueExpression?: string; /** * Text describing the value returned from the `valueExpression`. This is used by the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ valueExpressionTitle?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ sqlExpression?: string; /** * A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ sqlWhere?: string; /** * A statistics object generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) function. If statistics for the field have already been generated, then pass the object here to avoid making a second statistics query to the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ statistics?: SummaryStatisticsResult; /** * A custom minimum value set by the user. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. This will be the lowest stop in the returned visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ minValue?: number; /** * A custom maximum value set by the user. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. This will be the uppermost stop in the returned visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ maxValue?: number; /** * Options for configuring the color portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ colorOptions?: univariateColorSizeCreateVisualVariablesParamsColorOptions; /** * Options for configuring the size portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ sizeOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptions; /** * When generating 3D symbols, a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance is required. The relevant SceneView or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** * Indicates if the size units of the symbols will be in meters. This should be `true` when generating visualizations with 3D volumetric symbology. A `view` must be provided if this property is set to `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ worldScale?: boolean; } - export interface univariateColorSizeCreateVisualVariablesParamsColorOptions extends Object { /** * Determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. - * + * * | Value | Description | Example | * | ----- | ----------- | ------- | * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ theme?: string; /** * In authoring apps, the user may select a pre-defined color scheme. Pass the scheme object to this property to avoid getting one based on a `theme` and the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ colorScheme?: ColorScheme; /** * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ legendOptions?: univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions; } - export interface univariateColorSizeCreateVisualVariablesParamsColorOptionsLegendOptions extends Object { /** * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ title: string; } - export interface univariateColorSizeCreateVisualVariablesParamsSizeOptions extends Object { /** * When set to `all`, a single size variable that scales uniformly in all dimensions is generated. When set to `height`, the result contains two size visual variables: the first one sizes the height according to the field statistics, while the second defines a constant size for width and depth. **Possible Values:** all | height - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) - * + * * @default all */ axis?: boolean; /** * In authoring apps, the user may select a pre-defined size scheme. Pass the scheme object to this property to avoid getting one based on the `basemap`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ sizeScheme?: SizeScheme; /** * Provides options for setting a title to a field when an expression is provided instead of a field name. This title will represent the field in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ legendOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions; } - export interface univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions extends Object { /** * The title used to represent the given field or expression in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) */ title: string; @@ -22863,107 +22710,103 @@ declare namespace __esri { /** * The result object of the [createVisualVariables()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#createVisualVariables) method. See the table below for details of each property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ export interface VisualVariablesResult extends Object { /** * Object containing visual variable and scheme information for the color portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ color: VisualVariablesResultColor; /** * Object containing visual variable and scheme information for the size portion of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ size: VisualVariablesResultSize; /** * Indicates whether default values were used in the absence of sufficient data and/or statistics from the layer. Default values are typically used when all features have the same field value or no value at all. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ defaultValuesUsed: boolean; /** * Basic statistics returned from a query to the service for the given field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ statistics: SummaryStatisticsResult; /** * The ID of the basemap used to determine the optimal fill color of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ basemapId: string; /** * Authoring information related to the creation of the visual variables. This includes inforamation related to UI inputs from sliders and selected themes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ authoringInfo: AuthoringInfo; } - export interface ContinuousRendererResultColor extends Object { /** * A color visual variable configured based on the statistics of the data and the given basemap and scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ - visualVariable: ColorVisualVariable; + visualVariable: ColorVariable; /** * The color scheme used by the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ colorScheme: ColorScheme; } - export interface ContinuousRendererResultSize extends Object { /** * The size visual variable(s) configured based on the statistics of the data and the view scale. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ - visualVariables: SizeVisualVariable[]; + visualVariables: SizeVariable[]; /** * The size scheme used by the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#ContinuousRendererResult) */ sizeScheme: SizeScheme; } - export interface VisualVariablesResultColor extends Object { /** * A color visual variable configured based on the statistics of the data and the given basemap and scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ - visualVariable: ColorVisualVariable; + visualVariable: ColorVariable; /** * The color scheme used by the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ colorScheme: ColorScheme; } - export interface VisualVariablesResultSize extends Object { /** * The size visual variable(s) configured based on the statistics of the data and the view scale. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ - visualVariables: SizeVisualVariable[]; + visualVariables: SizeVariable[]; /** * The size scheme used by the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html#VisualVariablesResult) */ sizeScheme: SizeScheme; @@ -22971,22 +22814,22 @@ declare namespace __esri { /** * Function for generating class breaks for an input field in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) based on a given classification method and normalization type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html) */ interface classBreaks { /** * Generates class breaks for an input field (or expression) of a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) based on a given classification method and normalization type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) - * + * * @param params See the table below for details about parameters that may be passed to this function. * @param params.layer The layer from which to generate class breaks. * @param params.field The class breaks will be generated based on values of this field. If a field is provided, the values from the given field from all features will be queried in the service. * @param params.normalizationField The field by which to normalize the values returned from the given `field`. - * @param params.classificationMethod - * The method for classifying the data. See the table below for a list of possible values. - * + * @param params.classificationMethod + * The method for classifying the data. See the table below for a list of possible values. + * * | Possible Value | Description | * |---------------|------------ | * | natural-breaks | Data values that cluster are placed into a single class. Class breaks occur where gaps exist between clusters. You should use this method if your data is unevenly distributed; that is, many features have the same or similar values and there are gaps between groups of values. | @@ -23002,7 +22845,7 @@ declare namespace __esri { * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.view A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. * @param params.features A subset of features for which to generate the class breaks. - * + * */ classBreaks(params: classBreaksClassBreaksParams): IPromise; } @@ -23010,92 +22853,90 @@ declare namespace __esri { const __classBreaksMapped: classBreaks; export const classBreaks: typeof __classBreaksMapped.classBreaks; - - export interface classBreaksClassBreaksParams extends Object { /** * The layer from which to generate class breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer; /** * The class breaks will be generated based on values of this field. If a field is provided, the values from the given field from all features will be queried in the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ field?: string; /** * The field by which to normalize the values returned from the given `field`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ normalizationField?: string; /** - * The method for classifying the data. See the table below for a list of possible values. - * + * The method for classifying the data. See the table below for a list of possible values. + * * | Possible Value | Description | * |---------------|------------ | * | natural-breaks | Data values that cluster are placed into a single class. Class breaks occur where gaps exist between clusters. You should use this method if your data is unevenly distributed; that is, many features have the same or similar values and there are gaps between groups of values. | * | equal-interval | Each class has an equal range of values; in other words, the difference between the high and low value is equal for each class. You should use this method if your data is evenly distributed and you want to emphasize the difference in values between the features. | * | quantile | Each class has roughly the same number of features. If your data is evenly distributed and you want to emphasize the difference in relative position between features, you should use the quantile classification method. If, for example, the point values are divided into five classes, points in the highest class would fall into the top fifth of all points. | * | standard-deviation | Class breaks are placed above and below the mean value at intervals of `1`, `0.5`, or `0.25` standard deviations until all the data values are included in a class. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ classificationMethod?: string; /** * When `classificationMethod = "standard-deviation"`, this sets the interval at which each class break should be set (e.g. `0.25`, `0.33`, `0.5`, `1`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ standardDeviationInterval?: number; /** * The minimum bounding value for the class breaks definition. Use this in conjunction with `maxValue` to generate class breaks between lower and upper bounds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ minValue?: number; /** * The maximum bounding value for the class breaks definition. Use this in conjunction with `minValue` to generate class breaks between lower and upper bounds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ maxValue?: number; /** * Indicates the number of classes to generate for the class breaks definition. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ numClasses?: number; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ valueExpression?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ sqlExpression?: string; /** * A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ sqlWhere?: string; /** * A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** * A subset of features for which to generate the class breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) */ features?: Graphic[]; @@ -23103,53 +22944,52 @@ declare namespace __esri { /** * Object returned from the [classBreaks()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) method. This object describes classes generated from data in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) for a given field with a specified classification method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ export interface ClassBreaksResult extends Object { /** * An array of objects describing the class breaks generated from the [classBreaks()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#classBreaks) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ classBreaksInfos: ClassBreaksResultClassBreaksInfos[]; /** * The minimum value of features in the dataset. This will be the lower bound of the lowest class break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ minValue: number; /** * The maximum value of features in the dataset. This will be the upper bound of the highest class break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ maxValue: number; /** * The normalization total if `normalizationType` is set to `percent-of-total` when generating class breaks with [createClassBreaksRenderer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html#createClassBreaksRenderer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ normalizationTotal: number; } - export interface ClassBreaksResultClassBreaksInfos extends Object { /** * The label describing the given class break for use in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ label: string; /** * The lower bound of the class break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ minValue: number; /** * The upper bound of the class break. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-classBreaks.html#ClassBreaksResult) */ maxValue: number; @@ -23157,22 +22997,22 @@ declare namespace __esri { /** * Generates a histogram based on data in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) for a given field. The returned object can be used for displaying a histogram in the UI within visualization authoring applications and analytical apps that query and display statistics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) */ interface histogram { /** * Generates a histogram for data returned from a `field` in a given `layer`. The returned object can be used for displaying a histogram to the UI in visualization authoring applications and analytical apps that query and display statistics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) - * + * * @param params See the table below for details on parameters that may be passed to this function. * @param params.layer The layer for which to generate a histogram. * @param params.field The name of the numeric field for which the histogram will be generated. This property is ignored if a `valueExpression` is used. * @param params.normalizationField The field by which to normalize the values returned from the given `field`. - * @param params.classificationMethod - * The method for classifying the data. See the table below for a list of possible values. - * + * @param params.classificationMethod + * The method for classifying the data. See the table below for a list of possible values. + * * | Possible Value | Description | * |---------------|------------ | * | natural-breaks | Data values that cluster are placed into a single class. Class breaks occur where gaps exist between clusters. You should use this method if your data is unevenly distributed; that is, many features have the same or similar values and there are gaps between groups of values. | @@ -23188,7 +23028,7 @@ declare namespace __esri { * @param params.sqlWhere A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. * @param params.view A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. * @param params.features A subset of features for which to generate the histogram. - * + * */ histogram(params: histogramHistogramParams): IPromise; } @@ -23196,94 +23036,92 @@ declare namespace __esri { const __histogramMapped: histogram; export const histogram: typeof __histogramMapped.histogram; - - export interface histogramHistogramParams extends Object { /** * The layer for which to generate a histogram. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer; /** * The name of the numeric field for which the histogram will be generated. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ field?: string; /** * The field by which to normalize the values returned from the given `field`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ normalizationField?: string; /** - * The method for classifying the data. See the table below for a list of possible values. - * + * The method for classifying the data. See the table below for a list of possible values. + * * | Possible Value | Description | * |---------------|------------ | * | natural-breaks | Data values that cluster are placed into a single class. Class breaks occur where gaps exist between clusters. You should use this method if your data is unevenly distributed; that is, many features have the same or similar values and there are gaps between groups of values. | * | equal-interval | Each class has an equal range of values; in other words, the difference between the high and low value is equal for each class. You should use this method if your data is evenly distributed and you want to emphasize the difference in values between the features. | * | quantile | Each class has roughly the same number of features. If your data is evenly distributed and you want to emphasize the difference in relative position between features, you should use the quantile classification method. If, for example, the point values are divided into five classes, points in the highest class would fall into the top fifth of all points. | * | standard-deviation | Class breaks are placed above and below the mean value at intervals of `1`, `0.5`, or `0.25` standard deviations until all the data values are included in a class. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ classificationMethod?: string; /** * When `classificationMethod = "standard-deviation"`, this sets the interval at which each class break should be set (e.g. `0.25`, `0.33`, `0.5`, `1`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ standardDeviationInterval?: number; /** * The minimum bounding value for the histogram. Use this in conjunction with `maxValue` to generate a histogram between custom lower and upper bounds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ minValue?: number; /** * The maximum bounding value for the histogram. Use this in conjunction with `minValue` to generate a histogram between custom lower and upper bounds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ maxValue?: number; /** * Indicates the number of classes to generate for the histogram. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) - * + * * @default 10 */ numBins?: number; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ valueExpression?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ sqlExpression?: string; /** * A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ sqlWhere?: string; /** * A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** * A subset of features for which to generate the histogram. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) */ features?: Graphic[]; @@ -23291,47 +23129,46 @@ declare namespace __esri { /** * The result returned from the [histogram()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#histogram) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) */ export interface HistogramResult extends Object { /** * An array of objects representing each bin in the histogram. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) */ bins: HistogramResultBins[]; /** * The minimum value returned by the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) */ minValue: number; /** * The maximum value returned by the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) */ maxValue: number; } - export interface HistogramResultBins extends Object { /** * The number of features that are contained between the indicated `minValue` and `maxValue`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) */ count: number; /** * The minimum value of the bin. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) */ minValue: number; /** * The maximum value of the bin. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html#HistogramResult) */ maxValue: number; @@ -23339,15 +23176,15 @@ declare namespace __esri { /** * Function for generating attribute statistics in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) based on values returned from a given field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) */ interface summaryStatistics { /** * Returns an object containing various statistics describing a set of values returned from a field (or expression) in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) - * + * * @param params See the table below for details of each parameter. * @param params.layer The layer from which to generate statistics for the given `field`. * @param params.field The name of the numeric field for which the summary statistics will be generated. This property is ignored if a `valueExpression` is used. @@ -23359,7 +23196,7 @@ declare namespace __esri { * @param params.maxValue The maximum bounding value for the statistics calculation. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. * @param params.view A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. * @param params.features A subset of features for which to calculate the statistics. - * + * */ summaryStatistics(params: summaryStatisticsSummaryStatisticsParams): IPromise; } @@ -23367,116 +23204,114 @@ declare namespace __esri { const __summaryStatisticsMapped: summaryStatistics; export const summaryStatistics: typeof __summaryStatisticsMapped.summaryStatistics; - /** * The statistics returned from the [summaryStatistics()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ export interface SummaryStatisticsResult extends Object { /** * The average of all values returned from the field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ avg: number; /** * The number of features evaluated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ count: number; /** * The maximum of all values returned from the field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ max: number; /** * The minimum of all values returned from the field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ min: number; /** * The standard deviation calculated from values returned from the field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ stddev: number; /** * The sum of all values returned from the field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ sum: number; /** * The calculated variance from all values returned from the field or expression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#SummaryStatisticsResult) */ variance: number; } - export interface summaryStatisticsSummaryStatisticsParams extends Object { /** * The layer from which to generate statistics for the given `field`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer; /** * The name of the numeric field for which the summary statistics will be generated. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ field?: string; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ valueExpression?: string; /** * A SQL expression evaluating to a number. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ sqlExpression?: string; /** * A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ sqlWhere?: string; /** * The field by which to normalize the values returned from the given `field`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ normalizationField?: string; /** * The minimum bounding value for the statistics calculation. Use this in conjunction with `maxValue` to generate statistics between lower and upper bounds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ minValue?: number; /** * The maximum bounding value for the statistics calculation. Use this in conjunction with `minValue` to generate statistics between lower and upper bounds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ maxValue?: number; /** * A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** * A subset of features for which to calculate the statistics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html#summaryStatistics) */ features?: Graphic[]; @@ -23484,15 +23319,15 @@ declare namespace __esri { /** * A function that queries for unique values from a field in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html) */ interface uniqueValues { /** * Returns an object containing an array of unique values queried from a given field (or values returned from an expression) in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) along with the total count of features that belong to the given category. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) - * + * * @param params See the table below for details of each parameter. * @param params.layer The layer from which to query for unique values. * @param params.field The name of the numeric or string field from which the unique values will be obtained. This property is ignored if a `valueExpression` is used. @@ -23502,7 +23337,7 @@ declare namespace __esri { * @param params.returnAllCodedValues Indicates that all domain codes should be returned if the given field has domain values. * @param params.view A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. * @param params.features A subset of features for which to generate the unique values. - * + * */ uniqueValues(params: uniqueValuesUniqueValuesParams): IPromise; } @@ -23510,133 +23345,130 @@ declare namespace __esri { const __uniqueValuesMapped: uniqueValues; export const uniqueValues: typeof __uniqueValuesMapped.uniqueValues; - /** * An object that contains the unique values returned from the [uniqueValues()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) query of a layer's field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#UniqueValuesResult) */ export interface UniqueValuesResult extends Object { /** * An array of objects, each containing a unique value/type/category present in the field specified in the [uniqueValues()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) query. See table below for the specification of each object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#UniqueValuesResult) */ uniqueValueInfos: UniqueValuesResultUniqueValueInfos[]; } - export interface uniqueValuesUniqueValuesParams extends Object { /** * The layer from which to query for unique values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ layer: FeatureLayer | SceneLayer | CSVLayer | PointCloudLayer; /** * The name of the numeric or string field from which the unique values will be obtained. This property is ignored if a `valueExpression` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ field?: string; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression that returns a number or string. This expression can reference field values using the `$feature` global variable. This property overrides the `field` property and therefore is used instead of an input `field` value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ valueExpression?: string; /** * A SQL expression evaluating to a number or string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ sqlExpression?: string; /** * A SQL where clause used to filter features for the statistics query. For example, this is useful in situations where you want to avoid dividing by zero as is the case with creating a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ sqlWhere?: string; /** * Indicates that all domain codes should be returned if the given field has domain values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ returnAllCodedValues?: boolean; /** * A [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) or [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) instance is required when a `valueExpression` is specified. - * + * * [Read more...](global.html) */ view?: View; /** * A subset of features for which to generate the unique values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#uniqueValues) */ features?: Graphic[]; } - export interface UniqueValuesResultUniqueValueInfos extends Object { /** * A unique value representing a type or category of features in the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#UniqueValuesResult) */ value: string | number; /** * The number of features assigned the given `value` (or belonging to the given category). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-uniqueValues.html#UniqueValuesResult) */ count: number; } - interface symbologyColor { /** * Clones a color scheme object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#cloneScheme) - * + * * @param scheme The color scheme object to clone. - * + * */ cloneScheme(scheme: ColorScheme): ColorScheme; /** * Flips the colors in reverse order of the input color scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#flipColors) - * + * * @param scheme The color scheme to reverse. - * + * */ flipColors(scheme: ColorScheme): ColorScheme; /** * Returns all schemes matching the given color ramp. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getMatchingSchemes) - * - * @param theme The name of the theme from which to get color schemes. - * @param colors An array of colors used to match with schemes for the given theme. - * @param geometryType The geometry type of the layer for which the color scheme will be applied. - * @param worldScale Indicates whether 3D volumetric symbols will be used in the visualization. - * @param view The [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance used to calculate the suggested sizes of the symbols. This is required for 3D visualizations. - * + * + * @param params See the table below for details of each parameter that may be passed to this function. + * @param params.theme The name of the theme from which to get color schemes. + * @param params.colors An array of colors used to match with schemes for the given theme. + * @param params.geometryType The geometry type of the layer for which the color scheme will be applied. + * @param params.worldScale Indicates whether 3D volumetric symbols will be used in the visualization. + * @param params.view The [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance used to calculate the suggested sizes of the symbols. This is required for 3D visualizations. + * */ - getMatchingSchemes(theme: string, colors: Color[], geometryType: string, worldScale?: boolean, view?: SceneView): ColorScheme[]; + getMatchingSchemes(params: colorGetMatchingSchemesParams): ColorScheme[]; /** * Returns a primary scheme and secondary schemes defining symbol properties for data-driven color visualizions in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). The `basemap` parameter determines the color schemes of the graphics used to visualize each feature. The `geometryType` determines which type of symbol to return. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) - * + * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features against the given basemap. * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh - * @param params.theme + * @param params.theme * The theme determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. - * + * * | Value | Description | Example | * | ----- | ----------- | ------- | * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | @@ -23645,59 +23477,91 @@ declare namespace __esri { * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. - * + * */ getSchemes(params: colorGetSchemesParams): ColorSchemes; /** * Returns metadata for the available themes. If a `basemap` is provided, returns themes that look best with the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getThemes) - * + * * @param basemap The [Esri basemap string](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) or object that will be used with the returned theme(s). - * + * */ getThemes(basemap?: string | Basemap): any[]; } export const symbologyColor: symbologyColor; + export interface colorGetMatchingSchemesParams extends Object { + /** + * The name of the theme from which to get color schemes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getMatchingSchemes) + */ + theme: string; + /** + * An array of colors used to match with schemes for the given theme. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getMatchingSchemes) + */ + colors: Color[]; + /** + * The geometry type of the layer for which the color scheme will be applied. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getMatchingSchemes) + */ + geometryType: string; + /** + * Indicates whether 3D volumetric symbols will be used in the visualization. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getMatchingSchemes) + */ + worldScale?: boolean; + /** + * The [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance used to calculate the suggested sizes of the symbols. This is required for 3D visualizations. + * + * [Read more...](global.html) + */ + view?: SceneView; + } export interface colorGetSchemesParams extends Object { /** * The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features against the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) */ basemap: string | Basemap; /** * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) */ geometryType: string; /** * The theme determines which values will be emphasized in the continuous ramp and the map. Possible values are listed below. - * + * * | Value | Description | Example | * | ----- | ----------- | ------- | * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) */ theme: string; /** * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. - * + * * [Read more...](global.html) */ view?: SceneView; /** * Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) */ worldScale?: boolean; @@ -23705,58 +23569,58 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize features with attribute data-driven color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorScheme) */ export type ColorScheme = ColorSchemeForPoint | ColorSchemeForPolyline | ColorSchemeForPolygon | ColorSchemeForMesh; /** * Properties defining the symbology scheme used to visualize mesh features with attribute data-driven color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ export interface ColorSchemeForMesh extends Object { /** * The unique id of the color scheme to usee in the visualization. The id is assigned based on the following template: `//`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ id: string; /** * Indicates which values will be emphasized in the continuous ramp and the map. Possible values are listed below. - * + * * | Value | Description | Example | * | ----- | ----------- | ------- | * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ theme: string; /** * The continuous color ramp that will be applied to the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ colors: Color[]; /** * The color of the symbol used to indicate features with no data and features that are out of range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ noDataColor: Color; /** * Predefined classed color schemes to use for the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ colorsForClassBreaks: ColorSchemeForMeshColorsForClassBreaks[]; /** * The opacity of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ opacity: number; @@ -23764,63 +23628,63 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize point features with attribute data-driven color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ export interface ColorSchemeForPoint extends Object { /** * The unique id of the color scheme to usee in the visualization. The id is assigned based on the following template: `//`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ id: string; /** * Indicates which values will be emphasized in the continuous ramp and the map. Possible values are listed below. - * + * * | Value | Description | Example | * | ----- | ----------- | ------- | * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ theme: string; /** * The continuous color ramp that will be applied to the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ colors: Color[]; /** * The color of the symbol used to indicate features with no data and features that are out of range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ noDataColor: Color; /** * Predefined classed color schemes to use for the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ colorsForClassBreaks: ColorSchemeForPointColorsForClassBreaks[]; /** * Properties for defining the outline of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ outline: ColorSchemeForPointOutline; /** * The default size of the symbol in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ size: number; /** * The opacity of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ opacity: number; @@ -23828,57 +23692,57 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize polygon features with attribute data-driven color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) */ export interface ColorSchemeForPolygon extends Object { /** * The unique id of the color scheme to usee in the visualization. The id is assigned based on the following template: `//`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) */ id: string; /** * Indicates which values will be emphasized in the continuous ramp and the map. Possible values are listed below. - * + * * | Value | Description | Example | * | ----- | ----------- | ------- | * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) */ theme: string; /** * The continuous color ramp that will be applied to the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) */ colors: Color[]; /** * The color of the symbol used to indicate features with no data and features that are out of range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) */ noDataColor: Color; /** * Predefined classed color schemes to use for the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) */ colorsForClassBreaks: ColorSchemeForPolygonColorsForClassBreaks[]; /** * Properties for defining the outline of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) */ outline: ColorSchemeForPolygonOutline; /** * The opacity of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) */ opacity: number; @@ -23886,57 +23750,57 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize polyline features with attribute data-driven color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) */ export interface ColorSchemeForPolyline extends Object { /** * The unique id of the color scheme to usee in the visualization. The id is assigned based on the following template: `//`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) */ id: string; /** * Indicates which values will be emphasized in the continuous ramp and the map. Possible values are listed below. - * + * * | Value | Description | Example | * | ----- | ----------- | ------- | * | high-to-low | High values are emphasized with strong colors. | ![high-to-low](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-high-to-low.png) | * | above-and-below | Values centered around a given point (e.g. the average) are visualized with weak colors while other values are emphasized with strong colors. | ![above-and-below](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-above-and-below.png) | * | centered-on | Values centered around a given point (e.g. the average) are emphasized with strong colors while other values are visualized with weak colors. | ![centered-on](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-centered-on.png) | * | extremes | High and low values are emphasized with strong colors. All others are visualized with weak colors. | ![extremes](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/sm-extremes.png) | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) */ theme: string; /** * The continuous color ramp that will be applied to the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) */ colors: Color[]; /** * The color of the symbol used to indicate features with no data and features that are out of range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) */ noDataColor: Color; /** * Predefined classed color schemes to use for the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) */ colorsForClassBreaks: ColorSchemeForPolylineColorsForClassBreaks[]; /** * The default width of the symbol in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) */ width: number; /** * The opacity of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) */ opacity: number; @@ -23944,177 +23808,169 @@ declare namespace __esri { /** * The return object of the [getSchemes()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#getSchemes) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemes) */ export interface ColorSchemes extends Object { /** * The color scheme best suited for the given basemap and geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemes) */ primaryScheme: ColorScheme; /** * Additional color schemes that may be used to visualize data of the given geometry type overlaid on the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemes) */ secondarySchemes: ColorScheme[]; /** * The ID of the basemap associated with the given schemes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemes) */ basemapId: string; } - export interface ColorSchemeForMeshColorsForClassBreaks extends Object { /** * An array of hex color strings. Each color is assigned to a specific break in classed color visualizations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ colors: Color[]; /** * The number of classes used in the classed color visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForMesh) */ numClasses: number; } - export interface ColorSchemeForPointColorsForClassBreaks extends Object { /** * An array of hex color strings. Each color is assigned to a specific break in classed color visualizations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ colors: Color[]; /** * The number of classes used in the classed color visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ numClasses: number; } - export interface ColorSchemeForPointOutline extends Object { /** * The outline color of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ color: Color; /** * The width of the symbol in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPoint) */ width: number; } - export interface ColorSchemeForPolygonColorsForClassBreaks extends Object { /** * An array of hex color strings. Each color is assigned to a specific break in classed color visualizations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) */ colors: Color[]; /** * The number of classes used in the classed color visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) */ numClasses: number; } - export interface ColorSchemeForPolygonOutline extends Object { /** * The outline color of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) */ color: Color; /** * The width of the symbol in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolygon) */ width: number; } - export interface ColorSchemeForPolylineColorsForClassBreaks extends Object { /** * An array of hex color strings. Each color is assigned to a specific break in classed color visualizations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) */ colors: Color[]; /** * The number of classes used in the classed color visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-color.html#ColorSchemeForPolyline) */ numClasses: number; } - interface symbologyLocation { /** * Clones a location scheme object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#cloneScheme) - * + * * @param scheme The location scheme object to clone. - * + * */ cloneScheme(scheme: LocationScheme): LocationScheme; /** * Returns a primary scheme and secondary schemes defining symbol properties for location-only visualizions in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html). The `basemap` parameter determines the color of the graphics used to visualize each feature. The `geometryType` determines which type of symbol to return. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) - * + * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features on top of the given basemap. * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. - * + * */ getSchemes(params: locationGetSchemesParams): LocationSchemes; } export const symbologyLocation: symbologyLocation; - export interface locationGetSchemesParams extends Object { /** * The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features on top of the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) */ basemap: string | Basemap; /** * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) */ geometryType: string; /** * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. - * + * * [Read more...](global.html) */ view?: SceneView; /** * Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) */ worldScale?: boolean; @@ -24122,26 +23978,30 @@ declare namespace __esri { /** * Defines the symbology scheme used to visualize default location-based symbols depending on the layer's geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationScheme) */ - export type LocationScheme = LocationSchemeForPoint | LocationSchemeForPolyline | LocationSchemeForPolygon | LocationSchemeForMesh; + export type LocationScheme = + | LocationSchemeForPoint + | LocationSchemeForPolyline + | LocationSchemeForPolygon + | LocationSchemeForMesh; /** * Properties defining the location-only symbology scheme used to visualize mesh features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForMesh) */ export interface LocationSchemeForMesh extends Object { /** * The color of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForMesh) */ color: Color; /** * The opacity of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForMesh) */ opacity: number; @@ -24149,31 +24009,31 @@ declare namespace __esri { /** * Properties defining the location-only symbology scheme used to visualize point features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPoint) */ export interface LocationSchemeForPoint extends Object { /** * The fill color of the marker symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPoint) */ color: Color; /** * Properties for defining the outline of the marker symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPoint) */ outline: LocationSchemeForPointOutline; /** * The size of the marker symbol in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPoint) */ size: number; /** * The opacity of the marker symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPoint) */ opacity: number; @@ -24181,25 +24041,25 @@ declare namespace __esri { /** * Properties defining the location-only symbology scheme used to visualize polygon features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolygon) */ export interface LocationSchemeForPolygon extends Object { /** * The color of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolygon) */ color: Color; /** * Properties for defining the outline of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolygon) */ outline: LocationSchemeForPolygonOutline; /** * The opacity of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolygon) */ opacity: number; @@ -24207,25 +24067,25 @@ declare namespace __esri { /** * Properties defining the location-only symbology scheme used to visualize polyline features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolyline) */ export interface LocationSchemeForPolyline extends Object { /** * The color of the line symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolyline) */ color: Color; /** * The width of the line symbol in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolyline) */ width: number; /** * The opacity of the line symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolyline) */ opacity: number; @@ -24233,78 +24093,75 @@ declare namespace __esri { /** * The return object of the [getSchemes()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#getSchemes) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemes) */ export interface LocationSchemes extends Object { /** * The location scheme best suited for the given basemap and geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemes) */ primaryScheme: LocationScheme; /** * Additional location schemes that may be used to visualize data of the given geometry type overlaid on the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemes) */ secondarySchemes: LocationScheme[]; /** * The ID of the basemap associated with the given schemes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemes) */ basemapId: string; } - export interface LocationSchemeForPointOutline extends Object { /** * The outline color of the marker symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPoint) */ color: Color; /** * The width of the marker symbol in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPoint) */ width: number; } - export interface LocationSchemeForPolygonOutline extends Object { /** * The outline color of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolygon) */ color: Color; /** * The width of the fill symbol in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-location.html#LocationSchemeForPolygon) */ width: number; } - interface symbologyPredominance { /** * Clones a predominance scheme object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#cloneScheme) - * + * * @param scheme The predominance scheme object to clone. - * + * */ cloneScheme(scheme: PredominanceScheme): PredominanceScheme; /** * Returns a primary scheme and secondary schemes defining symbol properties for predominance-based data-driven visualizations in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The `basemap` parameter determines the color of the symbols used to visualize each feature. The `geometryType` determines which type of symbol to return. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#getSchemes) - * + * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features with the given basemap. * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh @@ -24312,50 +24169,49 @@ declare namespace __esri { * @param params.theme Determines which set of primary and secondary color schemes to return **Possible Values:** default * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. - * + * */ getSchemes(params: predominanceGetSchemesParams): PredominanceSchemes; } export const symbologyPredominance: symbologyPredominance; - export interface predominanceGetSchemesParams extends Object { /** * The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features with the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#getSchemes) */ basemap: string | Basemap; /** * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#getSchemes) */ geometryType: string; /** * The number of unique values to include in the predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#getSchemes) */ numColors: number; /** * Determines which set of primary and secondary color schemes to return **Possible Values:** default - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#getSchemes) - * + * * @default default */ theme?: string; /** * Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#getSchemes) */ worldScale?: boolean; /** * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. - * + * * [Read more...](global.html) */ view?: SceneView; @@ -24363,32 +24219,36 @@ declare namespace __esri { /** * Defines the symbology scheme used to visualize predominance based on the layer's geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceScheme) */ - export type PredominanceScheme = PredominanceSchemeForPoint | PredominanceSchemeForPolyline | PredominanceSchemeForPolygon | PredominanceSchemeForMesh; + export type PredominanceScheme = + | PredominanceSchemeForPoint + | PredominanceSchemeForPolyline + | PredominanceSchemeForPolygon + | PredominanceSchemeForMesh; /** * Properties defining the symbology scheme used to visualize predominance for mesh features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForMesh) */ export interface PredominanceSchemeForMesh extends Object { /** * The fill colors of the mesh symbols used for each category. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForMesh) */ colors: Color[]; /** * The color of the fill symbol used to indicate features with no data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForMesh) */ noDataColor: Color; /** * The opacity of the symbol (0 - 1). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForMesh) */ opacity: number; @@ -24396,37 +24256,37 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize predominance for point features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) */ export interface PredominanceSchemeForPoint extends Object { /** * The fill colors of the point symbols used for each category. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) */ colors: Color[]; /** * The color of the point symbol used to indicate features with no data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) */ noDataColor: Color; /** * Properties for defining the outline of the marker symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) */ outline: PredominanceSchemeForPointOutline; /** * The opacity of the point symbol (0 - 1). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) */ opacity: number; /** * The scheme defining the size visual variable if included in a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) */ sizeScheme: SizeSchemeForPoint; @@ -24434,37 +24294,37 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize predominance for polygon features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) */ export interface PredominanceSchemeForPolygon extends Object { /** * The fill colors of the polygon symbols used for each category. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) */ colors: Color[]; /** * The color of the fill symbol used to indicate features with no data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) */ noDataColor: Color; /** * Properties for defining the outline of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) */ outline: PredominanceSchemeForPolygonOutline; /** * The opacity of the symbol (0 - 1). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) */ opacity: number; /** * The scheme defining the size visual variable if included in a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) */ sizeScheme: SizeSchemeForPolygon; @@ -24472,37 +24332,37 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize predominance for polyline features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolyline) */ export interface PredominanceSchemeForPolyline extends Object { /** * The colors of the line symbols used for each category. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolyline) */ colors: Color[]; /** * The color of the line symbol used to indicate features with no data and features that are out of range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolyline) */ noDataColor: Color; /** * The default width of the line symbol in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolyline) */ width: number; /** * The opacity of the line symbol (0 - 1). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolyline) */ opacity: number; /** * The scheme defining the size visual variable if included in a predominance visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolyline) */ sizeScheme: SizeSchemeForPolyline; @@ -24510,122 +24370,118 @@ declare namespace __esri { /** * The return object of the [getSchemes()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#getSchemes) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemes) */ export interface PredominanceSchemes extends Object { /** * The predominance scheme best suited for the given basemap and geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemes) */ primaryScheme: PredominanceScheme; /** * Additional predominance schemes that may be used to visualize data of the given geometry type overlaid on the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemes) */ secondarySchemes: PredominanceScheme[]; /** * The ID of the basemap associated with the given schemes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemes) */ basemapId: string; } - export interface PredominanceSchemeForPointOutline extends Object { /** * The outline color of the marker symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) */ color: Color; /** * The width of the marker symbol in points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPoint) */ width: number; } - export interface PredominanceSchemeForPolygonOutline extends Object { /** * The outline color of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) */ color: Color; /** * The width of the fill symbol's outline in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-predominance.html#PredominanceSchemeForPolygon) */ width: number; } - interface symbologyRelationship { /** * Clones a relationship (bivariate color) scheme object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#cloneScheme) - * + * * @param scheme The relationship scheme object to clone. - * + * */ cloneScheme(scheme: RelationshipScheme): RelationshipScheme; /** * Returns a primary scheme and secondary schemes defining symbol properties for relationship-based (bivariate choropleth) data-driven visualizations in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The `basemap` parameter determines the color of the symbols used to visualize each feature. The `geometryType` determines which type of symbol to return. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#getSchemes) - * + * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features with the given basemap. * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * @param params.theme Determines which set of primary and secondary color schemes to return **Possible Values:** default * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. - * + * */ getSchemes(params: relationshipGetSchemesParams): RelationshipSchemes; } export const symbologyRelationship: symbologyRelationship; - export interface relationshipGetSchemesParams extends Object { /** * The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features with the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#getSchemes) */ basemap: string | Basemap; /** * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#getSchemes) */ geometryType: string; /** * Determines which set of primary and secondary color schemes to return **Possible Values:** default - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#getSchemes) - * + * * @default default */ theme?: string; /** * Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#getSchemes) */ worldScale?: boolean; /** * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. - * + * * [Read more...](global.html) */ view?: SceneView; @@ -24633,38 +24489,42 @@ declare namespace __esri { /** * Defines the symbology scheme used to visualize relationship renderers (bivariate color) based on the layer's geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipScheme) */ - export type RelationshipScheme = RelationshipSchemeForPoint | RelationshipSchemeForPolyline | RelationshipSchemeForPolygon | RelationshipSchemeForMesh; + export type RelationshipScheme = + | RelationshipSchemeForPoint + | RelationshipSchemeForPolyline + | RelationshipSchemeForPolygon + | RelationshipSchemeForMesh; /** * Properties defining the symbology scheme used to visualize relationship renderers (bivariate color) for mesh features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForMesh) */ export interface RelationshipSchemeForMesh extends Object { /** * The ID uniquely identifying the color scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForMesh) */ id: string; /** * Defines the colors to use in each bin of the relationship visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForMesh) */ colorsForClassBreaks: RelationshipSchemeForMeshColorsForClassBreaks[]; /** * The color of the fill symbol used to indicate features with no data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForMesh) */ noDataColor: Color; /** * The opacity of the fill symbol (0 - 1). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForMesh) */ opacity: number; @@ -24672,43 +24532,43 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize relationship renderers (bivariate color) for point features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) */ export interface RelationshipSchemeForPoint extends Object { /** * The ID uniquely identifying the color scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) */ id: string; /** * Defines the colors to use in each bin of the relationship visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) */ colorsForClassBreaks: RelationshipSchemeForPointColorsForClassBreaks[]; /** * The color of the point symbol used to indicate features with no data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) */ noDataColor: Color; /** * Properties for defining the outline of the marker symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) */ outline: RelationshipSchemeForPointOutline; /** * The opacity of the point symbol (0 - 1). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) */ opacity: number; /** * The size of the point symbol in points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) */ size: number; @@ -24716,37 +24576,37 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize relationship renderers (bivariate color) for polygon features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) */ export interface RelationshipSchemeForPolygon extends Object { /** * The ID uniquely identifying the color scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) */ id: string; /** * Defines the colors to use in each bin of the relationship visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) */ colorsForClassBreaks: RelationshipSchemeForPolygonColorsForClassBreaks[]; /** * The color of the fill symbol used to indicate features with no data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) */ noDataColor: Color; /** * Properties for defining the outline of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) */ outline: RelationshipSchemeForPolygonOutline; /** * The opacity of the fill symbol (0 - 1). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) */ opacity: number; @@ -24754,37 +24614,37 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize relationship renderers (bivariate color) for polyline features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) */ export interface RelationshipSchemeForPolyline extends Object { /** * The ID uniquely identifying the color scheme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) */ id: string; /** * Defines the colors to use in each bin of the relationship visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) */ colorsForClassBreaks: RelationshipSchemeForPolylineColorsForClassBreaks[]; /** * The color of the line symbol used to indicate features with no data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) */ noDataColor: Color; /** * The opacity of the line symbol (0 - 1). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) */ opacity: number; /** * The width of the line symbol in points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) */ width: number; @@ -24792,177 +24652,169 @@ declare namespace __esri { /** * The return object of the [getSchemes()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#getSchemes) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemes) */ export interface RelationshipSchemes extends Object { /** * The relationship scheme best suited for the given basemap and geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemes) */ primaryScheme: RelationshipScheme; /** * Additional relationship schemes that may be used to visualize data of the given geometry type overlaid on the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemes) */ secondarySchemes: RelationshipScheme[]; /** * The ID of the basemap associated with the given schemes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemes) */ basemapId: string; } - export interface RelationshipSchemeForMeshColorsForClassBreaks extends Object { /** * The colors of the fill symbols used for each bin in the relationship visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForMesh) */ colors: Color[][]; /** * The number of breaks (rows/columns) for each variable in the relationship visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForMesh) */ numClasses: number; } - export interface RelationshipSchemeForPointColorsForClassBreaks extends Object { /** * The fill colors of the point symbols used for each bin in the relationship visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) */ colors: Color[][]; /** * The number of breaks (rows/columns) for each variable in the relationship visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) */ numClasses: number; } - export interface RelationshipSchemeForPointOutline extends Object { /** * The outline color of the marker symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) */ color: Color; /** * The width of the outline in points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPoint) */ width: number; } - export interface RelationshipSchemeForPolygonColorsForClassBreaks extends Object { /** * The colors of the fill symbols used for each bin in the relationship visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) */ colors: Color[][]; /** * The number of breaks (rows/columns) for each variable in the relationship visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) */ numClasses: number; } - export interface RelationshipSchemeForPolygonOutline extends Object { /** * The outline color of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) */ color: Color; /** * The width of the outline in points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolygon) */ width: number; } - export interface RelationshipSchemeForPolylineColorsForClassBreaks extends Object { /** * The colors of the line symbols used for each bin in the relationship visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) */ colors: Color[][]; /** * The number of breaks (rows/columns) for each variable in the relationship visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-relationship.html#RelationshipSchemeForPolyline) */ numClasses: number; } - interface symbologySize { /** * Clones a size scheme object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#cloneScheme) - * + * * @param scheme The SizeScheme object to clone. - * + * */ cloneScheme(scheme: SizeScheme): SizeScheme; /** * Returns a primary scheme and secondary schemes defining symbol properties for size-based data-driven visualizions in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). The `basemap` parameter determines the color of the graphics used to visualize each feature. The `geometryType` determines which type of symbol to return. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) - * + * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features against the given basemap. * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. - * + * */ getSchemes(params: sizeGetSchemesParams): SizeSchemes; } export const symbologySize: symbologySize; - export interface sizeGetSchemesParams extends Object { /** * The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features against the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) */ basemap: string | Basemap; /** * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) */ geometryType: string; /** * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. - * + * * [Read more...](global.html) */ view?: SceneView; /** * Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) */ worldScale?: boolean; @@ -24970,62 +24822,62 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize features with attribute data-driven size. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeScheme) */ export type SizeScheme = SizeSchemeForPoint | SizeSchemeForPolyline | SizeSchemeForPolygon; /** * Properties defining the symbology scheme used to visualize point features driven by attribute data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) */ export interface SizeSchemeForPoint extends Object { /** * The fill color of the marker symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) */ color: Color; /** * The color of the marker symbol used to indicate features with no data and features that are out of range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) */ noDataColor: Color; /** * Properties for defining the outline of the marker symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) */ outline: SizeSchemeForPointOutline; /** * The default size of the marker symbol in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) */ size: number; /** * The size of the marker symbol (in pixels or points) used to indicate features with no data and features that are out of range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) */ noDataSize: number; /** * The minimum size of a marker symbol in pixels or points representing features with low data values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) */ minSize: number; /** * The maximum size of a marker symbol in pixels or points representing features with high data values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) */ maxSize: number; /** * The opacity of the marker symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) */ opacity: number; @@ -25033,25 +24885,25 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize polygon features driven by attribute data. When visualized by size, polygons are represented with marker symbols. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) */ export interface SizeSchemeForPolygon extends Object { /** * The scheme defining the symbology of the marker symbol used to represent polygon features by size. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) */ marker: SizeSchemeForPoint; /** * The schema defining the backgound symbol of the feature. This is a fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) */ background: SizeSchemeForPolygonBackground; /** * The opacity of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) */ opacity: number; @@ -25059,49 +24911,49 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize polyline features driven by attribute data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) */ export interface SizeSchemeForPolyline extends Object { /** * The color of the line symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) */ color: Color; /** * The color of the line symbol used to indicate features with no data and features that are out of range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) */ noDataColor: Color; /** * The default width of the line symbol in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) */ width: number; /** * The width of the line symbol in pixels or points used to indicate features with no data and features that are out of range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) */ noDataWidth: number; /** * The minimum width of a line symbol in pixels or points representing features with low data values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) */ minWidth: number; /** * The maximum width of a line symbol in pixels or points representing features with high data values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) */ maxWidth: number; /** * The opacity of the line symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolyline) */ opacity: number; @@ -25109,138 +24961,133 @@ declare namespace __esri { /** * The return object of the [getSchemes()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#getSchemes) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemes) */ export interface SizeSchemes extends Object { /** * The size scheme best suited for the given basemap and geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemes) */ primaryScheme: SizeScheme; /** * Additional size schemes that may be used to visualize data of the given geometry type overlaid on the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemes) */ secondarySchemes: SizeScheme[]; /** * The ID of the basemap associated with the given schemes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemes) */ basemapId: string; } - export interface SizeSchemeForPointOutline extends Object { /** * The outline color of the marker symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) */ color: Color; /** * The width of the marker symbol in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPoint) */ width: number; } - export interface SizeSchemeForPolygonBackground extends Object { /** * The color of the fill symbol representing the polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) */ color: Color; /** * Properties for defining the outline of the background fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) */ outline: SizeSchemeForPolygonBackgroundOutline; } - export interface SizeSchemeForPolygonBackgroundOutline extends Object { /** * The outline color of the background fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) */ color: Color; /** * The width of the background fill symbol's outline in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-size.html#SizeSchemeForPolygon) */ width: number; } - interface symbologyType { /** * Clones a type scheme object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#cloneScheme) - * + * * @param scheme The type scheme object to clone. - * + * */ cloneScheme(scheme: TypeScheme): TypeScheme; /** * Returns a primary scheme and secondary schemes defining symbol properties for type-based data-driven visualizations in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). The `basemap` parameter determines the color of the graphics used to visualize each feature. The `geometryType` determines which type of symbol to return. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) - * + * * @param params See the table below for details of each parameter that may be passed to this function. * @param params.basemap The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features with the given basemap. * @param params.geometryType The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh * @param params.theme Determines whether to return a standardized unique value scheme for point cloud class renderers (i.e. when the `CLASS_CODE` field is driving the visualization in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html)), or to return the other default primary schemes used in other unique value renderers generated for non-point cloud layer types. **Possible Values:** point-cloud-class | default * @param params.worldScale Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. * @param params.view The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. - * + * */ getSchemes(params: typeGetSchemesParams): TypeSchemes; } export const symbologyType: symbologyType; - export interface typeGetSchemesParams extends Object { /** * The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features with the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) */ basemap: string | Basemap; /** * The geometry type of the features to visualize. **Possible Values:** point | multipoint | polyline | polygon | mesh - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) */ geometryType: string; /** * Determines whether to return a standardized unique value scheme for point cloud class renderers (i.e. when the `CLASS_CODE` field is driving the visualization in a [PointCloudLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-PointCloudLayer.html)), or to return the other default primary schemes used in other unique value renderers generated for non-point cloud layer types. **Possible Values:** point-cloud-class | default - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) - * + * * @default default */ theme?: string; /** * Indicates if the size units of the scheme will be in meters. This should be `true` when the scheme is intended for 3D volumetric symbology. A `view` must be provided if this property is set to `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) */ worldScale?: boolean; /** * The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols. - * + * * [Read more...](global.html) */ view?: SceneView; @@ -25248,32 +25095,32 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize features with attribute data-driven types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeScheme) */ export type TypeScheme = TypeSchemeForPoint | TypeSchemeForPolyline | TypeSchemeForPolygon | TypeSchemeForMesh; /** * Properties defining the symbology scheme used to visualize mesh features driven by type-based attribute data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForMesh) */ export interface TypeSchemeForMesh extends Object { /** * The fill colors of the symbols comprising the theme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForMesh) */ colors: Color[]; /** * The color of the fill symbol used to indicate features with no data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForMesh) */ noDataColor: Color; /** * The opacity of the symbol (0 - 1). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForMesh) */ opacity: number; @@ -25281,37 +25128,37 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize point features driven by type-based attribute data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) */ export interface TypeSchemeForPoint extends Object { /** * The fill colors of the point symbols comprising the theme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) */ colors: Color[]; /** * The color of the point symbol used to indicate features with no data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) */ noDataColor: Color; /** * Properties for defining the outline of the marker symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) */ outline: TypeSchemeForPointOutline; /** * The default size of the point symbol in pixels, points, or real-world units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) */ size: number; /** * The opacity of the point symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) */ opacity: number; @@ -25319,31 +25166,31 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize polygon features driven by type-based attribute data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolygon) */ export interface TypeSchemeForPolygon extends Object { /** * The fill colors of the symbols comprising the theme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolygon) */ colors: Color[]; /** * The color of the fill symbol used to indicate features with no data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolygon) */ noDataColor: Color; /** * Properties for defining the outline of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolygon) */ outline: TypeSchemeForPolygonOutline; /** * The opacity of the symbol (0 - 1). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolygon) */ opacity: number; @@ -25351,31 +25198,31 @@ declare namespace __esri { /** * Properties defining the symbology scheme used to visualize polyline features driven by type-based attribute data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolyline) */ export interface TypeSchemeForPolyline extends Object { /** * The colors of the line symbols comprising the theme. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolyline) */ colors: Color[]; /** * The color of the line symbol used to indicate features with no data and features that are out of range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolyline) */ noDataColor: Color; /** * The default width of the line symbol in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolyline) */ width: number; /** * The opacity of the line symbol (0 - 1). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolyline) */ opacity: number; @@ -25383,57 +25230,55 @@ declare namespace __esri { /** * The return object of the [getSchemes()](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#getSchemes) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemes) */ export interface TypeSchemes extends Object { /** * The type scheme best suited for the given basemap and geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemes) */ primaryScheme: TypeScheme; /** * Additional type schemes that may be used to visualize data of the given geometry type overlaid on the given basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemes) */ secondarySchemes: TypeScheme[]; /** * The ID of the basemap associated with the given schemes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemes) */ basemapId: string; } - export interface TypeSchemeForPointOutline extends Object { /** * The outline color of the marker symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) */ color: Color; /** * The width of the marker symbol in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPoint) */ width: number; } - export interface TypeSchemeForPolygonOutline extends Object { /** * The outline color of the fill symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolygon) */ color: Color; /** * The width of the fill symbol's outline in pixels or points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-symbology-type.html#TypeSchemeForPolygon) */ width: number; @@ -25442,79 +25287,77 @@ declare namespace __esri { interface AuthoringInfo extends Accessor, JSONSupport { /** * Indicates which classification method was used if a classed color or classed size renderer was generated using one of the Smart Mapping functions. **Possible Values:** equal-interval | manual | natural-breaks | quantile | standard-deviation - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#classificationMethod) */ classificationMethod: string; /** * A numeric field used for generating a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html) along with [field2](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2). In the default visualization, the values of this field are rendered along the vertical axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) */ field1: AuthoringInfoField1; /** * A numeric field used for generating a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html) along with [field1](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1). In the default visualization, the values of this field are rendered along the horizontal axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) */ field2: AuthoringInfoField2; /** * An array of string values representing field names used for creating a [predominance renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#fields) */ fields: string[]; /** * The focus of a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html). This determines the orientation of the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#focus) */ focus: string; /** * **Only applicable to renderer used in web scenes.** Indicates the unit used in real-world sizes. **Possible Values:** inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#lengthUnit) */ lengthUnit: string; /** * The number of classes used to classify each field of a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html). This determines the number of categories in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#numClasses) */ numClasses: number; /** * Indicates the standard deviation interval for each stop in a classed color or classed size renderer that was generated using the `standard-deviation` classification method. **Possible Values:** 0.25 | 0.33 | 0.5 | 1 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#standardDeviationInterval) */ standardDeviationInterval: number; /** * Indicates the renderer type generated from one of the Smart Mapping functions. **Possible Values:** class-breaks-size | class-breaks-color | classed-color | classed-size | predominance | relationship | univariate-color-size - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#type) */ type: string; /** * Contains authoring properties of visual variables generated from one of the Smart Mapping methods or sliders. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#visualVariables) */ visualVariables: AuthoringInfoVisualVariable[]; /** * Creates a deep clone of the instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#clone) - * - * + * + * */ clone(): AuthoringInfo; } interface AuthoringInfoConstructor { - - - new(properties?: AuthoringInfoProperties): AuthoringInfo; + new (properties?: AuthoringInfoProperties): AuthoringInfo; fromJSON(json: any): AuthoringInfo; } @@ -25524,117 +25367,115 @@ declare namespace __esri { interface AuthoringInfoProperties { /** * Indicates which classification method was used if a classed color or classed size renderer was generated using one of the Smart Mapping functions. **Possible Values:** equal-interval | manual | natural-breaks | quantile | standard-deviation - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#classificationMethod) */ classificationMethod?: string; /** * A numeric field used for generating a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html) along with [field2](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2). In the default visualization, the values of this field are rendered along the vertical axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) */ field1?: AuthoringInfoField1; /** * A numeric field used for generating a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html) along with [field1](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1). In the default visualization, the values of this field are rendered along the horizontal axis of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) */ field2?: AuthoringInfoField2; /** * An array of string values representing field names used for creating a [predominance renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-predominance.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#fields) */ fields?: string[]; /** * The focus of a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html). This determines the orientation of the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#focus) */ focus?: string; /** * **Only applicable to renderer used in web scenes.** Indicates the unit used in real-world sizes. **Possible Values:** inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#lengthUnit) */ lengthUnit?: string; /** * The number of classes used to classify each field of a [relationship renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-relationship.html). This determines the number of categories in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#numClasses) */ numClasses?: number; /** * Indicates the standard deviation interval for each stop in a classed color or classed size renderer that was generated using the `standard-deviation` classification method. **Possible Values:** 0.25 | 0.33 | 0.5 | 1 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#standardDeviationInterval) */ standardDeviationInterval?: number; /** * Indicates the renderer type generated from one of the Smart Mapping functions. **Possible Values:** class-breaks-size | class-breaks-color | classed-color | classed-size | predominance | relationship | univariate-color-size - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#type) */ type?: string; /** * Contains authoring properties of visual variables generated from one of the Smart Mapping methods or sliders. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#visualVariables) */ visualVariables?: AuthoringInfoVisualVariableProperties[]; } - export interface AuthoringInfoField1 extends Object { /** * The name of a numeric field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) */ field: string; /** * The name of a numeric field used to normalize the given `field`. In choropleth visualizations it is best practice to normalize your data values if they haven't already been normalized. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) */ normalizationField?: string; /** * The maximum bound of values to visualize in the given field. If a feature's value is greater than this value, then it will be assigned the default symbol of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) */ maxValue?: number; /** * The minimum bound of values to visualize in the given field. If a feature's value is less than this value, then it will be assigned the default symbol of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field1) */ minValue?: number; } - export interface AuthoringInfoField2 extends Object { /** * The name of a numeric field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) */ field: string; /** * The name of a numeric field used to normalize the given `field`. In choropleth visualizations it is best practice to normalize your data values if they haven't already been normalized. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) */ normalizationField?: string; /** * The maximum bound of values to visualize in the given field. If a feature's value is greater than this value, then it will be assigned the default symbol of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) */ maxValue?: number; /** * The minimum bound of values to visualize in the given field. If a feature's value is less than this value, then it will be assigned the default symbol of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfo.html#field2) */ minValue?: number; @@ -25643,73 +25484,71 @@ declare namespace __esri { interface AuthoringInfoVisualVariable extends Accessor, JSONSupport { /** * If an age or timeline renderer was generated, indicates the end time of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#endTime) */ endTime: string | number; /** * Indicates the field name used for generating the data-driven visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#field) */ field: string; /** * Indicates the value of the upper handle if a slider was used to generate the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#maxSliderValue) */ maxSliderValue: number; /** * Indicates the value of the lower handle if a slider was used to generate the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#minSliderValue) */ minSliderValue: number; /** * If an age or timeline renderer was generated, indicates the start time of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#startTime) */ startTime: string | number; /** * If the UI offers the option to display values based on a ratio or percentage, this indicates which selection was made. **Possible Values:** percent | percent-of-total | ratio - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#style) */ style: string; /** * Indicates the theme selected by the user when generating a renderer or visual variable with one of the Smart Mapping functions. **Possible Values:** above-and-below | centered-on | extremes | high-to-low - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#theme) */ theme: string; /** * The type of visual variable generated. **Possible Values:** color | size | opacity - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#type) */ type: string; /** * If an age or timeline renderer was generated, indicates the time units used. **Possible Values:** seconds | minutes | hours | days | months | years - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#units) */ units: string; /** * Creates a deep clone of the instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#clone) - * - * + * + * */ clone(): AuthoringInfoVisualVariable; } interface AuthoringInfoVisualVariableConstructor { - - - new(properties?: AuthoringInfoVisualVariableProperties): AuthoringInfoVisualVariable; + new (properties?: AuthoringInfoVisualVariableProperties): AuthoringInfoVisualVariable; fromJSON(json: any): AuthoringInfoVisualVariable; } @@ -25719,55 +25558,55 @@ declare namespace __esri { interface AuthoringInfoVisualVariableProperties { /** * If an age or timeline renderer was generated, indicates the end time of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#endTime) */ endTime?: string | number; /** * Indicates the field name used for generating the data-driven visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#field) */ field?: string; /** * Indicates the value of the upper handle if a slider was used to generate the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#maxSliderValue) */ maxSliderValue?: number; /** * Indicates the value of the lower handle if a slider was used to generate the visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#minSliderValue) */ minSliderValue?: number; /** * If an age or timeline renderer was generated, indicates the start time of the visualization. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#startTime) */ startTime?: string | number; /** * If the UI offers the option to display values based on a ratio or percentage, this indicates which selection was made. **Possible Values:** percent | percent-of-total | ratio - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#style) */ style?: string; /** * Indicates the theme selected by the user when generating a renderer or visual variable with one of the Smart Mapping functions. **Possible Values:** above-and-below | centered-on | extremes | high-to-low - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#theme) */ theme?: string; /** * The type of visual variable generated. **Possible Values:** color | size | opacity - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#type) */ type?: string; /** * If an age or timeline renderer was generated, indicates the time units used. **Possible Values:** seconds | minutes | hours | days | months | years - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-AuthoringInfoVisualVariable.html#units) */ units?: string; @@ -25776,31 +25615,29 @@ declare namespace __esri { interface HeatmapColorStop extends Accessor { /** * The color to shade a given pixel based on its calculated pixel intensity [ratio](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#color) */ color: Color; /** * The ratio of a pixel's intensity value to the [minPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#minPixelIntensity) of the renderer. The ratio of each pixel is matched to the corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#color). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio) */ ratio: number; /** * Creates a deep clone of the color stop. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#clone) - * - * + * + * */ clone(): HeatmapColorStop; } interface HeatmapColorStopConstructor { - - - new(properties?: HeatmapColorStopProperties): HeatmapColorStop; + new (properties?: HeatmapColorStopProperties): HeatmapColorStop; } export const HeatmapColorStop: HeatmapColorStopConstructor; @@ -25808,61 +25645,60 @@ declare namespace __esri { interface HeatmapColorStopProperties { /** * The color to shade a given pixel based on its calculated pixel intensity [ratio](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#color) */ color?: Color | number[] | string; /** * The ratio of a pixel's intensity value to the [minPixelIntensity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-HeatmapRenderer.html#minPixelIntensity) of the renderer. The ratio of each pixel is matched to the corresponding [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#color). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-HeatmapColorStop.html#ratio) */ ratio?: number; } - interface supportJsonUtils { /** * Creates a new instance of an appropriate [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-support-jsonUtils.html#fromJSON) - * + * * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](https://developers.arcgis.com/documentation/common-data-types/renderer-objects.htm) for examples of the structure of various input JSON objects. - * + * */ fromJSON(json: any): Renderer; } export const supportJsonUtils: supportJsonUtils; - interface UniqueValueRenderer extends Renderer, VisualVariablesMixin { + interface UniqueValueRenderer extends Renderer, VisualVariablesRenderer { /** - * This property is only relevant When symbolizing polygon features with marker symbols (or [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html)) in the [uniqueValueInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) of this renderer. This is usually done when adding a [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) to the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#visualVariables)) in a bivariate visualization (color indicates a type-based value and size indicates the value of a separate numeric field). Use this property to set a background [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) (or [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) if visualizing data in 3D) to visualize the boundaries of each polygon. - * + * This property is only relevant When symbolizing polygon features with marker symbols (or [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html)) in the [uniqueValueInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) of this renderer. This is usually done when adding a [SizeVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) to the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#visualVariables)) in a bivariate visualization (color indicates a type-based value and size indicates the value of a separate numeric field). Use this property to set a background [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) (or [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) if visualizing data in 3D) to visualize the boundaries of each polygon. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#backgroundFillSymbol) */ backgroundFillSymbol: FillSymbol | PolygonSymbol3D; /** * Label used in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) to describe features assigned the [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol). The [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol) is used to draw all features with unspecified, unmatched values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultLabel) */ defaultLabel: string; /** - * The default symbol used to draw a feature whose value is not matched or specified by the renderer. If `null`, unmatched features will not be assigned a symbol. + * The default symbol used to draw a feature whose value is not matched or specified by the renderer. If `null`, unmatched features will not be assigned a symbol. * > **Known Limitations** SceneLayers with a `mesh` [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) will display unmatching features with a generic symbol even if the `defaultSymbol` is `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol) */ defaultSymbol: Symbol; /** * The name of the attribute field the renderer uses to match unique values or types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) */ field: string; /** - * If needed, specifies the name of an additional attribute field the renderer will use to match values. For example, if you specify two fields: + * If needed, specifies the name of an additional attribute field the renderer will use to match values. For example, if you specify two fields: * ```js * var renderer = { * type: "unique-value", // autocasts as new UniqueValueRenderer() @@ -25881,15 +25717,15 @@ declare namespace __esri { * ] * }; * ``` - * + * * All combinations of values of [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) and `field2` are unique values and * may have their own symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field2) */ field2: string; /** - * If needed, specify the name of a third attribute field the renderer will use to match values. For example, if you specify three fields: + * If needed, specify the name of a third attribute field the renderer will use to match values. For example, if you specify three fields: * ```js * var renderer = { * type: "unique-value", // autocasts as new UniqueValueRenderer() @@ -25909,84 +25745,84 @@ declare namespace __esri { * ] * }; * ``` - * + * * All combinations of values of [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field), [field2](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field2), and `field3` are unique values and * may have their own symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field3) */ field3: string; /** * String inserted between the values if multiple attribute fields are specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#fieldDelimiter) */ fieldDelimiter: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) */ legendOptions: UniqueValueRendererLegendOptions; /** * The type of Renderer. For UniqueValueRenderer this value is always `unique-value`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#type) */ readonly type: "unique-value"; /** * Each element in the array is an object that provides information about a unique value associated with the renderer. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) */ uniqueValueInfos: UniqueValueRendererUniqueValueInfos[]; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to either a string or a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. This property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) for data-driven visualizations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpression) */ valueExpression: string; /** * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpression) property. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the [legendOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpressionTitle) */ valueExpressionTitle: string; /** * Adds a unique value and symbol to the renderer. You can provide the value and its associated symbol as individual arguments or as an info object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#addUniqueValueInfo) - * + * * @param valueOrInfo The value to match. The value can be provided as an individual argument or as an [info object described in uniqueValueInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos). * @param symbol The symbol used to represent features matching the specified `value`. - * + * */ addUniqueValueInfo(valueOrInfo: string | number | any, symbol?: Symbol | SymbolProperties): void; /** * Creates a deep clone of the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#clone) - * - * + * + * */ clone(): UniqueValueRenderer; /** * Returns rendering and legend information (as defined by the renderer) associated with the given graphic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#getUniqueValueInfo) - * + * * @param graphic The graphic whose rendering and legend information will be returned. - * + * */ getUniqueValueInfo(graphic: Graphic): any; /** * Removes a unique value from the renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#removeUniqueValueInfo) - * + * * @param value Value to remove from [uniqueValueInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos). - * + * */ removeUniqueValueInfo(value: string): void; } @@ -25994,45 +25830,45 @@ declare namespace __esri { interface UniqueValueRendererConstructor { /** * UniqueValueRenderer allows you to symbolize features in a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) based on one or more matching string attributes. This is typically done by using unique colors, fill styles, or images to represent features with equal values in a string field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html) */ - new(properties?: UniqueValueRendererProperties): UniqueValueRenderer; + new (properties?: UniqueValueRendererProperties): UniqueValueRenderer; fromJSON(json: any): UniqueValueRenderer; } export const UniqueValueRenderer: UniqueValueRendererConstructor; - interface UniqueValueRendererProperties extends RendererProperties, VisualVariablesMixinProperties { + interface UniqueValueRendererProperties extends RendererProperties, VisualVariablesRendererProperties { /** - * This property is only relevant When symbolizing polygon features with marker symbols (or [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html)) in the [uniqueValueInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) of this renderer. This is usually done when adding a [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) to the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#visualVariables)) in a bivariate visualization (color indicates a type-based value and size indicates the value of a separate numeric field). Use this property to set a background [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) (or [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) if visualizing data in 3D) to visualize the boundaries of each polygon. - * + * This property is only relevant When symbolizing polygon features with marker symbols (or [IconSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html)) in the [uniqueValueInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) of this renderer. This is usually done when adding a [SizeVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) to the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#visualVariables)) in a bivariate visualization (color indicates a type-based value and size indicates the value of a separate numeric field). Use this property to set a background [FillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) (or [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) if visualizing data in 3D) to visualize the boundaries of each polygon. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#backgroundFillSymbol) */ backgroundFillSymbol?: FillSymbolProperties | PolygonSymbol3DProperties; /** * Label used in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) to describe features assigned the [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol). The [default symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol) is used to draw all features with unspecified, unmatched values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultLabel) */ defaultLabel?: string; /** - * The default symbol used to draw a feature whose value is not matched or specified by the renderer. If `null`, unmatched features will not be assigned a symbol. + * The default symbol used to draw a feature whose value is not matched or specified by the renderer. If `null`, unmatched features will not be assigned a symbol. * > **Known Limitations** SceneLayers with a `mesh` [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) will display unmatching features with a generic symbol even if the `defaultSymbol` is `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#defaultSymbol) */ defaultSymbol?: SymbolProperties; /** * The name of the attribute field the renderer uses to match unique values or types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) */ field?: string; /** - * If needed, specifies the name of an additional attribute field the renderer will use to match values. For example, if you specify two fields: + * If needed, specifies the name of an additional attribute field the renderer will use to match values. For example, if you specify two fields: * ```js * var renderer = { * type: "unique-value", // autocasts as new UniqueValueRenderer() @@ -26051,15 +25887,15 @@ declare namespace __esri { * ] * }; * ``` - * + * * All combinations of values of [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) and `field2` are unique values and * may have their own symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field2) */ field2?: string; /** - * If needed, specify the name of a third attribute field the renderer will use to match values. For example, if you specify three fields: + * If needed, specify the name of a third attribute field the renderer will use to match values. For example, if you specify three fields: * ```js * var renderer = { * type: "unique-value", // autocasts as new UniqueValueRenderer() @@ -26079,133 +25915,1089 @@ declare namespace __esri { * ] * }; * ``` - * + * * All combinations of values of [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field), [field2](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field2), and `field3` are unique values and * may have their own symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field3) */ field3?: string; /** * String inserted between the values if multiple attribute fields are specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#fieldDelimiter) */ fieldDelimiter?: string; /** * An object providing options for displaying the renderer in the Legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) */ legendOptions?: UniqueValueRendererLegendOptions; /** * Each element in the array is an object that provides information about a unique value associated with the renderer. Each object has the following specification: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) */ uniqueValueInfos?: UniqueValueRendererUniqueValueInfos[]; /** * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to either a string or a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. This property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#field) for data-driven visualizations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpression) */ valueExpression?: string; /** * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpression) property. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the [legendOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpressionTitle) */ valueExpressionTitle?: string; } - export interface UniqueValueRendererLegendOptions extends Object { /** * Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) and takes precedence over a [field alias](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#alias) or [valueExpressionTitle](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#valueExpressionTitle). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#legendOptions) */ title?: string; } - export interface UniqueValueRendererUniqueValueInfos extends Object { /** * The unique value used to classify features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) */ value: string | number; /** * The symbol used to style features whose value matches `value`. This value may be autocast by specifying the symbol `type`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) */ symbol: Symbol; /** * Label used to describe features matched to this unique value in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html#uniqueValueInfos) */ label?: string; } - interface VisualVariablesMixin { + interface ColorVariable extends VisualVariable, JSONSupport { /** - * Visual variables define the parameters for data-driven geographic visualizations of numeric data. They allow you to easily map continuous ramps of [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable), [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable), [opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable), and/or [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) to minimum and maximum data values of one of the layer's numeric attribute fields. Visual variables can primarily be used in two ways. **1**. Thematic mapping Visual variables allow you to easily create stunning visualizations based on thematic attributes (e.g. population, education, rank, money, magnitude, etc.) in either 2D or 3D. This is accomplished by mapping data values from a numeric field attribute to color, size, and/or opacity values. The renderer then takes over and re-sizes or shades features based on the value of the given field and its position relative to the minimum and maximum values. The sample below uses three visual variables (size, color, and opacity). [![renderer-unique-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/renderer-unique-vv.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-2d/index.html) **2**. Mapping real-world sizes The [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) visual variable can be used to visualize the true sizes of features (e.g. tree canopy, road width, building height, etc.) based on their size in the real world. This can be particularly powerful when working in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). The image below shows a layer of building footprints that uses visual variables to extrude each feature to the true height of the buildings based on data stored in an attribute field. [![renderer-vv-rw](https://developers.arcgis.com/javascript/assets/img/samples/2-extrude-height.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-buildings-3d/index.html) The `visualVariables` property of the renderer is an array of objects called "visual variables". Each object must indicate the type of visual variable to apply (e.g. color, size, opacity, rotation), the numeric field from which to drive the visualization, and the ramp of visual values to map to the data. The following list identifies each visual variable type and provides a link to the specification table of each. - * - * Type | Object Specification | Legend Example - * -----|----------------------|--------------- - * color | [ColorVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-color-vv.png) - * size | [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-size-vv.png) - * opacity | [OpacityVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-opacity-vv.png) - * rotation | [RotationVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) | - - * - * See the [Visualize features with realistic 3D symbols](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) for an example of using multiple visual variables to visualize your data. - * > **Known Limitations** Color and opacity visual variables must not have more than 8 stops and size visual variables must not have more than 6 stops. This does not apply to variables driven by view scale. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-VisualVariablesMixin.html#visualVariables) + * Name of the numeric attribute field by which to normalize the data. If this field is used, then the values in [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#stops) should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#normalizationField) */ - visualVariables: any[]; - } - - interface VisualVariablesMixinConstructor { - - - new(): VisualVariablesMixin; - } - - export const VisualVariablesMixin: VisualVariablesMixinConstructor; - - interface VisualVariablesMixinProperties { + normalizationField: string; /** - * Visual variables define the parameters for data-driven geographic visualizations of numeric data. They allow you to easily map continuous ramps of [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable), [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable), [opacity](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable), and/or [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) to minimum and maximum data values of one of the layer's numeric attribute fields. Visual variables can primarily be used in two ways. **1**. Thematic mapping Visual variables allow you to easily create stunning visualizations based on thematic attributes (e.g. population, education, rank, money, magnitude, etc.) in either 2D or 3D. This is accomplished by mapping data values from a numeric field attribute to color, size, and/or opacity values. The renderer then takes over and re-sizes or shades features based on the value of the given field and its position relative to the minimum and maximum values. The sample below uses three visual variables (size, color, and opacity). [![renderer-unique-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/renderer-unique-vv.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-2d/index.html) **2**. Mapping real-world sizes The [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) visual variable can be used to visualize the true sizes of features (e.g. tree canopy, road width, building height, etc.) based on their size in the real world. This can be particularly powerful when working in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). The image below shows a layer of building footprints that uses visual variables to extrude each feature to the true height of the buildings based on data stored in an attribute field. [![renderer-vv-rw](https://developers.arcgis.com/javascript/assets/img/samples/2-extrude-height.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-buildings-3d/index.html) The `visualVariables` property of the renderer is an array of objects called "visual variables". Each object must indicate the type of visual variable to apply (e.g. color, size, opacity, rotation), the numeric field from which to drive the visualization, and the ramp of visual values to map to the data. The following list identifies each visual variable type and provides a link to the specification table of each. - * - * Type | Object Specification | Legend Example - * -----|----------------------|--------------- - * color | [ColorVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#ColorVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-color-vv.png) - * size | [SizeVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-size-vv.png) - * opacity | [OpacityVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#OpacityVisualVariable) | ![legend-color-vv](https://developers.arcgis.com/javascript/assets/img/apiref/renderers/legend-opacity-vv.png) - * rotation | [RotationVisualVariable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#RotationVisualVariable) | - - * - * See the [Visualize features with realistic 3D symbols](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) for an example of using multiple visual variables to visualize your data. - * > **Known Limitations** Color and opacity visual variables must not have more than 8 stops and size visual variables must not have more than 6 stops. This does not apply to variables driven by view scale. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-VisualVariablesMixin.html#visualVariables) + * An array of sequential objects, or stops, that defines a continuous color ramp. You must specify 2 - 8 stops. In most cases, no more than five are needed. Features with values that fall between the given stops will be assigned colors linearly interpolated along the ramp in relation to the nearest stop values. The stops must be listed in ascending order based on the value of the `value` property in each stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#stops) */ - visualVariables?: any[]; + stops: ColorStop[]; + /** + * The visual variable type. For ColorVariable, this value is always `color`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#type) + */ + readonly type: "color"; + + /** + * Creates a deep clone of the ColorVariable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#clone) + * + * + */ + clone(): ColorVariable; } + interface ColorVariableConstructor { + /** + * The color visual variable is used to visualize features along a continuous color ramp based on the values of a numeric attribute [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#field) or an [expression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#valueExpression). The color ramp is defined along a sequence of [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#stops), where color values are mapped to data values. Data values that fall between two stops are assigned a color that is linearly interpolated based on the value's position relative to the closest defined stops. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html) + */ + + new (properties?: ColorVariableProperties): ColorVariable; + + fromJSON(json: any): ColorVariable; + } + + export const ColorVariable: ColorVariableConstructor; + + interface ColorVariableProperties extends VisualVariableProperties { + /** + * Name of the numeric attribute field by which to normalize the data. If this field is used, then the values in [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#stops) should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#normalizationField) + */ + normalizationField?: string; + /** + * An array of sequential objects, or stops, that defines a continuous color ramp. You must specify 2 - 8 stops. In most cases, no more than five are needed. Features with values that fall between the given stops will be assigned colors linearly interpolated along the ramp in relation to the nearest stop values. The stops must be listed in ascending order based on the value of the `value` property in each stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-ColorVariable.html#stops) + */ + stops?: ColorStopProperties[]; + } + + interface OpacityVariable extends VisualVariable, JSONSupport { + /** + * Name of the numeric attribute field by which to normalize the data. If this field is used, then the values in [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#stops) should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#normalizationField) + */ + normalizationField: string; + /** + * An array of objects that defines the opacity to apply to features in a layer in a sequence of stops. You must specify 2 - 8 stops. In most cases, no more than five are needed. Features with data values that fall between the given stops will be assigned opacity values linearly interpolated along the ramp in relation to the stop values. The stops must be listed in ascending order based on the value of the `value` property in each stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#stops) + */ + stops: OpacityStop[]; + /** + * The visual variable type. For OpacityVariable, this value is always `opacity`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#type) + */ + readonly type: "opacity"; + + /** + * Creates a deep clone of the OpacityVariable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#clone) + * + * + */ + clone(): OpacityVariable; + } + + interface OpacityVariableConstructor { + /** + * The opacity visual variable defines the opacity of each feature's symbol based on a numeric [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#field) value or number returned from an [expression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#valueExpression). You must specify [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#stops) to construct the opacity ramp. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html) + */ + + new (properties?: OpacityVariableProperties): OpacityVariable; + + fromJSON(json: any): OpacityVariable; + } + + export const OpacityVariable: OpacityVariableConstructor; + + interface OpacityVariableProperties extends VisualVariableProperties { + /** + * Name of the numeric attribute field by which to normalize the data. If this field is used, then the values in [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#stops) should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#normalizationField) + */ + normalizationField?: string; + /** + * An array of objects that defines the opacity to apply to features in a layer in a sequence of stops. You must specify 2 - 8 stops. In most cases, no more than five are needed. Features with data values that fall between the given stops will be assigned opacity values linearly interpolated along the ramp in relation to the stop values. The stops must be listed in ascending order based on the value of the `value` property in each stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-OpacityVariable.html#stops) + */ + stops?: OpacityStopProperties[]; + } + + interface RotationVariable extends VisualVariable, JSONSupport { + /** + * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the rotation visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then the following rotation axis will rotate the symbol as indicated by their name. + * + * Possible Value | Description + * ----------------|----------- + * heading | The rotation of the symbol in the horizontal plane (i.e., around the z axis). + * tilt | The rotation of the symbol in the longitudinal vertical plane (i.e., around the x axis). + * roll | The rotation of the symbol in the lateral vertical plane (i.e., around the y axis). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html#axis) + * + * @default heading + */ + axis: string; + /** + * Defines the origin and direction of rotation depending on how the angle of rotation was measured. See the table below for a list of possible values. This property only applies to rotations around the `heading` axis. + * + * Value | Description + * ------|------------ + * geographic | Rotates the symbol from the north in a clockwise direction. + * arithmetic | Rotates the symbol from the east in a counter-clockwise direction. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html#rotationType) + * + * @default geographic + */ + rotationType: string; + /** + * The visual variable type. For RotationVariable, this value is always `rotation`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html#type) + */ + readonly type: "rotation"; + + /** + * Creates a deep clone of the RotationVariable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html#clone) + * + * + */ + clone(): RotationVariable; + } + + interface RotationVariableConstructor { + /** + * The rotation visual variable defines how features rendered with [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html) or [text symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) in a MapView are rotated. The rotation value is determined by mapping the values to data in a field, or by other arithmetic means with an Arcade expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html) + */ + + new (properties?: RotationVariableProperties): RotationVariable; + + fromJSON(json: any): RotationVariable; + } + + export const RotationVariable: RotationVariableConstructor; + + interface RotationVariableProperties extends VisualVariableProperties { + /** + * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the rotation visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then the following rotation axis will rotate the symbol as indicated by their name. + * + * Possible Value | Description + * ----------------|----------- + * heading | The rotation of the symbol in the horizontal plane (i.e., around the z axis). + * tilt | The rotation of the symbol in the longitudinal vertical plane (i.e., around the x axis). + * roll | The rotation of the symbol in the lateral vertical plane (i.e., around the y axis). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html#axis) + * + * @default heading + */ + axis?: string; + /** + * Defines the origin and direction of rotation depending on how the angle of rotation was measured. See the table below for a list of possible values. This property only applies to rotations around the `heading` axis. + * + * Value | Description + * ------|------------ + * geographic | Rotates the symbol from the north in a clockwise direction. + * arithmetic | Rotates the symbol from the east in a counter-clockwise direction. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-RotationVariable.html#rotationType) + * + * @default geographic + */ + rotationType?: string; + } + + interface SizeVariable extends VisualVariable, JSONSupport { + /** + * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the size visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). See the [local scene sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-local/index.html) for an example of this. + * + * Possible Value | Description + * ----------------|----------- + * width | The diameter of the symbol from east to west. + * depth | The diameter of the symbol from north to south. + * height | The height of the symbol. + * width-and-depth | Applies the size visual variable to both width and depth axes. + * all | Applies the size visual variable to all axes. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#axis) + * + * @default all + */ + axis: string; + /** + * Deprecated. Use [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) instead**. The only supported expression is `view.scale`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#expression) + */ + expression: string; + /** + * The maximum data value used in the size ramp. Features whose [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) return a value equal to or higher than the value defined in `maxDataValue` will be rendered at the size defined in [maxSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxSize). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue) + */ + maxDataValue: number; + /** + * The size used to render a feature containing the maximum data value. + * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. + * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). + * * When an object is used, the size of features whose data value (defined in [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression)) is greater than or equal to the [maxDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue) for the given view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxSize) + */ + maxSize: number | ScaleDependentStops; + /** + * The minimum data value used in the size ramp. Features whose [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) return a value equal to or lower than the value defined in `maxDataValue` will be rendered at the size defined in [minSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minSize). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue) + */ + minDataValue: number; + /** + * The size used to render a feature containing the minimum data value. + * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. + * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). + * * When an object is used, the size of features whose data value (defined in [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression)) is greater than or equal to the [minDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue) for the given view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minSize) + */ + minSize: number | ScaleDependentStops; + /** + * The name of the numeric attribute field used to normalize the data in the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field). If this field is used, then the values in [maxDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue) and [minDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue) or [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#stops) should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#normalizationField) + */ + normalizationField: string; + /** + * An array of objects that defines the mapping of data values returned from [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) to icon sizes. You must specify 2 - 6 stops. The stops must be listed in ascending order based on the value of the `value` property in each stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#stops) + */ + stops: SizeStop[]; + /** + * This value must be `outline` when scaling polygon outline widths based on the view scale. If scale-dependent icons are desired, then this property should be ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#target) + */ + target: string; + /** + * The visual variable type. For SizeVariable, this value is always `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#type) + */ + readonly type: "size"; + /** + * When setting a size visual variable on a renderer using an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), this property indicates whether to apply the value defined by the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width), or [depth](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) properties to the corresponding [axis](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#axis) of this visual variable instead of proportionally scaling this axis' value. [View an example](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-3d/index.html) of this. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#useSymbolValue) + */ + useSymbolValue: boolean; + /** + * Specifies how to apply the data value when mapping real-world sizes. See table below for supported values. + * + * Value | Description + * ------|----------- + * radius | The point data value represents the radius of a circular feature. + * diameter | The point data value represents the diameter of a circular feature. + * area | The point data value represents the area of a feature. + * width | The polyline data value represents the width of a line. + * distance | The polyline data value represents the distance from the center line (one half of the width). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueRepresentation) + */ + valueRepresentation: string; + /** + * Indicates the unit of measurement used to interpret the value returned by [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression). For 3D volumetric symbols the default is `meters`. This property should not be used if the data value represents a thematic quantity (e.g. traffic count, census data, etc.). **Possible Values:** unknown | inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueUnit) + */ + valueUnit: string; + + /** + * Creates a deep clone of the SizeVisualVariable. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#clone) + * + * + */ + clone(): SizeVariable; + } + + interface SizeVariableConstructor { + /** + * The size visual variable defines the size of individual features in a layer based on a numeric (often thematic) value. This value comes from one of the following: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) + */ + + new (properties?: SizeVariableProperties): SizeVariable; + + fromJSON(json: any): SizeVariable; + } + + export const SizeVariable: SizeVariableConstructor; + + interface SizeVariableProperties extends VisualVariableProperties { + /** + * Only applicable when working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Defines the axis the size visual variable should be applied to when rendering features with an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html). See the [local scene sample](https://developers.arcgis.com/javascript/latest/sample-code/scene-local/index.html) for an example of this. + * + * Possible Value | Description + * ----------------|----------- + * width | The diameter of the symbol from east to west. + * depth | The diameter of the symbol from north to south. + * height | The height of the symbol. + * width-and-depth | Applies the size visual variable to both width and depth axes. + * all | Applies the size visual variable to all axes. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#axis) + * + * @default all + */ + axis?: string; + /** + * Deprecated. Use [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) instead**. The only supported expression is `view.scale`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#expression) + */ + expression?: string; + /** + * The maximum data value used in the size ramp. Features whose [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) return a value equal to or higher than the value defined in `maxDataValue` will be rendered at the size defined in [maxSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxSize). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue) + */ + maxDataValue?: number; + /** + * The size used to render a feature containing the maximum data value. + * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. + * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). + * * When an object is used, the size of features whose data value (defined in [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression)) is greater than or equal to the [maxDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue) for the given view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxSize) + */ + maxSize?: number | ScaleDependentStops | string; + /** + * The minimum data value used in the size ramp. Features whose [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) return a value equal to or lower than the value defined in `maxDataValue` will be rendered at the size defined in [minSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minSize). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue) + */ + minDataValue?: number; + /** + * The size used to render a feature containing the minimum data value. + * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. + * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). + * * When an object is used, the size of features whose data value (defined in [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression)) is greater than or equal to the [minDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue) for the given view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minSize) + */ + minSize?: number | ScaleDependentStops | string; + /** + * The name of the numeric attribute field used to normalize the data in the given [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field). If this field is used, then the values in [maxDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue) and [minDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue) or [stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#stops) should be normalized as percentages or ratios. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#normalizationField) + */ + normalizationField?: string; + /** + * An array of objects that defines the mapping of data values returned from [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression) to icon sizes. You must specify 2 - 6 stops. The stops must be listed in ascending order based on the value of the `value` property in each stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#stops) + */ + stops?: SizeStopProperties[]; + /** + * This value must be `outline` when scaling polygon outline widths based on the view scale. If scale-dependent icons are desired, then this property should be ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#target) + */ + target?: string; + /** + * When setting a size visual variable on a renderer using an [ObjectSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html), this property indicates whether to apply the value defined by the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width), or [depth](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) properties to the corresponding [axis](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#axis) of this visual variable instead of proportionally scaling this axis' value. [View an example](https://developers.arcgis.com/javascript/latest/sample-code/visualization-multivariate-3d/index.html) of this. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#useSymbolValue) + */ + useSymbolValue?: boolean; + /** + * Specifies how to apply the data value when mapping real-world sizes. See table below for supported values. + * + * Value | Description + * ------|----------- + * radius | The point data value represents the radius of a circular feature. + * diameter | The point data value represents the diameter of a circular feature. + * area | The point data value represents the area of a feature. + * width | The polyline data value represents the width of a line. + * distance | The polyline data value represents the distance from the center line (one half of the width). + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueRepresentation) + */ + valueRepresentation?: string; + /** + * Indicates the unit of measurement used to interpret the value returned by [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field) or [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression). For 3D volumetric symbols the default is `meters`. This property should not be used if the data value represents a thematic quantity (e.g. traffic count, census data, etc.). **Possible Values:** unknown | inches | feet | yards | miles | nautical-miles | millimeters | centimeters | decimeters | meters | kilometers | decimal-degrees + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueUnit) + */ + valueUnit?: string; + } + + /** + * Defines a size visual variable with minimum and maximum bounds. When an object with this specification is applied to the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) property of a renderer, then feature sizes are bounded by min and max data values. Features with values greater than the provided max value are assigned the specified maximum size. Likewise, features with values less than the provided min value are assigned the specified minimum size. Features with values between the min and the max are assigned a corresponding size that is linearly interpolated between the min and max size values. The properties for this size visual variable type are defined below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + export interface BoundedMinMax extends Object { + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + type: string; + /** + * See [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + field?: string; + /** + * See [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#normalizationField). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + normalizationField?: string; + /** + * See [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + valueExpression?: string; + /** + * See [valueExpressionTitle](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpressionTitle). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + valueExpressionTitle?: string; + /** + * See [maxDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + maxDataValue: number; + /** + * The size used to render a feature containing the maximum data value. + * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. + * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + maxSize: string | number; + /** + * See [minDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + minDataValue: number; + /** + * The size used to render a feature containing the minimum data value. + * * When setting a number, sizes are expressed in points for all 2D symbols and 3D flat symbol layers; size is expressed in meters for all 3D volumetric symbols. + * * String values are only supported for 2D symbols and 3D flat symbol layers. Strings may specify size in either points or pixels (e.g. `minSize: "16pt"`, `minSize: "12px"`). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) + */ + minSize: string | number; + } + + /** + * Defines a size visual variable where data values are interpreted as real-world sizes based on a given unit. Features are then sized according to the real-world measurements, not thematic values and screen units. [![renderer-vv-rw](https://developers.arcgis.com/javascript/assets/img/samples/3-trees-3d.png)](https://developers.arcgis.com/javascript/latest/sample-code/visualization-trees-realistic/index.html) The object specification for this object is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#RealWorldSize) + */ + export interface RealWorldSize extends Object { + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#RealWorldSize) + */ + type: string; + /** + * See [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#RealWorldSize) + */ + field?: string; + /** + * See [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#normalizationField). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#RealWorldSize) + */ + normalizationField?: string; + /** + * See [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#RealWorldSize) + */ + valueExpression?: string; + /** + * See [valueUnit](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueUnit). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#RealWorldSize) + */ + valueUnit: string; + /** + * See [valueRepresentation](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueRepresentation). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#RealWorldSize) + */ + valueRepresentation?: string; + } + + /** + * Defines icon sizes in a size visual variable based on minimum and maximum bounds similar to the [BoundedMinMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) case. However, this specification allows the developer to specify various min and max sizes based on the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale). Features with values greater than the provided max value are assigned the specified maximum size for the given view scale. Likewise, features with values less than the provided min value are assigned the specified minimum size for the given view scale. Features with values between the min and the max are assigned a corresponding size linearly interpolated between the provided min and max size values for the given scale value. The object specification for this object is provided below. + * > **Known Limitations** Scale-dependent size visual variables are currently not supported in [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + export interface ScaleDependentIcons extends Object { + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + type: string; + /** + * See [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + field?: string; + /** + * See [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#normalizationField). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + normalizationField?: string; + /** + * This value must be `$view.scale`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + valueExpression?: string; + /** + * **Deprecated since version 4.2. Use `valueExpression` instead**. The only supported expression is `view.scale`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + expression?: string; + /** + * See [maxDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#maxDataValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + maxDataValue: number; + /** + * An object defining the size of features whose data value (defined in `field` or `valueExpression`) is greater than or equal to the `maxDataValue` for the given view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + maxSize: ScaleDependentStops; + /** + * See [minDataValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#minDataValue). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + minDataValue: number; + /** + * An object defining the size of features whose data value (defined in `field` or `valueExpression`) is less than or equal to the `minDataValue` for the given view scale. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) + */ + minSize: ScaleDependentStops; + } + + /** + * Defines feature sizes and outline widths in a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#SizeVisualVariable) based on the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale). It also provides the specification of the `minSize` and `maxSize` properties in a [ScaleDependentIcons](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentIcons) size visual variable. The object specification for this object is provided below. + * > **Known Limitations** Scale-dependent size visual variables are currently not supported in [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentStops) + */ + export interface ScaleDependentStops extends Object { + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentStops) + */ + type: string; + /** + * This value must be `$view.scale`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentStops) + */ + valueExpression: string; + /** + * **Deprecated since version 4.2. Use `valueExpression` instead**. The only supported expression is `view.scale`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentStops) + */ + expression?: string; + /** + * This value must be `outline` when scaling polygon outline widths based on the view scale. If scale-dependent icons are desired, then this property should be ignored. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentStops) + */ + target?: string; + /** + * An array of objects that define the size of the icon (or alternatively the width of the polygon outline) at the given scale `value`. You must specify 2 - 6 stops. The stops must be listed in ascending order based on the value of the `value` property in each stop. When the [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) equals the `value` in a stop, then icons (or outlines) will be rendered with the corresponding size. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ScaleDependentStops) + */ + stops: SizeStop[]; + } + + /** + * Defines two or more stops at which feature sizes are mapped to data values in a size visual variable. Setting two stops will have the same effect as creating a [BoundedMinMax](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#BoundedMinMax) size visual variable. Adding additional stops allows you to map specific sizes to data values. Sizes are interpolated linearly between stop values. The object specification for this object is provided below. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ThematicStops) + */ + export interface ThematicStops extends Object { + /** + * Value must be `size`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ThematicStops) + */ + type: string; + /** + * See [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#field). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ThematicStops) + */ + field?: string; + /** + * See [normalizationField](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#normalizationField). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ThematicStops) + */ + normalizationField?: string; + /** + * See [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#valueExpression). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ThematicStops) + */ + valueExpression?: string; + /** + * An array of objects defining the thematic size ramp in a sequence of data or expression stops. At least two stops are required. The stops must be listed in ascending order based on the value of the `value` property in each stop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html#ThematicStops) + */ + stops: SizeStop[]; + } + + interface ColorStop extends Accessor, JSONSupport { + /** + * The [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#value). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#color) + */ + color: Color; + /** + * A string value used to label the stop along the color ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#label) + */ + label: string; + /** + * Specifies the data value to map to the given [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#color). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#value) + */ + value: number; + + /** + * Creates a deep clone of the ColorStop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#clone) + * + * + */ + clone(): ColorStop; + } + + interface ColorStopConstructor { + new (properties?: ColorStopProperties): ColorStop; + + fromJSON(json: any): ColorStop; + } + + export const ColorStop: ColorStopConstructor; + + interface ColorStopProperties { + /** + * The [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#value). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#color) + */ + color?: Color | number[] | string; + /** + * A string value used to label the stop along the color ramp in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#label) + */ + label?: string; + /** + * Specifies the data value to map to the given [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#color). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-ColorStop.html#value) + */ + value?: number; + } + + interface OpacityStop extends Accessor, JSONSupport { + /** + * The opacity value (between `0` and `1`) used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#value). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#color) + */ + color: Color; + /** + * A string value used to label the stop in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#label) + */ + label: string; + /** + * Specifies the data value to map to the given [opacity value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#opacity). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#value) + */ + value: number; + + /** + * Creates a deep clone of the OpacityStop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#clone) + * + * + */ + clone(): OpacityStop; + } + + interface OpacityStopConstructor { + new (properties?: OpacityStopProperties): OpacityStop; + + fromJSON(json: any): OpacityStop; + } + + export const OpacityStop: OpacityStopConstructor; + + interface OpacityStopProperties { + /** + * The opacity value (between `0` and `1`) used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#value). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#color) + */ + color?: Color | number[] | string; + /** + * A string value used to label the stop in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#label) + */ + label?: string; + /** + * Specifies the data value to map to the given [opacity value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#opacity). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-OpacityStop.html#value) + */ + value?: number; + } + + interface SizeStop extends Accessor, JSONSupport { + /** + * A string value used to label the stop in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#label) + */ + label: string; + /** + * The size value in points (between `0` and `90`) used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#value). This value may also be autocast from a string in points or pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#size) + */ + size: number; + /** + * Specifies the data value to map to the given [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#size). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#value) + */ + value: number; + + /** + * Creates a deep clone of the SizeStop. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#clone) + * + * + */ + clone(): SizeStop; + } + + interface SizeStopConstructor { + new (properties?: SizeStopProperties): SizeStop; + + fromJSON(json: any): SizeStop; + } + + export const SizeStop: SizeStopConstructor; + + interface SizeStopProperties { + /** + * A string value used to label the stop in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#label) + */ + label?: string; + /** + * The size value in points (between `0` and `90`) used to render features with the given [value](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#value). This value may also be autocast from a string in points or pixels. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#size) + */ + size?: number | string; + /** + * Specifies the data value to map to the given [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#size). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-support-SizeStop.html#value) + */ + value?: number; + } + + interface VisualVariable extends Accessor, JSONSupport { + /** + * The name of the numeric attribute field that contains the data values used to determine the color/opacity/size/rotation of each feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#field) + */ + field: string; + /** + * The index of the visual variable in relation to its position in the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) property of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#index) + */ + index: string | number; + /** + * An object providing options for displaying the visual variable in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#legendOptions) + */ + legendOptions: VisualVariableLegendOptions; + /** + * The visual variable type. **Possible values:** color | opacity | rotation | size + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#type) + */ + readonly type: string; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#field). Therefore, this property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#field) in visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#valueExpression) + */ + valueExpression: string; + /** + * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#valueExpression) property. This is displayed as the title of the corresponding visual variable in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the [legendOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#legendOptions) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#valueExpressionTitle) + */ + valueExpressionTitle: string; + } + + interface VisualVariableConstructor { + /** + * The visual variable base class. See each of the subclasses that extend this class to learn how to create continuous data-driven thematic visualizations. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html) + */ + + new (properties?: VisualVariableProperties): VisualVariable; + + fromJSON(json: any): VisualVariable; + } + + export const VisualVariable: VisualVariableConstructor; + + interface VisualVariableProperties { + /** + * The name of the numeric attribute field that contains the data values used to determine the color/opacity/size/rotation of each feature. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#field) + */ + field?: string; + /** + * The index of the visual variable in relation to its position in the [visualVariables](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-SimpleRenderer.html#visualVariables) property of the renderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#index) + */ + index?: string | number; + /** + * An object providing options for displaying the visual variable in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#legendOptions) + */ + legendOptions?: VisualVariableLegendOptions; + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to a number. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. The values returned from this expression are the data used to drive the visualization. This takes precedence over [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#field). Therefore, this property is typically used as an alternative to [field](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#field) in visual variables. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#valueExpression) + */ + valueExpression?: string; + /** + * The title identifying and describing the associated [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression as defined in the [valueExpression](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#valueExpression) property. This is displayed as the title of the corresponding visual variable in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) in the absence of a provided `title` in the [legendOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#legendOptions) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#valueExpressionTitle) + */ + valueExpressionTitle?: string; + } + + export interface VisualVariableLegendOptions extends Object { + /** + * Indicates whether to show the visual variable in the legend. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#legendOptions) + */ + showLegend?: boolean; + /** + * The title describing the visualization of the visual variable in the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html). This takes precedence over a field alias or [valueExpressionTitle](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#valueExpressionTitle). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-VisualVariable.html#legendOptions) + */ + title?: string; + } + + /** + * ClassBreaksRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#ClassBreaksRenderer) + */ + export type renderersClassBreaksRenderer = ClassBreaksRenderer; + + /** + * HeatmapRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#HeatmapRenderer) + */ + export type renderersHeatmapRenderer = HeatmapRenderer; + + /** + * Renderer types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#Renderer) + */ + export type renderersRenderer = ClassBreaksRenderer | SimpleRenderer | UniqueValueRenderer | HeatmapRenderer; + + /** + * SimpleRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#SimpleRenderer) + */ + export type renderersSimpleRenderer = SimpleRenderer; + + /** + * UniqueValueRenderer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers.html#UniqueValueRenderer) + */ + export type renderersUniqueValueRenderer = UniqueValueRenderer; interface request { /** * Retrieves data from a remote server or uploads a file from a user's computer. If the request returns an [Error](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html), the error object will include the details specified in [EsriErrorDetails](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) - * + * * @param url The request URL. * @param options The options specified by the user in the data request. See [RequestOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) for available properties. - * + * */ esriRequest(url: string, options?: RequestOptions): IPromise; } @@ -26213,58 +27005,57 @@ declare namespace __esri { const __requestMapped: request; export const request: typeof __requestMapped.esriRequest; - /** * The specification of the [details object](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html#details) returned in an [Error](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ export interface EsriErrorDetails extends Object { /** * A function to retrieve headers sent from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ getHeader: GetHeader; /** * The status of the http request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ httpStatus: number; /** * The error message code. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ messageCode: string; /** * Additional error message(s). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ messages: string[]; /** * The query parameters sent with the http request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ requestOptions: any; /** * Indicates if the request required https. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ ssl: boolean; /** * The error message subcode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ subCode: number; /** * The URL of the request that returned an error message. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails) */ url: string; @@ -26274,19 +27065,19 @@ declare namespace __esri { /** * An object with the following properties that describe the request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ export interface RequestOptions extends Object { /** * If the request URL points to a web server that requires parameters, specify them here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ query?: any; /** - * Response format. When this value is `image` the `headers` and `timeout` options are ignored. **Possible Values:** json | xml | text | blob | array-buffer | document | image - * + * Response format. When this value is `image` the `timeout` option is ignored. **Possible Values:** json | xml | text | blob | array-buffer | document | image + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ responseType?: string; @@ -26295,7 +27086,7 @@ declare namespace __esri { * ```js * const controller = new AbortController(); * const signal = controller.signal; - * + * * esriRequest(url, { signal }) * .then((response) => { * // The request went OK @@ -26307,61 +27098,61 @@ declare namespace __esri { * console.error('Error encountered', err); * } * }); - * + * * // Abort requests that are aware of the controller's signal * controller.abort(); * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ signal?: AbortSignal; /** - * Headers to use for the request. This is an object whose property names are header names. This option is ignored when `responseType = "image"`. - * + * Headers to use for the request. This is an object whose property names are header names. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ headers?: any; /** * Indicates the amount of time in milliseconds to wait for a response from the server. Set to `0` to wait for the response indefinitely. This option is ignored when `responseType = "image"`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ timeout?: number; /** * Indicates if the request should be made using the HTTP POST method. By default, this is determined automatically based on the request size. **Possible Values:** auto | post - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ method?: string; /** * If uploading a file, specify the form data or element used to submit the file here. If a form element is specified, the parameters of the `query` will be added to the URL. If not specified, then query parameters will only be added to the URL when a GET request is used. If POST is used, then query parameters will be added to the body. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ body?: FormData | HTMLFormElement | string; /** * Indicates the request should use the proxy. By default this is determined automatically based on the domain of the request url. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ useProxy?: boolean; /** * Indicates whether to send an extra query parameter to ensure the server doesn't supply cached values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ cacheBust?: boolean; /** - * Indicates if and how requests to ArcGIS Services are authenticated. Only applicable when [`esriConfig.request.useIdentity = true`](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request). - * + * Indicates if and how requests to ArcGIS Services are authenticated. Only applicable when [`esriConfig.request.useIdentity = true`](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request). + * * | Known Value | Description | * |-------------|-------------| * | auto | The user will be signed in when a secure resource is requested. | * | anonymous | An error will be returned when a secure resource is requested. | * | immediate | The user will be signed in before the resource is requested. | * | no-prompt | Checks for whether the user is already signed in. If so, no additional prompts display for sign-in. | - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) */ authMode?: string; @@ -26369,37 +27160,37 @@ declare namespace __esri { /** * Returns a promise that resolves to an object with the following specification. If the request returns an [Error](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html), the error object will include the details specified in [EsriErrorDetails](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#EsriErrorDetails). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) */ export interface RequestResponse extends Object { /** * The requested data. Should match the `responseType` with the data return type. Possible types are: [json](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object), [xml](https://developer.mozilla.org/en-US/docs/Web/API/XMLDocument), [text](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), [blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob), [array-buffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), [document](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDocument), and [image](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) */ data?: any; /** * The options specified by the user in the data request. See [RequestOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions) for available properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) */ requestOptions?: RequestOptions; /** * Indicates if the request required https. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) */ ssl?: boolean; /** * The URL used to request the data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) */ url?: string; /** * Method for getting a header sent from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestResponse) */ getHeader?: GetHeader; @@ -26408,60 +27199,58 @@ declare namespace __esri { interface ActionBase { /** * Indicates whether the action is currently active. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#active) - * + * * @default false */ active: boolean; /** * Adds a CSS class to the action's node. Can be used in conjunction with the `image` property or by itself. Any icon font may be used in this property. The [Esri Icon Font](https://developers.arcgis.com/javascript/latest/guide/esri-icon-font/index.html) is automatically made available via the ArcGIS API for JavaScript for you to use in styling custom actions. To use one of these provided icon fonts, you must prefix the class name with `esri-`. For example, the default `zoom-to` action in [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) uses the font `esri-icon-zoom-in-magnifying-glass`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#className) */ className: string; /** * Indicates whether this action is disabled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#disabled) - * + * * @default false */ disabled: boolean; /** * The name of the ID assigned to this action. This is used for differentiating actions when listening to the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#event:trigger-action) event. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#id) */ id: string; /** * The title of the action. _For popups_: When there are fewer than three actions defined in a popup, this text is displayed to the right of the icon or image representing the action. If there are three or more actions in the popup, then this text is used as a tooltip on the action. _For LayerList_: The first action is displayed in the layerlist with an icon. The layerlist has a menu that will display all actions with their titles - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#title) */ title: string; /** * Specifies the type of action. Choose between ["button"](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or ["toggle"](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html). Currently, these two are the only supported types. A "slider" type will follow-up in a future release. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#type) - * + * * @default null */ type: string; /** * Indicates if the action is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionBase.html#visible) - * + * * @default true */ visible: boolean; } interface ActionBaseConstructor { - - - new(): ActionBase; + new (): ActionBase; } export const ActionBase: ActionBaseConstructor; @@ -26469,26 +27258,23 @@ declare namespace __esri { interface ActionButton extends ActionBase { /** * The URL to an image that will be used to represent the action. This property will be used as a background image for the node. It may be used in conjunction with the `className` property or by itself. If neither `image` nor `className` are specified, a default icon ![default icon](https://developers.arcgis.com/javascript/assets/img/guide/whats-new/41/default-action.png) will display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html#image) */ image: string; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html#clone) - * - * + * + * */ clone(): ActionButton; } interface ActionButtonConstructor { - - - - new(properties?: any): ActionButton; + new (properties?: any): ActionButton; } export const ActionButton: ActionButtonConstructor; @@ -26496,27 +27282,1001 @@ declare namespace __esri { interface ActionToggle extends ActionBase { /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html#clone) - * - * + * + * */ clone(): ActionToggle; } interface ActionToggleConstructor { - - - - new(properties?: any): ActionToggle; + new (properties?: any): ActionToggle; } export const ActionToggle: ActionToggleConstructor; + /** + * A convenience module for importing [ContentElement](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-ContentElement.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing content elements one at a time like this: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html) + */ + namespace ContentElement { + /** + * Popup content element types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#ContentElement) + */ + export type ContentElement = __esri.Text | __esri.Media | __esri.Fields | __esri.Attachments; + + /** + * TextContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Text) + */ + export type Text = __esri.Text; + export const Text: typeof __esri.Text; + + /** + * MediaContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Media) + */ + export type Media = __esri.Media; + export const Media: typeof __esri.Media; + + /** + * FieldsContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Fields) + */ + export type Fields = __esri.Fields; + export const Fields: typeof __esri.Fields; + + /** + * AttachmentsContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Attachments) + */ + export type Attachments = __esri.Attachments; + export const Attachments: typeof __esri.Attachments; + } + + interface Attachments extends ContentElementContentElement, JSONSupport { + /** + * An array of [AttachmentInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html) objects used to display within the popup's content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html#attachmentInfos) + */ + attachmentInfos: AttachmentInfo; + /** + * A string value indicating how to display the attachment. Possible values are: preview | list If `list` is specified, attachments show as links. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html#displayType) + */ + displayType: string; + + /** + * Creates a deep clone of the AttachmentsContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html#clone) + * + * + */ + clone(): Attachments; + } + + interface AttachmentsConstructor { + /** + * An AttachmentsContentElement represents an attachment element associated with a feature. This resource is available only if the [FeatureLayer's capabilities.data.supportsAttachment](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html) + */ + + new (properties?: AttachmentsProperties): Attachments; + + fromJSON(json: any): Attachments; + } + + export const Attachments: AttachmentsConstructor; + + interface AttachmentsProperties extends ContentElementContentElementProperties { + /** + * An array of [AttachmentInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-AttachmentInfo.html) objects used to display within the popup's content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html#attachmentInfos) + */ + attachmentInfos?: AttachmentInfoProperties; + /** + * A string value indicating how to display the attachment. Possible values are: preview | list If `list` is specified, attachments show as links. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Attachments.html#displayType) + */ + displayType?: string; + } + + interface ContentElementContentElement extends Accessor, JSONSupport { + /** + * The type of popup element displayed. **Possible values**: text | fields | media | attachments + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-ContentElement.html#type) + */ + readonly type: string; + } + + interface ContentElementContentElementConstructor { + /** + * Content elements define what should display within the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) content. There are four specific element types: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-ContentElement.html) + */ + + new (properties?: ContentElementContentElementProperties): ContentElementContentElement; + + fromJSON(json: any): ContentElementContentElement; + } + + export const ContentElementContentElement: ContentElementContentElementConstructor; + + interface ContentElementContentElementProperties {} + + interface Fields extends ContentElementContentElement, JSONSupport { + /** + * Object array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html). If the `fieldInfos` property is not provided directly within the content, the popup will display whatever is set in the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Fields.html#fieldInfos) + */ + fieldInfos: FieldInfo[]; + + /** + * Creates a deep clone of the FieldsContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Fields.html#clone) + * + * + */ + clone(): Fields; + } + + interface FieldsConstructor { + /** + * A FieldsContentElement represents [fieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) associated with a feature. If this is not set within the content, it will revert to whatever may be set within the [PopupTemplate.Fieldinfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Fields.html) + */ + + new (properties?: FieldsProperties): Fields; + + fromJSON(json: any): Fields; + } + + export const Fields: FieldsConstructor; + + interface FieldsProperties extends ContentElementContentElementProperties { + /** + * Object array of [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html). If the `fieldInfos` property is not provided directly within the content, the popup will display whatever is set in the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Fields.html#fieldInfos) + */ + fieldInfos?: FieldInfoProperties[]; + } + + interface Media extends ContentElementContentElement, JSONSupport { + /** + * Contains the media elements representing images or charts to display within the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). This can be an individual chart or image element, or an array containing a combination of any of these types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media.html#mediaInfos) + */ + mediaInfos: BarChart | ColumnChart | Image | LineChart | PieChart | any[]; + + /** + * Creates a deep clone of the MediaContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media.html#clone) + * + * + */ + clone(): Media; + } + + interface MediaConstructor { + /** + * A `MediaContentElement` represents an individual or array of [Media](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Media.html) elements to display within a popup's content. Examples of these types of media are [charts](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart.html) and/or [images](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media.html) + */ + + new (properties?: MediaProperties): Media; + + fromJSON(json: any): Media; + } + + export const Media: MediaConstructor; + + interface MediaProperties extends ContentElementContentElementProperties { + /** + * Contains the media elements representing images or charts to display within the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). This can be an individual chart or image element, or an array containing a combination of any of these types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media.html#mediaInfos) + */ + mediaInfos?: + | BarChartProperties + | ColumnChartProperties + | ImageProperties + | LineChartProperties + | PieChartProperties + | any[]; + } + + interface BarChart extends Chart, JSONSupport { + /** + * Creates a deep clone of the MediaBarChartContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-BarChart.html#clone) + * + * + */ + clone(): BarChart; + } + + interface BarChartConstructor { + new (properties?: BarChartProperties): BarChart; + + fromJSON(json: any): BarChart; + } + + export const BarChart: BarChartConstructor; + + interface BarChartProperties extends ChartProperties {} + + interface Chart extends MediaMedia, JSONSupport { + /** + * Defines the chart value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart.html#value) + */ + value: Value; + } + + interface ChartConstructor { + new (properties?: ChartProperties): Chart; + + fromJSON(json: any): Chart; + } + + export const Chart: ChartConstructor; + + interface ChartProperties extends MediaMediaProperties { + /** + * Defines the chart value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart.html#value) + */ + value?: ValueProperties; + } + + interface Series extends Accessor { + /** + * String value indicating the tooltip for a series. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html#tooltipField) + */ + tooltipField: string; + /** + * Numerical value indicating the x-value for the chart series. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html#x) + */ + x: number; + /** + * Numerical value indicating the y-value for the chart series. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html#y) + */ + y: number; + + /** + * Creates a deep clone of the MediaInfoChartSeries class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html#clone) + * + * + */ + clone(): Series; + } + + interface SeriesConstructor { + new (properties?: SeriesProperties): Series; + } + + export const Series: SeriesConstructor; + + interface SeriesProperties { + /** + * String value indicating the tooltip for a series. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html#tooltipField) + */ + tooltipField?: string; + /** + * Numerical value indicating the x-value for the chart series. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html#x) + */ + x?: number; + /** + * Numerical value indicating the y-value for the chart series. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html#y) + */ + y?: number; + } + + interface Value extends Accessor, JSONSupport { + /** + * An array of strings, with each string containing the name of a field to display in the chart. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#fields) + */ + fields: string[]; + /** + * A string containing the name of a field. The values of all fields in the chart will be normalized (divided) by the value of this field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#normalizeField) + */ + normalizeField: string; + /** + * An array of [Series](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html) objects which provide information of x/y data data that is plotted in a chart. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#series) + */ + series: Series[]; + /** + * Used for chart values. Defines a new Dojo theme, only valid for chart types. View the [Dojox Charting Theme Preview](https://download.dojotoolkit.org/release-1.10.0/dojo-release-1.10.0/dojox/charting/tests/theme_preview.html) to see some of the theme options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#theme) + */ + theme: string; + /** + * String value indicating the tooltip for a chart specified from another field. This field is needed when related records are not used. It is used for showing tooltips from another field in the same layer or related layer/table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#tooltipField) + */ + tooltipField: string; + + /** + * Creates a deep clone of the MediaInfoChartValue class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#clone) + * + * + */ + clone(): Value; + } + + interface ValueConstructor { + new (properties?: ValueProperties): Value; + + fromJSON(json: any): Value; + } + + export const Value: ValueConstructor; + + interface ValueProperties { + /** + * An array of strings, with each string containing the name of a field to display in the chart. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#fields) + */ + fields?: string[]; + /** + * A string containing the name of a field. The values of all fields in the chart will be normalized (divided) by the value of this field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#normalizeField) + */ + normalizeField?: string; + /** + * An array of [Series](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Series.html) objects which provide information of x/y data data that is plotted in a chart. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#series) + */ + series?: SeriesProperties[]; + /** + * Used for chart values. Defines a new Dojo theme, only valid for chart types. View the [Dojox Charting Theme Preview](https://download.dojotoolkit.org/release-1.10.0/dojo-release-1.10.0/dojox/charting/tests/theme_preview.html) to see some of the theme options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#theme) + */ + theme?: string; + /** + * String value indicating the tooltip for a chart specified from another field. This field is needed when related records are not used. It is used for showing tooltips from another field in the same layer or related layer/table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Chart-Value.html#tooltipField) + */ + tooltipField?: string; + } + + interface ColumnChart extends Chart, JSONSupport { + /** + * Creates a deep clone of the MediaColumnChartContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-ColumnChart.html#clone) + * + * + */ + clone(): ColumnChart; + } + + interface ColumnChartConstructor { + new (properties?: ColumnChartProperties): ColumnChart; + + fromJSON(json: any): ColumnChart; + } + + export const ColumnChart: ColumnChartConstructor; + + interface ColumnChartProperties extends ChartProperties {} + + interface Image extends MediaMedia, JSONSupport { + /** + * Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. Value of `0` indicates auto refresh is not enabled. If the property does not exist, it is equivalent to having a value of `0`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html#refreshInterval) + */ + refreshInterval: number; + /** + * Defines the value format of the image media element and how the images should be retrieved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html#value) + */ + value: ImageValue; + + /** + * Creates a deep clone of the MediaImageContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html#clone) + * + * + */ + clone(): Image; + } + + interface ImageConstructor { + new (properties?: ImageProperties): Image; + + fromJSON(json: any): Image; + } + + export const Image: ImageConstructor; + + interface ImageProperties extends MediaMediaProperties { + /** + * Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. Value of `0` indicates auto refresh is not enabled. If the property does not exist, it is equivalent to having a value of `0`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html#refreshInterval) + */ + refreshInterval?: number; + /** + * Defines the value format of the image media element and how the images should be retrieved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image.html#value) + */ + value?: ImageValueProperties; + } + + interface ImageValue extends Accessor, JSONSupport { + /** + * A string containing a URL to be launched in a browser when a user clicks the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image-Value.html#linkURL) + */ + linkURL: string; + /** + * A string containing the URL to the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image-Value.html#sourceURL) + */ + sourceURL: string; + + /** + * Creates a deep clone of the MediaInfoImageValue class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image-Value.html#clone) + * + * + */ + clone(): ImageValue; + } + + interface ImageValueConstructor { + new (properties?: ImageValueProperties): ImageValue; + + fromJSON(json: any): ImageValue; + } + + export const ImageValue: ImageValueConstructor; + + interface ImageValueProperties { + /** + * A string containing a URL to be launched in a browser when a user clicks the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image-Value.html#linkURL) + */ + linkURL?: string; + /** + * A string containing the URL to the image. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Image-Value.html#sourceURL) + */ + sourceURL?: string; + } + + interface LineChart extends Chart, JSONSupport { + /** + * Creates a deep clone of the MediaLineChartContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-LineChart.html#clone) + * + * + */ + clone(): LineChart; + } + + interface LineChartConstructor { + new (properties?: LineChartProperties): LineChart; + + fromJSON(json: any): LineChart; + } + + export const LineChart: LineChartConstructor; + + interface LineChartProperties extends ChartProperties {} + + interface MediaMedia extends Accessor, JSONSupport { + /** + * Defines a caption for the media. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Media.html#caption) + */ + caption: string; + /** + * The title of the media element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Media.html#title) + */ + title: string; + /** + * The type of media element displayed. **Possible values**: image | bar-chart | column-chart | line-chart | pie-chart + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Media.html#type) + */ + readonly type: string; + } + + interface MediaMediaConstructor { + new (properties?: MediaMediaProperties): MediaMedia; + + fromJSON(json: any): MediaMedia; + } + + export const MediaMedia: MediaMediaConstructor; + + interface MediaMediaProperties { + /** + * Defines a caption for the media. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Media.html#caption) + */ + caption?: string; + /** + * The title of the media element. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-Media.html#title) + */ + title?: string; + } + + interface PieChart extends Chart, JSONSupport { + /** + * Creates a deep clone of the MediaPieChartContentElement class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Media-PieChart.html#clone) + * + * + */ + clone(): PieChart; + } + + interface PieChartConstructor { + new (properties?: PieChartProperties): PieChart; + + fromJSON(json: any): PieChart; + } + + export const PieChart: PieChartConstructor; + + interface PieChartProperties extends ChartProperties {} + + interface Text extends ContentElementContentElement, JSONSupport { + /** + * The formatted string content to display. This may contain a field name enclosed in `{}`, such as `{FIELDNAME}`, or an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression name, referenced as `{expression/EXPRESSIONNAME}`. Text content may also leverage HTML tags such as ``, `

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

`, and `
` for formatting the look and feel of the content. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement-Text.html#text) + */ + text?: string; + } + + /** + * AttachmentsContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Attachments) + */ + export type ContentElementAttachments = Attachments; + + /** + * Popup content element types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#ContentElement) + */ + export type supportContentElementContentElement = Text | Media | Fields | Attachments; + + /** + * FieldsContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Fields) + */ + export type ContentElementFields = Fields; + + /** + * MediaContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Media) + */ + export type ContentElementMedia = Media; + + /** + * TextContentElement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ContentElement.html#Text) + */ + export type ContentElementText = Text; + + interface ExpressionInfo extends Accessor, JSONSupport { + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to either a string, number, dictionary, or array. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#expression) + */ + expression: string; + /** + * The name of the expression. This is used to reference the value of the given `expression` in the popupTemplate's [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) property by wrapping it in curly braces and prefacing it with `expression/` (e.g. `{expression/expressionName}`). See the code snippets below for more examples. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#name) + */ + name: string; + /** + * Indicates the return type of the Arcade expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#returnType) + */ + returnType: string | number; + /** + * The title used to describe the value returned by the expression in the popup. This will display if the value is referenced in a [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#title) + */ + title: string; + + /** + * Creates a deep clone of the ExpressionInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#clone) + * + * + */ + clone(): ExpressionInfo; + } + + interface ExpressionInfoConstructor { + new (properties?: ExpressionInfoProperties): ExpressionInfo; + + fromJSON(json: any): ExpressionInfo; + } + + export const ExpressionInfo: ExpressionInfoConstructor; + + interface ExpressionInfoProperties { + /** + * An [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression evaluating to either a string, number, dictionary, or array. This expression can reference field values using the `$feature` global variable and perform mathematical calculations and logical evaluations at runtime. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#expression) + */ + expression?: string; + /** + * The name of the expression. This is used to reference the value of the given `expression` in the popupTemplate's [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content) property by wrapping it in curly braces and prefacing it with `expression/` (e.g. `{expression/expressionName}`). See the code snippets below for more examples. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#name) + */ + name?: string; + /** + * Indicates the return type of the Arcade expression. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#returnType) + */ + returnType?: string | number; + /** + * The title used to describe the value returned by the expression in the popup. This will display if the value is referenced in a [FieldInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html) table. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-ExpressionInfo.html#title) + */ + title?: string; + } + + interface FieldInfo extends Accessor, JSONSupport { + /** + * The field name as defined by the service or the `name` of an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression. Arcade expression names are defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#expressionInfos) property. When referencing Arcade expressions, you must preface the name with `expression/`, such as `expression/percent-total`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#fieldName) + */ + fieldName: string; + /** + * Class which provides formatting options for numerical or date fields and how they should display within a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#format) + */ + format: FieldInfoFormat; + /** + * A Boolean determining whether users can edit this field. This is not applicable to Arcade expressions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#isEditable) + * + * @default false + */ + isEditable: boolean; + /** + * A string containing the field alias. Not applicable to Arcade expressions as the title is used instead. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#label) + */ + label: string; + /** + * Used in a `one:many` or `many:many` relationship to compute the statistics on the field to show in the popup. If the property is present, must be one of the following values: **Possible Values:** count | sum | min | max | avg | stddev | var + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#statisticType) + */ + statisticType: string; + /** + * A string determining what type of input box editors see when editing the field. Applies only to string fields. This is not applicable to Arcade expressions. If this property is present, it must be one of the following values: **Possible Values:** rich-text | text-area | text-box + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#stringFieldOption) + * + * @default text-box + */ + stringFieldOption: string; + /** + * A string providing an editing hint for editors of the field. This is not applicable to Arcade expressions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#tooltip) + */ + tooltip: string; + /** + * Indicates whether the field is visible in the popup window. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#visible) + * + * @default true + */ + visible: boolean; + + /** + * Creates a deep clone of the FieldInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#clone) + * + * + */ + clone(): FieldInfo; + } + + interface FieldInfoConstructor { + new (properties?: FieldInfoProperties): FieldInfo; + + fromJSON(json: any): FieldInfo; + } + + export const FieldInfo: FieldInfoConstructor; + + interface FieldInfoProperties { + /** + * The field name as defined by the service or the `name` of an [Arcade](https://developers.arcgis.com/javascript/latest/guide/arcade/index.html) expression. Arcade expression names are defined in the [expressionInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#expressionInfos) property. When referencing Arcade expressions, you must preface the name with `expression/`, such as `expression/percent-total`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#fieldName) + */ + fieldName?: string; + /** + * Class which provides formatting options for numerical or date fields and how they should display within a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#format) + */ + format?: FieldInfoFormatProperties; + /** + * A Boolean determining whether users can edit this field. This is not applicable to Arcade expressions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#isEditable) + * + * @default false + */ + isEditable?: boolean; + /** + * A string containing the field alias. Not applicable to Arcade expressions as the title is used instead. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#label) + */ + label?: string; + /** + * Used in a `one:many` or `many:many` relationship to compute the statistics on the field to show in the popup. If the property is present, must be one of the following values: **Possible Values:** count | sum | min | max | avg | stddev | var + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#statisticType) + */ + statisticType?: string; + /** + * A string determining what type of input box editors see when editing the field. Applies only to string fields. This is not applicable to Arcade expressions. If this property is present, it must be one of the following values: **Possible Values:** rich-text | text-area | text-box + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#stringFieldOption) + * + * @default text-box + */ + stringFieldOption?: string; + /** + * A string providing an editing hint for editors of the field. This is not applicable to Arcade expressions. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#tooltip) + */ + tooltip?: string; + /** + * Indicates whether the field is visible in the popup window. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo.html#visible) + * + * @default true + */ + visible?: boolean; + } + + interface FieldInfoFormat extends Accessor, JSONSupport { + /** + * Used only with `Date` fields. Specifies how the date should appear in a popup. **Possible Values**: short-date | short-date-le | long-date | day-short-month-year | long-month-day-year | short-date-long-time | short-date-le-long-time | short-date-short-time | short-date-le-short-time | short-date-short-time-24 | short-date-le-short-time-24 | short-date-short-time-24 | short-date-le-short-time-24 | long-month-year | short-month-year | year + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo-Format.html#dateFormat) + */ + dateFormat: string; + /** + * Used only with `Number` fields. A value of `true` indicates the number should have a digit (or thousands) separator when the value appears in popups. A value of `false` means that no separator will be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo-Format.html#digitSeparator) + * + * @default false + */ + digitSeparator: boolean; + /** + * Used only with `Number` fields to specify the number of supported decimal places that should appear in popups. Any places beyond this value are rounded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo-Format.html#places) + */ + places: number; + } + + interface FieldInfoFormatConstructor { + /** + * An object used with numerical or date fields to provide more detail about how the value should be displayed in a popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo-Format.html) + */ + + new (properties?: FieldInfoFormatProperties): FieldInfoFormat; + + fromJSON(json: any): FieldInfoFormat; + } + + export const FieldInfoFormat: FieldInfoFormatConstructor; + + interface FieldInfoFormatProperties { + /** + * Used only with `Date` fields. Specifies how the date should appear in a popup. **Possible Values**: short-date | short-date-le | long-date | day-short-month-year | long-month-day-year | short-date-long-time | short-date-le-long-time | short-date-short-time | short-date-le-short-time | short-date-short-time-24 | short-date-le-short-time-24 | short-date-short-time-24 | short-date-le-short-time-24 | long-month-year | short-month-year | year + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo-Format.html#dateFormat) + */ + dateFormat?: string; + /** + * Used only with `Number` fields. A value of `true` indicates the number should have a digit (or thousands) separator when the value appears in popups. A value of `false` means that no separator will be used. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo-Format.html#digitSeparator) + * + * @default false + */ + digitSeparator?: boolean; + /** + * Used only with `Number` fields to specify the number of supported decimal places that should appear in popups. Any places beyond this value are rounded. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-FieldInfo-Format.html#places) + */ + places?: number; + } + + interface LayerOptions extends Accessor, JSONSupport { + /** + * Applicable to [Imagery Layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). Indicates whether records without data should display within the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayerOptions.html#showNoDataRecords) + * + * @default true + */ + showNoDataRecords: boolean; + + /** + * Creates a deep clone of the LayerOptions class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayerOptions.html#clone) + * + * + */ + clone(): LayerOptions; + } + + interface LayerOptionsConstructor { + new (properties?: LayerOptionsProperties): LayerOptions; + + fromJSON(json: any): LayerOptions; + } + + export const LayerOptions: LayerOptionsConstructor; + + interface LayerOptionsProperties { + /** + * Applicable to [Imagery Layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html). Indicates whether records without data should display within the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayerOptions.html#showNoDataRecords) + * + * @default true + */ + showNoDataRecords?: boolean; + } + interface LayersMixin { /** - * A collection of operational [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). This property only contains interactive operational layers, such as [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [WebTileLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) and {@link module:esri/layers/GraphicsLayer GraphicsLayers} that may be queried, assigned different renderers, analyzed, etc. It does not include [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html). A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) is a collection of one or more features, or {@link module:esri/Graphic graphics}, that represent real-world phenomena. Each feature contains a {@link module:esri/symbols/Symbol symbol} and [geographic data](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered on the map as a graphic with spatial context. Features within the layer may also contain data attributes that provide additional information that may be viewed in [popup windows](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) and used for {@link module:esri/renderers/Renderer rendering the layer}. Layers may be added in the [constructor](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#constructors-summary), with the [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#addMany) methods, or directly to the layers collection using [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#addMany). - * > A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) may only be added to one parent. Adding the same layer to multiple [Maps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) or [GroupLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) is not possible. If you attempt to do so, the layer will automatically be removed from its current parent and placed in the new parent. + * A collection of operational [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). This property only contains interactive operational layers, such as [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [WebTileLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) and {@link module:esri/layers/GraphicsLayer GraphicsLayers} that may be queried, assigned different renderers, analyzed, etc. It does not include [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html). A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) is a collection of one or more features, or {@link module:esri/Graphic graphics}, that represent real-world phenomena. Each feature contains a {@link module:esri/symbols/Symbol symbol} and [geographic data](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered on the map as a graphic with spatial context. Features within the layer may also contain data attributes that provide additional information that may be viewed in [popup windows](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) and used for {@link module:esri/renderers/Renderer rendering the layer}. Layers may be added in the [constructor](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#constructors-summary), with the [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#addMany) methods, or directly to the layers collection using [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#addMany). + * > A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) may only be added to one parent. Adding the same layer to multiple [Maps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) or [GroupLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) is not possible. If you attempt to do so, the layer will automatically be removed from its current parent and placed in the new parent. * > ```js * > var layer = new GraphicsLayer(); * > // The layer belongs to map1 @@ -26525,90 +28285,88 @@ declare namespace __esri { * > // and implicitly does: map1.layers.remove(layer) * > map2.layers.add(layer); * > ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers) */ layers: Collection; /** * Adds a layer to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) - * + * * @param layer Layer or a Promise<Layer> to be added to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). * @param index A layer can be added at a specified index in the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). If no index is specified or the index specified is greater than the current number of layers, the layer is automatically appended to the list of layers in the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers) and the index is normalized. - * + * */ add(layer: Layer | IPromise, index?: number): void; /** * Adds a layer or an array of layers to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#addMany) - * + * * @param layers Layer(s) to be added to the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). * @param index A layer can be added at a specified index in the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers). If no index is specified or the index specified is greater than the current number of layers, the layer is automatically appended to the list of layers in the [layers collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers) and the index is normalized. - * + * */ addMany(layers: Layer[], index?: number): void; /** * Returns a layer based on the given layer id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#findLayerById) - * + * * @param layerId The ID assigned to the layer. - * + * */ findLayerById(layerId: string): Layer; /** * Removes the specified layer from the layers collection. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#remove) - * + * * @param layer Layer to remove from the layers collection. - * + * */ remove(layer: Layer): Layer; /** * Removes all layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#removeAll) - * - * + * + * */ removeAll(): Layer[]; /** * Removes the specified layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#removeMany) - * + * * @param layers Array of layers to remove from the layers collection. - * + * */ removeMany(layers: Layer[]): Layer[]; /** * Changes the layer order. The first layer added is always the base layer, even if its order is changed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#reorder) - * + * * @param layer The layer to be moved. * @param index The index location for placing the layer. The bottom-most layer has an index of `0`. - * + * */ reorder(layer: Layer, index: number): Layer; } interface LayersMixinConstructor { - - - new(): LayersMixin; + new (): LayersMixin; } export const LayersMixin: LayersMixinConstructor; interface LayersMixinProperties { /** - * A collection of operational [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). This property only contains interactive operational layers, such as [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [WebTileLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) and {@link module:esri/layers/GraphicsLayer GraphicsLayers} that may be queried, assigned different renderers, analyzed, etc. It does not include [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html). A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) is a collection of one or more features, or {@link module:esri/Graphic graphics}, that represent real-world phenomena. Each feature contains a {@link module:esri/symbols/Symbol symbol} and [geographic data](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered on the map as a graphic with spatial context. Features within the layer may also contain data attributes that provide additional information that may be viewed in [popup windows](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) and used for {@link module:esri/renderers/Renderer rendering the layer}. Layers may be added in the [constructor](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#constructors-summary), with the [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#addMany) methods, or directly to the layers collection using [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#addMany). - * > A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) may only be added to one parent. Adding the same layer to multiple [Maps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) or [GroupLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) is not possible. If you attempt to do so, the layer will automatically be removed from its current parent and placed in the new parent. + * A collection of operational [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html). This property only contains interactive operational layers, such as [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [WebTileLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html) and {@link module:esri/layers/GraphicsLayer GraphicsLayers} that may be queried, assigned different renderers, analyzed, etc. It does not include [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html). A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) is a collection of one or more features, or {@link module:esri/Graphic graphics}, that represent real-world phenomena. Each feature contains a {@link module:esri/symbols/Symbol symbol} and [geographic data](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) that allows it to be rendered on the map as a graphic with spatial context. Features within the layer may also contain data attributes that provide additional information that may be viewed in [popup windows](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) and used for {@link module:esri/renderers/Renderer rendering the layer}. Layers may be added in the [constructor](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#constructors-summary), with the [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#addMany) methods, or directly to the layers collection using [add()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add) or [addMany()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#addMany). + * > A [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) may only be added to one parent. Adding the same layer to multiple [Maps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) or [GroupLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GroupLayer.html) is not possible. If you attempt to do so, the layer will automatically be removed from its current parent and placed in the new parent. * > ```js * > var layer = new GraphicsLayer(); * > // The layer belongs to map1 @@ -26617,29 +28375,359 @@ declare namespace __esri { * > // and implicitly does: map1.layers.remove(layer) * > map2.layers.add(layer); * > ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-LayersMixin.html#layers) */ layers?: CollectionProperties | LayerProperties[]; } - /** - * A convenience module for importing [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing symbols one at a time like this: - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html) - */ - interface symbols { + interface RelatedRecordsInfo extends Accessor, JSONSupport { + /** + * An array of [FieldOrder](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo-FieldOrder.html) objects indicating the field display order for the related records and whether they should be sorted in ascending `asc` or descending `desc` order. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo.html#orderByFields) + */ + orderByFields: FieldOrder[]; + /** + * Indicates whether to display related records in the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo.html#showRelatedRecords) + */ + showRelatedRecords: boolean; + + /** + * Creates a deep clone of the RelatedRecordsInfo class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo.html#clone) + * + * + */ + clone(): RelatedRecordsInfo; } - export const symbols: symbols; + interface RelatedRecordsInfoConstructor { + new (properties?: RelatedRecordsInfoProperties): RelatedRecordsInfo; + + fromJSON(json: any): RelatedRecordsInfo; + } + + export const RelatedRecordsInfo: RelatedRecordsInfoConstructor; + + interface RelatedRecordsInfoProperties { + /** + * An array of [FieldOrder](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo-FieldOrder.html) objects indicating the field display order for the related records and whether they should be sorted in ascending `asc` or descending `desc` order. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo.html#orderByFields) + */ + orderByFields?: FieldOrderProperties[]; + /** + * Indicates whether to display related records in the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo.html#showRelatedRecords) + */ + showRelatedRecords?: boolean; + } + + interface FieldOrder extends Accessor, JSONSupport { + /** + * The attribute value of the field selected that will drive the sorting of related records. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo-FieldOrder.html#field) + */ + field: string; + /** + * Set the ascending or descending sort order of the returned related records. **Possible Values**: asc | desc + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo-FieldOrder.html#order) + */ + order: string; + + /** + * Creates a deep clone of the FieldOrder class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo-FieldOrder.html#clone) + * + * + */ + clone(): FieldOrder; + } + + interface FieldOrderConstructor { + new (properties?: FieldOrderProperties): FieldOrder; + + fromJSON(json: any): FieldOrder; + } + + export const FieldOrder: FieldOrderConstructor; + + interface FieldOrderProperties { + /** + * The attribute value of the field selected that will drive the sorting of related records. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo-FieldOrder.html#field) + */ + field?: string; + /** + * Set the ascending or descending sort order of the returned related records. **Possible Values**: asc | desc + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-RelatedRecordsInfo-FieldOrder.html#order) + */ + order?: string; + } + + /** + * A convenience module for importing [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) classes when developing with [TypeScript](https://developers.arcgis.com/javascript/latest/guide/typescript-setup/index.html). For example, rather than importing symbols one at a time like this: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html) + */ + namespace symbols { + /** + * ExtrudeSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#ExtrudeSymbol3DLayer) + */ + export type ExtrudeSymbol3DLayer = __esri.ExtrudeSymbol3DLayer; + export const ExtrudeSymbol3DLayer: typeof __esri.ExtrudeSymbol3DLayer; + + /** + * FillSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#FillSymbol3DLayer) + */ + export type FillSymbol3DLayer = __esri.FillSymbol3DLayer; + export const FillSymbol3DLayer: typeof __esri.FillSymbol3DLayer; + + /** + * Font. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Font) + */ + export type Font = __esri.Font; + export const Font: typeof __esri.Font; + + /** + * IconSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#IconSymbol3DLayer) + */ + export type IconSymbol3DLayer = __esri.IconSymbol3DLayer; + export const IconSymbol3DLayer: typeof __esri.IconSymbol3DLayer; + + /** + * LabelSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#LabelSymbol3D) + */ + export type LabelSymbol3D = __esri.LabelSymbol3D; + export const LabelSymbol3D: typeof __esri.LabelSymbol3D; + + /** + * LineSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#LineSymbol3D) + */ + export type LineSymbol3D = __esri.LineSymbol3D; + export const LineSymbol3D: typeof __esri.LineSymbol3D; + + /** + * LineSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#LineSymbol3DLayer) + */ + export type LineSymbol3DLayer = __esri.LineSymbol3DLayer; + export const LineSymbol3DLayer: typeof __esri.LineSymbol3DLayer; + + /** + * MeshSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#MeshSymbol3D) + */ + export type MeshSymbol3D = __esri.MeshSymbol3D; + export const MeshSymbol3D: typeof __esri.MeshSymbol3D; + + /** + * ObjectSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#ObjectSymbol3DLayer) + */ + export type ObjectSymbol3DLayer = __esri.ObjectSymbol3DLayer; + export const ObjectSymbol3DLayer: typeof __esri.ObjectSymbol3DLayer; + + /** + * PathSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PathSymbol3DLayer) + */ + export type PathSymbol3DLayer = __esri.PathSymbol3DLayer; + export const PathSymbol3DLayer: typeof __esri.PathSymbol3DLayer; + + /** + * PictureFillSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PictureFillSymbol) + */ + export type PictureFillSymbol = __esri.PictureFillSymbol; + export const PictureFillSymbol: typeof __esri.PictureFillSymbol; + + /** + * PictureMarkerSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PictureMarkerSymbol) + */ + export type PictureMarkerSymbol = __esri.PictureMarkerSymbol; + export const PictureMarkerSymbol: typeof __esri.PictureMarkerSymbol; + + /** + * PointSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PointSymbol3D) + */ + export type PointSymbol3D = __esri.PointSymbol3D; + export const PointSymbol3D: typeof __esri.PointSymbol3D; + + /** + * PolygonSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PolygonSymbol3D) + */ + export type PolygonSymbol3D = __esri.PolygonSymbol3D; + export const PolygonSymbol3D: typeof __esri.PolygonSymbol3D; + + /** + * SimpleFillSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#SimpleFillSymbol) + */ + export type SimpleFillSymbol = __esri.SimpleFillSymbol; + export const SimpleFillSymbol: typeof __esri.SimpleFillSymbol; + + /** + * SimpleLineSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#SimpleLineSymbol) + */ + export type SimpleLineSymbol = __esri.SimpleLineSymbol; + export const SimpleLineSymbol: typeof __esri.SimpleLineSymbol; + + /** + * SimpleMarkerSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#SimpleMarkerSymbol) + */ + export type SimpleMarkerSymbol = __esri.SimpleMarkerSymbol; + export const SimpleMarkerSymbol: typeof __esri.SimpleMarkerSymbol; + + /** + * TextSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#TextSymbol) + */ + export type TextSymbol = __esri.TextSymbol; + export const TextSymbol: typeof __esri.TextSymbol; + + /** + * TextSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#TextSymbol3DLayer) + */ + export type TextSymbol3DLayer = __esri.TextSymbol3DLayer; + export const TextSymbol3DLayer: typeof __esri.TextSymbol3DLayer; + + /** + * WebStyleSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#WebStyleSymbol) + */ + export type WebStyleSymbol = __esri.WebStyleSymbol; + export const WebStyleSymbol: typeof __esri.WebStyleSymbol; + + /** + * FillSymbol types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#FillSymbol) + */ + export type FillSymbol = __esri.PictureFillSymbol | __esri.SimpleFillSymbol; + + /** + * MarkerSymbol types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#MarkerSymbol) + */ + export type MarkerSymbol = __esri.PictureMarkerSymbol | __esri.SimpleMarkerSymbol; + + /** + * Symbol2D types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol2D) + */ + export type Symbol2D = + | __esri.PictureFillSymbol + | __esri.PictureMarkerSymbol + | __esri.SimpleFillSymbol + | __esri.SimpleLineSymbol + | __esri.SimpleMarkerSymbol + | __esri.TextSymbol; + + /** + * Symbol2D3D types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol2D3D) + */ + export type Symbol2D3D = + | __esri.PictureFillSymbol + | __esri.PictureMarkerSymbol + | __esri.SimpleFillSymbol + | __esri.SimpleLineSymbol + | __esri.SimpleMarkerSymbol + | __esri.TextSymbol + | __esri.Symbol2D + | __esri.LabelSymbol3D + | __esri.LineSymbol3D + | __esri.MeshSymbol3D + | __esri.PointSymbol3D + | __esri.PolygonSymbol3D; + + /** + * Symbol types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol) + */ + export type Symbol = __esri.Symbol2D | __esri.symbolsSymbol3D | __esri.WebStyleSymbol; + + /** + * Symbol3DLayer types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol3DLayer) + */ + export type Symbol3DLayer = + | __esri.ExtrudeSymbol3DLayer + | __esri.FillSymbol3DLayer + | __esri.IconSymbol3DLayer + | __esri.LineSymbol3DLayer + | __esri.ObjectSymbol3DLayer + | __esri.PathSymbol3DLayer + | __esri.TextSymbol3DLayer; + + /** + * Symbol3D types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol3D) + */ + export type Symbol3D = + | __esri.LabelSymbol3D + | __esri.LineSymbol3D + | __esri.MeshSymbol3D + | __esri.PointSymbol3D + | __esri.PolygonSymbol3D; + } interface Callout3D extends Accessor, JSONSupport { /** * Creates a deep clone of the callout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html#clone) - * - * + * + * */ clone(): Callout3D; } @@ -26647,57 +28735,55 @@ declare namespace __esri { interface Callout3DConstructor { /** * When symbols have an offset from their position, it's important to still see what the real location is. This can be achieved with callouts: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-Callout3D.html) */ - new(properties?: Callout3DProperties): Callout3D; + new (properties?: Callout3DProperties): Callout3D; fromJSON(json: any): Callout3D; } export const Callout3D: Callout3DConstructor; - interface Callout3DProperties { - - } + interface Callout3DProperties {} interface LineCallout3D extends Callout3D { /** * The border settings of the callout line. The border of the callout line can be used to improve the contrast of the callout line color against various background colors. If the border is `null`, then no border will be visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#border) */ border: LineCallout3DBorder; /** * The color of the callout line. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#color) - * + * * @default black */ color: Color; /** * The width of the callout line in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#size) - * + * * @default 1px */ size: number; /** * For LineCallout3D the type is always `line`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#type) */ type: string; /** * Creates a deep clone of the callout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#clone) - * - * + * + * */ clone(): LineCallout3D; } @@ -26705,11 +28791,11 @@ declare namespace __esri { interface LineCallout3DConstructor { /** * This type of callout displays a line to connect a symbol or a label with its actual location in the scene. For example when displaying points of interest in a city, visualizing them with a callout line helps to understand where the points are actually located: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html) */ - new(properties?: LineCallout3DProperties): LineCallout3D; + new (properties?: LineCallout3DProperties): LineCallout3D; fromJSON(json: any): LineCallout3D; } @@ -26719,41 +28805,40 @@ declare namespace __esri { interface LineCallout3DProperties extends Callout3DProperties { /** * The border settings of the callout line. The border of the callout line can be used to improve the contrast of the callout line color against various background colors. If the border is `null`, then no border will be visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#border) */ border?: LineCallout3DBorderProperties; /** * The color of the callout line. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#color) - * + * * @default black */ color?: Color | number[] | string; /** * The width of the callout line in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#size) - * + * * @default 1px */ size?: number | string; /** * For LineCallout3D the type is always `line`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#type) */ type?: string; } - export interface LineCallout3DBorderProperties extends Object { /** * The color of the callout line border. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#border) - * + * * @default white */ color?: Color; @@ -26762,9 +28847,9 @@ declare namespace __esri { export interface LineCallout3DBorder extends AnonymousAccessor { /** * The color of the callout line border. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html#border) - * + * * @default white */ color?: Color; @@ -26773,35 +28858,35 @@ declare namespace __esri { interface Edges3D extends Accessor, JSONSupport { /** * The color of the edges. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html#color) - * + * * @default black */ color: Color; /** * A size in points by which to extend edges beyond their original end points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html#extensionLength) - * + * * @default "0" */ extensionLength: number; /** * The size of the edges in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html#size) - * + * * @default 1px */ size: number; /** * Creates a deep clone of the edges. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html#clone) - * - * + * + * */ clone(): Edges3D; } @@ -26809,11 +28894,11 @@ declare namespace __esri { interface Edges3DConstructor { /** * Edges3D is the base class for symbol classes that add edge rendering visualization to existing symbols. Edge rendering visualization is specific for 3D visualizations and can only be applied to [FillSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html) on [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html) or [ExtrudeSymbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html) on [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html) */ - new(properties?: Edges3DProperties): Edges3D; + new (properties?: Edges3DProperties): Edges3D; fromJSON(json: any): Edges3D; } @@ -26823,25 +28908,25 @@ declare namespace __esri { interface Edges3DProperties { /** * The color of the edges. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html#color) - * + * * @default black */ color?: Color | number[] | string; /** * A size in points by which to extend edges beyond their original end points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html#extensionLength) - * + * * @default "0" */ extensionLength?: number | string; /** * The size of the edges in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-Edges3D.html#size) - * + * * @default 1px */ size?: number | string; @@ -26850,17 +28935,17 @@ declare namespace __esri { interface SketchEdges3D extends Edges3D { /** * For SketchEdges3D the type is always `sketch`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SketchEdges3D.html#type) */ type: "sketch"; /** * Creates a deep clone of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SketchEdges3D.html#clone) - * - * + * + * */ clone(): SketchEdges3D; } @@ -26868,11 +28953,11 @@ declare namespace __esri { interface SketchEdges3DConstructor { /** * SketchEdges3D is a symbol type that visualizes edges of [3D Object SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html), extruded polygons or mesh geometries with a sketched line. It can be used to emphasize the form of 3D objects and to improve the three-dimensional spatial understanding. A sketched line aims to look like a hand-drawn line. In architecture this is useful for visualizing planned urban projects. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SketchEdges3D.html) */ - new(properties?: SketchEdges3DProperties): SketchEdges3D; + new (properties?: SketchEdges3DProperties): SketchEdges3D; fromJSON(json: any): SketchEdges3D; } @@ -26882,7 +28967,7 @@ declare namespace __esri { interface SketchEdges3DProperties extends Edges3DProperties { /** * For SketchEdges3D the type is always `sketch`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SketchEdges3D.html#type) */ type?: "sketch"; @@ -26891,17 +28976,17 @@ declare namespace __esri { interface SolidEdges3D extends Edges3D { /** * For SolidEdges3D the type is always `solid`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SolidEdges3D.html#type) */ type: "solid"; /** * Creates a deep clone of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SolidEdges3D.html#clone) - * - * + * + * */ clone(): SolidEdges3D; } @@ -26909,11 +28994,11 @@ declare namespace __esri { interface SolidEdges3DConstructor { /** * SolidEdges3D is a symbol type that visualizes edges of [3D Object SceneLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html), extruded polygons or mesh geometries with a solid line. It can be used to emphasize the form of 3D objects and to improve the three-dimensional spatial understanding. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SolidEdges3D.html) */ - new(properties?: SolidEdges3DProperties): SolidEdges3D; + new (properties?: SolidEdges3DProperties): SolidEdges3D; fromJSON(json: any): SolidEdges3D; } @@ -26923,7 +29008,7 @@ declare namespace __esri { interface SolidEdges3DProperties extends Edges3DProperties { /** * For SolidEdges3D the type is always `solid`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-edges-SolidEdges3D.html#type) */ type?: "solid"; @@ -26932,31 +29017,31 @@ declare namespace __esri { interface ExtrudeSymbol3DLayer extends Symbol3DLayer { /** * Sets the contour edges on polygons symbolized with ExtrudeSymbol3DLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#edges) */ edges: Edges3D; /** * The height of the extrusion in meters. Negative values will extrude the polygon surface downward towards or below the ground. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#size) - * + * * @default 1 */ size: number; /** * For ExtrudeSymbol3DLayer the type is always `extrude`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#type) */ readonly type: "extrude"; /** * Creates a deep clone of the symbol layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#clone) - * - * + * + * */ clone(): ExtrudeSymbol3DLayer; } @@ -26964,11 +29049,11 @@ declare namespace __esri { interface ExtrudeSymbol3DLayerConstructor { /** * ExtrudeSymbol3DLayer is used to render [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries by extruding them upward from the ground, creating a 3D volumetric object. This is done with a [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html) */ - new(properties?: ExtrudeSymbol3DLayerProperties): ExtrudeSymbol3DLayer; + new (properties?: ExtrudeSymbol3DLayerProperties): ExtrudeSymbol3DLayer; fromJSON(json: any): ExtrudeSymbol3DLayer; } @@ -26978,15 +29063,15 @@ declare namespace __esri { interface ExtrudeSymbol3DLayerProperties extends Symbol3DLayerProperties { /** * Sets the contour edges on polygons symbolized with ExtrudeSymbol3DLayer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#edges) */ edges?: Edges3DProperties; /** * The height of the extrusion in meters. Negative values will extrude the polygon surface downward towards or below the ground. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ExtrudeSymbol3DLayer.html#size) - * + * * @default 1 */ size?: number; @@ -26995,7 +29080,7 @@ declare namespace __esri { interface FillSymbol extends Symbol { /** * The outline of the polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html#outline) */ outline: SimpleLineSymbol; @@ -27004,11 +29089,11 @@ declare namespace __esri { interface FillSymbolConstructor { /** * Fill symbols are used to draw [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) graphics in a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) or a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). To create new fill symbols, use either [SimpleFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html) or [PictureFillSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html) */ - new(properties?: FillSymbolProperties): FillSymbol; + new (properties?: FillSymbolProperties): FillSymbol; fromJSON(json: any): FillSymbol; } @@ -27018,7 +29103,7 @@ declare namespace __esri { interface FillSymbolProperties extends SymbolProperties { /** * The outline of the polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html#outline) */ outline?: SimpleLineSymbolProperties; @@ -27027,29 +29112,29 @@ declare namespace __esri { interface FillSymbol3DLayer extends Symbol3DLayer { /** * Sets the contour edges on 3D Objects. This is only applicable for [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html). ![symbol3D-edges-solid](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbol3d-edges-solid-2.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#edges) */ edges: Edges3D; /** * The outline used to draw a line around the filled geometry. This property is not supported in [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html) symbol layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) */ outline: FillSymbol3DLayerOutline; /** * For FillSymbol3DLayer the type is always `fill`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#type) */ readonly type: "fill"; /** * Creates a deep clone of the symbol layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#clone) - * - * + * + * */ clone(): FillSymbol3DLayer; } @@ -27057,11 +29142,11 @@ declare namespace __esri { interface FillSymbol3DLayerConstructor { /** * FillSymbol3DLayer is used to render the surfaces of flat 2D [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometries and 3D volumetric meshes in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html) */ - new(properties?: FillSymbol3DLayerProperties): FillSymbol3DLayer; + new (properties?: FillSymbol3DLayerProperties): FillSymbol3DLayer; fromJSON(json: any): FillSymbol3DLayer; } @@ -27071,29 +29156,28 @@ declare namespace __esri { interface FillSymbol3DLayerProperties extends Symbol3DLayerProperties { /** * Sets the contour edges on 3D Objects. This is only applicable for [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html). ![symbol3D-edges-solid](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbol3d-edges-solid-2.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#edges) */ edges?: Edges3DProperties; /** * The outline used to draw a line around the filled geometry. This property is not supported in [MeshSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html) symbol layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) */ outline?: FillSymbol3DLayerOutlineProperties; } - export interface FillSymbol3DLayerOutlineProperties extends Object { /** * The color of the outline. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) */ color?: Color | number[] | string; /** * The width of the outline in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) */ size?: number | string; @@ -27102,13 +29186,13 @@ declare namespace __esri { export interface FillSymbol3DLayerOutline extends AnonymousAccessor { /** * The color of the outline. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) */ color: Color; /** * The width of the outline in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol3DLayer.html#outline) */ size: number; @@ -27116,63 +29200,62 @@ declare namespace __esri { interface Font extends Accessor, JSONSupport { /** - * The text decoration. **Possible Values:** underline | line-through | none + * The text decoration. **Possible Values:** underline | line-through | none * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#decoration) - * + * * @default none */ decoration: "underline" | "line-through" | "none"; /** - * The font family of the text. The possible values are dependent upon the: layer type, rendering mechanism, and if you working with a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [Labeling guide page](https://developers.arcgis.com/javascript/latest/guide/labeling/index.html) for detailed explanation. - * + * The font family of the text. The possible values are dependent upon the layer type, and if you working with a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [Labeling guide page](https://developers.arcgis.com/javascript/latest/guide/labeling/index.html) for detailed explanation. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#family) - * + * * @default sans-serif */ family: string; /** * The font size in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * > **Known Limitations** In 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), if the [TextSymbol3DLayer.size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#size) property is set, it will override this [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) property. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) - * + * * @default 9 */ size: number; /** - * The text style. Specifies whether a font should be styled: normal, italic, or oblique. **Possible Values:** normal | italic | oblique - * > **Known Limitations** `oblique` is not supported in 2D [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) labels. - * + * The text style. Specifies whether a font should be styled: normal, italic, or oblique. **Possible Values:** normal | italic | oblique + * > **Known Limitations** `oblique` is not supported in 2D [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) labels. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#style) - * + * * @default normal */ style: "normal" | "italic" | "oblique"; /** - * The text weight. Specifies the level of boldness. **Possible Values:** normal | bold | bolder | lighter - * > **Known Limitations** `bolder` and `lighter` are not supported in 2D [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) labels. - * + * The text weight. Specifies the level of boldness. **Possible Values:** normal | bold | bolder | lighter + * > **Known Limitations** `bolder` and `lighter` are not supported in 2D [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) labels. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#weight) - * + * * @default normal */ weight: "normal" | "bold" | "bolder" | "lighter"; /** * Creates a deep clone of the font object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#clone) - * - * + * + * */ clone(): Font; } interface FontConstructor { - - - new(properties?: FontProperties): Font; + new (properties?: FontProperties): Font; fromJSON(json: any): Font; } @@ -27181,45 +29264,46 @@ declare namespace __esri { interface FontProperties { /** - * The text decoration. **Possible Values:** underline | line-through | none + * The text decoration. **Possible Values:** underline | line-through | none * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#decoration) - * + * * @default none */ decoration?: "underline" | "line-through" | "none"; /** - * The font family of the text. The possible values are dependent upon the: layer type, rendering mechanism, and if you working with a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [Labeling guide page](https://developers.arcgis.com/javascript/latest/guide/labeling/index.html) for detailed explanation. - * + * The font family of the text. The possible values are dependent upon the layer type, and if you working with a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [Labeling guide page](https://developers.arcgis.com/javascript/latest/guide/labeling/index.html) for detailed explanation. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#family) - * + * * @default sans-serif */ family?: string; /** * The font size in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * > **Known Limitations** In 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), if the [TextSymbol3DLayer.size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#size) property is set, it will override this [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) property. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) - * + * * @default 9 */ size?: number | string; /** - * The text style. Specifies whether a font should be styled: normal, italic, or oblique. **Possible Values:** normal | italic | oblique - * > **Known Limitations** `oblique` is not supported in 2D [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) labels. - * + * The text style. Specifies whether a font should be styled: normal, italic, or oblique. **Possible Values:** normal | italic | oblique + * > **Known Limitations** `oblique` is not supported in 2D [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) labels. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#style) - * + * * @default normal */ style?: "normal" | "italic" | "oblique"; /** - * The text weight. Specifies the level of boldness. **Possible Values:** normal | bold | bolder | lighter - * > **Known Limitations** `bolder` and `lighter` are not supported in 2D [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) labels. - * + * The text weight. Specifies the level of boldness. **Possible Values:** normal | bold | bolder | lighter + * > **Known Limitations** `bolder` and `lighter` are not supported in 2D [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) labels. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#weight) - * + * * @default normal */ weight?: "normal" | "bold" | "bolder" | "lighter"; @@ -27228,47 +29312,47 @@ declare namespace __esri { interface IconSymbol3DLayer extends Symbol3DLayer { /** * The positioning of the icon relative to the geometry. **Possible values:** center | left | right | top | bottom | top-left | top-right | bottom-left | bottom-right - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#anchor) - * + * * @default center */ anchor: string; /** * The outline of the icon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) */ outline: IconSymbol3DLayerOutline; /** * The shape (`primitive`) or image URL (`href`) used to visualize the features. If both properties are present, `href` takes precedence and `primitive` is ignored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) - * + * * @default { primitive: "circle" } */ resource: IconSymbol3DLayerResource; /** * The size of the icon in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#size) - * + * * @default 12 */ size: number; /** * For IconSymbol3DLayer the type is always `icon`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#type) */ readonly type: "icon"; /** * Creates a deep clone of the symbol layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#clone) - * - * + * + * */ clone(): IconSymbol3DLayer; } @@ -27276,11 +29360,11 @@ declare namespace __esri { interface IconSymbol3DLayerConstructor { /** * IconSymbol3DLayer is used to render [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries using a flat 2D icon (e.g. a circle) with a [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) features may also be rendered with IconSymbol3DLayers, but the icon symbol layer must be contained within a [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html), not a [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) in that scenario. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html) */ - new(properties?: IconSymbol3DLayerProperties): IconSymbol3DLayer; + new (properties?: IconSymbol3DLayerProperties): IconSymbol3DLayer; fromJSON(json: any): IconSymbol3DLayer; } @@ -27290,51 +29374,50 @@ declare namespace __esri { interface IconSymbol3DLayerProperties extends Symbol3DLayerProperties { /** * The positioning of the icon relative to the geometry. **Possible values:** center | left | right | top | bottom | top-left | top-right | bottom-left | bottom-right - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#anchor) - * + * * @default center */ anchor?: string; /** * The outline of the icon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) */ outline?: IconSymbol3DLayerOutlineProperties; /** * The shape (`primitive`) or image URL (`href`) used to visualize the features. If both properties are present, `href` takes precedence and `primitive` is ignored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) - * + * * @default { primitive: "circle" } */ resource?: IconSymbol3DLayerResource; /** * The size of the icon in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#size) - * + * * @default 12 */ size?: number | string; } - export interface IconSymbol3DLayerOutlineProperties extends Object { /** * The color of the outline. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) - * + * * @default black */ color?: Color | number[] | string; /** * The width of the outline in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) - * + * * @default 1.125 */ size?: number | string; @@ -27343,27 +29426,26 @@ declare namespace __esri { export interface IconSymbol3DLayerOutline extends AnonymousAccessor { /** * The color of the outline. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) - * + * * @default black */ color?: Color; /** * The width of the outline in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#outline) - * + * * @default 1.125 */ size?: number; } - export interface IconSymbol3DLayerResource extends Object { /** - * Uses a built-in shape. See the table below for list of possible values. - * + * Uses a built-in shape. See the table below for list of possible values. + * * Value | Description * ------|------------ * circle | ![s3d-icon-circle](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-icon-circle.png) @@ -27371,14 +29453,14 @@ declare namespace __esri { * cross | ![s3d-icon-cross](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-icon-cross.png) * x | ![s3d-icon-x](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-icon-x.png) * kite | ![s3d-icon-kite](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-icon-kite.png) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) */ primitive?: string; /** * The URL or data URI for the image. If the external resource is an SVG then the SVG root node must have a set width and height, otherwise it will not render at the correct size. SVG is not supported in IE11. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-IconSymbol3DLayer.html#resource) */ href?: string; @@ -27387,29 +29469,29 @@ declare namespace __esri { interface LabelSymbol3D extends Symbol3D { /** * Settings for adding a callout visualization to the symbol. Callouts are drawn from the point feature location that is being symbolized, to the vertical offset of the symbol. This property has no effect if [verticalOffset](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) is not set. At the moment only callouts of type `line` are supported. See [LineCallout3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#callout) */ callout: Callout3D; /** * For LabelSymbol3D the type is always `label-3d`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#type) */ readonly type: "label-3d"; /** * Shifts the symbol along the vertical world axis by a given height. The height is set in screen space units like points or pixels. For points displayed with a [callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#callout) `verticalOffset` should be set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ verticalOffset: LabelSymbol3DVerticalOffset; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#clone) - * - * + * + * */ clone(): LabelSymbol3D; } @@ -27417,11 +29499,11 @@ declare namespace __esri { interface LabelSymbol3DConstructor { /** * LabelSymbol3D is used to render labels for features from a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) */ - new(properties?: LabelSymbol3DProperties): LabelSymbol3D; + new (properties?: LabelSymbol3DProperties): LabelSymbol3D; fromJSON(json: any): LabelSymbol3D; } @@ -27431,35 +29513,34 @@ declare namespace __esri { interface LabelSymbol3DProperties extends Symbol3DProperties { /** * Settings for adding a callout visualization to the symbol. Callouts are drawn from the point feature location that is being symbolized, to the vertical offset of the symbol. This property has no effect if [verticalOffset](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) is not set. At the moment only callouts of type `line` are supported. See [LineCallout3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#callout) */ callout?: Callout3DProperties; /** * Shifts the symbol along the vertical world axis by a given height. The height is set in screen space units like points or pixels. For points displayed with a [callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#callout) `verticalOffset` should be set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ verticalOffset?: LabelSymbol3DVerticalOffsetProperties; } - export interface LabelSymbol3DVerticalOffsetProperties extends Object { /** * The vertical symbol offset in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ screenLength?: number; /** * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid the vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ minWorldLength?: number; /** * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ maxWorldLength?: number; @@ -27468,38 +29549,30 @@ declare namespace __esri { export interface LabelSymbol3DVerticalOffset extends AnonymousAccessor { /** * The vertical symbol offset in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ screenLength: number; /** * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid the vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ minWorldLength?: number; /** * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html#verticalOffset) */ maxWorldLength?: number; } interface LineSymbol extends Symbol { - /** - * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html#color) - * - * @default "black" - */ - color: Color; /** * The width of the symbol in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html#width) - * + * * @default 0.75 */ width: number; @@ -27508,11 +29581,11 @@ declare namespace __esri { interface LineSymbolConstructor { /** * Line symbols are used to draw [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html) */ - new(properties?: LineSymbolProperties): LineSymbol; + new (properties?: LineSymbolProperties): LineSymbol; fromJSON(json: any): LineSymbol; } @@ -27520,19 +29593,11 @@ declare namespace __esri { export const LineSymbol: LineSymbolConstructor; interface LineSymbolProperties extends SymbolProperties { - /** - * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html#color) - * - * @default "black" - */ - color?: Color | number[] | string; /** * The width of the symbol in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol.html#width) - * + * * @default 0.75 */ width?: number | string; @@ -27541,17 +29606,17 @@ declare namespace __esri { interface LineSymbol3D extends Symbol3D { /** * For LineSymbol3D the type is always `line-3d`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html#type) */ readonly type: "line-3d"; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html#clone) - * - * + * + * */ clone(): LineSymbol3D; } @@ -27559,43 +29624,41 @@ declare namespace __esri { interface LineSymbol3DConstructor { /** * LineSymbol3D is used to render features with [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometry in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html) */ - new(properties?: LineSymbol3DProperties): LineSymbol3D; + new (properties?: LineSymbol3DProperties): LineSymbol3D; fromJSON(json: any): LineSymbol3D; } export const LineSymbol3D: LineSymbol3DConstructor; - interface LineSymbol3DProperties extends Symbol3DProperties { - - } + interface LineSymbol3DProperties extends Symbol3DProperties {} interface LineSymbol3DLayer extends Symbol3DLayer { /** * The width of the line in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html#size) - * + * * @default "1px" */ size: number; /** * For LineSymbol3DLayer the type is always `line`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html#type) */ readonly type: "line"; /** * Creates a deep clone of the symbol layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html#clone) - * - * + * + * */ clone(): LineSymbol3DLayer; } @@ -27603,11 +29666,11 @@ declare namespace __esri { interface LineSymbol3DLayerConstructor { /** * LineSymbol3DLayer renders [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometries using a flat 2D line with a [LineSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html) */ - new(properties?: LineSymbol3DLayerProperties): LineSymbol3DLayer; + new (properties?: LineSymbol3DLayerProperties): LineSymbol3DLayer; fromJSON(json: any): LineSymbol3DLayer; } @@ -27617,9 +29680,9 @@ declare namespace __esri { interface LineSymbol3DLayerProperties extends Symbol3DLayerProperties { /** * The width of the line in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3DLayer.html#size) - * + * * @default "1px" */ size?: number | string; @@ -27627,29 +29690,29 @@ declare namespace __esri { interface MarkerSymbol extends Symbol { /** - * The angle of the marker in degrees. + * The angle of the marker in degrees. * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#angle) - * + * * @default 0 */ angle: number; /** - * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#xoffset) - * + * * @default 0 */ xoffset: number; /** - * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#yoffset) - * + * * @default 0 */ yoffset: number; @@ -27658,11 +29721,11 @@ declare namespace __esri { interface MarkerSymbolConstructor { /** * Marker symbols are used to draw [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) graphics in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or individual [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). To create new marker symbols, use either [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html) or [PictureMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html) */ - new(properties?: MarkerSymbolProperties): MarkerSymbol; + new (properties?: MarkerSymbolProperties): MarkerSymbol; fromJSON(json: any): MarkerSymbol; } @@ -27671,29 +29734,29 @@ declare namespace __esri { interface MarkerSymbolProperties extends SymbolProperties { /** - * The angle of the marker in degrees. + * The angle of the marker in degrees. * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#angle) - * + * * @default 0 */ angle?: number; /** - * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#xoffset) - * + * * @default 0 */ xoffset?: number | string; /** - * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#yoffset) - * + * * @default 0 */ yoffset?: number | string; @@ -27702,17 +29765,17 @@ declare namespace __esri { interface MeshSymbol3D extends Symbol3D { /** * For MeshSymbol3D, the type is always `mesh-3d`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html#type) */ readonly type: "mesh-3d"; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html#clone) - * - * + * + * */ clone(): MeshSymbol3D; } @@ -27720,99 +29783,103 @@ declare namespace __esri { interface MeshSymbol3DConstructor { /** * MeshSymbol3D is used to render 3D mesh features in a [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MeshSymbol3D.html) */ - new(properties?: MeshSymbol3DProperties): MeshSymbol3D; + new (properties?: MeshSymbol3DProperties): MeshSymbol3D; fromJSON(json: any): MeshSymbol3D; } export const MeshSymbol3D: MeshSymbol3DConstructor; - interface MeshSymbol3DProperties extends Symbol3DProperties { - - } + interface MeshSymbol3DProperties extends Symbol3DProperties {} interface ObjectSymbol3DLayer extends Symbol3DLayer { /** - * The positioning of the object relative to the geometry. The default behavior (`origin`) depends on the resource: + * The positioning of the symbol relative to the geometry. The default behavior (`origin`) depends on the resource: * * For `sphere`, `cube` and `diamond` primitives, the origin is at the center. * * For `cylinder`, `cone`, `inverted-cone` and `tetrahedron` primitives, the origin is at the bottom. * * For `href` resources, the origin coincides with the origin of the 3D model. - * - * - * **Possible Values:** center | top | bottom | origin - * + * + * + * If `anchor` is set to `relative`, the anchor is defined by [`anchorPosition`](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchorPosition) as a fraction of the symbol's bounding box. **Possible Values:** center | top | bottom | origin | relative + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) - * + * * @default origin */ anchor: string; + /** + * Defines the [anchor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) relative to the center of the [symbol layer resource](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource). It is specified as a ratio of the resource's bounding box dimensions. For example, a value of `{ x: 0, y: 0, z: 0 }` designates the center, while a value of `{ x: -0.5, y: -0.5, z: -0.5 }` places the symbol at the lower south-west corner of the symbol's bounding box. This property only applies when [anchor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) is set to `relative`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchorPosition) + */ + anchorPosition: ObjectSymbol3DLayerAnchorPosition; /** * The depth, or diameter from north to south, of the object in meters. If `undefined`, the depth will be calculated to maintain the original proportions of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) - * + * * @default 10 */ depth: number; /** * The clockwise rotation of the symbol in the horizontal plane (i.e., around the z axis). The rotation is specified in degrees and is relative to the y-axis. If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then this angle corresponds to the heading of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#heading) */ heading: number; /** * The height of the object in meters. If `undefined`, the height will be calculated to maintain the original proportions of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height) - * + * * @default 10 */ height: number; /** * The primitive shape (`primitive`) or external 3D model (`href`) used to visualize the points. If both properties are present, `primitive` takes precedence and `href` is ignored. When using the `href` property, external 3D models must be present in a specific format, which can be generated using the ArcGIS Pro SDK. [See these instructions](https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/ExportWeb3DObjectResource#exportweb3dobjectresource) to learn how to generate a custom 3D model for use in this property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) - * + * * @default { primitive: "sphere" } */ resource: ObjectSymbol3DLayerResource; /** * The rotation of the symbol in the lateral vertical plane (i.e., around the y axis). The rotation is specified in degrees and is relative to the x-axis. At 0 degrees, the model is level. A positive value lifts the left part and lowers the right part of the model. If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then this angle corresponds to the roll of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#roll) */ roll: number; /** * The rotation of the symbol in the longitudinal vertical plane (i.e., around the x axis). The rotation is specified in degrees and is relative to the y-axis. At 0 degrees, the model is level. A positive value points lifts the front and lowers the back of the model. If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then this angle corresponds to the tilt of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#tilt) */ tilt: number; /** * For ObjectSymbol3DLayer the type is always `object`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#type) */ readonly type: "object"; /** * The width, or diameter from east to west, of the object in meters. If `undefined`, the width will be calculated to maintain the original proportions of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width) - * + * * @default 10 */ width: number; /** * Creates a deep clone of the symbol layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#clone) - * - * + * + * */ clone(): ObjectSymbol3DLayer; } @@ -27820,11 +29887,11 @@ declare namespace __esri { interface ObjectSymbol3DLayerConstructor { /** * ObjectSymbol3DLayer is used to render [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries using a volumetric 3D shape (e.g., a sphere or cylinder) with a [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) features may also be rendered with ObjectSymbol3DLayers, but the object symbol layer must be contained in a [PolygonSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html), not a [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) in this scenario. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html) */ - new(properties?: ObjectSymbol3DLayerProperties): ObjectSymbol3DLayer; + new (properties?: ObjectSymbol3DLayerProperties): ObjectSymbol3DLayer; fromJSON(json: any): ObjectSymbol3DLayer; } @@ -27833,76 +29900,89 @@ declare namespace __esri { interface ObjectSymbol3DLayerProperties extends Symbol3DLayerProperties { /** - * The positioning of the object relative to the geometry. The default behavior (`origin`) depends on the resource: + * The positioning of the symbol relative to the geometry. The default behavior (`origin`) depends on the resource: * * For `sphere`, `cube` and `diamond` primitives, the origin is at the center. * * For `cylinder`, `cone`, `inverted-cone` and `tetrahedron` primitives, the origin is at the bottom. * * For `href` resources, the origin coincides with the origin of the 3D model. - * - * - * **Possible Values:** center | top | bottom | origin - * + * + * + * If `anchor` is set to `relative`, the anchor is defined by [`anchorPosition`](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchorPosition) as a fraction of the symbol's bounding box. **Possible Values:** center | top | bottom | origin | relative + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) - * + * * @default origin */ anchor?: string; + /** + * Defines the [anchor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) relative to the center of the [symbol layer resource](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource). It is specified as a ratio of the resource's bounding box dimensions. For example, a value of `{ x: 0, y: 0, z: 0 }` designates the center, while a value of `{ x: -0.5, y: -0.5, z: -0.5 }` places the symbol at the lower south-west corner of the symbol's bounding box. This property only applies when [anchor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchor) is set to `relative`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#anchorPosition) + */ + anchorPosition?: ObjectSymbol3DLayerAnchorPosition; /** * The depth, or diameter from north to south, of the object in meters. If `undefined`, the depth will be calculated to maintain the original proportions of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#depth) - * + * * @default 10 */ depth?: number; /** * The clockwise rotation of the symbol in the horizontal plane (i.e., around the z axis). The rotation is specified in degrees and is relative to the y-axis. If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then this angle corresponds to the heading of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#heading) */ heading?: number; /** * The height of the object in meters. If `undefined`, the height will be calculated to maintain the original proportions of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#height) - * + * * @default 10 */ height?: number; /** * The primitive shape (`primitive`) or external 3D model (`href`) used to visualize the points. If both properties are present, `primitive` takes precedence and `href` is ignored. When using the `href` property, external 3D models must be present in a specific format, which can be generated using the ArcGIS Pro SDK. [See these instructions](https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/ExportWeb3DObjectResource#exportweb3dobjectresource) to learn how to generate a custom 3D model for use in this property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) - * + * * @default { primitive: "sphere" } */ resource?: ObjectSymbol3DLayerResource; /** * The rotation of the symbol in the lateral vertical plane (i.e., around the y axis). The rotation is specified in degrees and is relative to the x-axis. At 0 degrees, the model is level. A positive value lifts the left part and lowers the right part of the model. If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then this angle corresponds to the roll of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#roll) */ roll?: number; /** * The rotation of the symbol in the longitudinal vertical plane (i.e., around the x axis). The rotation is specified in degrees and is relative to the y-axis. At 0 degrees, the model is level. A positive value points lifts the front and lowers the back of the model. If the symbol resource is aligned such that its forward facing side points in the direction of the y-axis (the y-axis always points North in WGS84 or WebMercator coordinates), its upwards facing side is pointing in the direction of the z-axis, and its right-hand side points in the direction of the x-axis (the x-axis always points East in WGS84 or WebMercator coordinates), then this angle corresponds to the tilt of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#tilt) */ tilt?: number; /** * The width, or diameter from east to west, of the object in meters. If `undefined`, the width will be calculated to maintain the original proportions of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#width) - * + * * @default 10 */ width?: number; } + export interface ObjectSymbol3DLayerAnchorPosition extends Object { + x: number; + + y: number; + + z: number; + } export interface ObjectSymbol3DLayerResource extends Object { /** - * Uses a built-in shape. See the table below for possible values. - * + * Uses a built-in shape. See the table below for possible values. + * * Value | Description * ------|------------ * sphere | ![s3d-object-sphere](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-object-sphere.png) @@ -27912,14 +29992,14 @@ declare namespace __esri { * inverted-cone | ![s3d-object-inverted-cone](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-object-inverted-cone.png) * diamond | ![s3d-object-diamond](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-object-diamond.png) * tetrahedron | ![s3d-object-tetrahedron](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-object-tetrahedron.png) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) */ primitive?: string; /** * The URL to the 3D model. [See these instructions](https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Authoring/ExportWeb3DObjectResource#exportweb3dobjectresource) to learn how to create a custom 3D model. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource) */ href?: string; @@ -27928,25 +30008,25 @@ declare namespace __esri { interface PathSymbol3DLayer extends Symbol3DLayer { /** * The diameter of the tube in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#size) - * + * * @default 1 */ size: number; /** * For PathSymbol3DLayer, the type is always `path`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#type) */ readonly type: "path"; /** * Creates a deep clone of the symbol layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#clone) - * - * + * + * */ clone(): PathSymbol3DLayer; } @@ -27954,11 +30034,11 @@ declare namespace __esri { interface PathSymbol3DLayerConstructor { /** * PathSymbol3DLayer renders [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometries using a volumetric 3D tube with a [LineSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LineSymbol3D.html) in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html) */ - new(properties?: PathSymbol3DLayerProperties): PathSymbol3DLayer; + new (properties?: PathSymbol3DLayerProperties): PathSymbol3DLayer; fromJSON(json: any): PathSymbol3DLayer; } @@ -27968,9 +30048,9 @@ declare namespace __esri { interface PathSymbol3DLayerProperties extends Symbol3DLayerProperties { /** * The diameter of the tube in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PathSymbol3DLayer.html#size) - * + * * @default 1 */ size?: number; @@ -27979,71 +30059,71 @@ declare namespace __esri { interface PictureFillSymbol extends FillSymbol { /** * The height of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#height) - * + * * @default 12 */ height: number; /** * For PictureFillSymbol the type is always `picture-fill`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#type) */ readonly type: "picture-fill"; /** * The URL to the image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#url) */ url: string; /** * The width of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#width) - * + * * @default 12 */ width: number; /** * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#xoffset) - * + * * @default 0 */ xoffset: number; /** * The scale factor on the x axis of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#xscale) - * + * * @default 1 */ xscale: number; /** * The offset on the y-axis in pixels or points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#yoffset) - * + * * @default 0 */ yoffset: number; /** * The scale factor on the y axis of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#yscale) - * + * * @default 1 */ yscale: number; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#clone) - * - * + * + * */ clone(): PictureFillSymbol; } @@ -28051,11 +30131,11 @@ declare namespace __esri { interface PictureFillSymbolConstructor { /** * PictureFillSymbol uses an image in a repeating pattern to symbolize polygon features in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). A [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#url) must point to a valid image. In addition, the symbol can have an optional [outline](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#outline), which is defined by a [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). PictureFillSymbols may be applied to polygon features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or an individual [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html) */ - new(properties?: PictureFillSymbolProperties): PictureFillSymbol; + new (properties?: PictureFillSymbolProperties): PictureFillSymbol; fromJSON(json: any): PictureFillSymbol; } @@ -28065,55 +30145,55 @@ declare namespace __esri { interface PictureFillSymbolProperties extends FillSymbolProperties { /** * The height of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#height) - * + * * @default 12 */ height?: number | string; /** * The URL to the image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#url) */ url?: string; /** * The width of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#width) - * + * * @default 12 */ width?: number | string; /** * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#xoffset) - * + * * @default 0 */ xoffset?: number | string; /** * The scale factor on the x axis of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#xscale) - * + * * @default 1 */ xscale?: number; /** * The offset on the y-axis in pixels or points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#yoffset) - * + * * @default 0 */ yoffset?: number | string; /** * The scale factor on the y axis of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureFillSymbol.html#yscale) - * + * * @default 1 */ yscale?: number; @@ -28122,42 +30202,42 @@ declare namespace __esri { interface PictureMarkerSymbol extends MarkerSymbol { /** * The height of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#height) - * + * * @default 12 */ height: number; /** * For PictureMarkerSymbol the type is always `picture-marker`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#type) */ readonly type: "picture-marker"; /** - * The URL to the image. To avoid CORS issues with this symbol, do one of the following: + * The URL to the image. To avoid CORS issues with this symbol, do one of the following: * * Make certain that the [image](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) is hosted on a [CORS enabled server](https://enable-cors.org/server.html). * * Use an [image](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) hosted on the same domain as the application. * * Install a proxy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) */ url: string; /** * The width of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#width) - * + * * @default 12 */ width: number; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#clone) - * - * + * + * */ clone(): PictureMarkerSymbol; } @@ -28165,11 +30245,11 @@ declare namespace __esri { interface PictureMarkerSymbolConstructor { /** * PictureMarkerSymbol renders [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) graphics in either a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) using an image. A [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) must point to a valid image. PictureMarkerSymbols may be applied to point features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or individual [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). The image below depicts a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) whose point features are styled with a [PictureMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html) */ - new(properties?: PictureMarkerSymbolProperties): PictureMarkerSymbol; + new (properties?: PictureMarkerSymbolProperties): PictureMarkerSymbol; fromJSON(json: any): PictureMarkerSymbol; } @@ -28179,26 +30259,26 @@ declare namespace __esri { interface PictureMarkerSymbolProperties extends MarkerSymbolProperties { /** * The height of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#height) - * + * * @default 12 */ height?: number | string; /** - * The URL to the image. To avoid CORS issues with this symbol, do one of the following: + * The URL to the image. To avoid CORS issues with this symbol, do one of the following: * * Make certain that the [image](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) is hosted on a [CORS enabled server](https://enable-cors.org/server.html). * * Use an [image](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) hosted on the same domain as the application. * * Install a proxy. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#url) */ url?: string; /** * The width of the image in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html#width) - * + * * @default 12 */ width?: number | string; @@ -28207,29 +30287,29 @@ declare namespace __esri { interface PointSymbol3D extends Symbol3D { /** * Settings for adding a callout visualization to the symbol. Callouts are drawn from the point feature location that is being symbolized, to the vertical offset of the symbol. This property has no effect if [verticalOffset](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) is not set. At the moment only callouts of type line are supported. See [LineCallout3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#callout) */ callout: Callout3D; /** * For PointSymbol3D the type is always `point-3d`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#type) */ readonly type: "point-3d"; /** * Shifts the symbol along the vertical world axis by a given height. The height is set in screen space units like points or pixels. For points displayed with a [callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#callout) `verticalOffset` should be set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ verticalOffset: PointSymbol3DVerticalOffset; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#clone) - * - * + * + * */ clone(): PointSymbol3D; } @@ -28237,11 +30317,11 @@ declare namespace __esri { interface PointSymbol3DConstructor { /** * PointSymbol3D is used to render features with [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) */ - new(properties?: PointSymbol3DProperties): PointSymbol3D; + new (properties?: PointSymbol3DProperties): PointSymbol3D; fromJSON(json: any): PointSymbol3D; } @@ -28251,35 +30331,34 @@ declare namespace __esri { interface PointSymbol3DProperties extends Symbol3DProperties { /** * Settings for adding a callout visualization to the symbol. Callouts are drawn from the point feature location that is being symbolized, to the vertical offset of the symbol. This property has no effect if [verticalOffset](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) is not set. At the moment only callouts of type line are supported. See [LineCallout3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-callouts-LineCallout3D.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#callout) */ callout?: Callout3DProperties; /** * Shifts the symbol along the vertical world axis by a given height. The height is set in screen space units like points or pixels. For points displayed with a [callout](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#callout) `verticalOffset` should be set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ verticalOffset?: PointSymbol3DVerticalOffsetProperties; } - export interface PointSymbol3DVerticalOffsetProperties extends Object { /** * The vertical symbol offset in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ screenLength?: number; /** * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ minWorldLength?: number; /** * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ maxWorldLength?: number; @@ -28288,19 +30367,19 @@ declare namespace __esri { export interface PointSymbol3DVerticalOffset extends AnonymousAccessor { /** * The vertical symbol offset in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ screenLength: number; /** * The minimum vertical symbol offset in world units. It acts as a lower bound to avoid vertical offset becoming too small. In the following animation the green symbol on the left has `minWorldLength = 20` and for the orange symbol on the right `minWorldLength` has not been set: ![minWorldLength-on](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-minWorldLength.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ minWorldLength?: number; /** * The maximum vertical symbol offset in world units. It acts as an upper bound to avoid vertical offset becoming too big. In the following animation the green symbols have `maxWorldLength = 50` and orange symbols don't have `maxWorldLength` set: ![maxWorldLength](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3D-line-callout-maxWorldLength.gif) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html#verticalOffset) */ maxWorldLength?: number; @@ -28309,17 +30388,17 @@ declare namespace __esri { interface PolygonSymbol3D extends Symbol3D { /** * For PolygonSymbol3D the type is always `polygon-3d`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html#type) */ readonly type: "polygon-3d"; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html#clone) - * - * + * + * */ clone(): PolygonSymbol3D; } @@ -28327,33 +30406,23 @@ declare namespace __esri { interface PolygonSymbol3DConstructor { /** * PolygonSymbol3D is used to render features with [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) geometry in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This symbol type is not supported in 2D MapViews. Polygon features may also be rendered as points with icons or objects at the centroid of each polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PolygonSymbol3D.html) */ - new(properties?: PolygonSymbol3DProperties): PolygonSymbol3D; + new (properties?: PolygonSymbol3DProperties): PolygonSymbol3D; fromJSON(json: any): PolygonSymbol3D; } export const PolygonSymbol3D: PolygonSymbol3DConstructor; - interface PolygonSymbol3DProperties extends Symbol3DProperties { - - } + interface PolygonSymbol3DProperties extends Symbol3DProperties {} interface SimpleFillSymbol extends FillSymbol { /** - * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#color) - * - * @default [0, 0, 0, 0.25] - black, semitransparent - */ - color: Color; - /** - * The fill style. Possible values are listed in the table below: - * + * The fill style. Possible values are listed in the table below: + * * Value | Description * ------|------------- * backward-diagonal | ![sfs-backward-diagonal](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-backward-diagonal.png) @@ -28364,27 +30433,27 @@ declare namespace __esri { * none | The polygon has no fill. * solid | ![sfs-solid](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-solid.png) * vertical | ![sfs-vertical](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-vertical.png) - * + * * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#style) - * + * * @default solid */ style: string; /** * For SimpleFillSymbol the type is always `simple-fill`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#type) */ readonly type: "simple-fill"; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#clone) - * - * + * + * */ clone(): SimpleFillSymbol; } @@ -28392,11 +30461,11 @@ declare namespace __esri { interface SimpleFillSymbolConstructor { /** * SimpleFillSymbol is used for rendering 2D polygons in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It can be filled with a solid [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#color), or a [pattern](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#style). In addition, the symbol can have an optional [outline](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#outline), which is defined by a [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html) */ - new(properties?: SimpleFillSymbolProperties): SimpleFillSymbol; + new (properties?: SimpleFillSymbolProperties): SimpleFillSymbol; fromJSON(json: any): SimpleFillSymbol; } @@ -28405,16 +30474,8 @@ declare namespace __esri { interface SimpleFillSymbolProperties extends FillSymbolProperties { /** - * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#color) - * - * @default [0, 0, 0, 0.25] - black, semitransparent - */ - color?: Color | number[] | string; - /** - * The fill style. Possible values are listed in the table below: - * + * The fill style. Possible values are listed in the table below: + * * Value | Description * ------|------------- * backward-diagonal | ![sfs-backward-diagonal](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-backward-diagonal.png) @@ -28425,11 +30486,11 @@ declare namespace __esri { * none | The polygon has no fill. * solid | ![sfs-solid](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-solid.png) * vertical | ![sfs-vertical](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sfs-vertical.png) - * + * * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleFillSymbol.html#style) - * + * * @default solid */ style?: string; @@ -28437,51 +30498,51 @@ declare namespace __esri { interface SimpleLineSymbol extends LineSymbol { /** - * Specifies the cap style. The cap is the end node of a polyline, or the end of a line segment that does not connect with another segment of the same polyline. See the table below for possible values. - * + * Specifies the cap style. The cap is the end node of a polyline, or the end of a line segment that does not connect with another segment of the same polyline. See the table below for possible values. + * * Possible Value | Example * ---------------|--------- * butt | ![sls-cap-butt](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-cap-butt.png) * round | ![sls-cap-round](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-cap-round.png) * square | ![sls-cap-square](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-cap-square.png) - * - * > **Known Limitations** + * + * > **Known Limitations** * * This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * This property does not persist when applied to a symbol used in a layer saved to a web map or portal item. See the [web map specification](https://developers.arcgis.com/web-map-specification/objects/esriSLS_symbol/) for more details about properties that persist when a SimpleLineSymbol is saved to an ArcGIS Online or Portal item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#cap) - * + * * @default round */ cap: "butt" | "round" | "square"; /** - * Specifies the join style. A `join` refers to the joint of a polyline, or the end of a line segment that connects to another segment of the same polyline. See the table below for possible values. - * + * Specifies the join style. A `join` refers to the joint of a polyline, or the end of a line segment that connects to another segment of the same polyline. See the table below for possible values. + * * Possible Value | Example * ---------------|--------- * bevel | ![sls-join-bevel](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-join-bevel.png) * miter | ![sls-join-miter](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-join-miter.png) * round | ![sls-join-round](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-join-round.png) - * + * * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#join) - * + * * @default round */ join: "miter" | "round" | "bevel"; /** - * Size threshold for showing mitered line joins. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * Size threshold for showing mitered line joins. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#miterLimit) - * + * * @default 0.75 */ miterLimit: number; /** - * Specifies the line style. Possible values are listed in the table below: - * + * Specifies the line style. Possible values are listed in the table below: + * * Value | Description * ------|------------- * dash | ![sls-dash](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-dash.png) @@ -28496,27 +30557,27 @@ declare namespace __esri { * short-dash-dot-dot | ![sls-short-dash-dot-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-short-dash-dot-dot.png) * short-dot | ![sls-short-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-short-dot.png) * solid | ![sls-solid](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-solid.png) - * + * * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#style) - * + * * @default solid */ style: string; /** * For SimpleLineSymbol, the type is always `simple-line`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#type) */ readonly type: "simple-line"; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#clone) - * - * + * + * */ clone(): SimpleLineSymbol; } @@ -28524,11 +30585,11 @@ declare namespace __esri { interface SimpleLineSymbolConstructor { /** * SimpleLineSymbol is used for rendering 2D [polyline geometries](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). SimpleLineSymbol is also used for rendering outlines for [marker symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html) and [fill symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-FillSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html) */ - new(properties?: SimpleLineSymbolProperties): SimpleLineSymbol; + new (properties?: SimpleLineSymbolProperties): SimpleLineSymbol; fromJSON(json: any): SimpleLineSymbol; } @@ -28537,51 +30598,51 @@ declare namespace __esri { interface SimpleLineSymbolProperties extends LineSymbolProperties { /** - * Specifies the cap style. The cap is the end node of a polyline, or the end of a line segment that does not connect with another segment of the same polyline. See the table below for possible values. - * + * Specifies the cap style. The cap is the end node of a polyline, or the end of a line segment that does not connect with another segment of the same polyline. See the table below for possible values. + * * Possible Value | Example * ---------------|--------- * butt | ![sls-cap-butt](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-cap-butt.png) * round | ![sls-cap-round](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-cap-round.png) * square | ![sls-cap-square](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-cap-square.png) - * - * > **Known Limitations** + * + * > **Known Limitations** * * This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * This property does not persist when applied to a symbol used in a layer saved to a web map or portal item. See the [web map specification](https://developers.arcgis.com/web-map-specification/objects/esriSLS_symbol/) for more details about properties that persist when a SimpleLineSymbol is saved to an ArcGIS Online or Portal item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#cap) - * + * * @default round */ cap?: "butt" | "round" | "square"; /** - * Specifies the join style. A `join` refers to the joint of a polyline, or the end of a line segment that connects to another segment of the same polyline. See the table below for possible values. - * + * Specifies the join style. A `join` refers to the joint of a polyline, or the end of a line segment that connects to another segment of the same polyline. See the table below for possible values. + * * Possible Value | Example * ---------------|--------- * bevel | ![sls-join-bevel](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-join-bevel.png) * miter | ![sls-join-miter](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-join-miter.png) * round | ![sls-join-round](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/sls-join-round.png) - * + * * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#join) - * + * * @default round */ join?: "miter" | "round" | "bevel"; /** - * Size threshold for showing mitered line joins. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * Size threshold for showing mitered line joins. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#miterLimit) - * + * * @default 0.75 */ miterLimit?: number | string; /** - * Specifies the line style. Possible values are listed in the table below: - * + * Specifies the line style. Possible values are listed in the table below: + * * Value | Description * ------|------------- * dash | ![sls-dash](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-dash.png) @@ -28596,77 +30657,70 @@ declare namespace __esri { * short-dash-dot-dot | ![sls-short-dash-dot-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-short-dash-dot-dot.png) * short-dot | ![sls-short-dot](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-short-dot.png) * solid | ![sls-solid](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sls-solid.png) - * + * * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html#style) - * + * * @default solid */ style?: string; } interface SimpleMarkerSymbol extends MarkerSymbol { - /** - * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * > The `color` property does not apply to marker symbols defined with the `cross` or `x` [style](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style). Since these styles are wholly comprised of outlines, you must modify the [outline.color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline) property to set the color of symbols with those styles. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#color) - * - * @default [255, 255, 255, 0.25] - white, semitransparent - */ - color: Color; /** * The outline of the marker symbol. The `color` property of this object directly modifies the overall color of marker symbols defined with the `cross` or `x` [style](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline) */ outline: SimpleLineSymbol; /** - * The SVG path of the icon. + * The SVG path of the icon. * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#path) */ path: string; /** * The size of the marker in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#size) - * + * * @default 12 */ size: number; /** - * The marker style. Possible values are in the table below. - * + * The marker style. Possible values are in the table below. + * > **Known Limitations** The `triangle` value is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Value | Description * ------|------------ * circle | ![sms_circle](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-circle.png) * cross | ![sms_cross](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-cross.png) * diamond | ![sms_diamond](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-diamond.png) * square | ![sms_square](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-square.png) + * triangle | ![sms_triangle](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-triangle.png) * x | ![sms_x](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-x.png) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style) - * + * * @default circle */ style: string; /** * For SimpleMarkerSymbol the type is always `simple-marker`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#type) */ readonly type: "simple-marker"; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#clone) - * - * + * + * */ clone(): SimpleMarkerSymbol; } @@ -28674,11 +30728,11 @@ declare namespace __esri { interface SimpleMarkerSymbolConstructor { /** * SimpleMarkerSymbol is used for rendering 2D [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries with a simple shape and [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#color) in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It may be filled with a solid [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#color) and have an optional [outline](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline), which is defined with a [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html) */ - new(properties?: SimpleMarkerSymbolProperties): SimpleMarkerSymbol; + new (properties?: SimpleMarkerSymbolProperties): SimpleMarkerSymbol; fromJSON(json: any): SimpleMarkerSymbol; } @@ -28686,77 +30740,68 @@ declare namespace __esri { export const SimpleMarkerSymbol: SimpleMarkerSymbolConstructor; interface SimpleMarkerSymbolProperties extends MarkerSymbolProperties { - /** - * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * > The `color` property does not apply to marker symbols defined with the `cross` or `x` [style](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style). Since these styles are wholly comprised of outlines, you must modify the [outline.color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline) property to set the color of symbols with those styles. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#color) - * - * @default [255, 255, 255, 0.25] - white, semitransparent - */ - color?: Color | number[] | string; /** * The outline of the marker symbol. The `color` property of this object directly modifies the overall color of marker symbols defined with the `cross` or `x` [style](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#outline) */ outline?: SimpleLineSymbolProperties; /** - * The SVG path of the icon. + * The SVG path of the icon. * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#path) */ path?: string; /** * The size of the marker in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#size) - * + * * @default 12 */ size?: number | string; /** - * The marker style. Possible values are in the table below. - * + * The marker style. Possible values are in the table below. + * > **Known Limitations** The `triangle` value is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). + * * Value | Description * ------|------------ * circle | ![sms_circle](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-circle.png) * cross | ![sms_cross](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-cross.png) * diamond | ![sms_diamond](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-diamond.png) * square | ![sms_square](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-square.png) + * triangle | ![sms_triangle](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-triangle.png) * x | ![sms_x](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols-sms-x.png) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html#style) - * + * * @default circle */ style?: string; } - interface symbolsSupportJsonUtils { /** * Creates a new instance of an appropriate [Symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. When you create a [MarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html), [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html) or [PictureMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PictureMarkerSymbol.html) from a JSON object, you may specify a property angle to rotate the symbol. Be aware that the angle in the JSON is different from [MarkerSymbol.angle](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-MarkerSymbol.html#angle). The angle in the JSON follows the traditional ArcGIS specification and is rotated counter-clockwise, whereas the angle in the symbol is rotated clockwise. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-jsonUtils.html#fromJSON) - * + * * @param json A JSON representation of the instance in the ArcGIS format. See the [ArcGIS REST API documentation](https://developers.arcgis.com/documentation/common-data-types/symbol-objects.htm) for examples of the structure of various input JSON objects. - * + * */ fromJSON(json: any): Symbol; } export const symbolsSupportJsonUtils: symbolsSupportJsonUtils; - interface symbolPreview { /** * Generates a preview image of a given symbol that can be displayed in a custom widget or other DOM element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) - * + * * @param symbol The symbol for which to generate a preview image. * @param options Formatting options for the symbol preview image. * @param options.node The parent node to append to the symbol. @@ -28766,63 +30811,70 @@ declare namespace __esri { * @param options.scale Indicates whether to scale the symbol preview. * @param options.disableUpsampling Indicates whether to disable upsampling for raster images. * @param options.symbolConfig For "tall" symbols in portrait view, then the `tall` value should be used here. - * + * */ renderPreviewHTML(symbol: Symbol, options?: symbolPreviewRenderPreviewHTMLOptions): IPromise; } export const symbolPreview: symbolPreview; - export interface symbolPreviewRenderPreviewHTMLOptions extends Object { /** * The parent node to append to the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) */ node?: HTMLElement; /** * The size of the symbol preview in points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) */ size?: number; /** * The maximum size of the symbol preview in points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) */ maxSize?: number; /** * The opacity of the layer represented by the `symbol`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) */ opacity?: number; /** * Indicates whether to scale the symbol preview. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) */ scale?: boolean; /** * Indicates whether to disable upsampling for raster images. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) */ disableUpsampling?: boolean; /** * For "tall" symbols in portrait view, then the `tall` value should be used here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolPreview.html#renderPreviewHTML) */ symbolConfig?: string; } interface Symbol extends Accessor, JSONSupport { + /** + * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html#color) + * + * @default black + */ + color: Color; /** * The symbol type. **Possible values:** simple-marker | picture-marker | simple-line | cartographic-line-symbol | simple-fill | picture-fill | text | shield-label-symbol | point-3d | line-3d | polygon-3d | mesh-3d | label-3d - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html#type) */ readonly type: string; @@ -28831,11 +30883,11 @@ declare namespace __esri { interface SymbolConstructor { /** * Symbol is the base class for all symbols. Symbols represent point, line, polygon, and mesh geometries as vector graphics within a [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). Symbols can only be set directly on individual [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) in a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) or in [View.graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics). Otherwise they are assigned to a [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) that is applied to a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or a [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) */ - new(properties?: SymbolProperties): Symbol; + new (properties?: SymbolProperties): Symbol; fromJSON(json: any): Symbol; } @@ -28843,19 +30895,26 @@ declare namespace __esri { export const Symbol: SymbolConstructor; interface SymbolProperties { - + /** + * The color of the symbol. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html#color) + * + * @default black + */ + color?: Color | number[] | string; } interface Symbol3D extends Symbol { /** * The origin of the style from which the symbol was originally referenced. A reference to the style origin can be either by styleName or by styleUrl (but not both). This information is part of the WebScene persistence model and may be used to understand where a symbol was originally sourced from. It does not affect actual appearance or rendering of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#styleOrigin) */ styleOrigin: Symbol3DStyleOrigin; /** * A Collection of [Symbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html) objects used to visualize the graphic or feature. Individual symbol layers may be autocast as objects and specified using the `type` property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#symbolLayers) */ symbolLayers: Collection; @@ -28864,11 +30923,11 @@ declare namespace __esri { interface Symbol3DConstructor { /** * Symbol3D is the base class for all 3D symbols. It is used to render 2D [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), and [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) and 3D mesh features in a [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html). All 3D symbols must be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) instance; there is no support for 3D rendering in [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) */ - new(properties?: Symbol3DProperties): Symbol3D; + new (properties?: Symbol3DProperties): Symbol3D; fromJSON(json: any): Symbol3D; } @@ -28878,35 +30937,34 @@ declare namespace __esri { interface Symbol3DProperties extends SymbolProperties { /** * The origin of the style from which the symbol was originally referenced. A reference to the style origin can be either by styleName or by styleUrl (but not both). This information is part of the WebScene persistence model and may be used to understand where a symbol was originally sourced from. It does not affect actual appearance or rendering of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#styleOrigin) */ styleOrigin?: Symbol3DStyleOrigin; /** * A Collection of [Symbol3DLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html) objects used to visualize the graphic or feature. Individual symbol layers may be autocast as objects and specified using the `type` property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#symbolLayers) */ symbolLayers?: CollectionProperties; } - export interface Symbol3DStyleOrigin extends Object { /** * a well-known esri-provided style, such as `EsriThematicShapesStyle` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#styleOrigin) */ styleName?: string; /** * url to a style definition - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#styleOrigin) */ styleUrl?: string; /** * name of the symbol in the style referenced by styleName or styleUrl - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html#styleOrigin) */ name: string; @@ -28915,13 +30973,13 @@ declare namespace __esri { interface Symbol3DLayer extends Accessor, JSONSupport { /** * The material used to shade the geometry. For `material` properties, see the documentation of the individual symbol layer classes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html#material) */ material: any; /** - * The 3D symbol layer type. See the table below for a list of possible values. - * + * The 3D symbol layer type. See the table below for a list of possible values. + * * Value | Description * ------|------------ * icon | ![s3d-icon](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-icon-circle.png) @@ -28931,8 +30989,8 @@ declare namespace __esri { * fill | ![s3d-fill](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-fill-solid.png) * extrusion | ![s3d-extrusion](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-extrude-solid.png) * text | ![s3d-text](https://developers.arcgis.com/javascript/assets/img/apiref/symbols/symbols3d-label-text.png) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html#type) */ readonly type: string; @@ -28941,11 +30999,11 @@ declare namespace __esri { interface Symbol3DLayerConstructor { /** * Symbol layers are used to define the visualization of [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), and mesh geometries rendered with [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html). [3D symbols](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3D.html) may only be used to render features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html), or standalone [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). There is no support for 3D symbols in 2D [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html) */ - new(properties?: Symbol3DLayerProperties): Symbol3DLayer; + new (properties?: Symbol3DLayerProperties): Symbol3DLayer; fromJSON(json: any): Symbol3DLayer; } @@ -28955,7 +31013,7 @@ declare namespace __esri { interface Symbol3DLayerProperties { /** * The material used to shade the geometry. For `material` properties, see the documentation of the individual symbol layer classes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol3DLayer.html#material) */ material?: any; @@ -28963,145 +31021,140 @@ declare namespace __esri { interface TextSymbol extends Symbol { /** - * The angle of the text. `0` is horizontal and the angle moves clockwise. + * The angle of the text. `0` is horizontal and the angle moves clockwise. * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#angle) - * + * * @default 0 */ angle: number; /** * The background color of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#backgroundColor) */ backgroundColor: Color; /** * The border color of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#borderLineColor) */ borderLineColor: Color; /** * The border size or width of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#borderLineSize) */ borderLineSize: number; /** - * The color of the text. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#color) - */ - color: Color; - /** - * The font used to style the text. + * The font used to style the text. * > **Known Limitations** This property is not fully supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#font) */ font: Font; /** - * The color of the text symbol's halo. To include a halo in the TextSymbol, you must also set the size of the halo in [haloSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize). - * > **Known Limitations** + * The color of the text symbol's halo. To include a halo in the TextSymbol, you must also set the size of the halo in [haloSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize). + * > **Known Limitations** * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor) */ haloColor: Color; /** - * The size in points of the text symbol's halo. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). To include a halo in the TextSymbol, you must also set the color of the halo in [haloColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor). - * > **Known Limitations** + * The size in points of the text symbol's halo. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). To include a halo in the TextSymbol, you must also set the color of the halo in [haloColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor). + * > **Known Limitations** * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * + * * Halo size should not be 1/4 larger than the [text size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size). For example, if your text size is 12, the halo size should not be larger than 3. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize) */ haloSize: number; /** - * Adjusts the horizontal alignment of the text in multi-line labels. **Possible Values:** left | right | center | justify + * Adjusts the horizontal alignment of the text in multi-line labels. **Possible Values:** left | right | center | justify * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#horizontalAlignment) - * + * * @default center */ horizontalAlignment: string; /** * Determines whether to adjust the spacing between characters in the text string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#kerning) - * + * * @default true */ kerning: boolean; /** - * Determines whether every character in the text string is rotated. + * Determines whether every character in the text string is rotated. * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#rotated) - * + * * @default false */ rotated: boolean; /** * The text string to display in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#text) */ text: string; /** * For TextSymbol, the type is always `text`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#type) */ readonly type: "text"; /** - * Adjusts the vertical alignment of the text. **Possible Values:** baseline | top | middle | bottom + * Adjusts the vertical alignment of the text. **Possible Values:** baseline | top | middle | bottom * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#verticalAlignment) - * + * * @default baseline */ verticalAlignment: string; /** - * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#xoffset) - * + * * @default 0 */ xoffset: number; /** - * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#yoffset) - * + * * @default 0 */ yoffset: number; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#clone) - * - * + * + * */ clone(): TextSymbol; } interface TextSymbolConstructor { /** - * Text symbols are used to define the graphic for displaying labels on a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html), in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Text symbols can also be used to define the symbol property of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). With this class, you may alter the [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#color), [font](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#font), [halo](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize), and other properties of the label graphic. - * + * Text symbols are used to define the graphic for displaying labels on a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [Sublayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) in a 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Text symbols can also be used to define the symbol property of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) if the geometry type is [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). With this class, you may alter the [color](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#color), [font](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#font), [halo](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize), and other properties of the label graphic. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html) */ - new(properties?: TextSymbolProperties): TextSymbol; + new (properties?: TextSymbolProperties): TextSymbol; fromJSON(json: any): TextSymbol; } @@ -29110,117 +31163,112 @@ declare namespace __esri { interface TextSymbolProperties extends SymbolProperties { /** - * The angle of the text. `0` is horizontal and the angle moves clockwise. + * The angle of the text. `0` is horizontal and the angle moves clockwise. * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#angle) - * + * * @default 0 */ angle?: number; /** * The background color of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#backgroundColor) */ backgroundColor?: Color | number[] | string; /** * The border color of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#borderLineColor) */ borderLineColor?: Color | number[] | string; /** * The border size or width of the label's bounding box. This property is only supported for [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#borderLineSize) */ borderLineSize?: number; /** - * The color of the text. This can be autocast with a named string; hex string; array of rgb or rgba values; an object with `r`, `g`, `b`, and `a` properties; or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#color) - */ - color?: Color | number[] | string; - /** - * The font used to style the text. + * The font used to style the text. * > **Known Limitations** This property is not fully supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#font) */ font?: FontProperties; /** - * The color of the text symbol's halo. To include a halo in the TextSymbol, you must also set the size of the halo in [haloSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize). - * > **Known Limitations** + * The color of the text symbol's halo. To include a halo in the TextSymbol, you must also set the size of the halo in [haloSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize). + * > **Known Limitations** * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor) */ haloColor?: Color | number[] | string; /** - * The size in points of the text symbol's halo. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). To include a halo in the TextSymbol, you must also set the color of the halo in [haloColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor). - * > **Known Limitations** + * The size in points of the text symbol's halo. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). To include a halo in the TextSymbol, you must also set the color of the halo in [haloColor](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloColor). + * > **Known Limitations** * * Sub-pixel halo (i.e. fractional size such as 1.25px) renders inconsistently in various browsers. - * + * * Halo size should not be 1/4 larger than the [text size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size). For example, if your text size is 12, the halo size should not be larger than 3. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#haloSize) */ haloSize?: number | string; /** - * Adjusts the horizontal alignment of the text in multi-line labels. **Possible Values:** left | right | center | justify + * Adjusts the horizontal alignment of the text in multi-line labels. **Possible Values:** left | right | center | justify * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#horizontalAlignment) - * + * * @default center */ horizontalAlignment?: string; /** * Determines whether to adjust the spacing between characters in the text string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#kerning) - * + * * @default true */ kerning?: boolean; /** - * Determines whether every character in the text string is rotated. + * Determines whether every character in the text string is rotated. * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#rotated) - * + * * @default false */ rotated?: boolean; /** * The text string to display in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#text) */ text?: string; /** - * Adjusts the vertical alignment of the text. **Possible Values:** baseline | top | middle | bottom + * Adjusts the vertical alignment of the text. **Possible Values:** baseline | top | middle | bottom * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#verticalAlignment) - * + * * @default baseline */ verticalAlignment?: string; /** - * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the x-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#xoffset) - * + * * @default 0 */ xoffset?: number | string; /** - * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). + * The offset on the y-axis in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). * > **Known Limitations** This property is currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html#yoffset) - * + * * @default 0 */ yoffset?: number | string; @@ -29229,43 +31277,43 @@ declare namespace __esri { interface TextSymbol3DLayer extends Symbol3DLayer { /** * The font of the text label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) */ font: Font; /** * The halo surrounding the text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) */ halo: TextSymbol3DLayerHalo; /** * Size of the text label in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). When set, this property overrides the [font.size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#size) - * + * * @default 9 */ size: number; /** * The text to be displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#text) */ text: string; /** * For TextSymbol3DLayer the type is always `text`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#type) */ readonly type: "text"; /** * Creates a deep clone of the symbol layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#clone) - * - * + * + * */ clone(): TextSymbol3DLayer; } @@ -29273,11 +31321,11 @@ declare namespace __esri { interface TextSymbol3DLayerConstructor { /** * TextSymbol3DLayer is used to draw text labels for features of any geometry type. This is typically done by adding it to a [LabelSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-LabelSymbol3D.html) in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) does not support 3D symbols. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html) */ - new(properties?: TextSymbol3DLayerProperties): TextSymbol3DLayer; + new (properties?: TextSymbol3DLayerProperties): TextSymbol3DLayer; fromJSON(json: any): TextSymbol3DLayer; } @@ -29287,47 +31335,46 @@ declare namespace __esri { interface TextSymbol3DLayerProperties extends Symbol3DLayerProperties { /** * The font of the text label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#font) */ font?: FontProperties; /** * The halo surrounding the text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) */ halo?: TextSymbol3DLayerHaloProperties; /** * Size of the text label in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). When set, this property overrides the [font.size](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Font.html#size) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#size) - * + * * @default 9 */ size?: number | string; /** * The text to be displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#text) */ text?: string; } - export interface TextSymbol3DLayerHaloProperties extends Object { /** * The color of the halo. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) - * + * * @default black */ color?: Color | number[] | string; /** * The size of the halo in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) - * + * * @default 0 */ size?: number | string; @@ -29336,17 +31383,17 @@ declare namespace __esri { export interface TextSymbol3DLayerHalo extends AnonymousAccessor { /** * The color of the halo. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) - * + * * @default black */ color?: Color; /** * The size of the halo in points. This value may be autocast with a string expressing size in points or pixels (e.g. `12px`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo) - * + * * @default 0 */ size?: number; @@ -29355,49 +31402,49 @@ declare namespace __esri { interface WebStyleSymbol extends Symbol { /** * The name of the symbol within the web style. Each symbol in a web style is identified by a unique name. Only [Esri-provided web style symbol names](https://developers.arcgis.com/javascript/latest/guide/esri-web-style-symbols/index.html) can be referenced here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#name) */ name: string; /** * The portal that contains the web style this symbol refers to. Only required when [styleName](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) is set. Defaults to the value in [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) (e.g. https://www.arcgis.com). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal) */ portal: Portal; /** * A registered web style name. Only [Esri-provided web style names](https://developers.arcgis.com/javascript/latest/guide/esri-web-style-symbols/index.html) can be referenced here. Requires [portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal) property to be set. Can not be used in conjunction with [styleUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleUrl). See class description for example. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) */ styleName: string; /** * URL that points to the web style definition. Cannot be used in conjunction with [styleName](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) and [portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal). See class description for example. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleUrl) */ styleUrl: string; /** * For WebStyleSymbol the type is always `web-style`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#type) */ readonly type: "web-style"; /** * Creates a deep clone of the symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#clone) - * - * + * + * */ clone(): WebStyleSymbol; /** * Downloads and returns the [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) instance the WebStyleSymbol refers to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#fetchSymbol) - * - * + * + * */ fetchSymbol(): IPromise; } @@ -29405,11 +31452,11 @@ declare namespace __esri { interface WebStyleSymbolConstructor { /** * WebStyleSymbol is a class used to conveniently create realistic and thematic 3D symbols. It is a wrapper for creating [PointSymbol3D](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html) objects that point to a web style resource available in the API. This symbol type is not supported in 2D MapViews. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html) */ - new(properties?: WebStyleSymbolProperties): WebStyleSymbol; + new (properties?: WebStyleSymbolProperties): WebStyleSymbol; fromJSON(json: any): WebStyleSymbol; } @@ -29419,39 +31466,253 @@ declare namespace __esri { interface WebStyleSymbolProperties extends SymbolProperties { /** * The name of the symbol within the web style. Each symbol in a web style is identified by a unique name. Only [Esri-provided web style symbol names](https://developers.arcgis.com/javascript/latest/guide/esri-web-style-symbols/index.html) can be referenced here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#name) */ name?: string; /** * The portal that contains the web style this symbol refers to. Only required when [styleName](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) is set. Defaults to the value in [config.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl) (e.g. https://www.arcgis.com). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal) */ portal?: PortalProperties; /** * A registered web style name. Only [Esri-provided web style names](https://developers.arcgis.com/javascript/latest/guide/esri-web-style-symbols/index.html) can be referenced here. Requires [portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal) property to be set. Can not be used in conjunction with [styleUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleUrl). See class description for example. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) */ styleName?: string; /** * URL that points to the web style definition. Cannot be used in conjunction with [styleName](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleName) and [portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#portal). See class description for example. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#styleUrl) */ styleUrl?: string; } + /** + * ExtrudeSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#ExtrudeSymbol3DLayer) + */ + export type symbolsExtrudeSymbol3DLayer = ExtrudeSymbol3DLayer; + + /** + * FillSymbol types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#FillSymbol) + */ + export type symbolsFillSymbol = PictureFillSymbol | SimpleFillSymbol; + + /** + * FillSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#FillSymbol3DLayer) + */ + export type symbolsFillSymbol3DLayer = FillSymbol3DLayer; + + /** + * Font. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Font) + */ + export type symbolsFont = Font; + + /** + * IconSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#IconSymbol3DLayer) + */ + export type symbolsIconSymbol3DLayer = IconSymbol3DLayer; + + /** + * LabelSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#LabelSymbol3D) + */ + export type symbolsLabelSymbol3D = LabelSymbol3D; + + /** + * LineSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#LineSymbol3D) + */ + export type symbolsLineSymbol3D = LineSymbol3D; + + /** + * LineSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#LineSymbol3DLayer) + */ + export type symbolsLineSymbol3DLayer = LineSymbol3DLayer; + + /** + * MarkerSymbol types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#MarkerSymbol) + */ + export type symbolsMarkerSymbol = PictureMarkerSymbol | SimpleMarkerSymbol; + + /** + * MeshSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#MeshSymbol3D) + */ + export type symbolsMeshSymbol3D = MeshSymbol3D; + + /** + * ObjectSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#ObjectSymbol3DLayer) + */ + export type symbolsObjectSymbol3DLayer = ObjectSymbol3DLayer; + + /** + * PathSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PathSymbol3DLayer) + */ + export type symbolsPathSymbol3DLayer = PathSymbol3DLayer; + + /** + * PictureFillSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PictureFillSymbol) + */ + export type symbolsPictureFillSymbol = PictureFillSymbol; + + /** + * PictureMarkerSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PictureMarkerSymbol) + */ + export type symbolsPictureMarkerSymbol = PictureMarkerSymbol; + + /** + * PointSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PointSymbol3D) + */ + export type symbolsPointSymbol3D = PointSymbol3D; + + /** + * PolygonSymbol3D. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#PolygonSymbol3D) + */ + export type symbolsPolygonSymbol3D = PolygonSymbol3D; + + /** + * SimpleFillSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#SimpleFillSymbol) + */ + export type symbolsSimpleFillSymbol = SimpleFillSymbol; + + /** + * SimpleLineSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#SimpleLineSymbol) + */ + export type symbolsSimpleLineSymbol = SimpleLineSymbol; + + /** + * SimpleMarkerSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#SimpleMarkerSymbol) + */ + export type symbolsSimpleMarkerSymbol = SimpleMarkerSymbol; + + /** + * Symbol types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol) + */ + export type symbolsSymbol = Symbol2D | symbolsSymbol3D | WebStyleSymbol; + + /** + * Symbol2D types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol2D) + */ + export type Symbol2D = + | PictureFillSymbol + | PictureMarkerSymbol + | SimpleFillSymbol + | SimpleLineSymbol + | SimpleMarkerSymbol + | TextSymbol; + + /** + * Symbol2D3D types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol2D3D) + */ + export type Symbol2D3D = + | PictureFillSymbol + | PictureMarkerSymbol + | SimpleFillSymbol + | SimpleLineSymbol + | SimpleMarkerSymbol + | TextSymbol + | Symbol2D + | LabelSymbol3D + | LineSymbol3D + | MeshSymbol3D + | PointSymbol3D + | PolygonSymbol3D; + + /** + * Symbol3D types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol3D) + */ + export type symbolsSymbol3D = LabelSymbol3D | LineSymbol3D | MeshSymbol3D | PointSymbol3D | PolygonSymbol3D; + + /** + * Symbol3DLayer types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#Symbol3DLayer) + */ + export type symbolsSymbol3DLayer = + | ExtrudeSymbol3DLayer + | FillSymbol3DLayer + | IconSymbol3DLayer + | LineSymbol3DLayer + | ObjectSymbol3DLayer + | PathSymbol3DLayer + | TextSymbol3DLayer; + + /** + * TextSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#TextSymbol) + */ + export type symbolsTextSymbol = TextSymbol; + + /** + * TextSymbol3DLayer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#TextSymbol3DLayer) + */ + export type symbolsTextSymbol3DLayer = TextSymbol3DLayer; + + /** + * WebStyleSymbol. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols.html#WebStyleSymbol) + */ + export type symbolsWebStyleSymbol = WebStyleSymbol; + interface ClosestFacilityTask extends Task { /** * Solves the closest facility. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html#solve) - * + * * @param params Defines the parameters of the closest facility analysis. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ solve(params: ClosestFacilityParameters, requestOptions?: any): IPromise; } @@ -29459,35 +31720,33 @@ declare namespace __esri { interface ClosestFacilityTaskConstructor { /** * Helps you find closest facilities around any location (incident) on a network. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html) */ - new(properties?: ClosestFacilityTaskProperties): ClosestFacilityTask; + new (properties?: ClosestFacilityTaskProperties): ClosestFacilityTask; } export const ClosestFacilityTask: ClosestFacilityTaskConstructor; - interface ClosestFacilityTaskProperties extends TaskProperties { - - } + interface ClosestFacilityTaskProperties extends TaskProperties {} interface FindTask extends Task { /** * The geodatabase version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-FindTask.html#gdbVersion) */ gdbVersion: string; /** * Sends a request to the ArcGIS REST map service resource to perform a search based on the input [params](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-FindTask.html#execute) - * + * * @param params Specifies the layers and fields that are used for the search. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ execute(params: FindParameters, requestOptions?: any): IPromise; } @@ -29495,11 +31754,11 @@ declare namespace __esri { interface FindTaskConstructor { /** * Search a map service exposed by the ArcGIS Server REST API based on a string value. The search can be conducted on a single field of a single layer, on many fields of a layer, or on many fields of many layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-FindTask.html) */ - new(properties?: FindTaskProperties): FindTask; + new (properties?: FindTaskProperties): FindTask; } export const FindTask: FindTaskConstructor; @@ -29507,7 +31766,7 @@ declare namespace __esri { interface FindTaskProperties extends TaskProperties { /** * The geodatabase version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-FindTask.html#gdbVersion) */ gdbVersion?: string; @@ -29516,198 +31775,198 @@ declare namespace __esri { interface GeometryService extends Task { /** * Computes the area and length for the input [polygons](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#areasAndLengths) - * + * * @param areasAndLengthsParameters Specify the input polygons and optionally the linear and area units. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ areasAndLengths(areasAndLengthsParameters: AreasAndLengthsParameters, requestOptions?: any): IPromise; /** * The Auto Complete operation is performed on a geometry service resource. The AutoComplete operation simplifies the process of constructing new polygons that are adjacent to other polygons. It constructs polygons that fill in the gaps between existing polygons and a set of polylines. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#autoComplete) - * + * * @param polygons The array of polygons that will provide boundaries for new polygons. * @param polylines An array of polylines that will provide the remaining boundaries for new polygons. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ autoComplete(polygons: Polygon[], polylines: Polyline[], requestOptions?: any): IPromise; /** * Creates buffer polygons at a specified distance around the given geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#buffer) - * + * * @param bufferParameters Specifies the input geometries, buffer distances, and other options. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ buffer(bufferParameters: BufferParameters, requestOptions?: any): IPromise; /** * The convexHull operation is performed on a geometry service resource. It returns the convex hull of the input geometry. The input geometry can be a point, multipoint, polyline or polygon. The hull is typically a polygon but can also be a polyline or point in degenerate cases. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#convexHull) - * + * * @param geometries The geometries whose convex hull is to be created. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ convexHull(geometries: Geometry[], requestOptions?: any): IPromise; /** * The cut operation is performed on a geometry service resource. This operation splits the input polyline or polygon where it crosses a cutting polyline. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#cut) - * + * * @param geometries The polylines or polygons to be cut. * @param cutter The polyline that will be used to divide the target into pieces where it crosses the target. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ cut(geometries: Geometry[], cutter: Polyline, requestOptions?: any): IPromise; /** * The densify operation is performed on a geometry service resource. This operation densifies geometries by plotting points between existing vertices. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#densify) - * + * * @param densifyParameters The DensifyParameters objects contains `geometries`, `geodesic`, `lengthUnit`, and `maxSegmentLength` properties. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ densify(densifyParameters: DensifyParameters, requestOptions?: any): IPromise; /** * The difference operation is performed on a geometry service resource. This operation constructs the set-theoretic difference between an array of geometries and another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#difference) - * + * * @param geometries An array of points, multipoints, polylines or polygons. * @param geometry A single geometry of any type, with a dimension equal to or greater than the items in geometries. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ difference(geometries: Geometry[], geometry: Geometry, requestOptions?: any): IPromise; /** * Measures the planar or geodesic distance between geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#distance) - * + * * @param params Sets the input geometries to measure, distance units, and other parameters. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ distance(params: DistanceParameters, requestOptions?: any): IPromise; /** * Converts an array of well-known strings into xy-coordinates based on the conversion type and spatial reference supplied by the user. Only available with ArcGIS Server 10.3 or above. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) - * + * * @param params See the object specifications table below for the structure of the `params` object. * @param params.strings An array of formatted strings as specified by `conversionType`. Example: `["01N AA 66021 00000" , "11S NT 00000 62155" , "31U BT 94071 65288"]` * @param params.sr The spatial reference or well-known ID to convert the input string coordinates to. * @param params.conversionType The conversion type of the input strings. **Possible Values:** mrgs | usng | utm | geo-ref | gars | dms | ddm | dd * @param params.conversionMode Conversion options for mrgs, utm and gars conversion types. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/from-geocoordinatestring.htm) for possible values and their descriptions. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ fromGeoCoordinateString(params: GeometryServiceFromGeoCoordinateStringParams, requestOptions?: any): IPromise; /** * Generalizes the input geometries using the Douglas-Peucker algorithm. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#generalize) - * + * * @param params An array of geometries to generalize and a maximum deviation. Optionally set the deviation units. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ generalize(params: GeneralizeParameters, requestOptions?: any): IPromise; /** * The intersect operation is performed on a geometry service resource. This operation constructs the set-theoretic intersection between an array of geometries and another geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#intersect) - * + * * @param geometries An array of points, multipoints, polylines, or polygons. * @param intersector A single geometry of any type, of dimension equal to or greater than the dimension of the items in `geometries`. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ intersect(geometries: Geometry[], intersector: Geometry, requestOptions?: any): IPromise; /** * Calculates an interior point for each polygon specified. These interior points can be used by clients for labeling the polygons. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#labelPoints) - * + * * @param polygons The polygon graphics to process. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ labelPoints(polygons: Polygon[], requestOptions?: any): IPromise; /** * Gets the lengths for a [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) when the geometry type is [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#lengths) - * + * * @param params Specify the polylines and optionally the length unit and the geodesic length option. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ lengths(params: LengthsParameters, requestOptions?: any): IPromise; /** * Constructs the offset of the input geometries based on a planar distance. If the offsetDistance is positive the constructed offset will be on the right side of the geometry. Left side offsets are constructed with negative values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#offset) - * + * * @param params Set the geometries to offset, distance, and units. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ offset(params: OffsetParameters, requestOptions?: any): IPromise; /** * Projects a set of geometries to a new spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#project) - * + * * @param params The input projection parameters. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ project(params: ProjectParameters, requestOptions?: any): IPromise; /** * Computes the set of pairs of geometries from the input geometry arrays that belong to the specified relation. Both arrays are assumed to be in the same spatial reference. The relations are evaluated in 2D. Z-coordinates are not used. Geometry types cannot be mixed within an array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#relation) - * + * * @param params The set of parameters required to perform the comparison. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ relation(params: RelationParameters, requestOptions?: any): IPromise; /** * The reshape operation is performed on a geometry service resource. It reshapes a [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) or a part of a [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) using a reshaping line. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#reshape) - * + * * @param targetGeometry The Polyline or Polygon to be reshaped. * @param reshaper The single-part polyline that performs the reshaping. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ reshape(targetGeometry: Geometry, reshaper: Geometry, requestOptions?: any): IPromise; /** * Alters the given geometries to make their definitions topologically legal with respect to their geometry type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#simplify) - * + * * @param geometries The geometries to simplify. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ simplify(geometries: Geometry[], requestOptions?: any): IPromise; /** * Converts an array of XY-coordinates into well-known strings based on the conversion type and spatial reference supplied by the user. Only available with ArcGIS Server 10.3 or above. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) - * + * * @param params See the object specifications table below for the structure of the `params` object. * @param params.sr The spatial reference (or WKID of the spatial reference) of the XY-coordinates to be converted. * @param params.coordinates An array of XY-coordinates (in JSON format) to be converted. @@ -29717,27 +31976,27 @@ declare namespace __esri { * @param params.rounding If `true`, then numeric portions of the string are rounded to the nearest whole magnitude as specified by `numOfDigits`. Otherwise, numeric portions of the string are truncated. The rounding parameter applies only to conversion types `mgrs`, `usng` and `geo-ref`. * @param params.addSpaces If `true`, then spaces are added between components of the string. The `addSpaces` parameter applies only to conversion types `mgrs`, `usng` and `utm`. The default value for `mgrs` is `false` , while the default value for both `usng` and `utm` is `true`. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ toGeoCoordinateString(params: GeometryServiceToGeoCoordinateStringParams, requestOptions?: any): IPromise; /** * Trims or extends the input polylines using the user specified guide polyline. When trimming features, the portion to the left of the cutting line is preserved in the output and the rest is discarded. If the input polyline is not cut or extended then an empty polyline is added to the output array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#trimExtend) - * + * * @param params Input parameters for the `trimExtend` operation. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ trimExtend(params: TrimExtendParameters, requestOptions?: any): IPromise; /** * The union operation is performed on a geometry service resource. This operation constructs the set-theoretic union of the geometries in the input array. All inputs must be of the same type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#union) - * + * * @param geometries An array of the geometries to be unioned. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ union(geometries: Geometry[], requestOptions?: any): IPromise; } @@ -29745,92 +32004,88 @@ declare namespace __esri { interface GeometryServiceConstructor { /** * Represents a geometry service resource exposed by the ArcGIS REST API. It is used to perform various operations on geometries such as project, simplify, buffer, and relationships. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html) */ - new(properties?: GeometryServiceProperties): GeometryService; + new (properties?: GeometryServiceProperties): GeometryService; } export const GeometryService: GeometryServiceConstructor; - interface GeometryServiceProperties extends TaskProperties { - - } - + interface GeometryServiceProperties extends TaskProperties {} export interface GeometryServiceFromGeoCoordinateStringParams extends Object { /** * An array of formatted strings as specified by `conversionType`. Example: `["01N AA 66021 00000" , "11S NT 00000 62155" , "31U BT 94071 65288"]` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) */ strings: string[]; /** * The spatial reference or well-known ID to convert the input string coordinates to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) */ sr: SpatialReference | string | number; /** * The conversion type of the input strings. **Possible Values:** mrgs | usng | utm | geo-ref | gars | dms | ddm | dd - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) - * + * * @default mrgs */ conversionType?: string; /** * Conversion options for mrgs, utm and gars conversion types. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/from-geocoordinatestring.htm) for possible values and their descriptions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#fromGeoCoordinateString) */ conversionMode?: string; } - export interface GeometryServiceToGeoCoordinateStringParams extends Object { /** * The spatial reference (or WKID of the spatial reference) of the XY-coordinates to be converted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) */ sr: SpatialReference | string | number; /** * An array of XY-coordinates (in JSON format) to be converted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) */ coordinates: number[][]; /** * The conversion type of the input strings. **Possible values:** mgrs | usng | utm | geo-ref | gars | dms | ddm | dd - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) */ conversionType: string; /** * Conversion options for mgrs and utm conversion types. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/to-geocoordinatestring.htm) for valid conversion modes and their descriptions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) */ conversionMode?: string; /** * The number of digits to output for each of the numerical portions in the string. The default value depends of `conversionType`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/from-geocoordinatestring.htm) for default values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) */ numOfDigits?: number; /** * If `true`, then numeric portions of the string are rounded to the nearest whole magnitude as specified by `numOfDigits`. Otherwise, numeric portions of the string are truncated. The rounding parameter applies only to conversion types `mgrs`, `usng` and `geo-ref`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) - * + * * @default true */ rounding?: boolean; /** * If `true`, then spaces are added between components of the string. The `addSpaces` parameter applies only to conversion types `mgrs`, `usng` and `utm`. The default value for `mgrs` is `false` , while the default value for both `usng` and `utm` is `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html#toGeoCoordinateString) */ addSpaces?: boolean; @@ -29839,136 +32094,139 @@ declare namespace __esri { interface Geoprocessor extends Task { /** * The spatial reference of the output geometries. If not specified, the output geometries will be in the spatial reference of the input geometries. If [processSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#processSpatialReference) is specified and `outSpatialReference` is not specified, the output geometries will be in the spatial reference of the process spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * The spatial reference that the model will use to perform geometry operations. If `processSpatialReference` is specified and [outputSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#outputSpatialReference) is not specified, the output geometries will be in the spatial reference of the process spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#processSpatialReference) */ processSpatialReference: SpatialReference; /** * The time interval in milliseconds between each job status request sent to an asynchronous GP task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#updateDelay) - * + * * @default 1000 */ updateDelay: number; /** * Cancels an asynchronous geoprocessing job. Requires an ArcGIS Server 10.1 service or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#cancelJob) - * + * * @param jobId A string that uniquely identifies a job on the server. It is created when a job is submitted for execution and later used to check its status and retrieve the results. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ cancelJob(jobId: string, requestOptions?: any): IPromise; /** * Cancels the periodic job status updates automatically initiated when [submitJob()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#submitJob) is invoked for the job identified by `jobId`. You can still obtain the status of this job by calling the [checkJobStatus()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#checkJobStatus) method at your own discretion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#cancelJobStatusUpdates) - * + * * @param jobId A string that uniquely identifies the job for which the job updates are cancelled. - * + * */ cancelJobStatusUpdates(jobId: string): void; /** * Sends a request to the GP Task for the current state of the job identified by `jobId`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#checkJobStatus) - * + * * @param jobId The jobId returned from [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html). * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ checkJobStatus(jobId: string, requestOptions?: any): IPromise; /** * Sends a request to the server to execute a synchronous GP task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#execute) - * + * * @param params ``` * Specifies the input parameters accepted by the task and their corresponding values. These input parameters are listed in the parameters field of the associated GP Task resource. For example, assume that a GP Task resource has the following input parameters: * * `` Input_Points * * `` Distance - * - * - * The `params` argument would then be an Object of the form: + * + * + * The `params` argument would then be an Object of the form: * ``` * { * Input_Points: , * Distance: * } - * + * * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ execute(params: any, requestOptions?: any): IPromise; /** * Sends a request to the GP Task to get the task result identified by `jobId` and `resultName`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultData) - * + * * @param jobId The jobId returned from [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html). * @param resultName The name of the result parameter as defined in Services Directory. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getResultData(jobId: string, resultName: string, requestOptions?: any): IPromise; /** * Sends a request to the GP Task to get the task result identified by `jobId` and `resultName` as an image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultImage) - * + * * @param jobId The jobId returned from [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html). * @param resultName The name of the result parameter as defined in the Services Directory. * @param imageParams Specifies the properties of the result image. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ - getResultImage(jobId: string, resultName: string, imageParams: ImageParameters, requestOptions?: any): IPromise; + getResultImage( + jobId: string, + resultName: string, + imageParams: ImageParameters, + requestOptions?: any + ): IPromise; /** * Get the task result identified by `jobId` as an [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html). This method supports MapImageLayer 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultMapImageLayer) - * + * * @param jobId The jobId returned from [JobInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html). - * + * */ getResultMapImageLayer(jobId: string): MapImageLayer; /** * Submits a job to the server for asynchronous processing by the GP task. The task execution results can be retrieved using the [getResultData()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultData), [getResultImage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultImage), or [getResultMapImageLayer()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#getResultMapImageLayer) methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#submitJob) - * + * * @param params ``` * specifies the input parameters accepted by the task and their corresponding values. These input parameters are listed in the parameters field of the associated GP Task resource. For example, assume that a GP Task resource has the following input parameters: * * `` Input_Points * * `` Distance - * - * - * The `params` argument would then be an Object of the form: + * + * + * The `params` argument would then be an Object of the form: * ``` * { * Input_Points: , * Distance: * } - * + * * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ submitJob(params: any, requestOptions?: any): IPromise; } interface GeoprocessorConstructor { - - - new(properties?: GeoprocessorProperties): Geoprocessor; + new (properties?: GeoprocessorProperties): Geoprocessor; } export const Geoprocessor: GeoprocessorConstructor; @@ -29976,21 +32234,21 @@ declare namespace __esri { interface GeoprocessorProperties extends TaskProperties { /** * The spatial reference of the output geometries. If not specified, the output geometries will be in the spatial reference of the input geometries. If [processSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#processSpatialReference) is specified and `outSpatialReference` is not specified, the output geometries will be in the spatial reference of the process spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * The spatial reference that the model will use to perform geometry operations. If `processSpatialReference` is specified and [outputSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#outputSpatialReference) is not specified, the output geometries will be in the spatial reference of the process spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#processSpatialReference) */ processSpatialReference?: SpatialReferenceProperties; /** * The time interval in milliseconds between each job status request sent to an asynchronous GP task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#updateDelay) - * + * * @default 1000 */ updateDelay?: number; @@ -29999,19 +32257,19 @@ declare namespace __esri { interface IdentifyTask extends Task { /** * Specifies the geodatabase version to display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-IdentifyTask.html#gdbVersion) */ gdbVersion: string; /** * Sends a request to the ArcGIS REST map service resource to identify features based on the [IdentifyParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html) specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-IdentifyTask.html#execute) - * + * * @param params Specifies the criteria used to identify the features. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ execute(params: IdentifyParameters, requestOptions?: any): IPromise; } @@ -30019,11 +32277,11 @@ declare namespace __esri { interface IdentifyTaskConstructor { /** * Performs an identify operation on the layers of a map service exposed by the ArcGIS Server REST API. Use [IdentifyParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html) to set the parameters for the identify operation and [IdentifyResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html) to work with the results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-IdentifyTask.html) */ - new(properties?: IdentifyTaskProperties): IdentifyTask; + new (properties?: IdentifyTaskProperties): IdentifyTask; } export const IdentifyTask: IdentifyTaskConstructor; @@ -30031,7 +32289,7 @@ declare namespace __esri { interface IdentifyTaskProperties extends TaskProperties { /** * Specifies the geodatabase version to display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-IdentifyTask.html#gdbVersion) */ gdbVersion?: string; @@ -30040,53 +32298,49 @@ declare namespace __esri { interface ImageServiceIdentifyTask extends Task { /** * Sends a request to the ArcGIS REST image service resource to identify content based on the [ImageServiceIdentifyParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html) specified in the `params` argument. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ImageServiceIdentifyTask.html#execute) - * + * * @param params Specifies the criteria used to identify the features. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ execute(params: ImageServiceIdentifyParameters, requestOptions?: any): IPromise; } interface ImageServiceIdentifyTaskConstructor { - - - new(properties?: ImageServiceIdentifyTaskProperties): ImageServiceIdentifyTask; + new (properties?: ImageServiceIdentifyTaskProperties): ImageServiceIdentifyTask; } export const ImageServiceIdentifyTask: ImageServiceIdentifyTaskConstructor; - interface ImageServiceIdentifyTaskProperties extends TaskProperties { - - } + interface ImageServiceIdentifyTaskProperties extends TaskProperties {} interface Locator extends Task { /** * Limit the results to one or more categories. For example "Populated Place" or "airport". Only applicable when using the World Geocode Service. View the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#categories) */ categories: string[]; /** * Limits the results to only search in the country provided. For example `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. See the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#countryCode) */ countryCode: string; /** * The spatial reference of the output geometries. If not specified, the output geometries are in the spatial reference of the input geometries when performing a reverse geocode and in the default spatial reference returned by the service if finding locations by address. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * Find address candidates for multiple input addresses. This method requires an ArcGIS Server 10.1 or greater geocode service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressesToLocations) - * + * * @param params See specifications below. * @param params.addresses ``` * The input addresses in the format supported by the geocode service. If the service supports 'Single Line Input' the input addresses will be in the following format: @@ -30098,17 +32352,17 @@ declare namespace __esri { * @param params.countryCode Limits the results to only search in the country provided. For example `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. See the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. * @param params.categories Limit result to one or more categories. For example, "Populated Place" or "Scandinavian Food". Only applies to the World Geocode Service. See [Category filtering (World Geocoding Service)](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm#ESRI_SECTION1_502B3FE2028145D7B189C25B1A00E17B) for more information. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ addressesToLocations(params: LocatorAddressesToLocationsParams, requestOptions?: any): IPromise; /** * Sends a request to the ArcGIS REST geocode resource to find candidates for a single address specified in the address parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) - * + * * @param params Specify at least the address and optionally other properties. See the object specifications table below. * @param params.address visit the ArcGIS Online Geocoding Service help for more details on the World Geocoder. - * The address argument is data object that contains properties representing the various address fields accepted by the corresponding geocode service. These fields are listed in the addressFields property of the associated geocode service resource. For example, if the *addressFields* of a geocode service resource includes fields with the following names: Street, City, State and Zone, then the address argument is of the form: + * The address argument is data object that contains properties representing the various address fields accepted by the corresponding geocode service. These fields are listed in the addressFields property of the associated geocode service resource. For example, if the *addressFields* of a geocode service resource includes fields with the following names: Street, City, State and Zone, then the address argument is of the form: * ```js * { * Street: "1234 W Main St", @@ -30116,16 +32370,16 @@ declare namespace __esri { * State: "WA", * Zone: "99027" * } - * + * * ``` - * + * * Locators published using ArcGIS 10 or later support a single line address field, which * can be specified using the following syntax where field_name is the name of the single * line address field. You can find this name by viewing the help or services directory for * your locator services. Common values are *SingleLine* and *SingleLineFieldName*: - * + * * ```js - * var address = { "field_name": "380 New York St, Redlands, CA 92373" }; + * var address = { "field_name": "380 New York St, Redlands, CA 92373" }; * ``` * The Services Directory can be used to find out the required and optional address fields * and the correct names for the input name fields. If you are using the World Geocoding Service @@ -30139,32 +32393,32 @@ declare namespace __esri { * @param params.outFields The list of fields included in the returned result set. This list is a comma delimited list of field names. If you specify the shape field in the list of return fields, it is ignored. For non-intersection addresses you can specify the candidate fields as defined in the geocode service. For intersection addresses you can specify the intersection candidate fields. * @param params.searchExtent Defines the extent within which the geocode server will search. Requires ArcGIS Server version 10.1 or greater. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override `requestOptions` defined during construction). - * + * */ addressToLocations(params: LocatorAddressToLocationsParams, requestOptions?: any): IPromise; /** * Locates an address based on a given point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#locationToAddress) - * + * * @param location The point at which to search for the closest address. The location should be in the same spatial reference as that of the geocode service. * @param distance The distance in meters from the given location within which a matching address should be searched. If this parameter is not provided or an invalid value is provided, a default value of 0 meters is used. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ locationToAddress(location: Point, distance?: number, requestOptions?: any): IPromise; /** * Get character by character auto complete suggestions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) - * + * * @param params An object that defines suggest parameters. See specifications below. * @param params.categories A place or address type which can be used to filter suggest results. The parameter supports input of single category values or multiple comma-separated values. * @param params.distance Used with the `location` property. The `distance` property specifies the radial distance from the location. * @param params.location Defines a normalized location point that is used with the distance parameter to sort geocoding candidates based upon their proximity to the given location. * @param params.text The input text entered by a user which is used by the suggest operation to generate a list of possible matches. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ suggestLocations(params: LocatorSuggestLocationsParams, requestOptions?: any): IPromise; } @@ -30172,11 +32426,11 @@ declare namespace __esri { interface LocatorConstructor { /** * Represents a geocode service resource exposed by the ArcGIS Server REST API. It is used to generate candidates for an address. It is also used to generate batch results for a set of addresses. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) */ - new(properties?: LocatorProperties): Locator; + new (properties?: LocatorProperties): Locator; } export const Locator: LocatorConstructor; @@ -30184,25 +32438,24 @@ declare namespace __esri { interface LocatorProperties extends TaskProperties { /** * Limit the results to one or more categories. For example "Populated Place" or "airport". Only applicable when using the World Geocode Service. View the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#categories) */ categories?: string[]; /** * Limits the results to only search in the country provided. For example `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. See the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#countryCode) */ countryCode?: string; /** * The spatial reference of the output geometries. If not specified, the output geometries are in the spatial reference of the input geometries when performing a reverse geocode and in the default spatial reference returned by the service if finding locations by address. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; } - export interface LocatorAddressesToLocationsParams extends Object { /** * The input addresses in the format supported by the geocode service. If the service supports 'Single Line Input' the input addresses will be in the following format: @@ -30212,28 +32465,27 @@ declare namespace __esri { * "Single Line Input":"440 Arguello Blvd, 94118" * } * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressesToLocations) */ addresses: any[]; /** * Limits the results to only search in the country provided. For example `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. See the [World Geocoding Service documentation](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm) for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressesToLocations) */ countryCode: string; /** * Limit result to one or more categories. For example, "Populated Place" or "Scandinavian Food". Only applies to the World Geocode Service. See [Category filtering (World Geocoding Service)](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm#ESRI_SECTION1_502B3FE2028145D7B189C25B1A00E17B) for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressesToLocations) */ categories: string[]; } - export interface LocatorAddressToLocationsParams extends Object { /** - * The address argument is data object that contains properties representing the various address fields accepted by the corresponding geocode service. These fields are listed in the addressFields property of the associated geocode service resource. For example, if the *addressFields* of a geocode service resource includes fields with the following names: Street, City, State and Zone, then the address argument is of the form: + * The address argument is data object that contains properties representing the various address fields accepted by the corresponding geocode service. These fields are listed in the addressFields property of the associated geocode service resource. For example, if the *addressFields* of a geocode service resource includes fields with the following names: Street, City, State and Zone, then the address argument is of the form: * ```js * { * Street: "1234 W Main St", @@ -30241,103 +32493,102 @@ declare namespace __esri { * State: "WA", * Zone: "99027" * } - * + * * ``` - * + * * Locators published using ArcGIS 10 or later support a single line address field, which * can be specified using the following syntax where field_name is the name of the single * line address field. You can find this name by viewing the help or services directory for * your locator services. Common values are *SingleLine* and *SingleLineFieldName*: - * + * * ```js - * var address = { "field_name": "380 New York St, Redlands, CA 92373" }; + * var address = { "field_name": "380 New York St, Redlands, CA 92373" }; * ``` * The Services Directory can be used to find out the required and optional address fields * and the correct names for the input name fields. If you are using the World Geocoding Service * visit the ArcGIS Online Geocoding Service help for more details on the World Geocoder. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ address: any; /** * Limit result to one or more categories. For example, "Populated Place" or "Scandinavian Food". Only applies to the World Geocode Service. See [Category filtering (World Geocoding Service)](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm#ESRI_SECTION1_502B3FE2028145D7B189C25B1A00E17B) for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ categories: string[]; /** * Limit result to a specific country. For example, "US" for United States or "SE" for Sweden. Only applies to the World Geocode Service. See Geocode coverage (World Geocoding Service) for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ countryCode: string; /** * Used in combination with `location` option to weight returned results within this distance (meters). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ distance: number; /** * Allows the results of single geocode transactions to be persisted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ forStorage: boolean; /** * Used in combination with `distance` option to weight returned results for a specified area. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ location: Point; /** * A `suggestLocations` result ID (magicKey). Used to query for a specific results information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ magicKey: string; /** * Maximum results to return from the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ maxLocations: number; /** * The list of fields included in the returned result set. This list is a comma delimited list of field names. If you specify the shape field in the list of return fields, it is ignored. For non-intersection addresses you can specify the candidate fields as defined in the geocode service. For intersection addresses you can specify the intersection candidate fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ outFields: string[]; /** * Defines the extent within which the geocode server will search. Requires ArcGIS Server version 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations) */ searchExtent: Extent; } - export interface LocatorSuggestLocationsParams extends Object { /** * A place or address type which can be used to filter suggest results. The parameter supports input of single category values or multiple comma-separated values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) */ categories: string[]; /** * Used with the `location` property. The `distance` property specifies the radial distance from the location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) */ distance: number; /** * Defines a normalized location point that is used with the distance parameter to sort geocoding candidates based upon their proximity to the given location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) */ location: Point; /** * The input text entered by a user which is used by the suggest operation to generate a list of possible matches. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) */ text: string; @@ -30345,25 +32596,25 @@ declare namespace __esri { /** * Describes the object representing the result of the [suggestLocations()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#suggestLocations) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#SuggestionResult) */ export interface SuggestionResult extends Object { /** * Indicates if the result is a Collection. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#SuggestionResult) */ isCollection: boolean; /** * ID used in combination with the `text` property to uniquely identify a suggestion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#SuggestionResult) */ magicKey: string; /** * The string name of the suggested location to geocode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#SuggestionResult) */ text: string; @@ -30372,29 +32623,29 @@ declare namespace __esri { interface PrintTask extends Task { /** * The mode for the print task execution. **Possible Values:** async | sync - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#mode) - * + * * @default sync */ readonly mode: string; /** * The time interval in milliseconds between each job status request sent to an asynchronous GP task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#updateDelay) - * + * * @default 1000 */ updateDelay: number; /** * Sends a request to the print service to create a printable static image of the map using the options specified in the [PrintParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#execute) - * + * * @param params Defines the printing options. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ execute(params: PrintParameters, requestOptions?: any): IPromise; } @@ -30402,11 +32653,11 @@ declare namespace __esri { interface PrintTaskConstructor { /** * The PrintTask generates a printer-ready version of the map using an [Export Web Map Task](https://developers.arcgis.com/rest/services-reference/export-web-map-task.htm) available with ArGIS Server 10.1 and later. This class is used when you want to have more granular control over the user interface, for example, if you want to provide users the ability to define what appears on the printed page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html) */ - new(properties?: PrintTaskProperties): PrintTask; + new (properties?: PrintTaskProperties): PrintTask; } export const PrintTask: PrintTaskConstructor; @@ -30414,23 +32665,23 @@ declare namespace __esri { interface PrintTaskProperties extends TaskProperties { /** * The time interval in milliseconds between each job status request sent to an asynchronous GP task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#updateDelay) - * + * * @default 1000 */ updateDelay?: number; } /** - * Represents the reponse of the [execute()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#execute) method. - * + * Represents the response of the [execute()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#execute) method. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#PrintResponse) */ export interface PrintResponse extends Object { /** * URL pointing to the location of the generated printout of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html#PrintResponse) */ url: string; @@ -30439,81 +32690,87 @@ declare namespace __esri { interface QueryTask extends Task { /** * Specify the geodatabase version to query. Requires ArcGIS Server service 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#gdbVersion) */ gdbVersion: string; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the layer specified in the [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#url). The result is returned as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which can be accessed using the `.then()` method. A [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) contains an array of [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) features, which can be added to the map. This array will not be populated if no results are found. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#execute) - * + * * @param query Specifies the attributes and spatial filter of the query. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ execute(query: Query | QueryProperties, requestOptions?: any): IPromise; /** - * Query information about attachments associated with features from a [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) specified in the [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#url). It will return an error if the layer does not support [attachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities). - * + * Query information about attachments associated with features from a [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) specified in the [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#url). It will return an error if the layer's [capabilities.data.supportsAttachment](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is set to false. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeAttachmentQuery) - * + * * @param attachmentQuery Specifies the attachment parameters for query. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ - executeAttachmentQuery(attachmentQuery: AttachmentQuery | AttachmentQueryProperties, requestOptions?: any): IPromise; + executeAttachmentQuery( + attachmentQuery: AttachmentQuery | AttachmentQueryProperties, + requestOptions?: any + ): IPromise; /** * Gets a count of the number of features that satisfy the input query. Valid for layers published with 10.0 SP1. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeForCount) - * + * * @param query Specifies the attributes and spatial filter of the query. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ executeForCount(query: Query | QueryProperties, requestOptions?: any): IPromise; /** * Gets the extent of the features that satisfy the input query. The count of features that satisfy the input query is returned upon resolution as well. At 10.3, this option is only available for [hosted feature services](https://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm). At 10.3.1, this option is available for all feature services and map service layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeForExtent) - * + * * @param params Specifies the attributes and spatial filter of the query. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ executeForExtent(params: Query, requestOptions?: any): IPromise; /** * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against the layer specified in the [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#url). The result is an array of the object IDs of features that satisfy the input query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeForIds) - * + * * @param query Specifies the attributes and spatial filter of the query. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ executeForIds(query: Query | QueryProperties, requestOptions?: any): IPromise; /** * Executes a [RelationshipQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html) against the layer or table specified in the [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#url). If the query is successful, the returned results are [FeatureSets](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) grouped by source layer or table objectIds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeRelationshipQuery) - * + * * @param relationshipQuery Specifies relationship parameters for querying related features or records from a layer or a table. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ - executeRelationshipQuery(relationshipQuery: RelationshipQuery | RelationshipQueryProperties, requestOptions?: any): IPromise; + executeRelationshipQuery( + relationshipQuery: RelationshipQuery | RelationshipQueryProperties, + requestOptions?: any + ): IPromise; } interface QueryTaskConstructor { /** * Executes different types of query operations on a layer. The most common method used in this class is [execute()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#execute), which executes the query as defined in the [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) object that is passed as a parameter to the function. `QueryTask.execute()` returns a Promise that resolves to a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html), which contains the features in the layer that satisfy the [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html) */ - new(properties?: QueryTaskProperties): QueryTask; + new (properties?: QueryTaskProperties): QueryTask; } export const QueryTask: QueryTaskConstructor; @@ -30521,7 +32778,7 @@ declare namespace __esri { interface QueryTaskProperties extends TaskProperties { /** * Specify the geodatabase version to query. Requires ArcGIS Server service 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#gdbVersion) */ gdbVersion?: string; @@ -30529,43 +32786,43 @@ declare namespace __esri { /** * The AttachmentInfo returns information about attachments associated with a feature. This resource is available only if the [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) has attachments. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) */ - export interface AttachmentInfo extends Object { + export interface QueryTaskAttachmentInfo extends Object { /** * The content type of the attachment. For example, `image/jpeg`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-attachments-feature-service-layer-.htm) for more information on supported attachment types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) */ contentType: string; /** * The identifier for the attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) */ id: number; /** * The name of the attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) */ name: string; /** * The parent or the feature object id of the attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) */ parentObjectId: number; /** * The size of the attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) */ size: number; /** * The URL of the attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#AttachmentInfo) */ url: string; @@ -30574,12 +32831,12 @@ declare namespace __esri { interface RouteTask extends Task { /** * Solves the route against the route layer with the route parameters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html#solve) - * + * * @param params Route parameters used as input to generate the route. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ solve(params: RouteParameters, requestOptions?: any): IPromise; } @@ -30587,28 +32844,26 @@ declare namespace __esri { interface RouteTaskConstructor { /** * Find routes between two or more locations and optionally get driving directions. The RouteTask uses ArcGIS Server network analysis services to calculate routes. Network analysis services allow you to solve simple routing problems as well as complex ones that take into account multiple stops, barriers, and time windows. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) */ - new(properties?: RouteTaskProperties): RouteTask; + new (properties?: RouteTaskProperties): RouteTask; } export const RouteTask: RouteTaskConstructor; - interface RouteTaskProperties extends TaskProperties { - - } + interface RouteTaskProperties extends TaskProperties {} interface ServiceAreaTask extends Task { /** * Determines the service area based on a set of parameters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html#solve) - * + * * @param params The parameters needed to define the service area. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ solve(params: ServiceAreaParameters, requestOptions?: any): IPromise; } @@ -30616,56 +32871,52 @@ declare namespace __esri { interface ServiceAreaTaskConstructor { /** * ServiceAreaTask helps you find service areas around any location on a network. A network service area is a region that encompasses all accessible streets (streets that are within a specified impedance). For instance, the 5-minute service area for a point includes all the streets that can be reached within five minutes from that point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html) */ - new(properties?: ServiceAreaTaskProperties): ServiceAreaTask; + new (properties?: ServiceAreaTaskProperties): ServiceAreaTask; } export const ServiceAreaTask: ServiceAreaTaskConstructor; - interface ServiceAreaTaskProperties extends TaskProperties { - - } + interface ServiceAreaTaskProperties extends TaskProperties {} interface AddressCandidate extends Accessor, JSONSupport { /** * Address of the candidate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#address) */ address: string; /** * Name value pairs of field name and field value as defined in `outFields` in [Locator.addressToLocations()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#attributes) */ attributes: any; /** * The minimum and maximum X and Y coordinates of a bounding box of the address candidate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#extent) */ extent: Extent; /** * The [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) object representing the location of the [address](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#address). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#location) */ location: Point; /** * Numeric score between `0` and `100` for geocode candidates. A candidate with a score of `100` means a perfect match, and `0` means no match. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#score) */ score: number; } interface AddressCandidateConstructor { - - - new(properties?: AddressCandidateProperties): AddressCandidate; + new (properties?: AddressCandidateProperties): AddressCandidate; fromJSON(json: any): AddressCandidate; } @@ -30675,31 +32926,31 @@ declare namespace __esri { interface AddressCandidateProperties { /** * Address of the candidate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#address) */ address?: string; /** * Name value pairs of field name and field value as defined in `outFields` in [Locator.addressToLocations()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html#addressToLocations). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#attributes) */ attributes?: any; /** * The minimum and maximum X and Y coordinates of a bounding box of the address candidate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#extent) */ extent?: ExtentProperties; /** * The [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) object representing the location of the [address](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#address). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#location) */ location?: PointProperties; /** * Numeric score between `0` and `100` for geocode candidates. A candidate with a score of `100` means a perfect match, and `0` means no match. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AddressCandidate.html#score) */ score?: number; @@ -30708,50 +32959,48 @@ declare namespace __esri { interface AreasAndLengthsParameters extends Accessor { /** * The area unit in which areas of polygons will be calculated. Use the strings listed below or [any other valid area unit](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | hectares | square-miles | square-kilometers | square-meters | square-feet | square-yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#areaUnit) */ areaUnit: string; /** - * Defines the type of calculation for the geometry. The type can be one of the following: - * + * Defines the type of calculation for the geometry. The type can be one of the following: + * * Value | Description * ------|------------ * planar | Planar measurements use 2D Cartesian mathematics to calculate length. Use this type if the length needs to be calculated in the input spatial reference. Otherwise use `preserveShape`. * geodesic | Use this type to calculate an area or length using only the vertices of the polygon to define the lines connecting the vertices as geodesic segments independent of the actual shape of the polygon. **Note:** a geodesic segment is the shortest path between two points on an ellipsoid. * preserve-shape | Calculate the area or length of the geometry on the surface of the Earth ellipsoid (for geometries defined in a projected or geographic coordinate system). This method preserves the shape of the geometry in its coordinate system, which means the true area or length will be calculated for the geometry that is displayed on the map. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#calculationType) */ calculationType: string; /** * The length unit in which perimeters of polygons will be calculated. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#lengthUnit) */ lengthUnit: string; /** * Polygon geometries for which to compute areas and lengths. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#polygons) */ polygons: Polygon[]; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface AreasAndLengthsParametersConstructor { - - - new(properties?: AreasAndLengthsParametersProperties): AreasAndLengthsParameters; + new (properties?: AreasAndLengthsParametersProperties): AreasAndLengthsParameters; } export const AreasAndLengthsParameters: AreasAndLengthsParametersConstructor; @@ -30759,32 +33008,32 @@ declare namespace __esri { interface AreasAndLengthsParametersProperties { /** * The area unit in which areas of polygons will be calculated. Use the strings listed below or [any other valid area unit](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.AreaUnit.Code.ACRE). **Possible Values:** acres | hectares | square-miles | square-kilometers | square-meters | square-feet | square-yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#areaUnit) */ areaUnit?: string; /** - * Defines the type of calculation for the geometry. The type can be one of the following: - * + * Defines the type of calculation for the geometry. The type can be one of the following: + * * Value | Description * ------|------------ * planar | Planar measurements use 2D Cartesian mathematics to calculate length. Use this type if the length needs to be calculated in the input spatial reference. Otherwise use `preserveShape`. * geodesic | Use this type to calculate an area or length using only the vertices of the polygon to define the lines connecting the vertices as geodesic segments independent of the actual shape of the polygon. **Note:** a geodesic segment is the shortest path between two points on an ellipsoid. * preserve-shape | Calculate the area or length of the geometry on the surface of the Earth ellipsoid (for geometries defined in a projected or geographic coordinate system). This method preserves the shape of the geometry in its coordinate system, which means the true area or length will be calculated for the geometry that is displayed on the map. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#calculationType) */ calculationType?: string; /** * The length unit in which perimeters of polygons will be calculated. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#lengthUnit) */ lengthUnit?: string; /** * Polygon geometries for which to compute areas and lengths. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AreasAndLengthsParameters.html#polygons) */ polygons?: PolygonProperties[]; @@ -30793,53 +33042,53 @@ declare namespace __esri { interface AttachmentQuery extends Accessor, JSONSupport { /** * The file format that is supported by query attachment. For example, `image/jpeg`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-attachments-feature-service-layer-.htm) for more information on supported attachment types. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#attachmentTypes) */ attachmentTypes: string[]; /** * The definition expression to be applied to the layer. Only features that satisfy the definition expression and are in the list of [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds) will be returned. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#definitionExpression) */ definitionExpression: string; /** * An array of globalIds for the features in the layer being queried. The query results will return attachments only for specified global ids. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#globalIds) */ globalIds: number[]; /** * The number of features to retrieve. This option should be used in conjunction with the [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#start). Use this to implement paging (i.e. to retrieve "pages" of results when querying). Default Value is `10`. If not provided, but an instance of AttachmentQuery has a `start` property, then the default value of `num` is `maxRecordCount`. The maximum value for this parameter is the value of the layer's `maxRecordCount` of the service, which can be found at the REST endpoint of the feature layer. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#num) */ num: number; /** * An array of objectIds of the features to be queried for attachments. When the feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property is `false`, it only accepts a single `objectId`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds) */ objectIds: number[]; /** * The file size of the attachment is specified in bytes. You can enter a file size range [1000,15000] to query for attachments. The query result will return all attachments within the specified file size range (1000 - 15000). Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#size) */ size: number[]; /** * This option fetches query results by skipping a specified number of records. The query results start from the next record. The default value is `0`. This parameter only applies when the feature layer's [capabilities.query.supportsPagination](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is `true`. You can use this option to fetch records that are beyond `maxRecordCount`. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#start) */ start: number; /** * Creates a deep clone of AttachmentQuery object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#clone) - * - * + * + * */ clone(): AttachmentQuery; } @@ -30847,11 +33096,11 @@ declare namespace __esri { interface AttachmentQueryConstructor { /** * This class defines parameters for executing queries for feature attachments from a [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). Once an AttachmentQuery object's properties are defined, it can then be passed into the [QueryTask.executeAttachmentQuery()](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-QueryTask.html#executeAttachmentQuery) or [FeatureLayer.queryAttachments()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryAttachments) methods, which will return attachmentInfos grouped by the source feature objectIds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html) */ - new(properties?: AttachmentQueryProperties): AttachmentQuery; + new (properties?: AttachmentQueryProperties): AttachmentQuery; fromJSON(json: any): AttachmentQuery; } @@ -30861,43 +33110,43 @@ declare namespace __esri { interface AttachmentQueryProperties { /** * The file format that is supported by query attachment. For example, `image/jpeg`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-attachments-feature-service-layer-.htm) for more information on supported attachment types. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#attachmentTypes) */ attachmentTypes?: string[]; /** * The definition expression to be applied to the layer. Only features that satisfy the definition expression and are in the list of [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds) will be returned. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#definitionExpression) */ definitionExpression?: string; /** * An array of globalIds for the features in the layer being queried. The query results will return attachments only for specified global ids. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#globalIds) */ globalIds?: number[]; /** * The number of features to retrieve. This option should be used in conjunction with the [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#start). Use this to implement paging (i.e. to retrieve "pages" of results when querying). Default Value is `10`. If not provided, but an instance of AttachmentQuery has a `start` property, then the default value of `num` is `maxRecordCount`. The maximum value for this parameter is the value of the layer's `maxRecordCount` of the service, which can be found at the REST endpoint of the feature layer. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#num) */ num?: number; /** * An array of objectIds of the features to be queried for attachments. When the feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property is `false`, it only accepts a single `objectId`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#objectIds) */ objectIds?: number[]; /** * The file size of the attachment is specified in bytes. You can enter a file size range [1000,15000] to query for attachments. The query result will return all attachments within the specified file size range (1000 - 15000). Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#size) */ size?: number[]; /** * This option fetches query results by skipping a specified number of records. The query results start from the next record. The default value is `0`. This parameter only applies when the feature layer's [capabilities.query.supportsPagination](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) is `true`. You can use this option to fetch records that are beyond `maxRecordCount`. Requires an ArcGIS Server service 10.5 or greater and feature layer's [capabilities.query.supportsAttachments](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) to be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-AttachmentQuery.html#start) */ start?: number; @@ -30906,61 +33155,59 @@ declare namespace __esri { interface BufferParameters extends Accessor { /** * The spatial reference in which the geometries are buffered. If `bufferSpatialReference` is not specified, the geometries are buffered in the spatial reference specified by `outSpatialReference`. If `outSpatialReference` is also not specified, they are buffered in the spatial reference of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#bufferSpatialReference) */ bufferSpatialReference: SpatialReference; /** * The distances the input features are buffered. The distance units are specified by `unit`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#distances) */ distances: number[]; /** * If the input geometries are in a geographic coordinate system, set geodesic to `true` to generate a buffer polygon using a geodesic distance. The `bufferSpatialReference` property is ignored when geodesic is set to `true`. Requires ArcGIS Server 10.1 or greater geometry service. For more information, see the ArcGIS REST API documentation on the GeometryService buffer operation and the geodesic property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#geodesic) */ geodesic: boolean; /** * The input geometries to buffer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#geometries) */ geometries: Geometry[]; /** * The spatial reference for the returned geometries. If `outSpatialReference` is not specified, the output geometries are in the spatial reference specified by `bufferSpatialReference`. If `bufferSpatialReference` also is not specified, they are in the spatial reference of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * If `true`, all geometries buffered at a given distance are unioned into a single (possibly multipart) polygon, and the unioned geometry is placed in the output array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#unionResults) */ unionResults: boolean; /** * The units for calculating each buffer distance. If `unit` is not specified, the units are derived from `bufferSpatialReference`. If `bufferSpatialReference` is not specified, the units are derived from the features. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#unit) */ unit: string; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface BufferParametersConstructor { - - - new(properties?: BufferParametersProperties): BufferParameters; + new (properties?: BufferParametersProperties): BufferParameters; } export const BufferParameters: BufferParametersConstructor; @@ -30968,43 +33215,43 @@ declare namespace __esri { interface BufferParametersProperties { /** * The spatial reference in which the geometries are buffered. If `bufferSpatialReference` is not specified, the geometries are buffered in the spatial reference specified by `outSpatialReference`. If `outSpatialReference` is also not specified, they are buffered in the spatial reference of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#bufferSpatialReference) */ bufferSpatialReference?: SpatialReferenceProperties; /** * The distances the input features are buffered. The distance units are specified by `unit`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#distances) */ distances?: number[]; /** * If the input geometries are in a geographic coordinate system, set geodesic to `true` to generate a buffer polygon using a geodesic distance. The `bufferSpatialReference` property is ignored when geodesic is set to `true`. Requires ArcGIS Server 10.1 or greater geometry service. For more information, see the ArcGIS REST API documentation on the GeometryService buffer operation and the geodesic property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#geodesic) */ geodesic?: boolean; /** * The input geometries to buffer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#geometries) */ geometries?: GeometryProperties[]; /** * The spatial reference for the returned geometries. If `outSpatialReference` is not specified, the output geometries are in the spatial reference specified by `bufferSpatialReference`. If `bufferSpatialReference` also is not specified, they are in the spatial reference of the features. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * If `true`, all geometries buffered at a given distance are unioned into a single (possibly multipart) polygon, and the unioned geometry is placed in the output array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#unionResults) */ unionResults?: boolean; /** * The units for calculating each buffer distance. If `unit` is not specified, the units are derived from `bufferSpatialReference`. If `bufferSpatialReference` is not specified, the units are derived from the features. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-BufferParameters.html#unit) */ unit?: string; @@ -31013,241 +33260,247 @@ declare namespace __esri { interface ClosestFacilityParameters extends Accessor { /** * The list of network attribute names to be accumulated with the analysis, i.e., which attributes should be returned as part of the response. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#accumulateAttributes) */ accumulateAttributes: string[]; /** * An array of attribute parameter values that determine which network elements can be used by a vehicle. View the object specifications below for properties of the individual objects in this array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) */ attributeParameterValues: ClosestFacilityParametersAttributeParameterValues[]; /** * The cutoff value used to determine when to stop traversing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#defaultCutoff) */ defaultCutoff: number; /** * The number of facilities to find. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#defaultTargetFacilityCount) */ defaultTargetFacilityCount: number; /** * The language used when generating driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If an unsupported language code is specified, the service returns the directions using the default language, English. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLanguage) */ directionsLanguage: string; /** * The length units used when computing driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If not specified the task will use the value defined by the routing network layer is used. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLengthUnits) */ directionsLengthUnits: string; /** * Defines the amount of direction information returned. The default value is standard. **Possible Values:** complete | complete-no-events | instructions-only | standard | summary-only - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsOutputType) */ directionsOutputType: string; /** * The style to be used when returning directions. The default will be as defined in the network layer. View the REST layer description for your network service to see a list of supported styles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsStyleName) */ directionsStyleName: string; /** * The name of the attribute field that contains the drive time values. If not specified, the task will use the attribute field defined by the routing network layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsTimeAttribute) */ directionsTimeAttribute: string; /** * When `true`, restricted network elements should be considered when finding network locations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#doNotLocateOnRestrictedElements) - * + * * @default true */ doNotLocateOnRestrictedElements: boolean; /** * The set of facilities loaded as network locations during analysis. These can be specified as either a [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#facilities) */ facilities: DataLayer | FeatureSet; /** * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive, assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm) ArcGIS desktop help topic for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#impedanceAttribute) */ impedanceAttribute: string; /** * The set of incidents loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#incidents) */ incidents: DataLayer | FeatureSet; /** * The output geometry precision. When `0`, no generalization of the output geometry is performed. Positive values represent the `MaximumAllowableOffset` parameter used by generalize. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecision) */ outputGeometryPrecision: number; /** * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits: string; /** - * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. - * + * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. + * * Possible Value | Description * ---------------|------------ * none | No lines are returned * straight | Only returns straight lines * true-shape | Return the true shape of the lines * true-shape-with-measure | Return the true shape of the lines with their measurements - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputLines) */ outputLines: string; /** * The well-known id of the spatial reference or the spatial reference object for the geometries returned with the analysis results. If `outSpatialReference` is not specified, the geometries are returned in the spatial reference of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outSpatialReference) */ outSpatialReference: SpatialReference | string; /** * The set of point barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#pointBarriers) */ pointBarriers: DataLayer | FeatureSet; /** * The set of polygon barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#polygonBarriers) */ polygonBarriers: DataLayer | FeatureSet; /** * The set of polyline barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#polylineBarriers) */ polylineBarriers: DataLayer | FeatureSet; /** * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your RouteTask. Possible values are listed in the Service Directory under Network Dataset > Network Attributes. You can also specify a value of none to indicate that no network attributes should be used as restrictions. If you specify an empty array, it will default to the default of the service. Use `["none"]` to override the service defaults and specify that no restrictions should be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictionAttributes) */ restrictionAttributes: string[]; /** * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your module:"esri/tasks/ClosestFacilityTask". **Possible Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictUTurns) */ restrictUTurns: string; /** * Indicates whether the service should generate driving directions for each route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) - * + * * @default false */ returnDirections: boolean; /** * If `true`, facilities will be returned with the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnFacilities) - * + * * @default false */ returnFacilities: boolean; /** * If `true`, incidents will be returned with the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnIncidents) - * + * * @default false */ returnIncidents: boolean; /** * If `true`, point barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPointBarriers) - * + * * @default false */ returnPointBarriers: boolean; /** * If `true`, polygon barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPolygonBarriers) - * + * * @default false */ returnPolygonBarriers: boolean; /** * If `true`, polyline barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPolylineBarriers) - * + * * @default false */ returnPolylineBarriers: boolean; /** * When `true`, closest facility routes will be generated and returned in the route property of each [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnRoutes) - * + * * @default true */ returnRoutes: boolean; /** * The arrival or departure date and time. For example, if the travelDirection is set to `to-facility` and `timeOfDayUsage` is set to `end` and `timeOfDay` is set to 8:00 a.m., the returned route(s) will be setup to arrive at the facility at 8:00 a.m. local time. *Requires ArcGIS Server service version 10.1 or greater.* - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDay) */ timeOfDay: Date; /** * Defines the way the `timeOfDay` value is used. The default value is defined in the network layer. *Requires ArcGIS Server service version 10.1 or greater.* **Possible Values:** start | end - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDayUsage) */ timeOfDayUsage: string; /** - * Options for traveling to or from the facility. Default values are defined by the network layer. - * + * Options for traveling to or from the facility. Default values are defined by the network layer. + * * Possible Value | Description * ---------------|------------ * from-facility | Sets travel direction from the facility * to-facility | Sets travel direction to the facility - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#travelDirection) */ travelDirection: string; + /** + * Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#travelMode) + */ + travelMode: any; /** * If `true`, the hierarchy attribute for the network will be used in analysis. The default is defined in the routing network layer used by the [ClosestFacilityTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#useHierarchy) - * + * * @default false */ useHierarchy: boolean; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } @@ -31255,11 +33508,11 @@ declare namespace __esri { interface ClosestFacilityParametersConstructor { /** * Input parameters for [ClosestFacilityTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html) */ - new(properties?: ClosestFacilityParametersProperties): ClosestFacilityParameters; + new (properties?: ClosestFacilityParametersProperties): ClosestFacilityParameters; } export const ClosestFacilityParameters: ClosestFacilityParametersConstructor; @@ -31267,253 +33520,258 @@ declare namespace __esri { interface ClosestFacilityParametersProperties { /** * The list of network attribute names to be accumulated with the analysis, i.e., which attributes should be returned as part of the response. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#accumulateAttributes) */ accumulateAttributes?: string[]; /** * An array of attribute parameter values that determine which network elements can be used by a vehicle. View the object specifications below for properties of the individual objects in this array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) */ attributeParameterValues?: ClosestFacilityParametersAttributeParameterValues[]; /** * The cutoff value used to determine when to stop traversing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#defaultCutoff) */ defaultCutoff?: number; /** * The number of facilities to find. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#defaultTargetFacilityCount) */ defaultTargetFacilityCount?: number; /** * The language used when generating driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If an unsupported language code is specified, the service returns the directions using the default language, English. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLanguage) */ directionsLanguage?: string; /** * The length units used when computing driving directions. This parameter applies only when [returnDirections](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) parameter is set to `true`. If not specified the task will use the value defined by the routing network layer is used. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsLengthUnits) */ directionsLengthUnits?: string; /** * Defines the amount of direction information returned. The default value is standard. **Possible Values:** complete | complete-no-events | instructions-only | standard | summary-only - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsOutputType) */ directionsOutputType?: string; /** * The style to be used when returning directions. The default will be as defined in the network layer. View the REST layer description for your network service to see a list of supported styles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsStyleName) */ directionsStyleName?: string; /** * The name of the attribute field that contains the drive time values. If not specified, the task will use the attribute field defined by the routing network layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#directionsTimeAttribute) */ directionsTimeAttribute?: string; /** * When `true`, restricted network elements should be considered when finding network locations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#doNotLocateOnRestrictedElements) - * + * * @default true */ doNotLocateOnRestrictedElements?: boolean; /** * The set of facilities loaded as network locations during analysis. These can be specified as either a [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#facilities) */ facilities?: DataLayerProperties | FeatureSetProperties; /** * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive, assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm) ArcGIS desktop help topic for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#impedanceAttribute) */ impedanceAttribute?: string; /** * The set of incidents loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#incidents) */ incidents?: DataLayerProperties | FeatureSetProperties; /** * The output geometry precision. When `0`, no generalization of the output geometry is performed. Positive values represent the `MaximumAllowableOffset` parameter used by generalize. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecision) */ outputGeometryPrecision?: number; /** * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits?: string; /** - * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. - * + * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your RouteTask. + * * Possible Value | Description * ---------------|------------ * none | No lines are returned * straight | Only returns straight lines * true-shape | Return the true shape of the lines * true-shape-with-measure | Return the true shape of the lines with their measurements - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outputLines) */ outputLines?: string; /** * The well-known id of the spatial reference or the spatial reference object for the geometries returned with the analysis results. If `outSpatialReference` is not specified, the geometries are returned in the spatial reference of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties | string; /** * The set of point barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#pointBarriers) */ pointBarriers?: DataLayerProperties | FeatureSetProperties; /** * The set of polygon barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#polygonBarriers) */ polygonBarriers?: DataLayerProperties | FeatureSetProperties; /** * The set of polyline barriers loaded as network locations during analysis. Can be an instance of [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) or [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#polylineBarriers) */ polylineBarriers?: DataLayerProperties | FeatureSetProperties; /** * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your RouteTask. Possible values are listed in the Service Directory under Network Dataset > Network Attributes. You can also specify a value of none to indicate that no network attributes should be used as restrictions. If you specify an empty array, it will default to the default of the service. Use `["none"]` to override the service defaults and specify that no restrictions should be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictionAttributes) */ restrictionAttributes?: string[]; /** * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your module:"esri/tasks/ClosestFacilityTask". **Possible Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#restrictUTurns) */ restrictUTurns?: string; /** * Indicates whether the service should generate driving directions for each route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnDirections) - * + * * @default false */ returnDirections?: boolean; /** * If `true`, facilities will be returned with the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnFacilities) - * + * * @default false */ returnFacilities?: boolean; /** * If `true`, incidents will be returned with the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnIncidents) - * + * * @default false */ returnIncidents?: boolean; /** * If `true`, point barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPointBarriers) - * + * * @default false */ returnPointBarriers?: boolean; /** * If `true`, polygon barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPolygonBarriers) - * + * * @default false */ returnPolygonBarriers?: boolean; /** * If `true`, polyline barriers will be returned in the barriers property of the [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnPolylineBarriers) - * + * * @default false */ returnPolylineBarriers?: boolean; /** * When `true`, closest facility routes will be generated and returned in the route property of each [ClosestFacilitySolveResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#returnRoutes) - * + * * @default true */ returnRoutes?: boolean; /** * The arrival or departure date and time. For example, if the travelDirection is set to `to-facility` and `timeOfDayUsage` is set to `end` and `timeOfDay` is set to 8:00 a.m., the returned route(s) will be setup to arrive at the facility at 8:00 a.m. local time. *Requires ArcGIS Server service version 10.1 or greater.* - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDay) */ timeOfDay?: DateProperties; /** * Defines the way the `timeOfDay` value is used. The default value is defined in the network layer. *Requires ArcGIS Server service version 10.1 or greater.* **Possible Values:** start | end - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#timeOfDayUsage) */ timeOfDayUsage?: string; /** - * Options for traveling to or from the facility. Default values are defined by the network layer. - * + * Options for traveling to or from the facility. Default values are defined by the network layer. + * * Possible Value | Description * ---------------|------------ * from-facility | Sets travel direction from the facility * to-facility | Sets travel direction to the facility - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#travelDirection) */ travelDirection?: string; + /** + * Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#travelMode) + */ + travelMode?: any; /** * If `true`, the hierarchy attribute for the network will be used in analysis. The default is defined in the routing network layer used by the [ClosestFacilityTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#useHierarchy) - * + * * @default false */ useHierarchy?: boolean; } - export interface ClosestFacilityParametersAttributeParameterValues extends Object { /** * The name of the attribute. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) */ attributeName: string; /** * The parameter name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) */ parameterName: string; /** * The parameter value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilityParameters.html#attributeParameterValues) */ value: string; @@ -31522,49 +33780,49 @@ declare namespace __esri { interface ClosestFacilitySolveResult extends Accessor, JSONSupport { /** * An array of directions. A direction is an instance of [DirectionsFeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html). Route directions are returned if `returnDirections = true` (default is false). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#directions) */ directions: DirectionsFeatureSet; /** * An array of points representing facilities. Only returned when `ClosestFacilityParameters.returnFacilities = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#facilities) */ facilities: Point[]; /** * An array of points representing incidents. Only returned when `ClosestFacilityParameters.returnIncidents = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#incidents) */ incidents: Point[]; /** * Message received when the solve is complete. If a closest facility cannot be solved, the message returned by the server identifies the incident that could not be solved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#messages) */ messages: NAMessage[]; /** * The point barriers are an array of points. They are returned only if `ClosestFacilityParameters.returnPointBarriers` was set to `true` (which is not the default). If you send in the point barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#pointBarriers) */ pointBarriers: Point[]; /** * The polygon barriers are an array of polygons. They are returned only if `ClosestFacilityParameters.returnPolygonBarriers` was set to `true` (which is not the default). If you send in the polygon barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#polygonBarriers) */ polygonBarriers: Polygon[]; /** * The polyline barriers are an array of polylines. They are returned only if `ClosestFacilityParameters.returnPolylineBarriers` was set to `true` (which is not the default). If you send in the polyline barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#polylineBarriers) */ polylineBarriers: Polyline[]; /** * The array of routes. Route graphics are returned if `returnRoutes = true` and `outputLines` does not equal `none`. From version 2.0 to 2.5 the type is an array of Polylines. At version 2.6 the type is an array of Graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#routes) */ routes: Graphic[]; @@ -31573,11 +33831,11 @@ declare namespace __esri { interface ClosestFacilitySolveResultConstructor { /** * The result from [ClosestFacilityTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ClosestFacilityTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html) */ - new(properties?: ClosestFacilitySolveResultProperties): ClosestFacilitySolveResult; + new (properties?: ClosestFacilitySolveResultProperties): ClosestFacilitySolveResult; fromJSON(json: any): ClosestFacilitySolveResult; } @@ -31587,49 +33845,49 @@ declare namespace __esri { interface ClosestFacilitySolveResultProperties { /** * An array of directions. A direction is an instance of [DirectionsFeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html). Route directions are returned if `returnDirections = true` (default is false). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#directions) */ directions?: DirectionsFeatureSetProperties; /** * An array of points representing facilities. Only returned when `ClosestFacilityParameters.returnFacilities = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#facilities) */ facilities?: PointProperties[]; /** * An array of points representing incidents. Only returned when `ClosestFacilityParameters.returnIncidents = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#incidents) */ incidents?: PointProperties[]; /** * Message received when the solve is complete. If a closest facility cannot be solved, the message returned by the server identifies the incident that could not be solved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#messages) */ messages?: NAMessageProperties[]; /** * The point barriers are an array of points. They are returned only if `ClosestFacilityParameters.returnPointBarriers` was set to `true` (which is not the default). If you send in the point barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#pointBarriers) */ pointBarriers?: PointProperties[]; /** * The polygon barriers are an array of polygons. They are returned only if `ClosestFacilityParameters.returnPolygonBarriers` was set to `true` (which is not the default). If you send in the polygon barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#polygonBarriers) */ polygonBarriers?: PolygonProperties[]; /** * The polyline barriers are an array of polylines. They are returned only if `ClosestFacilityParameters.returnPolylineBarriers` was set to `true` (which is not the default). If you send in the polyline barriers as a FeatureSet (instead of using DataLayer), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#polylineBarriers) */ polylineBarriers?: PolylineProperties[]; /** * The array of routes. Route graphics are returned if `returnRoutes = true` and `outputLines` does not equal `none`. From version 2.0 to 2.5 the type is an array of Polylines. At version 2.6 the type is an array of Graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ClosestFacilitySolveResult.html#routes) */ routes?: GraphicProperties[]; @@ -31638,22 +33896,20 @@ declare namespace __esri { interface DataFile extends Accessor, JSONSupport { /** * The ID of the uploaded file returned as a result of the upload operation. For ArcGIS Server 10.1 and greater services that support uploads, this class can be used to specify an uploaded item as input by specifying the ItemID. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html#itemId) */ itemId: string; /** * URL to the location of the data file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html#url) */ url: string; } interface DataFileConstructor { - - - new(properties?: DataFileProperties): DataFile; + new (properties?: DataFileProperties): DataFile; fromJSON(json: any): DataFile; } @@ -31663,13 +33919,13 @@ declare namespace __esri { interface DataFileProperties { /** * The ID of the uploaded file returned as a result of the upload operation. For ArcGIS Server 10.1 and greater services that support uploads, this class can be used to specify an uploaded item as input by specifying the ItemID. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html#itemId) */ itemId?: string; /** * URL to the location of the data file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html#url) */ url?: string; @@ -31678,19 +33934,19 @@ declare namespace __esri { interface DataLayer extends Accessor { /** * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#spatialRelationship) is applied to this geometry while performing the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#geometry) */ geometry: Geometry; /** * The name of the data layer in the map service that is being referenced. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#name) */ name: string; /** - * The spatial relationship to be applied on the input geometry while performing the query. - * + * The spatial relationship to be applied on the input geometry while performing the query. + * * Possible Value | Description * ---------------|------------ * intersects | Part of a feature from feature class 1 is contained in a feature from feature class 2. @@ -31702,24 +33958,24 @@ declare namespace __esri { * touches | The feature from feature class 1 touches the border of a feature from feature class 2. * within | The feature from feature class 1 is completely enclosed by the feature from feature class 2. * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#spatialRelationship) */ spatialRelationship: string; /** * A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#where) */ where: string; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#toJSON) - * - * + * + * */ toJSON(): any; } @@ -31727,11 +33983,11 @@ declare namespace __esri { interface DataLayerConstructor { /** * Input for properties of ClosestFacilityParameters,RouteParameters or ServiceAreaParameters. The DataLayer can be used to define the following for each paramater type: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html) */ - new(properties?: DataLayerProperties): DataLayer; + new (properties?: DataLayerProperties): DataLayer; } export const DataLayer: DataLayerConstructor; @@ -31739,19 +33995,19 @@ declare namespace __esri { interface DataLayerProperties { /** * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#spatialRelationship) is applied to this geometry while performing the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#geometry) */ geometry?: GeometryProperties; /** * The name of the data layer in the map service that is being referenced. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#name) */ name?: string; /** - * The spatial relationship to be applied on the input geometry while performing the query. - * + * The spatial relationship to be applied on the input geometry while performing the query. + * * Possible Value | Description * ---------------|------------ * intersects | Part of a feature from feature class 1 is contained in a feature from feature class 2. @@ -31763,14 +34019,14 @@ declare namespace __esri { * touches | The feature from feature class 1 touches the border of a feature from feature class 2. * within | The feature from feature class 1 is completely enclosed by the feature from feature class 2. * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#spatialRelationship) */ spatialRelationship?: string; /** * A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html#where) */ where?: string; @@ -31779,24 +34035,22 @@ declare namespace __esri { interface supportDate extends Accessor, JSONSupport { /** * Date value returned from server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Date.html#date) */ date: Date; /** * The format of the date used in the date property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Date.html#format) - * + * * @default EEE MMM dd HH:mm:ss zzz yyyy */ format: string; } interface supportDateConstructor { - - - new(properties?: supportDateProperties): supportDate; + new (properties?: supportDateProperties): supportDate; fromJSON(json: any): supportDate; } @@ -31806,15 +34060,15 @@ declare namespace __esri { interface supportDateProperties { /** * Date value returned from server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Date.html#date) */ date?: DateProperties; /** * The format of the date used in the date property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Date.html#format) - * + * * @default EEE MMM dd HH:mm:ss zzz yyyy */ format?: string; @@ -31823,43 +34077,41 @@ declare namespace __esri { interface DensifyParameters extends Accessor { /** * If `true`, Geographic Coordinate System spatial references are used or densify geodesic will be performed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#geodesic) */ geodesic: boolean; /** * The array of geometries to be densified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#geometries) */ geometries: Geometry[]; /** * The length unit of `maxSegmentLength`. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#lengthUnit) */ lengthUnit: string; /** * All segments longer than `maxSegmentLength` are replaced with sequences of lines no longer than `maxSegmentLength.` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#maxSegmentLength) */ maxSegmentLength: number; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface DensifyParametersConstructor { - - - new(properties?: DensifyParametersProperties): DensifyParameters; + new (properties?: DensifyParametersProperties): DensifyParameters; } export const DensifyParameters: DensifyParametersConstructor; @@ -31867,25 +34119,25 @@ declare namespace __esri { interface DensifyParametersProperties { /** * If `true`, Geographic Coordinate System spatial references are used or densify geodesic will be performed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#geodesic) */ geodesic?: boolean; /** * The array of geometries to be densified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#geometries) */ geometries?: GeometryProperties[]; /** * The length unit of `maxSegmentLength`. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#lengthUnit) */ lengthUnit?: string; /** * All segments longer than `maxSegmentLength` are replaced with sequences of lines no longer than `maxSegmentLength.` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DensifyParameters.html#maxSegmentLength) */ maxSegmentLength?: number; @@ -31894,49 +34146,49 @@ declare namespace __esri { interface DirectionsFeatureSet extends FeatureSet, Accessor { /** * The extent of the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#extent) */ extent: Extent; /** * A single polyline representing the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#mergedGeometry) */ mergedGeometry: Polyline; /** * The ID of the route returned from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#routeId) */ routeId: string; /** * Name specified in [RouteParameters.stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#stops). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#routeName) */ routeName: string; /** * Lists additional information about the directions depending on the value of [RouteParameters.directionsOutputType](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsOutputType). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#strings) */ strings: any[]; /** * Actual drive time calculated for the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalDriveTime) */ totalDriveTime: number; /** * The length of the route as specified in the units set in [RouteParameters.directionsLengthUnits](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalLength) */ totalLength: number; /** * The total time calculated for the route as specified in the units set in [RouteParameters.directionsTimeAttribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsTimeAttribute). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalTime) */ totalTime: number; @@ -31945,11 +34197,11 @@ declare namespace __esri { interface DirectionsFeatureSetConstructor { /** * A [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) that has properties specific to routing. The [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#features) property contains the turn by turn directions text and geometry of the route. The attributes for each feature provide information associated with the corresponding route segment. The following attributes are returned: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html) */ - new(properties?: DirectionsFeatureSetProperties): DirectionsFeatureSet; + new (properties?: DirectionsFeatureSetProperties): DirectionsFeatureSet; fromJSON(json: any): DirectionsFeatureSet; } @@ -31959,49 +34211,49 @@ declare namespace __esri { interface DirectionsFeatureSetProperties extends FeatureSetProperties { /** * The extent of the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#extent) */ extent?: ExtentProperties; /** * A single polyline representing the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#mergedGeometry) */ mergedGeometry?: PolylineProperties; /** * The ID of the route returned from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#routeId) */ routeId?: string; /** * Name specified in [RouteParameters.stops](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#stops). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#routeName) */ routeName?: string; /** * Lists additional information about the directions depending on the value of [RouteParameters.directionsOutputType](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsOutputType). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#strings) */ strings?: any[]; /** * Actual drive time calculated for the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalDriveTime) */ totalDriveTime?: number; /** * The length of the route as specified in the units set in [RouteParameters.directionsLengthUnits](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalLength) */ totalLength?: number; /** * The total time calculated for the route as specified in the units set in [RouteParameters.directionsTimeAttribute](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsTimeAttribute). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DirectionsFeatureSet.html#totalTime) */ totalTime?: number; @@ -32010,43 +34262,41 @@ declare namespace __esri { interface DistanceParameters extends Accessor { /** * Specifies the units for measuring distance between [geometry1](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2). If the unit is not specified the units are derived from the spatial reference. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#distanceUnit) */ distanceUnit: string; /** * When `true`, the geodesic distance between [geometry1](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2) is measured. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geodesic) */ geodesic: boolean; /** * The geometry from which the distance is to be measured. The geometry can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) */ geometry1: Geometry[]; /** * The geometry to which the distance is to be measured. The geometry can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2) */ geometry2: Geometry[]; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface DistanceParametersConstructor { - - - new(properties?: DistanceParametersProperties): DistanceParameters; + new (properties?: DistanceParametersProperties): DistanceParameters; } export const DistanceParameters: DistanceParametersConstructor; @@ -32054,25 +34304,25 @@ declare namespace __esri { interface DistanceParametersProperties { /** * Specifies the units for measuring distance between [geometry1](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2). If the unit is not specified the units are derived from the spatial reference. For a list of valid units, see [esriSRUnitType Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnitType_Constants/000w00000042000000/) and [esriSRUnit2Type Constants](http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#/esriSRUnit2Type_Constants/000w00000041000000/). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#distanceUnit) */ distanceUnit?: string; /** * When `true`, the geodesic distance between [geometry1](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) and [geometry2](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2) is measured. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geodesic) */ geodesic?: boolean; /** * The geometry from which the distance is to be measured. The geometry can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry1) */ geometry1?: GeometryProperties[]; /** * The geometry to which the distance is to be measured. The geometry can be a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [Polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), [Polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html), or a [Multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DistanceParameters.html#geometry2) */ geometry2?: GeometryProperties[]; @@ -32081,46 +34331,44 @@ declare namespace __esri { interface FeatureSet extends Accessor, JSONSupport { /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. This is only applicable when the FeatureSet is returned from a task. It is ignored when the FeatureSet is used as input to a geoprocessing task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#displayFieldName) */ displayFieldName: string; /** * Typically, a layer has a limit on the number of features (i.e., records) returned by the query operation. If `maxRecordCount` is configured for a layer, `exceededTransferLimit` will be `true` if a query matches more than the `maxRecordCount` features. It will be `false` otherwise. Supported by ArcGIS Server version 10.1 and later. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#exceededTransferLimit) */ exceededTransferLimit: boolean; /** * The array of graphics returned from a task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#features) */ features: Graphic[]; /** * Information about each field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#fields) */ fields: Field[]; /** * The geometry type of the FeatureSet. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#geometryType) */ geometryType: string; /** * When a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default. This value can be changed. When a FeatureSet is returned from a task, the value is the result as returned from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#spatialReference) */ spatialReference: SpatialReference; } interface FeatureSetConstructor { - - - new(properties?: FeatureSetProperties): FeatureSet; + new (properties?: FeatureSetProperties): FeatureSet; fromJSON(json: any): FeatureSet; } @@ -32130,37 +34378,37 @@ declare namespace __esri { interface FeatureSetProperties { /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. This is only applicable when the FeatureSet is returned from a task. It is ignored when the FeatureSet is used as input to a geoprocessing task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#displayFieldName) */ displayFieldName?: string; /** * Typically, a layer has a limit on the number of features (i.e., records) returned by the query operation. If `maxRecordCount` is configured for a layer, `exceededTransferLimit` will be `true` if a query matches more than the `maxRecordCount` features. It will be `false` otherwise. Supported by ArcGIS Server version 10.1 and later. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#exceededTransferLimit) */ exceededTransferLimit?: boolean; /** * The array of graphics returned from a task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#features) */ features?: GraphicProperties[]; /** * Information about each field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#fields) */ fields?: FieldProperties[]; /** * The geometry type of the FeatureSet. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#geometryType) */ geometryType?: string; /** * When a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default. This value can be changed. When a FeatureSet is returned from a task, the value is the result as returned from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; @@ -32169,71 +34417,69 @@ declare namespace __esri { interface FindParameters extends Accessor { /** * Determines whether to look for an exact match of the search text or not. If `true`, searches for a value that contains the provided [searchText](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText). This is a case-insensitive search. If `false`, searches for an exact match of the [searchText](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText) string. The exact match is case-sensitive. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#contains) - * + * * @default true */ contains: boolean; /** * Specify the number of decimal places for the geometries returned by the task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#geometryPrecision) */ geometryPrecision: number; /** * The layers to perform the find operation on. The layers are specified as a comma-separated list of layer ids. The list of ids is returned in [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) layerInfos. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#layerIds) */ layerIds: number[]; /** * The maximum allowable offset used for generalizing geometries returned by the find operation. The offset is in the units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference). If [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference) is not defined, the spatial reference of the map is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#maxAllowableOffset) */ maxAllowableOffset: number; /** * The spatial reference of the output geometries. If this is not specified, the output geometries are returned in the spatial reference of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * If `true`, the output will include the geometry associated with each result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#returnGeometry) - * + * * @default false */ returnGeometry: boolean; /** * The names of the fields of a layer to search. The fields are specified as a comma-separated list of field names. If this parameter is not specified, all fields are searched by default. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchFields) */ searchFields: string[]; /** * The text that is searched across the layers and the fields as specified in the `layers` and [searchFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchFields) properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText) */ searchText: string; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface FindParametersConstructor { - - - new(properties?: FindParametersProperties): FindParameters; + new (properties?: FindParametersProperties): FindParameters; } export const FindParameters: FindParametersConstructor; @@ -32241,53 +34487,53 @@ declare namespace __esri { interface FindParametersProperties { /** * Determines whether to look for an exact match of the search text or not. If `true`, searches for a value that contains the provided [searchText](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText). This is a case-insensitive search. If `false`, searches for an exact match of the [searchText](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText) string. The exact match is case-sensitive. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#contains) - * + * * @default true */ contains?: boolean; /** * Specify the number of decimal places for the geometries returned by the task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#geometryPrecision) */ geometryPrecision?: number; /** * The layers to perform the find operation on. The layers are specified as a comma-separated list of layer ids. The list of ids is returned in [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html) layerInfos. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#layerIds) */ layerIds?: number[]; /** * The maximum allowable offset used for generalizing geometries returned by the find operation. The offset is in the units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference). If [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference) is not defined, the spatial reference of the map is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#maxAllowableOffset) */ maxAllowableOffset?: number; /** * The spatial reference of the output geometries. If this is not specified, the output geometries are returned in the spatial reference of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * If `true`, the output will include the geometry associated with each result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#returnGeometry) - * + * * @default false */ returnGeometry?: boolean; /** * The names of the fields of a layer to search. The fields are specified as a comma-separated list of field names. If this parameter is not specified, all fields are searched by default. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchFields) */ searchFields?: string[]; /** * The text that is searched across the layers and the fields as specified in the `layers` and [searchFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchFields) properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindParameters.html#searchText) */ searchText?: string; @@ -32296,46 +34542,44 @@ declare namespace __esri { interface FindResult extends Accessor, JSONSupport { /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#displayFieldName) */ displayFieldName: string; /** * The found feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#feature) */ feature: Graphic; /** * The name of the field that contains the search text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#foundFieldName) */ foundFieldName: string; /** * Unique ID of the layer that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#layerId) */ layerId: number; /** * The layer name that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#layerName) */ layerName: string; /** * The value of the `foundFieldName` in the feature's attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#value) */ value: void; } interface FindResultConstructor { - - - new(properties?: FindResultProperties): FindResult; + new (properties?: FindResultProperties): FindResult; fromJSON(json: any): FindResult; } @@ -32345,37 +34589,37 @@ declare namespace __esri { interface FindResultProperties { /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#displayFieldName) */ displayFieldName?: string; /** * The found feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#feature) */ feature?: GraphicProperties; /** * The name of the field that contains the search text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#foundFieldName) */ foundFieldName?: string; /** * Unique ID of the layer that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#layerId) */ layerId?: number; /** * The layer name that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#layerName) */ layerName?: string; /** * The value of the `foundFieldName` in the feature's attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FindResult.html#value) */ value?: void; @@ -32384,37 +34628,35 @@ declare namespace __esri { interface GeneralizeParameters extends Accessor { /** * The maximum deviation unit. If the unit is not specified, units are derived from the spatial reference. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#deviationUnit) */ deviationUnit: string; /** * The array of input geometries to generalize. All geometries in this array must be of the same geometry type (e.g. `esriGeometryPolyline` or `esriGeometryPolygon`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#geometries) */ geometries: Geometry[]; /** * The maximum deviation for constructing a generalized geometry based on the input geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#maxDeviation) */ maxDeviation: number; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface GeneralizeParametersConstructor { - - - new(properties?: GeneralizeParametersProperties): GeneralizeParameters; + new (properties?: GeneralizeParametersProperties): GeneralizeParameters; } export const GeneralizeParameters: GeneralizeParametersConstructor; @@ -32422,19 +34664,19 @@ declare namespace __esri { interface GeneralizeParametersProperties { /** * The maximum deviation unit. If the unit is not specified, units are derived from the spatial reference. Use one of the possible values listed below or any of the [numeric codes for linear units](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#deviationUnit) */ deviationUnit?: string; /** * The array of input geometries to generalize. All geometries in this array must be of the same geometry type (e.g. `esriGeometryPolyline` or `esriGeometryPolygon`). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#geometries) */ geometries?: GeometryProperties[]; /** * The maximum deviation for constructing a generalized geometry based on the input geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GeneralizeParameters.html#maxDeviation) */ maxDeviation?: number; @@ -32443,22 +34685,20 @@ declare namespace __esri { interface GPMessage extends Accessor, JSONSupport { /** * The geoprocessing message. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GPMessage.html#description) */ description: string; /** * The geoprocessing message type. **Possible Values:** informative | process-definition | process-start | process-stop | warning | error | empty | abort - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GPMessage.html#type) */ type: string; } interface GPMessageConstructor { - - - new(properties?: GPMessageProperties): GPMessage; + new (properties?: GPMessageProperties): GPMessage; fromJSON(json: any): GPMessage; } @@ -32468,13 +34708,13 @@ declare namespace __esri { interface GPMessageProperties { /** * The geoprocessing message. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GPMessage.html#description) */ description?: string; /** * The geoprocessing message type. **Possible Values:** informative | process-definition | process-start | process-stop | warning | error | empty | abort - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-GPMessage.html#type) */ type?: string; @@ -32483,140 +34723,138 @@ declare namespace __esri { interface IdentifyParameters extends Accessor { /** * Resolution of the current map view in dots per inch. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#dpi) - * + * * @default 96 */ dpi: number; /** * The geometry used to select features during the Identify operation. The type of the geometry is specified by [Geometry.type](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type). The most common geometry used with Identify is a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#geometry) */ geometry: Geometry; /** * Specify the number of decimal places for the geometries returned by the task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#geometryPrecision) */ geometryPrecision: number; /** * Height of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#height) - * + * * @default 400 */ height: number; /** * The layers on which to perform the identify operation. The layers are specified as a comma-separated list of layer IDs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#layerIds) */ layerIds: number[]; /** - * Specifies which layers to use when using Identify. - * + * Specifies which layers to use when using Identify. + * * Possible values | Description * --------------- | ----------- * top | Only the top-most visible layer is identified. * visible | All visible layers are identified. * all | All layers are identified, even if they are not visible. If your service has many layers, a request using this option will not perform well. A visible layer means you can see it in the map at the current extent. If a layer is turned off or not in range based on its scale dependency settings, it cannot be identified. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#layerOption) - * + * * @default top */ layerOption: string; /** * The Extent or bounding box of the current map view. The `mapExtent` property is assumed to be in the spatial reference of the map unless [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) has been specified. The values for [mapExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent), [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#width), and [dpi](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#dpi) are used to determine the current map scale. Once the scale is known, the map service can exclude layers based on their scale dependency settings. The map service is not performing a spatial intersection based on the provided extent. These properties are also used to calculate the search distance on the map based on the tolerance in screen pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent) */ mapExtent: Extent; /** * The maximum allowable offset used for generalizing geometries returned by the identify operation. The offset is in the units of the [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference). If a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) is not defined the spatial reference of the view is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#maxAllowableOffset) */ maxAllowableOffset: number; /** * If `true`, field names will be returned instead of field aliases. Requires ArcGIS Server service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnFieldName) - * + * * @default false */ returnFieldName: boolean; /** * If `true`, the result set includes the geometry associated with each result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnGeometry) - * + * * @default false */ returnGeometry: boolean; /** * When `true`, indicates that M values will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnM) - * + * * @default false */ returnM: boolean; /** * If `true`, the values in the result will not be formatted i.e. numbers will returned as is and dates will be returned as epoch values. Requires ArcGIS Server service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnUnformattedValues) - * + * * @default false */ returnUnformattedValues: boolean; /** * When `true`, indicates that M values will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnZ) - * + * * @default false */ returnZ: boolean; /** * The spatial reference of the input and output geometries as well as of the [mapExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent). If the spatial reference is not specified, the geometry and the extent are assumed to be in the spatial reference of the view, and the output geometries will also be in the spatial reference of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) */ spatialReference: SpatialReference; /** * The distance in screen pixels from the specified geometry within which the identify should be performed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#tolerance) */ tolerance: number; /** * Width of the current map view in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#width) - * + * * @default 400 */ width: number; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface IdentifyParametersConstructor { - - - new(properties?: IdentifyParametersProperties): IdentifyParameters; + new (properties?: IdentifyParametersProperties): IdentifyParameters; } export const IdentifyParameters: IdentifyParametersConstructor; @@ -32624,122 +34862,122 @@ declare namespace __esri { interface IdentifyParametersProperties { /** * Resolution of the current map view in dots per inch. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#dpi) - * + * * @default 96 */ dpi?: number; /** * The geometry used to select features during the Identify operation. The type of the geometry is specified by [Geometry.type](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type). The most common geometry used with Identify is a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#geometry) */ geometry?: GeometryProperties; /** * Specify the number of decimal places for the geometries returned by the task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#geometryPrecision) */ geometryPrecision?: number; /** * Height of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#height) - * + * * @default 400 */ height?: number; /** * The layers on which to perform the identify operation. The layers are specified as a comma-separated list of layer IDs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#layerIds) */ layerIds?: number[]; /** - * Specifies which layers to use when using Identify. - * + * Specifies which layers to use when using Identify. + * * Possible values | Description * --------------- | ----------- * top | Only the top-most visible layer is identified. * visible | All visible layers are identified. * all | All layers are identified, even if they are not visible. If your service has many layers, a request using this option will not perform well. A visible layer means you can see it in the map at the current extent. If a layer is turned off or not in range based on its scale dependency settings, it cannot be identified. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#layerOption) - * + * * @default top */ layerOption?: string; /** * The Extent or bounding box of the current map view. The `mapExtent` property is assumed to be in the spatial reference of the map unless [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) has been specified. The values for [mapExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent), [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#height), [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#width), and [dpi](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#dpi) are used to determine the current map scale. Once the scale is known, the map service can exclude layers based on their scale dependency settings. The map service is not performing a spatial intersection based on the provided extent. These properties are also used to calculate the search distance on the map based on the tolerance in screen pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent) */ mapExtent?: ExtentProperties; /** * The maximum allowable offset used for generalizing geometries returned by the identify operation. The offset is in the units of the [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference). If a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) is not defined the spatial reference of the view is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#maxAllowableOffset) */ maxAllowableOffset?: number; /** * If `true`, field names will be returned instead of field aliases. Requires ArcGIS Server service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnFieldName) - * + * * @default false */ returnFieldName?: boolean; /** * If `true`, the result set includes the geometry associated with each result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnGeometry) - * + * * @default false */ returnGeometry?: boolean; /** * When `true`, indicates that M values will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnM) - * + * * @default false */ returnM?: boolean; /** * If `true`, the values in the result will not be formatted i.e. numbers will returned as is and dates will be returned as epoch values. Requires ArcGIS Server service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnUnformattedValues) - * + * * @default false */ returnUnformattedValues?: boolean; /** * When `true`, indicates that M values will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#returnZ) - * + * * @default false */ returnZ?: boolean; /** * The spatial reference of the input and output geometries as well as of the [mapExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#mapExtent). If the spatial reference is not specified, the geometry and the extent are assumed to be in the spatial reference of the view, and the output geometries will also be in the spatial reference of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; /** * The distance in screen pixels from the specified geometry within which the identify should be performed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#tolerance) */ tolerance?: number; /** * Width of the current map view in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyParameters.html#width) - * + * * @default 400 */ width?: number; @@ -32748,34 +34986,32 @@ declare namespace __esri { interface IdentifyResult extends Accessor, JSONSupport { /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#displayFieldName) */ displayFieldName: string; /** * An identified feature from the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#feature) */ feature: Graphic; /** * Unique ID of the layer that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#layerId) */ layerId: number; /** * The layer name that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#layerName) */ layerName: string; } interface IdentifyResultConstructor { - - - new(properties?: IdentifyResultProperties): IdentifyResult; + new (properties?: IdentifyResultProperties): IdentifyResult; fromJSON(json: any): IdentifyResult; } @@ -32785,25 +35021,25 @@ declare namespace __esri { interface IdentifyResultProperties { /** * The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#displayFieldName) */ displayFieldName?: string; /** * An identified feature from the map service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#feature) */ feature?: GraphicProperties; /** * Unique ID of the layer that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#layerId) */ layerId?: number; /** * The layer name that contains the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-IdentifyResult.html#layerName) */ layerName?: string; @@ -32812,77 +35048,75 @@ declare namespace __esri { interface ImageServiceIdentifyParameters extends Accessor { /** * Input geometry that defines the location to be identified. The location can be a point or a polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#geometry) */ geometry: Point | Polygon; /** * Specifies the mosaic rules defining the image sorting order. When a mosaic rule is not specified, `center` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#mosaicRule) */ mosaicRule: MosaicRule; /** * The pixel or RGB color value representing no information. It can be defined as a number `noData = 0` representing a pixel value or as a string `noData = "58,128,187"` representing an RGB color value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#noData) */ noData: string | number; /** * Specifies the pixel level being identified on the x and y axis. Defaults to the base resolution of the dataset when not specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSize) */ pixelSize: Symbol; /** * The pixel level being identified (or the resolution being looked at) on the x-axis. If not specified, it will default to the base resolution of the dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSizeX) */ pixelSizeX: number; /** * The pixel level being identified (or the resolution being looked at) on the y-axis. If not specified, it will default to the base resolution of the dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSizeY) */ pixelSizeY: number; /** * Specifies the rendering rule for how the requested image should be rendered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#renderingRule) */ renderingRule: RasterFunction; /** * If `true`, returns both geometry and attributes of the catalog items. Set to `false` when catalog items are not needed to significantly improve identify operation's performance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#returnCatalogItems) - * + * * @default true */ returnCatalogItems: boolean; /** * When `true`, each feature in the catalog items includes the geometry. Set to `false` to not display the features on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#returnGeometry) - * + * * @default false */ returnGeometry: boolean; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface ImageServiceIdentifyParametersConstructor { - - - new(properties?: ImageServiceIdentifyParametersProperties): ImageServiceIdentifyParameters; + new (properties?: ImageServiceIdentifyParametersProperties): ImageServiceIdentifyParameters; } export const ImageServiceIdentifyParameters: ImageServiceIdentifyParametersConstructor; @@ -32890,59 +35124,59 @@ declare namespace __esri { interface ImageServiceIdentifyParametersProperties { /** * Input geometry that defines the location to be identified. The location can be a point or a polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#geometry) */ geometry?: PointProperties | PolygonProperties; /** * Specifies the mosaic rules defining the image sorting order. When a mosaic rule is not specified, `center` is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#mosaicRule) */ mosaicRule?: MosaicRuleProperties; /** * The pixel or RGB color value representing no information. It can be defined as a number `noData = 0` representing a pixel value or as a string `noData = "58,128,187"` representing an RGB color value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#noData) */ noData?: string | number; /** * Specifies the pixel level being identified on the x and y axis. Defaults to the base resolution of the dataset when not specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSize) */ pixelSize?: SymbolProperties; /** * The pixel level being identified (or the resolution being looked at) on the x-axis. If not specified, it will default to the base resolution of the dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSizeX) */ pixelSizeX?: number; /** * The pixel level being identified (or the resolution being looked at) on the y-axis. If not specified, it will default to the base resolution of the dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#pixelSizeY) */ pixelSizeY?: number; /** * Specifies the rendering rule for how the requested image should be rendered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#renderingRule) */ renderingRule?: RasterFunctionProperties; /** * If `true`, returns both geometry and attributes of the catalog items. Set to `false` when catalog items are not needed to significantly improve identify operation's performance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#returnCatalogItems) - * + * * @default true */ returnCatalogItems?: boolean; /** * When `true`, each feature in the catalog items includes the geometry. Set to `false` to not display the features on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyParameters.html#returnGeometry) - * + * * @default false */ returnGeometry?: boolean; @@ -32951,52 +35185,50 @@ declare namespace __esri { interface ImageServiceIdentifyResult extends Accessor, JSONSupport { /** * The set of catalog items that overlap the input geometry. Catalog Items are returned only when the image service source is a mosaic dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#catalogItems) */ catalogItems: FeatureSet; /** * The set of visible areas for the identified catalog items. `CatalogItemVisibilities` are returned only when the image service source is a mosaic dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#catalogItemVisibilities) */ catalogItemVisibilities: number[]; /** * The identified location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#location) */ location: Point; /** * The identify property name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#name) */ name: string; /** * The identify property id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#objectId) */ objectId: number; /** * The attributes of the identified object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#properties) */ properties: any; /** * The identify property pixel value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#value) */ value: string; } interface ImageServiceIdentifyResultConstructor { - - - new(properties?: ImageServiceIdentifyResultProperties): ImageServiceIdentifyResult; + new (properties?: ImageServiceIdentifyResultProperties): ImageServiceIdentifyResult; fromJSON(json: any): ImageServiceIdentifyResult; } @@ -33006,43 +35238,43 @@ declare namespace __esri { interface ImageServiceIdentifyResultProperties { /** * The set of catalog items that overlap the input geometry. Catalog Items are returned only when the image service source is a mosaic dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#catalogItems) */ catalogItems?: FeatureSetProperties; /** * The set of visible areas for the identified catalog items. `CatalogItemVisibilities` are returned only when the image service source is a mosaic dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#catalogItemVisibilities) */ catalogItemVisibilities?: number[]; /** * The identified location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#location) */ location?: PointProperties; /** * The identify property name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#name) */ name?: string; /** * The identify property id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#objectId) */ objectId?: number; /** * The attributes of the identified object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#properties) */ properties?: any; /** * The identify property pixel value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ImageServiceIdentifyResult.html#value) */ value?: string; @@ -33051,28 +35283,26 @@ declare namespace __esri { interface JobInfo extends Accessor, JSONSupport { /** * The unique job ID assigned by ArcGIS Server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#jobId) */ jobId: string; /** * The job status. **Possible Values:** job-cancelled | job-cancelling | job-deleted | job-deleting | job-timed-out | job-executing | job-failed | job-new | job-submitted | job-succeeded | job-waiting - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#jobStatus) */ jobStatus: string; /** * An array of messages that include the message type and a description. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#messages) */ messages: GPMessage[]; } interface JobInfoConstructor { - - - new(properties?: JobInfoProperties): JobInfo; + new (properties?: JobInfoProperties): JobInfo; fromJSON(json: any): JobInfo; } @@ -33082,19 +35312,19 @@ declare namespace __esri { interface JobInfoProperties { /** * The unique job ID assigned by ArcGIS Server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#jobId) */ jobId?: string; /** * The job status. **Possible Values:** job-cancelled | job-cancelling | job-deleted | job-deleting | job-timed-out | job-executing | job-failed | job-new | job-submitted | job-succeeded | job-waiting - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#jobStatus) */ jobStatus?: string; /** * An array of messages that include the message type and a description. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-JobInfo.html#messages) */ messages?: GPMessageProperties[]; @@ -33103,28 +35333,26 @@ declare namespace __esri { interface LegendLayer extends Accessor { /** * The id of the operational layer to include in the printout's legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#layerId) */ layerId: string; /** * The ids of the sublayers to include in the printout's legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#subLayerIds) */ subLayerIds: string[]; /** * The title of the feature layer. Use this property to modify feature layer name in the legend for the printout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#title) */ title: string; } interface LegendLayerConstructor { - - - new(properties?: LegendLayerProperties): LegendLayer; + new (properties?: LegendLayerProperties): LegendLayer; } export const LegendLayer: LegendLayerConstructor; @@ -33132,19 +35360,19 @@ declare namespace __esri { interface LegendLayerProperties { /** * The id of the operational layer to include in the printout's legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#layerId) */ layerId?: string; /** * The ids of the sublayers to include in the printout's legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#subLayerIds) */ subLayerIds?: string[]; /** * The title of the feature layer. Use this property to modify feature layer name in the legend for the printout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html#title) */ title?: string; @@ -33152,84 +35380,82 @@ declare namespace __esri { interface LengthsParameters extends Accessor { /** - * Defines the type of calculation for the geometry. The type can be one of the following: - * + * Defines the type of calculation for the geometry. The type can be one of the following: + * * Value | Description * ---------------|--------------- * planar | Planar measurements use 2D Cartesian mathematics to calculate length. Use this type if the length needs to be calculated in the input spatial reference otherwise use `preserve-shape`. * geodesic | Use this type to calculate an area or length using only the vertices of the polygon to define the lines connecting the vertices as geodesic segments independent of the actual shape of the polygon. **Note:** a geodesic segment is the shortest path between two points on an ellipsoid. * preserve-shape | Calculate the area or length of the geometry on the surface of the Earth ellipsoid, for geometries defined in a projected or geographic coordinate system. This method preserves the shape of the geometry in its coordinate system which means the true area or length will be calculated for the geometry that is displayed on the map. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#calculationType) */ calculationType: string; /** * If polylines are in a geographic coordinate system, then geodesic needs to be set to `true` in order to calculate the ellipsoidal shortest path distance between each pair of the vertices in the polylines. If `lengthUnit` is not specified, the output is returned in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#geodesic) */ geodesic: boolean; /** * The length unit in which perimeters of polygons will be calculated. For a list of valid units, see [linear unit codes](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#lengthUnit) */ lengthUnit: number | string; /** * The array of polylines whose lengths are to be computed. The structure of each polyline in the array is same as the structure of the JSON polyline objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#polylines) */ polylines: Polyline[]; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface LengthsParametersConstructor { - - - new(properties?: LengthsParametersProperties): LengthsParameters; + new (properties?: LengthsParametersProperties): LengthsParameters; } export const LengthsParameters: LengthsParametersConstructor; interface LengthsParametersProperties { /** - * Defines the type of calculation for the geometry. The type can be one of the following: - * + * Defines the type of calculation for the geometry. The type can be one of the following: + * * Value | Description * ---------------|--------------- * planar | Planar measurements use 2D Cartesian mathematics to calculate length. Use this type if the length needs to be calculated in the input spatial reference otherwise use `preserve-shape`. * geodesic | Use this type to calculate an area or length using only the vertices of the polygon to define the lines connecting the vertices as geodesic segments independent of the actual shape of the polygon. **Note:** a geodesic segment is the shortest path between two points on an ellipsoid. * preserve-shape | Calculate the area or length of the geometry on the surface of the Earth ellipsoid, for geometries defined in a projected or geographic coordinate system. This method preserves the shape of the geometry in its coordinate system which means the true area or length will be calculated for the geometry that is displayed on the map. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#calculationType) */ calculationType?: string; /** * If polylines are in a geographic coordinate system, then geodesic needs to be set to `true` in order to calculate the ellipsoidal shortest path distance between each pair of the vertices in the polylines. If `lengthUnit` is not specified, the output is returned in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#geodesic) */ geodesic?: boolean; /** * The length unit in which perimeters of polygons will be calculated. For a list of valid units, see [linear unit codes](https://developers.arcgis.com/java/api-reference/constant-values.html#com.esri.core.geometry.LinearUnit.Code.CENTIMETER). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#lengthUnit) */ lengthUnit?: number | string; /** * The array of polylines whose lengths are to be computed. The structure of each polyline in the array is same as the structure of the JSON polyline objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LengthsParameters.html#polylines) */ polylines?: PolylineProperties[]; @@ -33238,24 +35464,22 @@ declare namespace __esri { interface LinearUnit extends Accessor, JSONSupport { /** * Specifies the value of the linear distance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LinearUnit.html#distance) - * + * * @default 0 */ distance: number; /** * Specifies the unit type of the linear distance. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LinearUnit.html#units) */ units: string; } interface LinearUnitConstructor { - - - new(properties?: LinearUnitProperties): LinearUnit; + new (properties?: LinearUnitProperties): LinearUnit; fromJSON(json: any): LinearUnit; } @@ -33265,15 +35489,15 @@ declare namespace __esri { interface LinearUnitProperties { /** * Specifies the value of the linear distance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LinearUnit.html#distance) - * + * * @default 0 */ distance?: number; /** * Specifies the unit type of the linear distance. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LinearUnit.html#units) */ units?: string; @@ -33282,22 +35506,20 @@ declare namespace __esri { interface NAMessage extends Accessor, JSONSupport { /** * A description of the network analyst message. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-NAMessage.html#description) */ description: string; /** * The network analyst message type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-NAMessage.html#type) */ type: any; } interface NAMessageConstructor { - - - new(properties?: NAMessageProperties): NAMessage; + new (properties?: NAMessageProperties): NAMessage; fromJSON(json: any): NAMessage; } @@ -33307,13 +35529,13 @@ declare namespace __esri { interface NAMessageProperties { /** * A description of the network analyst message. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-NAMessage.html#description) */ description?: string; /** * The network analyst message type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-NAMessage.html#type) */ type?: any; @@ -33322,56 +35544,54 @@ declare namespace __esri { interface OffsetParameters extends Accessor { /** * The `bevelRatio` is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. When mitered is specified, the value set for `bevelRatio` is ignored and `10` is used internally. If beveled is specified, `1.1` will be used if no value is set for bevelRatio. The bevelRatio is ignored when `rounded` is specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#bevelRatio) */ bevelRatio: number; /** * The array of geometries to be offset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#geometries) */ geometries: Geometry[]; /** * Specifies the planar distance for constructing an offset based on the input geometries. If the `offsetDistance` parameter is positive, the constructed offset will be on the right side of the curve. Left side offsets are constructed with negative values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetDistance) */ offsetDistance: number; /** - * Options that determine how the ends intersect. Set to one of the following options: - * + * Options that determine how the ends intersect. Set to one of the following options: + * * Possible Value | Description * ---------------|------------- * bevelled | Squares off the corner after a given ratio distance. * mitered | Attempts to allow extended offsets to naturally intersect. If the intersection occurs too far from a corner, the corner will be beveled off at a fixed distance. * rounded | Rounds the corner between extended offsets. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetHow) */ offsetHow: string; /** * The offset distance unit. For a list of valid units see [esriSRUnitType constants](http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/esriSRUnitType.htm) or [esriSRUnit2Type constants](http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/esriSRUnit2Type.htm). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetUnit) */ offsetUnit: string; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface OffsetParametersConstructor { - - - new(properties?: OffsetParametersProperties): OffsetParameters; + new (properties?: OffsetParametersProperties): OffsetParameters; } export const OffsetParameters: OffsetParametersConstructor; @@ -33379,38 +35599,38 @@ declare namespace __esri { interface OffsetParametersProperties { /** * The `bevelRatio` is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled. When mitered is specified, the value set for `bevelRatio` is ignored and `10` is used internally. If beveled is specified, `1.1` will be used if no value is set for bevelRatio. The bevelRatio is ignored when `rounded` is specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#bevelRatio) */ bevelRatio?: number; /** * The array of geometries to be offset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#geometries) */ geometries?: GeometryProperties[]; /** * Specifies the planar distance for constructing an offset based on the input geometries. If the `offsetDistance` parameter is positive, the constructed offset will be on the right side of the curve. Left side offsets are constructed with negative values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetDistance) */ offsetDistance?: number; /** - * Options that determine how the ends intersect. Set to one of the following options: - * + * Options that determine how the ends intersect. Set to one of the following options: + * * Possible Value | Description * ---------------|------------- * bevelled | Squares off the corner after a given ratio distance. * mitered | Attempts to allow extended offsets to naturally intersect. If the intersection occurs too far from a corner, the corner will be beveled off at a fixed distance. * rounded | Rounds the corner between extended offsets. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetHow) */ offsetHow?: string; /** * The offset distance unit. For a list of valid units see [esriSRUnitType constants](http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/esriSRUnitType.htm) or [esriSRUnit2Type constants](http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriGeometry/esriSRUnit2Type.htm). **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html#offsetUnit) */ offsetUnit?: string; @@ -33419,13 +35639,13 @@ declare namespace __esri { interface ParameterValue extends Accessor, JSONSupport { /** * Specifies the parameter's data type. **Possible Values:** string | double | long | boolean | date | linear-unit | data-file | raster-data | record-set | raster-data-layer | feature-record-set-layer | multi-value - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ParameterValue.html#dataType) */ dataType: string; /** - * The value of the parameter. The data structure of this value depends on the `dataType`. - * + * The value of the parameter. The data structure of this value depends on the `dataType`. + * * Data Type | JavaScript Type * ----------|---------------- * string | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) @@ -33440,17 +35660,15 @@ declare namespace __esri { * raster-data-layer | [RasterData](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html) * feature-record-set-layer | [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) * multi-value | [String[]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ParameterValue.html#value) */ value: any; } interface ParameterValueConstructor { - - - new(properties?: ParameterValueProperties): ParameterValue; + new (properties?: ParameterValueProperties): ParameterValue; fromJSON(json: any): ParameterValue; } @@ -33460,13 +35678,13 @@ declare namespace __esri { interface ParameterValueProperties { /** * Specifies the parameter's data type. **Possible Values:** string | double | long | boolean | date | linear-unit | data-file | raster-data | record-set | raster-data-layer | feature-record-set-layer | multi-value - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ParameterValue.html#dataType) */ dataType?: string; /** - * The value of the parameter. The data structure of this value depends on the `dataType`. - * + * The value of the parameter. The data structure of this value depends on the `dataType`. + * * Data Type | JavaScript Type * ----------|---------------- * string | [String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) @@ -33481,8 +35699,8 @@ declare namespace __esri { * raster-data-layer | [RasterData](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html) * feature-record-set-layer | [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) * multi-value | [String[]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ParameterValue.html#value) */ value?: any; @@ -33491,34 +35709,32 @@ declare namespace __esri { interface PrintParameters extends Accessor { /** * Additional parameters for the print service. When an arcpy script is published as a custom print service there may be additional parameters associated with the print service. To determine the extra parameters visit the ArcGIS REST Services Directory page for the print service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#extraParameters) */ extraParameters: any; /** * Specify the output spatial reference for the printout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * Defines the layout template used for the printed map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#template) */ template: PrintTemplate; /** * The view to print. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#view) */ view: MapView; } interface PrintParametersConstructor { - - - new(properties?: PrintParametersProperties): PrintParameters; + new (properties?: PrintParametersProperties): PrintParameters; } export const PrintParameters: PrintParametersConstructor; @@ -33526,25 +35742,25 @@ declare namespace __esri { interface PrintParametersProperties { /** * Additional parameters for the print service. When an arcpy script is published as a custom print service there may be additional parameters associated with the print service. To determine the extra parameters visit the ArcGIS REST Services Directory page for the print service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#extraParameters) */ extraParameters?: any; /** * Specify the output spatial reference for the printout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * Defines the layout template used for the printed map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#template) */ template?: PrintTemplateProperties; /** * The view to print. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintParameters.html#view) */ view?: MapViewProperties; @@ -33553,37 +35769,37 @@ declare namespace __esri { interface PrintTemplate extends Accessor { /** * When `false`, the attribution is not displayed on the printout. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layout) value is `map-only`. Reference our policies on [Licensing & Attribution](https://developers.arcgis.com/javascript/latest/guide/licensing/) for specific attribution requirements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#attributionVisible) - * + * * @default true */ attributionVisible: boolean; /** * Define the map width, height and dpi. Required when `layout = 'map-only'`. See the object specification table below for available options to set for exportOptions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) */ exportOptions: PrintTemplateExportOptions; /** * When true, the feature's attributes are included in feature collection layers even when they are not needed for rendering. By default they are removed to reduce the request size. Only applicable to custom print services which use the feature attributes, for example to display a table of features and their attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#forceFeatureAttributes) - * + * * @default false */ forceFeatureAttributes: boolean; /** * The output format for the printed map. **Possible Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#format) - * + * * @default png32 */ format: string; /** * The layout used for the print output. When the value is `map-only` or is empty, the output map does not contain any page layout surroundings (for example, title, legend, scale bar and so forth). The print service provides out-of-the-box templates listed in possible values. The server administrator can add additional templates to the print service. Possible values are listed below: - * + * * Value | Description * | --- | --- * map-only | Map does not contain any layout elements. Only map image is printed. @@ -33595,49 +35811,47 @@ declare namespace __esri { * letter-ansi-a-portrait | Letter ANSI A Portrait * tabloid-ansi-b-landscape| Tabloid ANSI B Landscape * tabloid-ansi-b-portrait | Tabloid ANSI B Portrait - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layout) - * + * * @default map-only */ layout: string; /** * Defines the layout elements. It's an object with the following properties: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) */ layoutOptions: PrintTemplateLayoutOptions; /** * The optional map scale of the printed map. Only applies when `preserveScale = true`. If `outScale` is less than 1, then the printed map will use the scale of the input map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#outScale) - * + * * @default 0 */ outScale: number; /** * Define whether the printed map should preserve map scale or map extent. If `true`, the printed map will use the `outScale` property or default to the scale of the input map. If `false`, the printed map will use the same extent as the input map and thus scale might change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#preserveScale) - * + * * @default true */ preserveScale: boolean; /** * When `true`, labels will be shown on the layout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#showLabels) - * + * * @default true */ showLabels: boolean; } interface PrintTemplateConstructor { - - - new(properties?: PrintTemplateProperties): PrintTemplate; + new (properties?: PrintTemplateProperties): PrintTemplate; } export const PrintTemplate: PrintTemplateConstructor; @@ -33645,37 +35859,37 @@ declare namespace __esri { interface PrintTemplateProperties { /** * When `false`, the attribution is not displayed on the printout. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layout) value is `map-only`. Reference our policies on [Licensing & Attribution](https://developers.arcgis.com/javascript/latest/guide/licensing/) for specific attribution requirements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#attributionVisible) - * + * * @default true */ attributionVisible?: boolean; /** * Define the map width, height and dpi. Required when `layout = 'map-only'`. See the object specification table below for available options to set for exportOptions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) */ exportOptions?: PrintTemplateExportOptions; /** * When true, the feature's attributes are included in feature collection layers even when they are not needed for rendering. By default they are removed to reduce the request size. Only applicable to custom print services which use the feature attributes, for example to display a table of features and their attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#forceFeatureAttributes) - * + * * @default false */ forceFeatureAttributes?: boolean; /** * The output format for the printed map. **Possible Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#format) - * + * * @default png32 */ format?: string; /** * The layout used for the print output. When the value is `map-only` or is empty, the output map does not contain any page layout surroundings (for example, title, legend, scale bar and so forth). The print service provides out-of-the-box templates listed in possible values. The server administrator can add additional templates to the print service. Possible values are listed below: - * + * * Value | Description * | --- | --- * map-only | Map does not contain any layout elements. Only map image is printed. @@ -33687,104 +35901,102 @@ declare namespace __esri { * letter-ansi-a-portrait | Letter ANSI A Portrait * tabloid-ansi-b-landscape| Tabloid ANSI B Landscape * tabloid-ansi-b-portrait | Tabloid ANSI B Portrait - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layout) - * + * * @default map-only */ layout?: string; /** * Defines the layout elements. It's an object with the following properties: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) */ layoutOptions?: PrintTemplateLayoutOptions; /** * The optional map scale of the printed map. Only applies when `preserveScale = true`. If `outScale` is less than 1, then the printed map will use the scale of the input map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#outScale) - * + * * @default 0 */ outScale?: number; /** * Define whether the printed map should preserve map scale or map extent. If `true`, the printed map will use the `outScale` property or default to the scale of the input map. If `false`, the printed map will use the same extent as the input map and thus scale might change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#preserveScale) - * + * * @default true */ preserveScale?: boolean; /** * When `true`, labels will be shown on the layout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#showLabels) - * + * * @default true */ showLabels?: boolean; } - export interface PrintTemplateExportOptions extends Object { /** * Map width. Default value is 800. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) */ width?: number; /** * Map height. Default value is 1100. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) */ height?: number; /** * Resolution in dots per inch. If modified when `layout = 'map-only'`, the `width` and `height` will also need to be modified proportional to the `dpi` change. Default value is 96. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#exportOptions) */ dpi?: number; } - export interface PrintTemplateLayoutOptions extends Object { /** * The text used for the map title if the specified layout contains a title text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) */ titleText: string; /** * The text used for the author if the specified layout contains an author text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) */ authorText: string; /** * The text used for the copyright if the specified layout contains an copyright text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) */ copyrightText: string; /** * The unit used for the scalebar. **Possible Values:** `Miles` | `Kilometers` | `Meters` | `Feet` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) - * + * * @default Miles */ scalebarUnit?: string; /** * An array of [LegendLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-LegendLayer.html) containing the id's of the layers that will be included in the legend. If `legendLayers` is not specified, all operational layers (non-tiled layers) will be present in the legend. To specify that no layers will be included in the legend set `legendLayer = []`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) */ legendLayers: LegendLayer[]; /** * An array of name-value pairs. Use this property to update the text for custom text elements on the page layout. Values must be strings. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html#layoutOptions) */ customTextElements: any[]; @@ -33793,49 +36005,47 @@ declare namespace __esri { interface ProjectParameters extends Accessor { /** * The input geometries to project. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#geometries) */ geometries: Geometry[]; /** * The spatial reference to which you are projecting the geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * The spatial reference to which you are projecting the geometries. Use [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSpatialReference) instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSR) */ outSR: SpatialReference; /** * The well-known id {wkid:number} or well-known text {wkt:string} of the datum transformation to be applied to the projected geometries. See [Datum transformations](https://developers.arcgis.com/rest/services-reference/datum-transformations.htm) for a list of valid datum transformations that may be used here. If a transformation is specified, a value must also be specified in the [transformForward](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformForward) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformation) */ transformation: ProjectParametersTransformation; /** * Indicates whether to transform forward or not. The forward or reverse direction of transformation is implied in the name of the transformation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformForward) */ transformForward: boolean; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface ProjectParametersConstructor { - - - new(properties?: ProjectParametersProperties): ProjectParameters; + new (properties?: ProjectParametersProperties): ProjectParameters; } export const ProjectParameters: ProjectParametersConstructor; @@ -33843,47 +36053,46 @@ declare namespace __esri { interface ProjectParametersProperties { /** * The input geometries to project. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#geometries) */ geometries?: GeometryProperties[]; /** * The spatial reference to which you are projecting the geometries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * The spatial reference to which you are projecting the geometries. Use [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSpatialReference) instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#outSR) */ outSR?: SpatialReferenceProperties; /** * The well-known id {wkid:number} or well-known text {wkt:string} of the datum transformation to be applied to the projected geometries. See [Datum transformations](https://developers.arcgis.com/rest/services-reference/datum-transformations.htm) for a list of valid datum transformations that may be used here. If a transformation is specified, a value must also be specified in the [transformForward](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformForward) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformation) */ transformation?: ProjectParametersTransformation; /** * Indicates whether to transform forward or not. The forward or reverse direction of transformation is implied in the name of the transformation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformForward) */ transformForward?: boolean; } - export interface ProjectParametersTransformation extends Object { /** * The well-known ID of the datum transformation to apply to the projection. [List of valid IDs for Datum transformations](https://developers.arcgis.com/rest/services-reference/datum-transformations.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformation) */ wkid?: number; /** * The well-known text that defines a spatial reference. Many browsers have a limit to the length of a GET request of approximately 2048 characters. When using well-known text to specify the spatial reference you can easily exceed this limit. In these cases, you will need to [setup and use a proxy page](https://developers.arcgis.com/javascript/latest/guide/proxies/index.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ProjectParameters.html#transformation) */ wkt?: string; @@ -33892,202 +36101,202 @@ declare namespace __esri { interface Query extends Accessor, JSONSupport { /** * Datum transformation used for projecting geometries in the query results when [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) is different than the layer's spatial reference. Requires ArcGIS Server service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#datumTransformation) */ datumTransformation: number; /** * Specifies a search distance from a given [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) in a spatial query. The [units property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units) indicates the unit of measurement. In essence, setting this property creates a buffer at the specified size around the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). The query will use that buffer to return features in the layer or layer view that adhere to the to the indicated [spatial relationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship). If querying a feature service, the [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) capability must be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) */ distance: number; /** * Specifies the geodatabase version to display for feature service queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#gdbVersion) */ gdbVersion: string; /** - * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) will indicate how the geometry should be used to query features. + * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) will indicate how the geometry should be used to query features. * > **Known Limitations** [Mesh](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html) geometry types are currently not supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) */ geometry: Geometry; /** * Specifies the number of decimal places for geometries returned by the query operation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometryPrecision) */ geometryPrecision: number; /** * Used only in [statistical queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#statistic). When one or more field names are provided in this property, the output statisics will be grouped based on unique values from those fields. This is only valid when [outStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) has been defined. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics) */ groupByFieldsForStatistics: string[]; /** * A condition used with [outStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) and [groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics) to limit query results to groups that satisfy the aggregation function(s). The following aggregation functions are supported in this clause: `MIN` | `MAX` | `AVG` | `SUM` | `STDDEV` | `COUNT` | `VAR` Aggregation functions used in `having` must be included in the `outStatistics` as well. See the snippet below for an example of how this works. For service-based layer queries, this parameter applies only if the [supportsHavingClause](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property of the layer is `true`. This property is supported on all [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#having) */ having: string; /** * The historic moment to query. This parameter applies only if the `supportsQueryWithHistoricMoment` capability of the service being queried is `true`. This setting is provided in the layer resource. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#historicMoment) */ historicMoment: Date; /** - * The maximum distance in units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) used for generalizing geometries returned by the query operation. It limits how far any part of the generalized geometry can be from the original geometry. If `outSpatialReference` is not defined, the spatialReference of the data is used. + * The maximum distance in units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) used for generalizing geometries returned by the query operation. It limits how far any part of the generalized geometry can be from the original geometry. If `outSpatialReference` is not defined, the spatialReference of the data is used. * > **Known Limitations** This property does not apply to [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxAllowableOffset) */ maxAllowableOffset: number; /** - * When set, the maximum number of features returned by the query will equal the `maxRecordCount` of the service multiplied by this factor. The value of this property may not exceed `5`. For example, if the `maxRecordCount` of your feature service is `2000`, and you set the `maxRecordCountFactor` to `5`, then the maximum number of features that could be returned by the query is `10000`. + * When set, the maximum number of features returned by the query will equal the `maxRecordCount` of the service multiplied by this factor. The value of this property may not exceed `5`. For example, if the `maxRecordCount` of your feature service is `2000`, and you set the `maxRecordCountFactor` to `5`, then the maximum number of features that could be returned by the query is `10000`. * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxRecordCountFactor) - * + * * @default 1 */ maxRecordCountFactor: number; /** * Parameter dictates how the geometry of a multipatch feature will be returned. Currently, the only supported value is `xyFootprint`. If indicated, the xy footprint of each multipatch geometry will be returned in the result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#multipatchOption) */ multipatchOption: string; /** - * The number of features to retrieve. This option should be used in conjunction with the [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start). Use this to implement paging (i.e. to retrieve "pages" of results when querying). If not provided, but an instance of Query has a `start` property, then the default value of `num` is 10. If neither `num` nor `start` properties are provided, then the default value of `num` is equal to the `maxRecordCount` of the service, which can be found at the REST endpoint of the FeatureLayer. + * The number of features to retrieve. This option should be used in conjunction with the [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start). Use this to implement paging (i.e. to retrieve "pages" of results when querying). If not provided, but an instance of Query has a `start` property, then the default value of `num` is 10. If neither `num` nor `start` properties are provided, then the default value of `num` is equal to the `maxRecordCount` of the service, which can be found at the REST endpoint of the FeatureLayer. * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) */ num: number; /** * A comma delimited list of ObjectIDs for the features in the layer being queried. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) */ objectIds: number[]; /** - * One or more field names used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. - * > **Known Limitations** + * One or more field names used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. + * > **Known Limitations** * * If querying a [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), then `supportsAdvancedQueries` must be `true` on the service. * * For [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), `FeatureLayer.capabilities.queryRelated.supportsOrderBy` must be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields) */ orderByFields: string[]; /** - * Attribute fields to include in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). Fields must exist in the service layer. You must list actual field names rather than field aliases. You may, however, use field aliases when you display the results of the query. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the smaller the payload size, and therefore the faster the response of the query. You can also specify SQL expressions as `outFields` to calculate new values server side for the query results. See the example snippets below for an example of this. Each query must have access to the `Shape` and `ObjectId` fields for a layer. However, the list of outFields does not need to include these two fields. - * > **Known Limitations** + * Attribute fields to include in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). Fields must exist in the service layer. You must list actual field names rather than field aliases. You may, however, use field aliases when you display the results of the query. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the smaller the payload size, and therefore the faster the response of the query. You can also specify SQL expressions as `outFields` to calculate new values server side for the query results. See the example snippets below for an example of this. Each query must have access to the `Shape` and `ObjectId` fields for a layer. However, the list of outFields does not need to include these two fields. + * > **Known Limitations** * * If specifying outFields as expressions on a feature service-based [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), the service capabilities `advancedQueryCapabilities.supportsOutFieldSQLExpression` and `useStandardizedQueries` must both be true. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields) */ outFields: string[]; /** - * The spatial reference for the returned geometry. If not specified, the geometry is returned in the spatial reference of the map. - * + * The spatial reference for the returned geometry. If not specified, the geometry is returned in the spatial reference of the queried layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** - * The definitions for one or more field-based statistics to be calculated. If `outStatistics` is specified the only other query parameters that should be used are [groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics), [orderByFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields), [text](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text), and [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where). + * The definitions for one or more field-based statistics to be calculated. If `outStatistics` is specified the only other query parameters that should be used are [groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics), [orderByFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields), [text](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text), and [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where). * > **Known Limitations** For service-based queries, `outStatistics` is only supported on layers where `supportsStatistics = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) */ outStatistics: StatisticDefinition[]; /** * Filters features from the layer based on pre-authored parameterized filters. When value is not specified for any parameter in a request, the default value, that is assigned during authoring time, gets used. Requires an ArcGIS Enterprise service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#parameterValues) */ parameterValues: QueryParameterValues[]; /** * Specifies the pixel level to be identified on the X and Y axis. Defaults to the base resolution of the dataset if not specified. Applicable only to Image Service layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#pixelSize) */ pixelSize: Symbol; /** - * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. + * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. Geometry coordinates are converted to integers by building a grid with a resolution matching the `quantizationParameters.tolerance`. Each coordinate is then snapped to one pixel on the grid. * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6.1 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) */ quantizationParameters: QueryQuantizationParameters; /** * Filters features from the layer that are within the specified range values. Requires ArcGIS Enterprise services 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#rangeValues) */ rangeValues: QueryRangeValues[]; /** - * The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to query the spatial relationship of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) to the layer's features. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: 0,1,2), a Boolean value (T or F), or a mask character (for ignoring results: '*'). Set this parameter when the [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details on how to construct these strings. + * The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to query the spatial relationship of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) to the layer's features. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: 0,1,2), a Boolean value (T or F), or a mask character (for ignoring results: '*'). Set this parameter when the [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details on how to construct these strings. * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) */ relationParameter: string; /** - * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) will be returned with a centroid. This property only applies to queries against polygon [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). + * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) will be returned with a centroid. This property only applies to queries against polygon [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6.1 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnCentroid) - * + * * @default false */ returnCentroid: boolean; /** - * If `true` then the query returns distinct values based on the field(s) specified in [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields). - * > **Known Limitations** + * If `true` then the query returns distinct values based on the field(s) specified in [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields). + * > **Known Limitations** * * For service-based queries, this parameter applies only if the `supportsAdvancedQueries` capability of the layer is `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnDistinctValues) - * + * * @default false */ returnDistinctValues: boolean; /** - * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. + * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnExceededLimitFeatures) - * + * * @default true */ returnExceededLimitFeatures: boolean; /** - * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. + * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. * > **Known Limitations** For [FeatureLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html) queries, the precision of the returned geometries will only be as high as the view's scale resolution since geometries are quantized for improved performance on the view. The smaller the scale, the lower the resolution of the geometries. This limitation does not apply to [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [CSVLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) - * + * * @default false */ returnGeometry: boolean; /** * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then m-values are included in the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnM) */ returnM: boolean; /** * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then z-values are included in the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnZ) */ returnZ: boolean; /** - * For spatial queries, this parameter defines the spatial relationship to query features in the layer or layer view against the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). See the [Types of spatial relationships that can be validated](https://desktop.arcgis.com/en/arcmap/latest/extensions/data-reviewer/types-of-spatial-relationships-that-can-be-validated.htm) document for more details about each spatial relationship. The possible values are listed in the table below: - * + * For spatial queries, this parameter defines the spatial relationship to query features in the layer or layer view against the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). See the [Types of spatial relationships that can be validated](https://desktop.arcgis.com/en/arcmap/latest/extensions/data-reviewer/types-of-spatial-relationships-that-can-be-validated.htm) document for more details about each spatial relationship. The possible values are listed in the table below: + * * Value | Description * ------|------------- * intersects | Returns features from the layer or layer view that intersect the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). @@ -34099,58 +36308,58 @@ declare namespace __esri { * touches | Returns features from the layer or layer view that touch the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). * within | Returns features from the layer or layer view that are completely within the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). If this value is specified, then the [relationParameter](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) must also be specified. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) - * + * * @default intersects */ spatialRelationship: string; /** - * This parameter can be either standard SQL92 `standard` or it can use the native SQL of the underlying datastore `native`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm) for more information. **Possible Values:** none | standard | native + * This parameter can be either standard SQL92 `standard` or it can use the native SQL of the underlying datastore `native`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm) for more information. **Possible Values:** none | standard | native * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#sqlFormat) - * + * * @default none */ sqlFormat: string; /** - * The zero-based index indicating where to begin retrieving features. This property hould be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. + * The zero-based index indicating where to begin retrieving features. This property should be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) */ start: number; /** * Shorthand for a where clause using "like". The field used is the display field defined in the services directory. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text) - * + * * @default null */ text: string; /** - * The unit for calculating the buffer distance when [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) is specified in spatial queries. if `unit` is not specified, the unit is derived from the layer or layer view's [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html). + * The unit for calculating the buffer distance when [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) is specified in spatial queries. if `unit` is not specified, the unit is derived from the layer or layer view's [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html). * > **Known Limitations** For service-based queries, this parameter only applies if [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) is `true`. * **Possible Values:** feet | miles | nautical-miles | us-nautical-miles | meters | kilometers - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units) */ units: string; /** * A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed. Be sure to have the correct sequence of single and double quotes when writing the where clause in JavaScript. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where) */ where: string; /** * Creates a deep clone of Query object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#clone) - * - * + * + * */ clone(): Query; } @@ -34158,11 +36367,11 @@ declare namespace __esri { interface QueryConstructor { /** * This class defines parameters for executing queries for features from a layer or layer view. Once a Query object's properties are defined, it can then be passed into an [executable function](?search=queryfeatures), which will return the features in a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) */ - new(properties?: QueryProperties): Query; + new (properties?: QueryProperties): Query; fromJSON(json: any): Query; } @@ -34172,202 +36381,202 @@ declare namespace __esri { interface QueryProperties { /** * Datum transformation used for projecting geometries in the query results when [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) is different than the layer's spatial reference. Requires ArcGIS Server service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#datumTransformation) */ datumTransformation?: number; /** * Specifies a search distance from a given [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) in a spatial query. The [units property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units) indicates the unit of measurement. In essence, setting this property creates a buffer at the specified size around the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). The query will use that buffer to return features in the layer or layer view that adhere to the to the indicated [spatial relationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship). If querying a feature service, the [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) capability must be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) */ distance?: number; /** * Specifies the geodatabase version to display for feature service queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#gdbVersion) */ gdbVersion?: string; /** - * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) will indicate how the geometry should be used to query features. + * The geometry to apply to the spatial filter. The spatial relationship as specified by [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) will indicate how the geometry should be used to query features. * > **Known Limitations** [Mesh](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Mesh.html) geometry types are currently not supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) */ geometry?: GeometryProperties; /** * Specifies the number of decimal places for geometries returned by the query operation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometryPrecision) */ geometryPrecision?: number; /** * Used only in [statistical queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#statistic). When one or more field names are provided in this property, the output statisics will be grouped based on unique values from those fields. This is only valid when [outStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) has been defined. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics) */ groupByFieldsForStatistics?: string[]; /** * A condition used with [outStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) and [groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics) to limit query results to groups that satisfy the aggregation function(s). The following aggregation functions are supported in this clause: `MIN` | `MAX` | `AVG` | `SUM` | `STDDEV` | `COUNT` | `VAR` Aggregation functions used in `having` must be included in the `outStatistics` as well. See the snippet below for an example of how this works. For service-based layer queries, this parameter applies only if the [supportsHavingClause](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property of the layer is `true`. This property is supported on all [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#having) */ having?: string; /** * The historic moment to query. This parameter applies only if the `supportsQueryWithHistoricMoment` capability of the service being queried is `true`. This setting is provided in the layer resource. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#historicMoment) */ historicMoment?: DateProperties; /** - * The maximum distance in units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) used for generalizing geometries returned by the query operation. It limits how far any part of the generalized geometry can be from the original geometry. If `outSpatialReference` is not defined, the spatialReference of the data is used. + * The maximum distance in units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) used for generalizing geometries returned by the query operation. It limits how far any part of the generalized geometry can be from the original geometry. If `outSpatialReference` is not defined, the spatialReference of the data is used. * > **Known Limitations** This property does not apply to [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxAllowableOffset) */ maxAllowableOffset?: number; /** - * When set, the maximum number of features returned by the query will equal the `maxRecordCount` of the service multiplied by this factor. The value of this property may not exceed `5`. For example, if the `maxRecordCount` of your feature service is `2000`, and you set the `maxRecordCountFactor` to `5`, then the maximum number of features that could be returned by the query is `10000`. + * When set, the maximum number of features returned by the query will equal the `maxRecordCount` of the service multiplied by this factor. The value of this property may not exceed `5`. For example, if the `maxRecordCount` of your feature service is `2000`, and you set the `maxRecordCountFactor` to `5`, then the maximum number of features that could be returned by the query is `10000`. * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxRecordCountFactor) - * + * * @default 1 */ maxRecordCountFactor?: number; /** * Parameter dictates how the geometry of a multipatch feature will be returned. Currently, the only supported value is `xyFootprint`. If indicated, the xy footprint of each multipatch geometry will be returned in the result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#multipatchOption) */ multipatchOption?: string; /** - * The number of features to retrieve. This option should be used in conjunction with the [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start). Use this to implement paging (i.e. to retrieve "pages" of results when querying). If not provided, but an instance of Query has a `start` property, then the default value of `num` is 10. If neither `num` nor `start` properties are provided, then the default value of `num` is equal to the `maxRecordCount` of the service, which can be found at the REST endpoint of the FeatureLayer. + * The number of features to retrieve. This option should be used in conjunction with the [start property](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start). Use this to implement paging (i.e. to retrieve "pages" of results when querying). If not provided, but an instance of Query has a `start` property, then the default value of `num` is 10. If neither `num` nor `start` properties are provided, then the default value of `num` is equal to the `maxRecordCount` of the service, which can be found at the REST endpoint of the FeatureLayer. * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) */ num?: number; /** * A comma delimited list of ObjectIDs for the features in the layer being queried. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds) */ objectIds?: number[]; /** - * One or more field names used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. - * > **Known Limitations** + * One or more field names used to order the query results. Specfiy `ASC` (ascending) or `DESC` (descending) after the field name to control the order. The default order is `ASC`. + * > **Known Limitations** * * If querying a [MapImageLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html), then `supportsAdvancedQueries` must be `true` on the service. * * For [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), `FeatureLayer.capabilities.queryRelated.supportsOrderBy` must be `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields) */ orderByFields?: string[]; /** - * Attribute fields to include in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). Fields must exist in the service layer. You must list actual field names rather than field aliases. You may, however, use field aliases when you display the results of the query. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the smaller the payload size, and therefore the faster the response of the query. You can also specify SQL expressions as `outFields` to calculate new values server side for the query results. See the example snippets below for an example of this. Each query must have access to the `Shape` and `ObjectId` fields for a layer. However, the list of outFields does not need to include these two fields. - * > **Known Limitations** + * Attribute fields to include in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). Fields must exist in the service layer. You must list actual field names rather than field aliases. You may, however, use field aliases when you display the results of the query. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the smaller the payload size, and therefore the faster the response of the query. You can also specify SQL expressions as `outFields` to calculate new values server side for the query results. See the example snippets below for an example of this. Each query must have access to the `Shape` and `ObjectId` fields for a layer. However, the list of outFields does not need to include these two fields. + * > **Known Limitations** * * If specifying outFields as expressions on a feature service-based [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), the service capabilities `advancedQueryCapabilities.supportsOutFieldSQLExpression` and `useStandardizedQueries` must both be true. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields) */ outFields?: string[]; /** - * The spatial reference for the returned geometry. If not specified, the geometry is returned in the spatial reference of the map. - * + * The spatial reference for the returned geometry. If not specified, the geometry is returned in the spatial reference of the queried layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** - * The definitions for one or more field-based statistics to be calculated. If `outStatistics` is specified the only other query parameters that should be used are [groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics), [orderByFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields), [text](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text), and [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where). + * The definitions for one or more field-based statistics to be calculated. If `outStatistics` is specified the only other query parameters that should be used are [groupByFieldsForStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#groupByFieldsForStatistics), [orderByFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#orderByFields), [text](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text), and [where](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where). * > **Known Limitations** For service-based queries, `outStatistics` is only supported on layers where `supportsStatistics = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outStatistics) */ outStatistics?: StatisticDefinitionProperties[]; /** * Filters features from the layer based on pre-authored parameterized filters. When value is not specified for any parameter in a request, the default value, that is assigned during authoring time, gets used. Requires an ArcGIS Enterprise service 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#parameterValues) */ parameterValues?: QueryParameterValues[]; /** * Specifies the pixel level to be identified on the X and Y axis. Defaults to the base resolution of the dataset if not specified. Applicable only to Image Service layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#pixelSize) */ pixelSize?: SymbolProperties; /** - * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. + * Used to project the geometry onto a virtual grid, likely representing pixels on the screen. Geometry coordinates are converted to integers by building a grid with a resolution matching the `quantizationParameters.tolerance`. Each coordinate is then snapped to one pixel on the grid. * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6.1 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) */ quantizationParameters?: QueryQuantizationParameters; /** * Filters features from the layer that are within the specified range values. Requires ArcGIS Enterprise services 10.5 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#rangeValues) */ rangeValues?: QueryRangeValues[]; /** - * The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to query the spatial relationship of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) to the layer's features. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: 0,1,2), a Boolean value (T or F), or a mask character (for ignoring results: '*'). Set this parameter when the [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details on how to construct these strings. + * The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to query the spatial relationship of the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry) to the layer's features. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned: 0,1,2), a Boolean value (T or F), or a mask character (for ignoring results: '*'). Set this parameter when the [spatialRelationship](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) is `relation`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details on how to construct these strings. * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) */ relationParameter?: string; /** - * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) will be returned with a centroid. This property only applies to queries against polygon [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). + * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) will be returned with a centroid. This property only applies to queries against polygon [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6.1 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnCentroid) - * + * * @default false */ returnCentroid?: boolean; /** - * If `true` then the query returns distinct values based on the field(s) specified in [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields). - * > **Known Limitations** + * If `true` then the query returns distinct values based on the field(s) specified in [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields). + * > **Known Limitations** * * For service-based queries, this parameter applies only if the `supportsAdvancedQueries` capability of the layer is `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnDistinctValues) - * + * * @default false */ returnDistinctValues?: boolean; /** - * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. + * If `true`, then all features are returned for each tile request, even if they exceed the maximum record limit per query indicated on the service by `maxRecordCount`. If `false`, the tile request will not return any features if the `maxRecordCount` limit is exceeded. * > **Known Limitations** Only supported with ArcGIS Online hosted services or ArcGIS Enterprise 10.6 services. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnExceededLimitFeatures) - * + * * @default true */ returnExceededLimitFeatures?: boolean; /** - * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. + * If `true`, each feature in the returned [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. * > **Known Limitations** For [FeatureLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html) queries, the precision of the returned geometries will only be as high as the view's scale resolution since geometries are quantized for improved performance on the view. The smaller the scale, the lower the resolution of the geometries. This limitation does not apply to [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), and [CSVLayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) - * + * * @default false */ returnGeometry?: boolean; /** * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then m-values are included in the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnM) */ returnM?: boolean; /** * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnGeometry) is `true`, then z-values are included in the geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#returnZ) */ returnZ?: boolean; /** - * For spatial queries, this parameter defines the spatial relationship to query features in the layer or layer view against the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). See the [Types of spatial relationships that can be validated](https://desktop.arcgis.com/en/arcmap/latest/extensions/data-reviewer/types-of-spatial-relationships-that-can-be-validated.htm) document for more details about each spatial relationship. The possible values are listed in the table below: - * + * For spatial queries, this parameter defines the spatial relationship to query features in the layer or layer view against the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). See the [Types of spatial relationships that can be validated](https://desktop.arcgis.com/en/arcmap/latest/extensions/data-reviewer/types-of-spatial-relationships-that-can-be-validated.htm) document for more details about each spatial relationship. The possible values are listed in the table below: + * * Value | Description * ------|------------- * intersects | Returns features from the layer or layer view that intersect the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). @@ -34379,110 +36588,109 @@ declare namespace __esri { * touches | Returns features from the layer or layer view that touch the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). * within | Returns features from the layer or layer view that are completely within the input [geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#geometry). * relation | Allows specification of any relationship defined using the [Shape Comparison Language](http://resources.esri.com/help/9.3/arcgisengine/dotnet/concepts_start.htm#40de6491-9b2d-440d-848b-2609efcd46b1.htm). If this value is specified, then the [relationParameter](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#relationParameter) must also be specified. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#spatialRelationship) - * + * * @default intersects */ spatialRelationship?: string; /** - * This parameter can be either standard SQL92 `standard` or it can use the native SQL of the underlying datastore `native`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm) for more information. **Possible Values:** none | standard | native + * This parameter can be either standard SQL92 `standard` or it can use the native SQL of the underlying datastore `native`. See the [ArcGIS REST API documentation](https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm) for more information. **Possible Values:** none | standard | native * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#sqlFormat) - * + * * @default none */ sqlFormat?: string; /** - * The zero-based index indicating where to begin retrieving features. This property hould be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. + * The zero-based index indicating where to begin retrieving features. This property should be used in conjunction with [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num). Use this to implement paging and retrieve "pages" of results when querying. Features are sorted ascending by object ID by default. * > **Known Limitations** This property does not apply to layer view or [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html) queries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) */ start?: number; /** * Shorthand for a where clause using "like". The field used is the display field defined in the services directory. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#text) - * + * * @default null */ text?: string; /** - * The unit for calculating the buffer distance when [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) is specified in spatial queries. if `unit` is not specified, the unit is derived from the layer or layer view's [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html). + * The unit for calculating the buffer distance when [distance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#distance) is specified in spatial queries. if `unit` is not specified, the unit is derived from the layer or layer view's [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html). * > **Known Limitations** For service-based queries, this parameter only applies if [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm) is `true`. * **Possible Values:** feet | miles | nautical-miles | us-nautical-miles | meters | kilometers - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#units) */ units?: string; /** * A where clause for the query. Any legal SQL where clause operating on the fields in the layer is allowed. Be sure to have the correct sequence of single and double quotes when writing the where clause in JavaScript. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#where) */ where?: string; } - export interface QueryParameterValues extends Object { /** * The parameter name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#parameterValues) */ name: string; /** * Single value or array of values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#parameterValues) */ value: string | string[] | number | number[] | Date | Date[]; } - export interface QueryQuantizationParameters extends Object { /** * An extent defining the quantization grid bounds. Its [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) matches the input geometry spatial reference if one is specified for the query. Otherwise, the extent will be in the layer's spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) */ extent?: Extent; /** - * Geometry coordinates are optimized for viewing and displaying of data. **Possible Values:** view - * + * Geometry coordinates are optimized for viewing and displaying of data. **Possible Values:** view | edit + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) */ mode?: string; /** - * The integer's coordinates will be returned relative to the origin position defined by this property value. **Possible Values:** upper-left | lower-left - * + * The integer's coordinates will be returned relative to the origin position defined by this property value. **Possible Values:** upper-left | lower-left + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) - * + * * @default upper-left */ originPosition?: string; /** - * The size of one pixel in the units of outSpatialReference. This number is used to convert coordinates to integers by building a grid with a resolution matching the tolerance. Each coordinate is then snapped to one pixel on the grid. Consecutive coordinates snapped to the same pixel are removed for reducing the overall response size. The units of tolerance will match the units of outSpatialReference. If outSpatialReference is not specified, then tolerance is assumed to be in the units of the spatial reference of the layer. If tolerance is not specified, the maxAllowableOffset is used. If tolerance and maxAllowableOffset are not specified, a grid of 10,000 * 10,000 grid is used by default. - * + * The size of one pixel in the units of the [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference). This number is used to convert coordinates to integers by building a grid with a resolution matching the tolerance. Each coordinate is then snapped to one pixel on the grid. Consecutive coordinates snapped to the same pixel are removed for reducing the overall response size. The units of tolerance will match the units of [outSpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outSpatialReference). If `outSpatialReference` is not specified, then tolerance is assumed to be in the units of the spatial reference of the layer. If tolerance is not specified, the [maxAllowableOffset](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#maxAllowableOffset) is used. If tolerance and `maxAllowableOffset` are not specified, a grid of 10,000 * 10,000 grid is used by default. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#quantizationParameters) + * + * @default 1 */ tolerance?: number; } - export interface QueryRangeValues extends Object { /** * The range id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#rangeValues) */ name: string; /** * Single value or value range. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#rangeValues) */ values: number | number[]; @@ -34491,28 +36699,26 @@ declare namespace __esri { interface RasterData extends Accessor, JSONSupport { /** * Specifies the format of the raster data, such as "jpg", "tif", etc. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#format) */ format: string; /** * The ID of the uploaded file returned as a result of the upload operation. For ArcGIS Server 10.1 and greater, this class can be used to specify an uploaded item as input by specifying the ItemID. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#itemId) */ itemId: string; /** * URL to the location of the raster data file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#url) */ url: string; } interface RasterDataConstructor { - - - new(properties?: RasterDataProperties): RasterData; + new (properties?: RasterDataProperties): RasterData; fromJSON(json: any): RasterData; } @@ -34522,19 +36728,19 @@ declare namespace __esri { interface RasterDataProperties { /** * Specifies the format of the raster data, such as "jpg", "tif", etc. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#format) */ format?: string; /** * The ID of the uploaded file returned as a result of the upload operation. For ArcGIS Server 10.1 and greater, this class can be used to specify an uploaded item as input by specifying the ItemID. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#itemId) */ itemId?: string; /** * URL to the location of the raster data file. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RasterData.html#url) */ url?: string; @@ -34543,19 +36749,19 @@ declare namespace __esri { interface RelationParameters extends Accessor { /** * The first array of geometries to compute the relation. The structure of each geometry in the array is same as the structure of the json geometry objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#geometries1) */ geometries1: Geometry[]; /** * The second array of geometries to compute the relation. The structure of each geometry in the array is same as the structure of the json geometry objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#geometries2) */ geometries2: Geometry[]; /** - * The spatial relationship to be tested between the two input geometry arrays. See table below for a list of possible values. If the relation is specified as `relation`, the `relationParamater` parameter describes the spatial relationship and must be specified. - * + * The spatial relationship to be tested between the two input geometry arrays. See table below for a list of possible values. If the relation is specified as `relation`, the `relationParamater` parameter describes the spatial relationship and must be specified. + * * Value | Description * ------|------------ * cross | Two polylines cross if they share only points in common, at least one of which is not an endpoint. A polyline and an polygon cross if they share a polyline in common on the interior of the polygon which is not equivalent to the entire polyline. Cross is a Clementini operator. If either one of the geometries is empty, the geometries do not cross. @@ -34570,32 +36776,30 @@ declare namespace __esri { * relation | Allows specification of any relationship defined using the Shape Comparison Language. If this value is used, a value for `relationParameter` must be specified. * touch | The union of point touch and line touch. Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. For example, a point touches a polyline only if the point is coincident with one of the polyline end points. If either one of the two geometries is empty, the geometries are not touched. * within | Same as `in` but also allows polylines that are strictly on the boundaries of polygons to be considered in the polygon. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#relation) */ relation: string; /** * The string describes the spatial relationship to be tested when `RelationParameters.relation = 'relation'`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details. An example of a valid string is: `FFFTTT**`. Also see the description of [geometryEngine.relate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#relate) for additional examples of valid strings. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#relationParameter) */ relationParameter: string; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface RelationParametersConstructor { - - - new(properties?: RelationParametersProperties): RelationParameters; + new (properties?: RelationParametersProperties): RelationParameters; } export const RelationParameters: RelationParametersConstructor; @@ -34603,19 +36807,19 @@ declare namespace __esri { interface RelationParametersProperties { /** * The first array of geometries to compute the relation. The structure of each geometry in the array is same as the structure of the json geometry objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#geometries1) */ geometries1?: GeometryProperties[]; /** * The second array of geometries to compute the relation. The structure of each geometry in the array is same as the structure of the json geometry objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#geometries2) */ geometries2?: GeometryProperties[]; /** - * The spatial relationship to be tested between the two input geometry arrays. See table below for a list of possible values. If the relation is specified as `relation`, the `relationParamater` parameter describes the spatial relationship and must be specified. - * + * The spatial relationship to be tested between the two input geometry arrays. See table below for a list of possible values. If the relation is specified as `relation`, the `relationParamater` parameter describes the spatial relationship and must be specified. + * * Value | Description * ------|------------ * cross | Two polylines cross if they share only points in common, at least one of which is not an endpoint. A polyline and an polygon cross if they share a polyline in common on the interior of the polygon which is not equivalent to the entire polyline. Cross is a Clementini operator. If either one of the geometries is empty, the geometries do not cross. @@ -34630,14 +36834,14 @@ declare namespace __esri { * relation | Allows specification of any relationship defined using the Shape Comparison Language. If this value is used, a value for `relationParameter` must be specified. * touch | The union of point touch and line touch. Two geometries are said to touch when the intersection of the geometries is non-empty, but the intersection of their interiors is empty. For example, a point touches a polyline only if the point is coincident with one of the polyline end points. If either one of the two geometries is empty, the geometries are not touched. * within | Same as `in` but also allows polylines that are strictly on the boundaries of polygons to be considered in the polygon. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#relation) */ relation?: string; /** * The string describes the spatial relationship to be tested when `RelationParameters.relation = 'relation'`. The [Relational functions for ST_Geometry](https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/relational-functions-for-st-geometry.htm) topic has additional details. An example of a valid string is: `FFFTTT**`. Also see the description of [geometryEngine.relate()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#relate) for additional examples of valid strings. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationParameters.html#relationParameter) */ relationParameter?: string; @@ -34646,81 +36850,79 @@ declare namespace __esri { interface RelationshipQuery extends Accessor, JSONSupport { /** * The definition expression to be applied to the related table or layer. Only records in the list of [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#objectIds) that satisfy the definition expression are queried for related records. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#definitionExpression) */ definitionExpression: string; /** * Specify the geodatabase version to query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#gdbVersion) */ gdbVersion: string; /** * Specify the number of decimal places for the geometries returned by the query operation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#geometryPrecision) */ geometryPrecision: number; /** * The historic moment to query. This parameter applies only if the `supportsHistoricMoment` on [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property of the layer is set to `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#historicMoment) */ historicMoment: Date; /** * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of `outSpatialReference`. If `outSpatialReference` is not defined, the [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference) of the view is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#maxAllowableOffset) */ maxAllowableOffset: number; /** * An array of objectIds for the features in the layer/table being queried. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#objectIds) */ objectIds: number[]; /** * Attribute fields to include in the FeatureSet. Fields must exist in the map layer. You must list actual field names rather than the alias names. You are, however, able to use the alias names when you display the results. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the faster the response will be. Each query must have access to the Shape and ObjectId fields for a layer. However, your list of fields does not need to include these two fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#outFields) */ outFields: string[]; /** * The spatial reference for the returned geometry. If `outSpatialReference` is not defined, the [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference) of the view is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * The ID of the relationship to be queried. The ids for the relationships the table or layer participates in are listed in the ArcGIS Services directory. The ID of the relationship to be queried. The relationships that this layer/table participates in are included in the Feature Service Layer resource response. Records in tables/layers corresponding to the related table/layer of the relationship are queried. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#relationshipId) */ relationshipId: number; /** * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. Set to `false` (default) if you do not plan to include highlighted features on a map since the geometry makes up a significant portion of the response. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#returnGeometry) - * + * * @default false */ returnGeometry: boolean; /** * Creates a deep clone of RelationshipQuery object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#clone) - * - * + * + * */ clone(): RelationshipQuery; } interface RelationshipQueryConstructor { - - - new(properties?: RelationshipQueryProperties): RelationshipQuery; + new (properties?: RelationshipQueryProperties): RelationshipQuery; fromJSON(json: any): RelationshipQuery; } @@ -34730,63 +36932,63 @@ declare namespace __esri { interface RelationshipQueryProperties { /** * The definition expression to be applied to the related table or layer. Only records in the list of [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#objectIds) that satisfy the definition expression are queried for related records. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#definitionExpression) */ definitionExpression?: string; /** * Specify the geodatabase version to query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#gdbVersion) */ gdbVersion?: string; /** * Specify the number of decimal places for the geometries returned by the query operation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#geometryPrecision) */ geometryPrecision?: number; /** * The historic moment to query. This parameter applies only if the `supportsHistoricMoment` on [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#capabilities) property of the layer is set to `true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#historicMoment) */ historicMoment?: DateProperties; /** * The maximum allowable offset used for generalizing geometries returned by the query operation. The offset is in the units of `outSpatialReference`. If `outSpatialReference` is not defined, the [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference) of the view is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#maxAllowableOffset) */ maxAllowableOffset?: number; /** * An array of objectIds for the features in the layer/table being queried. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#objectIds) */ objectIds?: number[]; /** * Attribute fields to include in the FeatureSet. Fields must exist in the map layer. You must list actual field names rather than the alias names. You are, however, able to use the alias names when you display the results. When specifying the output fields, you should limit the fields to only those you expect to use in the query or the results. The fewer fields you include, the faster the response will be. Each query must have access to the Shape and ObjectId fields for a layer. However, your list of fields does not need to include these two fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#outFields) */ outFields?: string[]; /** * The spatial reference for the returned geometry. If `outSpatialReference` is not defined, the [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference) of the view is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * The ID of the relationship to be queried. The ids for the relationships the table or layer participates in are listed in the ArcGIS Services directory. The ID of the relationship to be queried. The relationships that this layer/table participates in are included in the Feature Service Layer resource response. Records in tables/layers corresponding to the related table/layer of the relationship are queried. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#relationshipId) */ relationshipId?: number; /** * If `true`, each feature in the [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) includes the geometry. Set to `false` (default) if you do not plan to include highlighted features on a map since the geometry makes up a significant portion of the response. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RelationshipQuery.html#returnGeometry) - * + * * @default false */ returnGeometry?: boolean; @@ -34795,71 +36997,71 @@ declare namespace __esri { interface RouteParameters extends Accessor { /** * The list of network attribute names to be accumulated with the analysis. For example, which attributes should be returned as part of the response. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. See also [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#accumulateAttributes) */ accumulateAttributes: string[]; /** * Each element in the array is an object that describes the parameter values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#attributeParameterValues) */ attributeParameterValues: AttributeParamValue; /** * The set of point barriers loaded as network locations during analysis. At ArcGIS Server 10.1 an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#barriers) */ barriers: DataLayer | FeatureSet; /** * The language used when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). By default, NAServer gets installed with `en_US` only - it is up to the server administrator to add additional languages. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLanguage) */ directionsLanguage: string; /** * The length units to use when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits) */ directionsLengthUnits: string; /** * Defines the amount of direction information returned. **Possible Values:** complete | complete-no-events | instructions-only | standard | summary-only - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsOutputType) - * + * * @default standard */ directionsOutputType: string; /** * The style to be used when returning directions. The default will be as defined in the network layer. View the REST layer description for your network service to see a list of supported styles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsStyleName) */ directionsStyleName: string; /** * The name of network attribute to use for the drive time when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsTimeAttribute) */ directionsTimeAttribute: string; /** * If `true`, avoids network elements restricted by barriers or restrictions specified in [restrictionAttributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictionAttributes). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#doNotLocateOnRestrictedElements) - * + * * @default true */ doNotLocateOnRestrictedElements: boolean; /** - * The [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) can help you find the most efficient path for visiting a given list of stops. This is sometimes known as the "traveling salesperson" problem. When the `findBestSequence = true`, the route solver is solving the Traveling Salesperson problem by computing the optimal sequence to visit the stops. As this is a combinatorial problem, we employ heuristics to solve this in a reasonable time. The heuristics do not guarantee the optimal sequence (as there is no good/fast way to prove optimality for large number of stops). It returns a solution that is close to optimal if not the optimal. The heuristic performs favorably when tested with known TSP benchmarks available in the OR research community. For these stops to be visited in the most efficient way, specify the following parameters: + * The [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) can help you find the most efficient path for visiting a given list of stops. This is sometimes known as the "traveling salesperson" problem. When the `findBestSequence = true`, the route solver is solving the Traveling Salesperson problem by computing the optimal sequence to visit the stops. As this is a combinatorial problem, we employ heuristics to solve this in a reasonable time. The heuristics do not guarantee the optimal sequence (as there is no good/fast way to prove optimality for large number of stops). It returns a solution that is close to optimal if not the optimal. The heuristic performs favorably when tested with known TSP benchmarks available in the OR research community. For these stops to be visited in the most efficient way, specify the following parameters: * ```js * routeParams.findBestSequence = true; * routeParams.preserveFirstStop = false; * routeParams.preserveLastStop = false; * routeParams.returnStops = true; * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#findBestSequence) */ findBestSequence: boolean; @@ -34867,179 +37069,183 @@ declare namespace __esri { * In routes where a stop is not located on a network or a stop could not be reached, the results will differ depending on the value of this property: * * When `false`, the solve operation will fail if at least one of the stops specified cannot be located or reached. * * When `true`, as long as there are at least two valid stops that have been connected by a route, a valid result is returned. If multiple routes are processed in a single request, as long as least one route is built, a valid result is returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#ignoreInvalidLocations) */ ignoreInvalidLocations: boolean; /** * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#impedanceAttribute) */ impedanceAttribute: string; /** * The precision of the output geometry after generalization. If `0`, no generalization of output geometry is performed. If present and positive, it represents the `MaximumAllowableOffset` parameter and generalization is performed according to `IPolycurve.Generalize`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecision) */ outputGeometryPrecision: number; /** * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits: string; /** * The type of output lines to be generated in the result. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** none | straight | true-shape | true-shape-with-measure - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputLines) - * + * * @default true-shape */ outputLines: string; /** * The well-known ID of the spatial reference for the geometries returned with the analysis results. If not specified, the geometries are returned in the spatial reference of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * The set of polygon barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the `features` or `url` property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#polygonBarriers) */ polygonBarriers: DataLayer | FeatureSet; /** * The set of polyline barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the `features` or `url` property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#polylineBarriers) */ polylineBarriers: DataLayer | FeatureSet; /** * If `true`, keeps the first stop fixed in the sequence even when `findBestSequence = true`. Only applicable if `findBestSequence = true`. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#preserveFirstStop) */ preserveFirstStop: boolean; /** * If `true`, keeps the last stop fixed in the sequence even when `findBestSequence = true`. Only applicable if `findBestSequence = true`. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#preserveLastStop) */ preserveLastStop: boolean; /** * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). Possible values are listed in the Service Directory under `Network Dataset -> Network Attributes`. You can also specify a value of `none` to indicate that no network attributes should be used as restrictions. If you specify an empty array, it will default to the default of the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictionAttributes) */ restrictionAttributes: string[]; /** * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictUTurns) */ restrictUTurns: string; /** * If `true`, barriers are returned with the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnBarriers) - * + * * @default false */ returnBarriers: boolean; /** * If `true`, barriers are returned in the [directions property of each RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#directions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnDirections) - * + * * @default false */ returnDirections: boolean; /** * If `true`, polygon barriers are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnPolygonBarriers) - * + * * @default false */ returnPolygonBarriers: boolean; /** * If `true`, polyline barriers are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnPolylineBarriers) - * + * * @default false */ returnPolylineBarriers: boolean; /** * If `true`, routes are generated and returned in the route property of each [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnRoutes) - * + * * @default true */ returnRoutes: boolean; /** * If `true`, stops are returned in the stops property of each [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnStops) - * + * * @default false */ returnStops: boolean; /** * If `true`, `z` values are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnZ) - * + * * @default true */ returnZ: boolean; /** * The time the route begins. If not specified, the default is the time specified in the route service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#startTime) */ startTime: Date; /** * If `true`, the start time will be in UTC format. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#startTimeIsUTC) */ startTimeIsUTC: boolean; /** * The set of stops loaded as network locations during analysis. When `stops` takes a FeatureSet, each feature in the FeatureSet must have a defined spatial reference. If the feature contains `x` and `y` attributes, those values are used for the stop, even if the feature includes geometry. At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The `url` property can be specified using DataFile Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#stops) */ stops: DataLayer | FeatureSet; + /** + * Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#travelMode) + */ + travelMode: any; /** * If `true`, the hierarchy attribute for the network should be used in analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#useHierarchy) */ useHierarchy: boolean; /** * A useful feature of the [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) is the ability to constrain stop visits to certain times of day, or "time windows". If you were required to deliver orders to four homes and each customer was available during a limited time period during the day, the route task could help you find the most efficient path for making all the deliveries. Time windows are treated as a "soft" constraint. This means that although the solver attempts to honor time windows, if necessary, it will violate the time windows of some stops in order to reach them. Remember, the stops will be visited in the order they were added unless you set `RouteParameters.findBestSequence = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#useTimeWindows) */ useTimeWindows: boolean; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface RouteParametersConstructor { - - - new(properties?: RouteParametersProperties): RouteParameters; + new (properties?: RouteParametersProperties): RouteParameters; } export const RouteParameters: RouteParametersConstructor; @@ -35047,71 +37253,71 @@ declare namespace __esri { interface RouteParametersProperties { /** * The list of network attribute names to be accumulated with the analysis. For example, which attributes should be returned as part of the response. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. See also [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#accumulateAttributes) */ accumulateAttributes?: string[]; /** * Each element in the array is an object that describes the parameter values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#attributeParameterValues) */ attributeParameterValues?: AttributeParamValue; /** * The set of point barriers loaded as network locations during analysis. At ArcGIS Server 10.1 an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#barriers) */ barriers?: DataLayerProperties | FeatureSetProperties; /** * The language used when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). By default, NAServer gets installed with `en_US` only - it is up to the server administrator to add additional languages. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLanguage) */ directionsLanguage?: string; /** * The length units to use when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsLengthUnits) */ directionsLengthUnits?: string; /** * Defines the amount of direction information returned. **Possible Values:** complete | complete-no-events | instructions-only | standard | summary-only - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsOutputType) - * + * * @default standard */ directionsOutputType?: string; /** * The style to be used when returning directions. The default will be as defined in the network layer. View the REST layer description for your network service to see a list of supported styles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsStyleName) */ directionsStyleName?: string; /** * The name of network attribute to use for the drive time when computing directions. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#directionsTimeAttribute) */ directionsTimeAttribute?: string; /** * If `true`, avoids network elements restricted by barriers or restrictions specified in [restrictionAttributes](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictionAttributes). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#doNotLocateOnRestrictedElements) - * + * * @default true */ doNotLocateOnRestrictedElements?: boolean; /** - * The [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) can help you find the most efficient path for visiting a given list of stops. This is sometimes known as the "traveling salesperson" problem. When the `findBestSequence = true`, the route solver is solving the Traveling Salesperson problem by computing the optimal sequence to visit the stops. As this is a combinatorial problem, we employ heuristics to solve this in a reasonable time. The heuristics do not guarantee the optimal sequence (as there is no good/fast way to prove optimality for large number of stops). It returns a solution that is close to optimal if not the optimal. The heuristic performs favorably when tested with known TSP benchmarks available in the OR research community. For these stops to be visited in the most efficient way, specify the following parameters: + * The [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) can help you find the most efficient path for visiting a given list of stops. This is sometimes known as the "traveling salesperson" problem. When the `findBestSequence = true`, the route solver is solving the Traveling Salesperson problem by computing the optimal sequence to visit the stops. As this is a combinatorial problem, we employ heuristics to solve this in a reasonable time. The heuristics do not guarantee the optimal sequence (as there is no good/fast way to prove optimality for large number of stops). It returns a solution that is close to optimal if not the optimal. The heuristic performs favorably when tested with known TSP benchmarks available in the OR research community. For these stops to be visited in the most efficient way, specify the following parameters: * ```js * routeParams.findBestSequence = true; * routeParams.preserveFirstStop = false; * routeParams.preserveLastStop = false; * routeParams.returnStops = true; * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#findBestSequence) */ findBestSequence?: boolean; @@ -35119,161 +37325,167 @@ declare namespace __esri { * In routes where a stop is not located on a network or a stop could not be reached, the results will differ depending on the value of this property: * * When `false`, the solve operation will fail if at least one of the stops specified cannot be located or reached. * * When `true`, as long as there are at least two valid stops that have been connected by a route, a valid result is returned. If multiple routes are processed in a single request, as long as least one route is built, a valid result is returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#ignoreInvalidLocations) */ ignoreInvalidLocations?: boolean; /** * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#impedanceAttribute) */ impedanceAttribute?: string; /** * The precision of the output geometry after generalization. If `0`, no generalization of output geometry is performed. If present and positive, it represents the `MaximumAllowableOffset` parameter and generalization is performed according to `IPolycurve.Generalize`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecision) */ outputGeometryPrecision?: number; /** * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits?: string; /** * The type of output lines to be generated in the result. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** none | straight | true-shape | true-shape-with-measure - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outputLines) - * + * * @default true-shape */ outputLines?: string; /** * The well-known ID of the spatial reference for the geometries returned with the analysis results. If not specified, the geometries are returned in the spatial reference of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * The set of polygon barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the `features` or `url` property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#polygonBarriers) */ polygonBarriers?: DataLayerProperties | FeatureSetProperties; /** * The set of polyline barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the `features` or `url` property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#polylineBarriers) */ polylineBarriers?: DataLayerProperties | FeatureSetProperties; /** * If `true`, keeps the first stop fixed in the sequence even when `findBestSequence = true`. Only applicable if `findBestSequence = true`. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#preserveFirstStop) */ preserveFirstStop?: boolean; /** * If `true`, keeps the last stop fixed in the sequence even when `findBestSequence = true`. Only applicable if `findBestSequence = true`. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#preserveLastStop) */ preserveLastStop?: boolean; /** * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). Possible values are listed in the Service Directory under `Network Dataset -> Network Attributes`. You can also specify a value of `none` to indicate that no network attributes should be used as restrictions. If you specify an empty array, it will default to the default of the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictionAttributes) */ restrictionAttributes?: string[]; /** * Specifies how U-Turns should be handled. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). **Possible Values:** allow-backtrack | at-dead-ends-only | no-backtrack | at-dead-ends-and-intersections - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#restrictUTurns) */ restrictUTurns?: string; /** * If `true`, barriers are returned with the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnBarriers) - * + * * @default false */ returnBarriers?: boolean; /** * If `true`, barriers are returned in the [directions property of each RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#directions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnDirections) - * + * * @default false */ returnDirections?: boolean; /** * If `true`, polygon barriers are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnPolygonBarriers) - * + * * @default false */ returnPolygonBarriers?: boolean; /** * If `true`, polyline barriers are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnPolylineBarriers) - * + * * @default false */ returnPolylineBarriers?: boolean; /** * If `true`, routes are generated and returned in the route property of each [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnRoutes) - * + * * @default true */ returnRoutes?: boolean; /** * If `true`, stops are returned in the stops property of each [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnStops) - * + * * @default false */ returnStops?: boolean; /** * If `true`, `z` values are returned in the [RouteResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#returnZ) - * + * * @default true */ returnZ?: boolean; /** * The time the route begins. If not specified, the default is the time specified in the route service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#startTime) */ startTime?: DateProperties; /** * If `true`, the start time will be in UTC format. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#startTimeIsUTC) */ startTimeIsUTC?: boolean; /** * The set of stops loaded as network locations during analysis. When `stops` takes a FeatureSet, each feature in the FeatureSet must have a defined spatial reference. If the feature contains `x` and `y` attributes, those values are used for the stop, even if the feature includes geometry. At ArcGIS Server 10.1 an optional `url` property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The `url` property can be specified using DataFile Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#stops) */ stops?: DataLayerProperties | FeatureSetProperties; + /** + * Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#travelMode) + */ + travelMode?: any; /** * If `true`, the hierarchy attribute for the network should be used in analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#useHierarchy) */ useHierarchy?: boolean; /** * A useful feature of the [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) is the ability to constrain stop visits to certain times of day, or "time windows". If you were required to deliver orders to four homes and each customer was available during a limited time period during the day, the route task could help you find the most efficient path for making all the deliveries. Time windows are treated as a "soft" constraint. This means that although the solver attempts to honor time windows, if necessary, it will violate the time windows of some stops in order to reach them. Remember, the stops will be visited in the order they were added unless you set `RouteParameters.findBestSequence = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#useTimeWindows) */ useTimeWindows?: boolean; @@ -35281,25 +37493,25 @@ declare namespace __esri { /** * An object describing the parameter values for the [attributeParameterValues](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#attributeParameterValues) property of [RouteParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#AttributeParamValue) */ export interface AttributeParamValue extends Object { /** * The name of the attribute. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#AttributeParamValue) */ attributeName: string; /** * The name of the parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#AttributeParamValue) */ parameterName: string; /** * The parameter's value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html#AttributeParamValue) */ value: string; @@ -35308,34 +37520,32 @@ declare namespace __esri { interface RouteResult extends Accessor, JSONSupport { /** * Route directions are returned if `RouteParameters.returnDirections = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#directions) */ directions: DirectionsFeatureSet; /** * The Route graphic that is returned if `RouteParameters.returnRoutes = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#route) */ route: Graphic; /** * The name of the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#routeName) */ routeName: string; /** * Array of stops. Returned only if `RouteParameters.returnStops = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#stops) */ stops: Graphic[]; } interface RouteResultConstructor { - - - new(properties?: RouteResultProperties): RouteResult; + new (properties?: RouteResultProperties): RouteResult; fromJSON(json: any): RouteResult; } @@ -35345,25 +37555,25 @@ declare namespace __esri { interface RouteResultProperties { /** * Route directions are returned if `RouteParameters.returnDirections = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#directions) */ directions?: DirectionsFeatureSetProperties; /** * The Route graphic that is returned if `RouteParameters.returnRoutes = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#route) */ route?: GraphicProperties; /** * The name of the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#routeName) */ routeName?: string; /** * Array of stops. Returned only if `RouteParameters.returnStops = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html#stops) */ stops?: GraphicProperties[]; @@ -35372,247 +37582,253 @@ declare namespace __esri { interface ServiceAreaParameters extends Accessor { /** * The list of network attribute names to be accumulated with the analysis (i.e. which attributes should be returned as part of the response). The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attributes names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#accumulateAttributes) */ accumulateAttributes: string[]; /** * A set of attribute parameter values that can be parameterized to determine which network elements can be used by a vehicle. The parameter holding a vehicle characteristic is compared to a value coming from a descriptor attribute to determine whether or not a network element is traversable. For example, a parameterized restriction attribute can compare the height of your vehicle with a descriptor attribute that holds the clearance under overpasses through tunnels. If the vehicle's height is greater than the clearance, the edge is restricted. Parameterized cost attributes that reference other cost attributes and scale them, can also be used. This is useful when inclement weather like ice, fog or heavy rain, descends on the study area and hinders normal flow of traffic. By having a parameter already outfitted on a cost attribute, travel-time expectations and traversable network paths can be adjusted with respect to changes in traffic speeds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#attributeParameterValues) */ attributeParameterValues: any[]; /** * An array of numbers defining the breaks. The default value is defined in the network analysis layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#defaultBreaks) */ defaultBreaks: number[]; /** * When `true`, restricted network elements should be considered when finding network locations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#doNotLocateOnRestrictedElements) - * + * * @default true */ doNotLocateOnRestrictedElements: boolean; /** * An array of network source names to NOT use when generating polygons. This property specifies if certain network sources should be excluded from the service area polygon generation. A service area on a multi-modal network where only one mode is being used to compute the service area would get a more appropriate shape if other modes are excluded from the polygons. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#excludeSourcesFromPolygons) */ excludeSourcesFromPolygons: string[]; /** * The set of facilities loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using `DataFile`. Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#facilities) */ facilities: DataLayer | FeatureSet; /** * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive, assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm) ArcGIS desktop help topic for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#impedanceAttribute) */ impedanceAttribute: string; /** * If `true`, similar ranges will be merged in the resulting polygons. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#mergeSimilarPolygonRanges) - * + * * @default false */ mergeSimilarPolygonRanges: boolean; /** * The precision of the output geometry after generalization. If `0`, no generalization of output geometry is performed. If present and positive, it represents the `MaximumAllowableOffset` parameter and generalization is performed according to IPolycurve.Generalize. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecision) */ outputGeometryPrecision: number; /** * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits: string; /** - * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). + * * Possible Value | Description * ---------------|------------ * none | No lines are returned * straight | Only returns straight lines * true-shape | Return the true shape of the lines * true-shape-with-measure | Return the true shape of the lines with their measurements - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputLines) */ outputLines: string; /** * The type of output polygons to be generated in the result. The default is as defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). **Possible Values:** none | simplified | detailed - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputPolygons) */ outputPolygons: string; /** * The well-known ID of the spatial reference for the geometries returned with the analysis results. If `outSpatialReference` is not specified, the geometries are returned in the spatial reference of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outSpatialReference) */ outSpatialReference: SpatialReference; /** * Indicates if the lines should overlap from multiple facilities. The default is defined by the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#overlapLines) - * + * * @default false */ overlapLines: boolean; /** * Indicates if the polygons should overlap from multiple facilities. The default is defined by the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#overlapPolygons) - * + * * @default false */ overlapPolygons: boolean; /** * The set of point barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#pointBarriers) */ pointBarriers: DataLayer | FeatureSet; /** * The set of polygon barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#polygonBarriers) */ polygonBarriers: DataLayer | FeatureSet; /** * The set of polyline barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#polylineBarriers) */ polylineBarriers: DataLayer | FeatureSet; /** * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attributes names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#restrictionAttributes) */ restrictionAttributes: string[]; /** - * Specifies how U-turns should be handled. The default is defined in the routing network layer used in your RouteTask. - * + * Specifies how U-turns should be handled. The default is defined in the routing network layer used in your RouteTask. + * * Possible Value | Description * ---------------|------------ * allow-backtrack | Allows U-turns on everywhere * at-dead-ends-only | Only allows U-turns at dead ends * no-backtrack | Restricts U-turns everywhere * at-dead-ends-and-intersections | Only allows U-turns at dead ends and intersections - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#restrictUTurns) */ restrictUTurns: string; /** * If `true`, facilities will be returned with the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnFacilities) - * + * * @default false */ returnFacilities: boolean; /** * If `true`, point barriers will be returned in the [pointBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#pointBarriers) property of the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPointBarriers) - * + * * @default false */ returnPointBarriers: boolean; /** * If `true`, polygon barriers will be returned in the [polygonBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polygonBarriers) property of the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPolygonBarriers) - * + * * @default false */ returnPolygonBarriers: boolean; /** * If `true`, polyline barriers will be returned in the [polylineBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polylineBarriers) property of the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPolylineBarriers) - * + * * @default false */ returnPolylineBarriers: boolean; /** * If `true`, lines will be split at breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#splitLinesAtBreaks) - * + * * @default false */ splitLinesAtBreaks: boolean; /** * If `true`, polygons will be split at breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#splitPolygonsAtBreaks) - * + * * @default false */ splitPolygonsAtBreaks: boolean; /** * Local date and time at the facility. If `travelDirection = "to-facility"`, the `timeOfDay` value specifies arrival time at the facility. if `travelDirection = "from-facility"`, `timeOfDay` specifies departure time from the facility. Requires ArcGIS Server service version 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#timeOfDay) */ timeOfDay: Date; /** - * Options for traveling to or from the facility. Default values are defined by the network layer. - * + * Options for traveling to or from the facility. Default values are defined by the network layer. + * * Possible Value | Description * ---------------|------------ * from-facility | Sets travel direction from the facility * to-facility | Sets travel direction to the facility - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#travelDirection) */ travelDirection: string; + /** + * Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#travelMode) + */ + travelMode: any; /** * If `true`, the outermost polygon (at the maximum break value) will be trimmed. The default is defined in the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimOuterPolygon) - * + * * @default false */ trimOuterPolygon: boolean; /** * If polygons are being trimmed, provides the distance to trim. The default value is defined in the network analysis layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistance) */ trimPolygonDistance: number; /** * If polygons are being trimmed, specifies the units of [trimPolygonDistance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistance). The default is defined in the network analysis layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistanceUnits) */ trimPolygonDistanceUnits: string; /** * When `true`, the hierarchy attributes for the network will be used in the analysis. The default value is defined in the network layer. `useHierarchy` cannot be used in conjunction with [outputLines](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputLines). Requires an ArcGIS Server service version 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#useHierarchy) */ useHierarchy: boolean; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } @@ -35620,11 +37836,11 @@ declare namespace __esri { interface ServiceAreaParametersConstructor { /** * Input parameters for [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html) */ - new(properties?: ServiceAreaParametersProperties): ServiceAreaParameters; + new (properties?: ServiceAreaParametersProperties): ServiceAreaParameters; } export const ServiceAreaParameters: ServiceAreaParametersConstructor; @@ -35632,237 +37848,243 @@ declare namespace __esri { interface ServiceAreaParametersProperties { /** * The list of network attribute names to be accumulated with the analysis (i.e. which attributes should be returned as part of the response). The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attributes names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#accumulateAttributes) */ accumulateAttributes?: string[]; /** * A set of attribute parameter values that can be parameterized to determine which network elements can be used by a vehicle. The parameter holding a vehicle characteristic is compared to a value coming from a descriptor attribute to determine whether or not a network element is traversable. For example, a parameterized restriction attribute can compare the height of your vehicle with a descriptor attribute that holds the clearance under overpasses through tunnels. If the vehicle's height is greater than the clearance, the edge is restricted. Parameterized cost attributes that reference other cost attributes and scale them, can also be used. This is useful when inclement weather like ice, fog or heavy rain, descends on the study area and hinders normal flow of traffic. By having a parameter already outfitted on a cost attribute, travel-time expectations and traversable network paths can be adjusted with respect to changes in traffic speeds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#attributeParameterValues) */ attributeParameterValues?: any[]; /** * An array of numbers defining the breaks. The default value is defined in the network analysis layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#defaultBreaks) */ defaultBreaks?: number[]; /** * When `true`, restricted network elements should be considered when finding network locations. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#doNotLocateOnRestrictedElements) - * + * * @default true */ doNotLocateOnRestrictedElements?: boolean; /** * An array of network source names to NOT use when generating polygons. This property specifies if certain network sources should be excluded from the service area polygon generation. A service area on a multi-modal network where only one mode is being used to compute the service area would get a more appropriate shape if other modes are excluded from the polygons. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#excludeSourcesFromPolygons) */ excludeSourcesFromPolygons?: string[]; /** * The set of facilities loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using `DataFile`. Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#facilities) */ facilities?: DataLayerProperties | FeatureSetProperties; /** * The network attribute name used as the impedance attribute in analysis. The default is as defined in the routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty string, it will use the default of the service. For example, set `impedanceAttribute = 'Time'` for quickest route and `impedanceAttribute = 'Length'` for shortest drive, assuming the service has those two esriNAUTCost attributes. View the [Understanding the network attribute](http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/understanding-network-attributes.htm) ArcGIS desktop help topic for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#impedanceAttribute) */ impedanceAttribute?: string; /** * If `true`, similar ranges will be merged in the resulting polygons. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#mergeSimilarPolygonRanges) - * + * * @default false */ mergeSimilarPolygonRanges?: boolean; /** * The precision of the output geometry after generalization. If `0`, no generalization of output geometry is performed. If present and positive, it represents the `MaximumAllowableOffset` parameter and generalization is performed according to IPolycurve.Generalize. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecision) */ outputGeometryPrecision?: number; /** * The units of the output geometry precision. **Possible Values:** centimeters | decimal-degrees | decimeters | feet | inches | kilometers | meters | miles | millimeters | nautical-miles | points | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputGeometryPrecisionUnits) */ outputGeometryPrecisionUnits?: string; /** - * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * The type of output lines to be generated in the result. The default is defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). + * * Possible Value | Description * ---------------|------------ * none | No lines are returned * straight | Only returns straight lines * true-shape | Return the true shape of the lines * true-shape-with-measure | Return the true shape of the lines with their measurements - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputLines) */ outputLines?: string; /** * The type of output polygons to be generated in the result. The default is as defined in the specific routing network layer used in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). **Possible Values:** none | simplified | detailed - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputPolygons) */ outputPolygons?: string; /** * The well-known ID of the spatial reference for the geometries returned with the analysis results. If `outSpatialReference` is not specified, the geometries are returned in the spatial reference of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outSpatialReference) */ outSpatialReference?: SpatialReferenceProperties; /** * Indicates if the lines should overlap from multiple facilities. The default is defined by the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#overlapLines) - * + * * @default false */ overlapLines?: boolean; /** * Indicates if the polygons should overlap from multiple facilities. The default is defined by the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#overlapPolygons) - * + * * @default false */ overlapPolygons?: boolean; /** * The set of point barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#pointBarriers) */ pointBarriers?: DataLayerProperties | FeatureSetProperties; /** * The set of polygon barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#polygonBarriers) */ polygonBarriers?: DataLayerProperties | FeatureSetProperties; /** * The set of polyline barriers loaded as network locations during analysis. At ArcGIS Server 10.1, an optional url property was added. Use this property to specify a REST query request to a Feature, Map or GP Service that returns a JSON feature set. The url property can be specified using [DataFile](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataFile.html). Note that either the features or url property should be specified. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#polylineBarriers) */ polylineBarriers?: DataLayerProperties | FeatureSetProperties; /** * The list of network attribute names to be used as restrictions with the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attributes names listed in the Service Directory under `Network Dataset > Network Attributes` as `Usage Type: esriNAUTCost`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#restrictionAttributes) */ restrictionAttributes?: string[]; /** - * Specifies how U-turns should be handled. The default is defined in the routing network layer used in your RouteTask. - * + * Specifies how U-turns should be handled. The default is defined in the routing network layer used in your RouteTask. + * * Possible Value | Description * ---------------|------------ * allow-backtrack | Allows U-turns on everywhere * at-dead-ends-only | Only allows U-turns at dead ends * no-backtrack | Restricts U-turns everywhere * at-dead-ends-and-intersections | Only allows U-turns at dead ends and intersections - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#restrictUTurns) */ restrictUTurns?: string; /** * If `true`, facilities will be returned with the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnFacilities) - * + * * @default false */ returnFacilities?: boolean; /** * If `true`, point barriers will be returned in the [pointBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#pointBarriers) property of the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPointBarriers) - * + * * @default false */ returnPointBarriers?: boolean; /** * If `true`, polygon barriers will be returned in the [polygonBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polygonBarriers) property of the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPolygonBarriers) - * + * * @default false */ returnPolygonBarriers?: boolean; /** * If `true`, polyline barriers will be returned in the [polylineBarriers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polylineBarriers) property of the analysis results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#returnPolylineBarriers) - * + * * @default false */ returnPolylineBarriers?: boolean; /** * If `true`, lines will be split at breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#splitLinesAtBreaks) - * + * * @default false */ splitLinesAtBreaks?: boolean; /** * If `true`, polygons will be split at breaks. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#splitPolygonsAtBreaks) - * + * * @default false */ splitPolygonsAtBreaks?: boolean; /** * Local date and time at the facility. If `travelDirection = "to-facility"`, the `timeOfDay` value specifies arrival time at the facility. if `travelDirection = "from-facility"`, `timeOfDay` specifies departure time from the facility. Requires ArcGIS Server service version 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#timeOfDay) */ timeOfDay?: DateProperties; /** - * Options for traveling to or from the facility. Default values are defined by the network layer. - * + * Options for traveling to or from the facility. Default values are defined by the network layer. + * * Possible Value | Description * ---------------|------------ * from-facility | Sets travel direction from the facility * to-facility | Sets travel direction to the facility - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#travelDirection) */ travelDirection?: string; + /** + * Travel modes define how a pedestrian, car, truck or other medium of transportation moves through the street network. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#travelMode) + */ + travelMode?: any; /** * If `true`, the outermost polygon (at the maximum break value) will be trimmed. The default is defined in the network analysis layer in your [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimOuterPolygon) - * + * * @default false */ trimOuterPolygon?: boolean; /** * If polygons are being trimmed, provides the distance to trim. The default value is defined in the network analysis layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistance) */ trimPolygonDistance?: number; /** * If polygons are being trimmed, specifies the units of [trimPolygonDistance](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistance). The default is defined in the network analysis layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#trimPolygonDistanceUnits) */ trimPolygonDistanceUnits?: string; /** * When `true`, the hierarchy attributes for the network will be used in the analysis. The default value is defined in the network layer. `useHierarchy` cannot be used in conjunction with [outputLines](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#outputLines). Requires an ArcGIS Server service version 10.1 or greater. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaParameters.html#useHierarchy) */ useHierarchy?: boolean; @@ -35871,43 +38093,43 @@ declare namespace __esri { interface ServiceAreaSolveResult extends Accessor, JSONSupport { /** * Array of points only returned if `ServiceAreaParameters.returnFacilities = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#facilities) */ facilities: Point[]; /** * Message received when solve is completed. If a service area cannot be solved, the message returned by the server identifies the incident that could not be solved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#messages) */ messages: NAMessage[]; /** * The point barriers are returned only if `ServiceAreaParameters.returnPointBarriers = true` (which is not the default). If you send in the point barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#pointBarriers) */ pointBarriers: Point[]; /** * The polygon barriers are returned only if `ServiceAreaParameters.returnPolygonBarriers = true` (which is not the default). If you send in the polygon barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polygonBarriers) */ polygonBarriers: Polygon[]; /** * The polyline barriers are returned only if `ServiceAreaParameters.returnPolylineBarriers = true` (which is not the default). If you send in the polyline barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polylineBarriers) */ polylineBarriers: Polyline[]; /** * An array of service area polygon graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#serviceAreaPolygons) */ serviceAreaPolygons: Graphic[]; /** * An array of service area polyline graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#serviceAreaPolylines) */ serviceAreaPolylines: Graphic[]; @@ -35916,11 +38138,11 @@ declare namespace __esri { interface ServiceAreaSolveResultConstructor { /** * The result from [ServiceAreaTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-ServiceAreaTask.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html) */ - new(properties?: ServiceAreaSolveResultProperties): ServiceAreaSolveResult; + new (properties?: ServiceAreaSolveResultProperties): ServiceAreaSolveResult; fromJSON(json: any): ServiceAreaSolveResult; } @@ -35930,43 +38152,43 @@ declare namespace __esri { interface ServiceAreaSolveResultProperties { /** * Array of points only returned if `ServiceAreaParameters.returnFacilities = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#facilities) */ facilities?: PointProperties[]; /** * Message received when solve is completed. If a service area cannot be solved, the message returned by the server identifies the incident that could not be solved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#messages) */ messages?: NAMessageProperties[]; /** * The point barriers are returned only if `ServiceAreaParameters.returnPointBarriers = true` (which is not the default). If you send in the point barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#pointBarriers) */ pointBarriers?: PointProperties[]; /** * The polygon barriers are returned only if `ServiceAreaParameters.returnPolygonBarriers = true` (which is not the default). If you send in the polygon barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polygonBarriers) */ polygonBarriers?: PolygonProperties[]; /** * The polyline barriers are returned only if `ServiceAreaParameters.returnPolylineBarriers = true` (which is not the default). If you send in the polyline barriers as a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html) (instead of using [DataLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-DataLayer.html)), you already have the barriers and might not need to request them back from the server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#polylineBarriers) */ polylineBarriers?: PolylineProperties[]; /** * An array of service area polygon graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#serviceAreaPolygons) */ serviceAreaPolygons?: GraphicProperties[]; /** * An array of service area polyline graphics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-ServiceAreaSolveResult.html#serviceAreaPolylines) */ serviceAreaPolylines?: GraphicProperties[]; @@ -35975,28 +38197,35 @@ declare namespace __esri { interface StatisticDefinition extends Accessor, JSONSupport { /** * Defines the field for which statistics will be calculated. This can be service field names or SQL expressions. See the snippets below for examples. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#onStatisticField) */ onStatisticField: string; /** * Specifies the output field name for the requested statistic. Output field names can only contain alpha-numeric characters and an underscore. If no output field name is specified, the server assigns a field name to the returned statistic field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#outStatisticFieldName) */ outStatisticFieldName: string; /** * Defines the type of statistic. **Possible Values:** count | sum | min | max | avg | stddev | var - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#statisticType) */ statisticType: "count" | "sum" | "min" | "max" | "avg" | "stddev" | "var"; + + /** + * Creates a deep clone of StatisticDefinition object. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#clone) + * + * + */ + clone(): StatisticDefinition; } interface StatisticDefinitionConstructor { - - - new(properties?: StatisticDefinitionProperties): StatisticDefinition; + new (properties?: StatisticDefinitionProperties): StatisticDefinition; fromJSON(json: any): StatisticDefinition; } @@ -36006,19 +38235,19 @@ declare namespace __esri { interface StatisticDefinitionProperties { /** * Defines the field for which statistics will be calculated. This can be service field names or SQL expressions. See the snippets below for examples. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#onStatisticField) */ onStatisticField?: string; /** * Specifies the output field name for the requested statistic. Output field names can only contain alpha-numeric characters and an underscore. If no output field name is specified, the server assigns a field name to the returned statistic field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#outStatisticFieldName) */ outStatisticFieldName?: string; /** * Defines the type of statistic. **Possible Values:** count | sum | min | max | avg | stddev | var - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-StatisticDefinition.html#statisticType) */ statisticType?: "count" | "sum" | "min" | "max" | "avg" | "stddev" | "var"; @@ -36026,8 +38255,8 @@ declare namespace __esri { interface TrimExtendParameters extends Accessor { /** - * A flag used with the `trimExtend` operation. - * + * A flag used with the `trimExtend` operation. + * * Possible Value | Description * ---------------|------------- * default-curve-extension | The extension considers both ends of the path. The old ends remain and new points are added to the extended ends. The new points have attributes that are extrapolated from existing adjacent segments. @@ -36036,48 +38265,46 @@ declare namespace __esri { * no-end-attributes | When an extension is performed at an end, do not extrapolate the end segments attributes for the new point. Instead the attributes will be empty. * no-extend-at-from | Do not extend the 'from' end of any path. * no-extend-at-to | Do not extend the 'to' end of any path. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#extendHow) - * + * * @default default-curve-extension */ extendHow: string; /** * The array of polylines to trim or extend. The structure of each geometry in the array is the same as the structure of the JSON polyline objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#polylines) */ polylines: Polyline[]; /** * A polyline used as a guide for trimming or extending input polylines. The structure of the polyline is the same as the structure of the JSON polyline object returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#trimExtendTo) */ trimExtendTo: Polyline; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#toJSON) - * - * + * + * */ toJSON(): any; } interface TrimExtendParametersConstructor { - - - new(properties?: TrimExtendParametersProperties): TrimExtendParameters; + new (properties?: TrimExtendParametersProperties): TrimExtendParameters; } export const TrimExtendParameters: TrimExtendParametersConstructor; interface TrimExtendParametersProperties { /** - * A flag used with the `trimExtend` operation. - * + * A flag used with the `trimExtend` operation. + * * Possible Value | Description * ---------------|------------- * default-curve-extension | The extension considers both ends of the path. The old ends remain and new points are added to the extended ends. The new points have attributes that are extrapolated from existing adjacent segments. @@ -36086,22 +38313,22 @@ declare namespace __esri { * no-end-attributes | When an extension is performed at an end, do not extrapolate the end segments attributes for the new point. Instead the attributes will be empty. * no-extend-at-from | Do not extend the 'from' end of any path. * no-extend-at-to | Do not extend the 'to' end of any path. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#extendHow) - * + * * @default default-curve-extension */ extendHow?: string; /** * The array of polylines to trim or extend. The structure of each geometry in the array is the same as the structure of the JSON polyline objects returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#polylines) */ polylines?: PolylineProperties[]; /** * A polyline used as a guide for trimming or extending input polylines. The structure of the polyline is the same as the structure of the JSON polyline object returned by the ArcGIS REST API. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-TrimExtendParameters.html#trimExtendTo) */ trimExtendTo?: PolylineProperties; @@ -36110,22 +38337,20 @@ declare namespace __esri { interface Task extends Accessor { /** * The [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for data requests. These options can also be controlled through the `requestOptions` method parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Task.html#requestOptions) */ requestOptions: any; /** * The ArcGIS Server REST service URL (usually of a Feature Service Layer or Map Service Layer) for use in a task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Task.html#url) */ url: string; } interface TaskConstructor { - - - new(properties?: TaskProperties): Task; + new (properties?: TaskProperties): Task; } export const Task: TaskConstructor; @@ -36133,13 +38358,13 @@ declare namespace __esri { interface TaskProperties { /** * The [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for data requests. These options can also be controlled through the `requestOptions` method parameter. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Task.html#requestOptions) */ requestOptions?: any; /** * The ArcGIS Server REST service URL (usually of a Feature Service Layer or Map Service Layer) for use in a task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Task.html#url) */ url?: string; @@ -36148,127 +38373,131 @@ declare namespace __esri { interface ConfigurationTask extends Task { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#url) */ url: string; /** * Gets an array of all the user groups that are configured in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getAllGroups) - * + * * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getAllGroups(requestOptions?: any): IPromise; /** * Gets an array of all the users that are configured in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getAllUsers) - * + * * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getAllUsers(requestOptions?: any): IPromise; /** * Gets the properties and an array of geodatabase versions for a data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getDataWorkspaceDetails) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.dataWorkspaceId The unique id of the data workspace, whose version will be returned. * @param params.user The user name of the user who is requesting the information. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ - getDataWorkspaceDetails(params: ConfigurationTaskGetDataWorkspaceDetailsParams, requestOptions?: any): IPromise; + getDataWorkspaceDetails( + params: ConfigurationTaskGetDataWorkspaceDetailsParams, + requestOptions?: any + ): IPromise; /** * Gets a single user group in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getGroup) - * + * * @param groupId The unique id of the group whose information will be retrieved. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getGroup(groupId: number, requestOptions?: any): IPromise; /** * Gets the detailed configuration properties of a job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getJobTypeDetails) - * + * * @param jobTypeId The unique id of a job type. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getJobTypeDetails(jobTypeId: number, requestOptions?: any): IPromise; /** * Gets the configuration of a publicly accessible job query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getPublicJobQueryDetails) - * + * * @param queryId The unique id of public query. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getPublicJobQueryDetails(queryId: number, requestOptions?: any): IPromise; /** * Gets the [configuration information](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) specific to a Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getServiceInfo) - * + * * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getServiceInfo(requestOptions?: any): IPromise; /** * Gets an array of registered [table relationships](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getTableRelationshipsDetails) - * + * * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getTableRelationshipsDetails(requestOptions?: any): IPromise; /** * Gets information for a single user in the system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getUser) - * + * * @param user The user name of the user whose information will be returned. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getUser(user: string, requestOptions?: any): IPromise; /** * Gets the configuration of a user-owned job query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getUserJobQueryDetails) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.queryId The unique id of user query. * @param params.user The user name of the user who is requesting the information. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ - getUserJobQueryDetails(params: ConfigurationTaskGetUserJobQueryDetailsParams, requestOptions?: any): IPromise; + getUserJobQueryDetails( + params: ConfigurationTaskGetUserJobQueryDetailsParams, + requestOptions?: any + ): IPromise; /** * Gets all the job types a user is allowed to see and create. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getVisibleJobTypes) - * + * * @param user The user name of the user for whom the information will be retrieved. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getVisibleJobTypes(user: string, requestOptions?: any): IPromise; } interface ConfigurationTaskConstructor { - - - new(properties?: ConfigurationTaskProperties): ConfigurationTask; + new (properties?: ConfigurationTaskProperties): ConfigurationTask; } export const ConfigurationTask: ConfigurationTaskConstructor; @@ -36276,39 +38505,37 @@ declare namespace __esri { interface ConfigurationTaskProperties extends TaskProperties { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#url) */ url?: string; } - export interface ConfigurationTaskGetDataWorkspaceDetailsParams extends Object { /** * The unique id of the data workspace, whose version will be returned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getDataWorkspaceDetails) */ dataWorkspaceId: string; /** * The user name of the user who is requesting the information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getDataWorkspaceDetails) */ user: string; } - export interface ConfigurationTaskGetUserJobQueryDetailsParams extends Object { /** * The unique id of user query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getUserJobQueryDetails) */ queryId: number; /** * The user name of the user who is requesting the information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#getUserJobQueryDetails) */ user: string; @@ -36316,19 +38543,19 @@ declare namespace __esri { /** * A geospatial database that will be used for editing in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#DataWorkspace) */ export interface DataWorkspace extends Object { /** * The unique id of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#DataWorkspace) */ id: string; /** * The name of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#DataWorkspace) */ name: string; @@ -36336,19 +38563,19 @@ declare namespace __esri { /** * The membership attributes of a group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#GroupMembership) */ export interface GroupMembership extends Object { /** * The unique id for the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#GroupMembership) */ id: number; /** * The name of the group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#GroupMembership) */ name: string; @@ -36356,25 +38583,25 @@ declare namespace __esri { /** * The type of hold that can be applied to suspend the execution of a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) */ export interface HoldType extends Object { /** * The description of the type of hold. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) */ description: string; /** * The unique id for the hold type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) */ id: number; /** * The name of the hold type - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) */ name: string; @@ -36382,25 +38609,25 @@ declare namespace __esri { /** * The properties of a job priority. Job priority is a way to assign a level of importance to the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) */ export interface JobPriority extends Object { /** * The description of the priority. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) */ description: string; /** * The name of the priority. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) */ name: string; /** * The unique id of the priority. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) */ value: number; @@ -36408,19 +38635,19 @@ declare namespace __esri { /** * A query that is available to the user to execute. A query returns jobs based on a specific criteria. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQuery) */ export interface JobQuery extends Object { /** * The unique id for the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQuery) */ id: number; /** * The name of the priority. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQuery) */ name: string; @@ -36428,31 +38655,31 @@ declare namespace __esri { /** * A container of job queries, it can also contain nested containers with child job query containers under it. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) */ export interface JobQueryContainer extends Object { /** * One or more [job query containers](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) which are nested under the parent container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) */ containers: JobQueryContainer[]; /** * The unique id for the container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) */ id: number; /** * The name of the query container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) */ name: string; /** * An array of [queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQuery) inside the query container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) */ queries: JobQuery[]; @@ -36460,49 +38687,49 @@ declare namespace __esri { /** * Detailed properties of a job query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ export interface JobQueryDetails extends Object { /** * An array of field aliases included in the select statement. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ aliases: string[]; /** * An array of fields included in the select statement. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ fields: string[]; /** * The unique id for the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ id: number; /** * The name of the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ name: string; /** * The field used to order the results returned by the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ orderBy: string; /** * An array of tables selected from and used in the where clause. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ tables: string[]; /** * The where clause used as filter for selecting job information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryDetails) */ where: string; @@ -36510,31 +38737,31 @@ declare namespace __esri { /** * Properties of a job status. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) */ export interface JobStatus extends Object { /** * An alias name for the status. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) */ caption: string; /** * The description of the type of status. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) */ description: string; /** * The unique id for the status type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) */ id: number; /** * The name of the status type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) */ name: string; @@ -36542,37 +38769,37 @@ declare namespace __esri { /** * A list of properties that describe a job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) */ export interface JobType extends Object { /** * A category to group other similar job types. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) */ category: string; /** * The description of the job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) */ description: string; /** * The unique id for the job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) */ id: string; /** * The name of the job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) */ name: string; /** * The state of the job type. **Possible Values:** draft | active | retired - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) */ state: string; @@ -36580,121 +38807,121 @@ declare namespace __esri { /** * Detailed information of a job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ export interface JobTypeDetails extends Object { - /** - * The name of the geodatabase version that will be assigned the parent version of the job's geodatabase by default. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) - */ - defaultParentVersionName: string; /** * Indicates whether jobs of this type will have their workflows automatically executed, when created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ autoExecuteCreatedJobs: boolean; + /** + * Indicates whether jobs of this type allows users to modify the current data workspace in the job. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) + */ + canDataWorkspaceChange: boolean; /** * The category of the job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ category: string; /** * The name of the user or group that the job will be assigned to by default. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultAssignedTo: string; /** * Indicates whether the job is assigned to a user, group or unassigned by default. **Possible Values:** unassigned | user | group - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultAssignedType: string; /** * The unique id of the default data workspace of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultDataWorkspaceId: string; /** * The description that gets associated with the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultDescription: string; /** * The default due date of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultDueDate: string; /** * The duration for completing the job assigned by default. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultJobDuration: number; /** - * Indicates whether jobs of this type allows users to modify the current data workspace in the job. - * + * The name of the geodatabase version that will be assigned the parent version of the job's geodatabase by default. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ - canDataWorkspaceChange: boolean; + defaultParentVersionName: string; /** * The numeric priority value assigned to the job by default. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultPriority: string; /** * The default start date of this job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ defaultStartDate: Date; /** * The description of the job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ description: string; /** * The unique id automatically generated for this job type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ id: string; /** * The naming scheme for this job type, which would serve as template for the name of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ jobNamingScheme: string; /** * The naming scheme for this job type, which would serve as template for the name of job's version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ jobVersionNamingScheme: string; /** * The naming scheme for this job type, which would serve as template for the name of job's map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ mxdNamingScheme: string; /** * The job type name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ name: string; /** * The state of the job type. **Possible Values:** draft | active | retired - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobTypeDetails) */ state: string; @@ -36702,25 +38929,25 @@ declare namespace __esri { /** * A privilege in the Workflow Manager system that controls application access. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) */ export interface Privilege extends Object { /** * The description of the privilege. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) */ description: string; /** * The unique id for the privilege. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) */ id: number; /** * The name of the privilege. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) */ name: string; @@ -36728,31 +38955,31 @@ declare namespace __esri { /** * TableRelationship represents a list of extended properties tables and the properties that identify them like name and cardinality. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) */ export interface TableRelationship extends Object { /** * The type of extra property table relationship, one-to-one represents one row for each property and one-to-many represents there will be multiple values for the property. **Possible Values:** one-to-one | one-to-many - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) */ cardinality: string; /** * The foreign key field used to join the jobs table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) */ linkField: string; /** * The alias name of the table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) */ tableAlias: string; /** * The name of the extended properties table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#TableRelationship) */ tableName: string; @@ -36760,85 +38987,85 @@ declare namespace __esri { /** * A list of properties including groups and privileges associated with a Workflow Manager user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ export interface UserDetails extends Object { - /** - * The last name of the user. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) - */ - lastName: string; /** * The address of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ address: string; + /** + * The email address of the user. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) + */ + email: string; /** * The fax number of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ faxNumber: string; /** * The first name of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ firstName: string; /** * The full name of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ fullName: string; /** * An array of [group memberships](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#GroupMembership) of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ groups: GroupMembership[]; /** - * The email address of the user. - * + * The last name of the user. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ - email: string; + lastName: string; /** * The phone number of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ phoneNumber: string; /** * An array of [application privileges](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ privileges: Privilege[]; /** * The room number of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ roomNumber: string; /** * The login username for the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ userName: string; /** * An array of [queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer) owned by the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ userQueries: JobQueryContainer[]; /** * The zip code of the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#UserDetails) */ zipCode: string; @@ -36846,25 +39073,25 @@ declare namespace __esri { /** * A list of properties that describe a geodatabase version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#VersionInfo) */ export interface VersionInfo extends Object { /** * The level of access to the geodatabase version. **Possible Values:** esriVersionAccessPrivate | esriVersionAccessPublic | esriVersionAccessProtected - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#VersionInfo) */ access: string; /** * The name of the geodatabase version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#VersionInfo) */ name: string; /** * The name of the parent version of the geodatabase. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#VersionInfo) */ parent: string; @@ -36872,161 +39099,160 @@ declare namespace __esri { /** * The base properties of a Workflow Manager service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ export interface WorkflowManagerServiceInfo extends Object { - /** - * An array of [job priorities](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) in the Workflow Manager system. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) - */ - jobPriorities: JobPriority[]; /** * An array of activity types in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ activityTypes: ActivityType[]; + /** + * The configuration properties of the Workflow Manager system stored in the database table as key/value pairs. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) + */ + configProperties: WorkflowManagerServiceInfoConfigProperties; /** * The current software version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ currentVersion: number; /** * An array of [data workspaces](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#DataWorkspace) in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ dataWorkspaces: DataWorkspace[]; /** * An array of [hold types](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#HoldType) in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ holdTypes: HoldType[]; /** - * The configuration properties of the Workflow Manager system stored in the database table as key/value pairs. - * + * An array of [job priorities](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobPriority) in the Workflow Manager system. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ - configProperties: WorkflowManagerServiceInfoConfigProperties; + jobPriorities: JobPriority[]; /** * An array of [job statuses](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobStatus) in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ jobStatuses: JobStatus[]; /** * An array of [job types](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobType) in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ jobTypes: JobType[]; /** * An array of notification types in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ notificationTypes: NotificationType[]; /** * An array of [privileges](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#Privilege) in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ privileges: Privilege[]; /** * The array of [public queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#JobQueryContainer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ publicQueries: JobQueryContainer[]; } - export interface WorkflowManagerServiceInfoConfigProperties extends Object { /** * Indicates whether the location of interest (LOI) for jobs are allowed to overlap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ AOIOVERLAP: string; /** * The color of the current job's LOI when selected in the LOI tab. The value is in range of 0 to 167772155. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ AOISELECTIONCOLOR: number; /** * Indicates whether the job will be automatically assigned based on step assignment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ AUTOASSIGNJOB: boolean; /** * Indicates whether the job will be automatically closed after the last step in the workflow is marked as complete. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ AUTOCLOSEJOB: boolean; /** * Indicates whether the job workflow witll be automatically committed to the database when saved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ AUTOCOMMITWORKFLOW: boolean; /** * Indicates whether the status of the jobs will be automatically assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ AUTOSTATUSASSIGN: boolean; /** * Indicates whether the user will be required to confirm that they want to mark the current procedural step as complete. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ CONFIRMPROCEDURALCHECK: boolean; /** * The default email address to be used in the sender field when sending notifications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ DEFAULT_SENDER_EMAIL: string; /** * The default name displayed to be used in the sender field when sending notifications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ DEFAULT_SENDER_NAME: string; /** * Indicates whether notifications will be sent as HTML. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ HTML_SUPPORT: string; /** * The starting value of job ids in the system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ JOB_ID_START_VALUE: string; /** * Indicates whether the the number of days for each hold is taken out of the pending days calculation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ PENDING_DAYS_USE_HOLDS: boolean; /** * Indicates whether the user attempting to delete a job version would be prompted to enter a password for the sde owner of the versions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ PROMPTSDEPWD: boolean; /** * Indicates whether it will be required to mark procedural steps as started. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ REQUIREPROCEDURALCHECKSTART: number; @@ -37035,103 +39261,103 @@ declare namespace __esri { * * `Warn` - Warn users when selecting features outside the job AOI. * * `NoSelect` - Prevent users from selecting features outside the job AOI. * * `Off` - Allow edits to features outside the job AOI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ RESTRICT_AOI_OPTION: string; /** * Indicates whether the spatial notifications will be sent on Workflow Manager Post. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SEND_SN_CUSTOM_POST: boolean; /** * Indicates whether to show step ids on workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SHOW_STEP_IDS: boolean; /** * Indicates whether the step completion percentage will be displayed on the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SHOW_STEP_PERCENT_COMPLETE: boolean; /** * The password of the authenticated SMTP user in the secure SMTP server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SMTP_PASSWORD: string; /** * Indicates whether the pending days will be displayed in the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SHOW_PENDING_DAYS: boolean; /** * The SMTP server port to be used for sending notifications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SMTP_PORT: string; /** * SMTP Authentication protocol. **Possible Values:** SSL | TLS - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SMTP_PROTOCOL: string; /** * The name of the SMTP Server to be used for sending notifications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SMTP_SERVER: string; /** * The user name that is authenticated in the secure SMTP server. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ SMTP_USERNAME: string; /** * Indicates whether to use step status assignment such that the job's status updates to match the step status when the step is reached. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ USE_STEP_STATUS: boolean; /** * Indicates the user store of the Workflow Manager system, whether the users will be stored in a Portal or the Workflow Manager system. **Possible Values:** traditional | portal - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ USER_STORE: string; /** * Indicates whether a user will be authenticated using domain along with the user name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ USEUSERDOMAIN: boolean; /** * The fill color of a selected step in a workflow. The value is in range of 0 to 167772155. When the option is disabled it's value is -1. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ WF_SEL_STEP_FILL_COLOR: number; /** * The outline color of a selected step in a workflow. The value is in range of 0 to 167772155. When the option is disabled it's value is -1. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ WF_SEL_STEP_OUTLINE_COLOR: number; /** * The outline width of a selected step in a workflow. **Possible Values:** 1 | 2 | 3 - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ WF_SEL_STEP_OUTLINE_WIDTH: number; /** * Indicates whether the LOI of the job will be automatically zoomed to in the LOI tab. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ConfigurationTask.html#WorkflowManagerServiceInfo) */ ZOOMTOAOI: boolean; @@ -37140,82 +39366,82 @@ declare namespace __esri { interface JobTask extends Task { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#url) */ url: string; /** * Uploads a file and attaches it to the job as an embedded attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addEmbeddedAttachment) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.form The form element that contains the file input control. The form parameter can be an instance of FormData. Using FormData you can send a "multipart/form-data" request to the server without having to create an HTML form element in markup. Note that the FormData api is not available in all browsers. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ addEmbeddedAttachment(params: JobTaskAddEmbeddedAttachmentParams, requestOptions?: any): IPromise; /** * Adds a linked attachment to a job (url or file). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.attachmentType The type of attachment to be added. **Possible Values:** linked-file | url * @param params.path The file path to the attachment. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ addLinkedAttachment(params: JobTaskAddLinkedAttachmentParams, requestOptions?: any): IPromise; /** * Adds a linked property record to a job's linked properties table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedRecord) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.tableName The name of the table to which the record will be added. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ addLinkedRecord(params: JobTaskAddLinkedRecordParams, requestOptions?: any): IPromise; /** * Assigns one or more jobs to a user or group. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobIds An array of unique job Ids. * @param params.assignedType Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group * @param params.assignedTo The name of the user or group to whom the job will be assigned. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ assignJobs(params: JobTaskAssignJobsParams, requestOptions?: any): IPromise; /** * Closes one or more jobs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#closeJobs) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobIds An array of unique job Ids. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ closeJobs(params: JobTaskCloseJobsParams, requestOptions?: any): IPromise; /** * Creates a job dependency. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.heldOnType Indicates whether the current job (to which the dependency is being added) will be held at a step, stage or status. **Possible Values:** step | stage | status @@ -37225,347 +39451,353 @@ declare namespace __esri { * @param params.depOnValue The value of the step or status of the other job on which the current job will be dependent. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ createDependency(params: JobTaskCreateDependencyParams, requestOptions?: any): IPromise; /** * Creates a job hold. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.holdTypeId The unique id representing the hold type to be placed on the job. * @param params.comments Reason or more detailed information regarding why the hold is being added. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ createHold(params: JobTaskCreateHoldParams, requestOptions?: any): IPromise; /** * Creates new jobs based on the provided parameters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobs) - * + * * @param params The parameters to be used for job creation, parameters defined in the job type can be overwritten. The jobTypeId and user are required parameters when creating a job. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ createJobs(params: JobCreationParameters, requestOptions?: any): IPromise; /** * Creates a version specific to the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.name The name of the version to be created. * @param params.parent The name of the job's assigned geodatabase (data workspace) version, based on which the new version will be created. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ createJobVersion(params: JobTaskCreateJobVersionParams, requestOptions?: any): IPromise; /** * Deletes an attachment from a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteAttachment) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.attachmentId The unique id of the attachment to be deleted. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ deleteAttachment(params: JobTaskDeleteAttachmentParams, requestOptions?: any): IPromise; /** * Deletes a job dependency. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteDependency) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.dependencyId The unique id of the dependency to be deleted. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ deleteDependency(params: JobTaskDeleteDependencyParams, requestOptions?: any): IPromise; /** * Delete one or more jobs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteJobs) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobIds An array of unique job Ids. * @param params.deleteHistory Indicates whether or not to delete the associated job history, the default is to delete job history. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ deleteJobs(params: JobTaskDeleteJobsParams, requestOptions?: any): IPromise; /** * Deletes a record from a job's linked properties table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.tableName The name of the table from which linked record will be deleted. * @param params.recordId The unique id of the record in the table. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ deleteLinkedRecord(params: JobTaskDeleteLinkedRecordParams, requestOptions?: any): IPromise; /** * Gets the activity log for a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getActivityLog) - * + * * @param jobId The unique id of the job. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getActivityLog(jobId: number, requestOptions?: any): IPromise; /** * Gets the URL to access the file content of an embedded job attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getAttachmentContentUrl) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.attachmentId The Id of the attachment to be retrieved. - * + * */ getAttachmentContentUrl(params: JobTaskGetAttachmentContentUrlParams): string; /** * Gets all the attachments associated with the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getAttachments) - * + * * @param jobId The unique id of the job. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getAttachments(jobId: number, requestOptions?: any): IPromise; /** * Gets an array of dependencies configured for a job. A job with a dependency is held at a step, stage or status of the other job, and cannot progress until the other job reaches the step, stage or status defined in the dependency. Once the other job reaches step, stage or status as defined in the dependency criteria the dependency is released and the dependent job can progress. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getDependencies) - * + * * @param jobId The unique id of the job. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getDependencies(jobId: number, requestOptions?: any): IPromise; /** * Gets an array of [extended properties](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) for a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getExtendedProperties) - * + * * @param jobId The unique id of the job. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getExtendedProperties(jobId: number, requestOptions?: any): IPromise; /** * Gets an array of holds on a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getHolds) - * + * * @param jobId The unique id of the job. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getHolds(jobId: number, requestOptions?: any): IPromise; /** * Gets the [job](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) object based on the given id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getJob) - * + * * @param jobId The unique id of the job to be retrieved. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getJob(jobId: number, requestOptions?: any): IPromise; /** * Gets all the job ids in the system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getJobIds) - * + * * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getJobIds(requestOptions?: any): IPromise; /** * Gets the notes for a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getNotes) - * + * * @param jobId The unique id of the job. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getNotes(jobId: number, requestOptions?: any): IPromise; /** * Gets an array of [values and descriptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) for a geodatabase domain or table list extended property field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.tableName The name of the extended property table. * @param params.field The field name of the extended property for which to retrieve values. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ listFieldValues(params: JobTaskListFieldValuesParams, requestOptions?: any): IPromise; /** * Gets an array of [display values](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) for a given fields that comprise a multi-level table list extended property. As each display field is selected, for example using a dropdown UI control, this method can be called to obtain a list of values to display in the subsequent dropdown control. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listMultiLevelFieldValues) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.field The name of the field. * @param params.previousSelectedValues The array of previous values, on which the current value is dependent on. For example, when selecting a city based on the state and county. The value for the state and county would be the previous values. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ - listMultiLevelFieldValues(params: JobTaskListMultiLevelFieldValuesParams, requestOptions?: any): IPromise; + listMultiLevelFieldValues( + params: JobTaskListMultiLevelFieldValuesParams, + requestOptions?: any + ): IPromise; /** * Logs an action in a job's activity log. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.activityTypeId The unique id representing the [activity type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) of the action associated with this log record. * @param params.comments The comment that is added to the history. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ logAction(params: JobTaskLogActionParams, requestOptions?: any): IPromise; /** * Queries the jobs using the queryId of an existing query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryJobs) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.queryId The unique id of a query, used to query jobs in the database. * @param params.user The username of the user who is requesting query. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ queryJobs(params: JobTaskQueryJobsParams, requestOptions?: any): IPromise; /** * Queries the jobs using an ad-hoc query definition and gets the [query result](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryResult). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryJobsAdHoc) - * + * * @param params The [parameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) to query jobs. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ queryJobsAdHoc(params: JobQueryParameters, requestOptions?: any): IPromise; /** * Gets an array of string values representing the current display values for each display field in a multi-level table list extended property. The values from this method should be used to pre-select items in dropdown lists when initially displaying the extended properties of a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryMultiLevelSelectedValues) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.field The name of the field. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ - queryMultiLevelSelectedValues(params: JobTaskQueryMultiLevelSelectedValuesParams, requestOptions?: any): IPromise; + queryMultiLevelSelectedValues( + params: JobTaskQueryMultiLevelSelectedValuesParams, + requestOptions?: any + ): IPromise; /** * Releases a job hold. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#releaseHold) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.holdId The unique id of the hold. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ releaseHold(params: JobTaskReleaseHoldParams, requestOptions?: any): IPromise; /** * Reopens one or more closed jobs. Supported from 10.3 onwards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#reopenClosedJobs) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobIds An array of unique job Ids. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ reopenClosedJobs(params: JobTaskReopenClosedJobsParams, requestOptions?: any): IPromise; /** * Performs a freeform text search and returns a set of matching job records. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#searchJobs) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.text The text which will be used to perform the search. * @param params.user The username of the user who is requesting search. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ searchJobs(params: JobTaskSearchJobsParams, requestOptions?: any): IPromise; /** * Unassigns one or more jobs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#unassignJobs) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobIds An array of unique job Ids. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ unassignJobs(params: JobTaskUnassignJobsParams, requestOptions?: any): IPromise; /** * Update a job's properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateJob) - * + * * @param params The [parameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) to be used for job properties update, the jobId and the user are required when updating jobs. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ updateJob(params: JobUpdateParameters, requestOptions?: any): IPromise; /** * Updates the notes for a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateNotes) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.notes The new notes for the job. Set to an empty (zero-length) string to clear the job notes. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ updateNotes(params: JobTaskUpdateNotesParams, requestOptions?: any): IPromise; /** * Updates the values of an extended or linked properties record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateRecord) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.record The record to be updated. * @param params.user The user name of the user who is requesting the change. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ updateRecord(params: JobTaskUpdateRecordParams, requestOptions?: any): IPromise; } @@ -37573,11 +39805,11 @@ declare namespace __esri { interface JobTaskConstructor { /** * Helps you work with Workflow Manager jobs. A job is a single unit of work that is carried out within an organization. Various methods are available in the class to work with the following: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html) */ - new(properties?: JobTaskProperties): JobTask; + new (properties?: JobTaskProperties): JobTask; } export const JobTask: JobTaskConstructor; @@ -37585,7 +39817,7 @@ declare namespace __esri { interface JobTaskProperties extends TaskProperties { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#url) */ url?: string; @@ -37593,31 +39825,31 @@ declare namespace __esri { /** * ActivityType represents an activity type template that gets logged on a job when a certain event is fired in the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) */ export interface ActivityType extends Object { /** * The description of the activity being recorded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) */ desription: string; /** * The unique id of the activity that is logged. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) */ id: number; /** * The message that will be logged when this type of activity occurs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) */ message: string; /** * The name of the activity that occurred. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) */ name: string; @@ -37625,25 +39857,25 @@ declare namespace __esri { /** * AuxRecord represents the extended/linked properties record information associated with a job so that you can fetch or update the information for a specified record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord) */ export interface AuxRecord extends Object { /** * The display value of the record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord) */ displayProperty: any; /** * The unique id of the record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord) */ id: number; /** * The array of the values in the [records](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord) */ recordvalues: AuxRecordValue; @@ -37651,31 +39883,31 @@ declare namespace __esri { /** * AuxRecordContainer represents the extended/linked properties table characteristics. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) */ export interface AuxRecordContainer extends Object { /** * The array of extended property [records](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecord). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) */ records: AuxRecord; /** * The type of extended property relationship. **Possible Values:** one-to-one | one-to-many - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) */ relationshipType: string; /** * The table alias. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) */ tableAlias: string; /** * The table name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordContainer) */ tableName: string; @@ -37683,25 +39915,25 @@ declare namespace __esri { /** * AuxRecordDescription represents the type of value that is captured in a specific AuxRecord field. There are multiple data types supported in Workflow Manager like - file, folder, text, date, etc. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordDescription) */ export interface AuxRecordDescription extends Object { /** * The array of property/value pairs of the record. - * + * * [Read more...](properties.html) */ properties: any; /** * The unique id of the record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordDescription) */ recordId: number; /** * The table name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordDescription) */ tableName: string; @@ -37709,97 +39941,97 @@ declare namespace __esri { /** * AuxRecordValue represents the values of extended/linked properties associated with a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ export interface AuxRecordValue extends Object { - /** - * The filter to restrict the types of records supported. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) - */ - filter: string; /** * The alias for the field in the table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ alias: string; + /** + * Indicates whether the extended property value can be updated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) + */ + canUpdate: boolean; /** * The data contained in the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ data: any; /** * The type of data expected in the field. **Possible Values:** small-integer | integer | single | double | string | date | oid | geometry | blob | raster | guid | global-id | xml - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ dataType: string; /** * The order each field is displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ displayOrder: number; /** * The type of extended property item. **Possible Values:** default | text | date | domain | file | geo-file | folder | list | table-list | multi-level-table-list - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ displayType: string; /** * The domain value configured for the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ domain: string; /** - * Indicates whether the extended property value can be updated. - * + * The filter to restrict the types of records supported. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ - canUpdate: boolean; + filter: string; /** * The length of the property string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ length: number; /** * The name property associated with the record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ name: string; /** * Indicates whether the property is a required or optional field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ required: boolean; /** * The lookup table that contains the list of values which will be selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ tableListClass: string; /** * The field that will be displayed for the extended property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ tableListDisplayField: string; /** * The field that contains the value that gets stored as the extended property value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ tableListStoreField: string; /** * Indicates whether the value will be visible to the user or not. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#AuxRecordValue) */ userVisible: boolean; @@ -37807,19 +40039,19 @@ declare namespace __esri { /** * FieldValue represents a single entry of a geodatabase domain or table list, applicable to constraining the values of an extended or linked property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) */ export interface FieldValue extends Object { /** * The description of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) */ description: string; /** * The value that is stored for the extended properties record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#FieldValue) */ value: any; @@ -37827,31 +40059,31 @@ declare namespace __esri { /** * JobAttachment represents an attachments associated with a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) */ export interface JobAttachment extends Object { /** * The name of the file attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) */ filename: string; /** * The file folder path or a URL. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) */ folder: string; /** * The unique id of the attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) */ id: number; /** * The storage type of the attachment. **Possible Values:** linked-file | embedded | url - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobAttachment) */ storageType: string; @@ -37859,109 +40091,109 @@ declare namespace __esri { /** * JobCreationParameters provides information about the properties used for creating a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ export interface JobCreationParameters extends Object { - /** - * The geometry of the job's location of interest (LOI). Supported geometry types include point, multipoint and polygon. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) - */ - loi: Geometry; /** * The name of the user or group to whom the job will be assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ assignedTo: string; + /** + * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) + */ + assignedType: string; /** * Indicates whether the workflow will be automatically committed upon creation of the job. The workflow cannot be edited after being committed to the system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ autoCommitWorkflow: boolean; /** * Indicates whether the job workflow will start execution automatically upon creation of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ autoExecute: boolean; /** * The unique id of the data workspace of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ dataWorkspaceId: string; /** * The description of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ description: string; /** * The date on which the job is expected to be complete. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ dueDate: Date; /** * The unique id of the job type from which to create the new job from. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ jobTypeId: number; /** - * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group - * + * The geometry of the job's location of interest (LOI). Supported geometry types include point, multipoint and polygon. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ - assignedType: string; + loi: Geometry; /** * The name of the new job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ name: string; /** * The number of jobs to be created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ numJobs: string; /** * The name of the user that will own the job. Job ownership allows modification of job properties and not workflow execution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ ownedBy: string; /** * The unique id of the job that will be designated as the parent job of the new job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ parentJobId: number; /** * The name of the geodatabase version that will be the parent version of the new job's version. By default it will be the parent version of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ parentVersion: string; /** * The numeric value to denote priority of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ priority: number; /** * The date on which the job is scheduled to begin. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ startDate: Date; /** * The username of the user creating the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobCreationParameters) */ user: string; @@ -37969,49 +40201,49 @@ declare namespace __esri { /** * JobDependency represents a dependency associated with a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ export interface JobDependency extends Object { /** * The unique id of the job on which the current job depends. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ depJobId: number; /** * Indicates whether the job is dependent on a step, stage or status of the other job. **Possible Values:** step | stage | status - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ depOnType: string; /** * The value of the step, stage or status of the other job on which the current job is dependent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ depOnValue: string; /** * The value of the step, stage or status at which the current job will be held. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ heldOnValue: number; /** * Indicates whether the job is held at a step, stage or status. **Possible Values:** step | stage | status - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ holdOnType: string; /** * The unique id of the dependency. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ id: number; /** * The unique id of the job on which the dependency exists. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobDependency) */ jobID: string; @@ -38019,157 +40251,157 @@ declare namespace __esri { /** * JobInfo represents a collection of job properties - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ export interface JobTaskJobInfo extends Object { - /** - * The name of the job. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) - */ - name: string; /** * The name of the user or group to whom the job is assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ assignedTo: string; + /** + * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) + */ + assignedType: string; /** * An array of unique job ids designated as child jobs for the current job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ childJobIds: number[]; /** * The user name of the person that created the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ createdBy: string; /** * The date the job was created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ createdDate: Date; /** * The unique id of the data workspace of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ dataWorkspaceId: string; /** * The description of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ description: string; /** * The date on which the job is expected to be complete. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ dueDate: Date; /** * The actual date the job's workflow was completed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ endDate: Date; /** * The unique id to identify the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ id: number; /** * The unique id of the job type whose instance is the current job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ jobTypeId: number; /** * The geometry of the job's location of interest (LOI). Supported geometry types include point, multipoint and polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ loi: Geometry; /** - * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group - * + * The name of the job. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ - assignedType: string; + name: string; /** * The name of the user that will own the job. Job ownership allows modification of job properties and not workflow execution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ ownedBy: string; /** * The unique id of the job that will be designated as the parent job of the new job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ parentJobId: number; /** * The name of the geodatabase version that is the parent version of the job's version. By default it will be the parent version of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ parentVersion: string; /** * The number of days that the job has been active. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ pendingDays: number; /** * The percentage of work completed on the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ percentageComplete: number; /** * The numeric value to denote priority of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ priority: number; /** * The internal stage of the job which corresponds to the status of the job. **Possible Values:** created | ready | working | done | closed - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ stage: string; /** * The date on which the job is scheduled to begin. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ startDate: Date; /** * The numeric value to represent the current status of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ status: number; /** * Indicates whether a version exists for the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ versionExists: boolean; /** * The information about job's geodatabase version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ versionInfo: JobVersionInfo; /** * The name of the job's geodatabase version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobInfo) */ versionName: string; @@ -38177,589 +40409,565 @@ declare namespace __esri { /** * JobQueryParameters is a full query definition of the selected query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) */ export interface JobQueryParameters extends Object { /** * An alias of fields included in the select statement. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) */ aliases: string; /** * An array of fields included in the select statement. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) */ fields: string; /** * The field that will be used to order the results returned by the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) */ orderBy: string; /** * The tables that will be used in the where clause for selection. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) */ tables: string; /** * The where clause used as a filter for selecting job information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) */ where: string; /** * The username of the user who is requesting query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobQueryParameters) */ user: string; } - export interface JobTaskAddEmbeddedAttachmentParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addEmbeddedAttachment) */ jobId: number; /** * The form element that contains the file input control. The form parameter can be an instance of FormData. Using FormData you can send a "multipart/form-data" request to the server without having to create an HTML form element in markup. Note that the FormData api is not available in all browsers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addEmbeddedAttachment) */ form: any; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addEmbeddedAttachment) */ user: string; } - export interface JobTaskAddLinkedAttachmentParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) */ jobId: number; /** * The type of attachment to be added. **Possible Values:** linked-file | url - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) */ attachmentType: number; /** * The file path to the attachment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) */ path: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedAttachment) */ user: string; } - export interface JobTaskAddLinkedRecordParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedRecord) */ jobId: number; /** * The name of the table to which the record will be added. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedRecord) */ tableName: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#addLinkedRecord) */ user: string; } - export interface JobTaskAssignJobsParams extends Object { /** * An array of unique job Ids. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) */ jobIds: number[]; /** * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) */ assignedType: string; /** * The name of the user or group to whom the job will be assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) */ assignedTo: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#assignJobs) */ user: string; } - export interface JobTaskCloseJobsParams extends Object { /** * An array of unique job Ids. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#closeJobs) */ jobIds: number[]; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#closeJobs) */ user: string; } - export interface JobTaskCreateDependencyParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) */ jobId: number; /** * Indicates whether the current job (to which the dependency is being added) will be held at a step, stage or status. **Possible Values:** step | stage | status - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) */ heldOnType: string; /** * The value of the step, stage or status at which the current job will be held. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) */ heldOnValue: number; /** * The unique id of the job on which the current job will depend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) */ depJobId: number; /** * Indicates whether the current job (to which the dependency is being added) will be dependent on a step, stage or status of the other job. **Possible Values:** step | stage | status - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) */ depOnType: string; /** * The value of the step or status of the other job on which the current job will be dependent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) */ depOnValue: number; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createDependency) */ user: string; } - export interface JobTaskCreateHoldParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) */ jobId: number; /** * The unique id representing the hold type to be placed on the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) */ holdTypeId: number; /** * Reason or more detailed information regarding why the hold is being added. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) */ comments: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createHold) */ user: string; } - export interface JobTaskCreateJobVersionParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) */ jobId: number; /** * The name of the version to be created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) */ name: string; /** * The name of the job's assigned geodatabase (data workspace) version, based on which the new version will be created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) */ parent: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#createJobVersion) */ user: string; } - export interface JobTaskDeleteAttachmentParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteAttachment) */ jobId: number; /** * The unique id of the attachment to be deleted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteAttachment) */ attachmentId: number; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteAttachment) */ user: string; } - export interface JobTaskDeleteDependencyParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteDependency) */ jobId: number; /** * The unique id of the dependency to be deleted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteDependency) */ dependencyId: number; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteDependency) */ user: string; } - export interface JobTaskDeleteJobsParams extends Object { /** * An array of unique job Ids. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteJobs) */ jobIds: number[]; /** * Indicates whether or not to delete the associated job history, the default is to delete job history. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteJobs) */ deleteHistory?: boolean; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteJobs) */ user: string; } - export interface JobTaskDeleteLinkedRecordParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) */ jobId: number; /** * The name of the table from which linked record will be deleted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) */ tableName: string; /** * The unique id of the record in the table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) */ recordId: number; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#deleteLinkedRecord) */ user: string; } - export interface JobTaskGetAttachmentContentUrlParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getAttachmentContentUrl) */ jobId: number; /** * The Id of the attachment to be retrieved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#getAttachmentContentUrl) */ attachmentId: number; } - export interface JobTaskListFieldValuesParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) */ jobId: number; /** * The name of the extended property table. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) */ tableName: string; /** * The field name of the extended property for which to retrieve values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) */ field: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listFieldValues) */ user: string; } - export interface JobTaskListMultiLevelFieldValuesParams extends Object { /** * The name of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listMultiLevelFieldValues) */ field: string; /** * The array of previous values, on which the current value is dependent on. For example, when selecting a city based on the state and county. The value for the state and county would be the previous values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listMultiLevelFieldValues) */ previousSelectedValues: string[]; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#listMultiLevelFieldValues) */ user: string; } - export interface JobTaskLogActionParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) */ jobId: number; /** * The unique id representing the [activity type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#ActivityType) of the action associated with this log record. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) */ activityTypeId: number; /** * The comment that is added to the history. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) */ comments: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#logAction) */ user: string; } - export interface JobTaskQueryJobsParams extends Object { /** * The unique id of a query, used to query jobs in the database. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryJobs) */ queryId: number; /** * The username of the user who is requesting query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryJobs) */ user: string; } - export interface JobTaskQueryMultiLevelSelectedValuesParams extends Object { /** * The name of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryMultiLevelSelectedValues) */ field: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#queryMultiLevelSelectedValues) */ user: string; } - export interface JobTaskReleaseHoldParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#releaseHold) */ jobId: number; /** * The unique id of the hold. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#releaseHold) */ holdId: number; } - export interface JobTaskReopenClosedJobsParams extends Object { /** * An array of unique job Ids. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#reopenClosedJobs) */ jobIds: number[]; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#reopenClosedJobs) */ user: string; } - export interface JobTaskSearchJobsParams extends Object { /** * The text which will be used to perform the search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#searchJobs) */ text: string; /** * The username of the user who is requesting search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#searchJobs) */ user: string; } - export interface JobTaskUnassignJobsParams extends Object { /** * An array of unique job Ids. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#unassignJobs) */ jobIds: number[]; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#unassignJobs) */ user: string; } - export interface JobTaskUpdateNotesParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateNotes) */ jobId: number; /** * The new notes for the job. Set to an empty (zero-length) string to clear the job notes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateNotes) */ notes: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateNotes) */ user: string; } - export interface JobTaskUpdateRecordParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateRecord) */ jobId: number; /** * The record to be updated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateRecord) */ record: AuxRecordDescription; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#updateRecord) */ user: string; @@ -38767,109 +40975,109 @@ declare namespace __esri { /** * JobUpdateParameters is a collection of properties that can be updated for jobs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ export interface JobUpdateParameters extends Object { - /** - * The name of the user that will own the job. Job ownership allows modification of job properties and not workflow execution. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) - */ - ownedBy: string; /** * The name of the user or group to whom the job will be assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ assignedTo: string; + /** + * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) + */ + assignedType: string; /** * The unique id of the data workspace of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ dataWorkspaceId: string; /** * The description of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ description: string; /** * The date on which the job is expected to be complete. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ dueDate: Date; /** * The geometry of the job's location of interest (LOI). Supported geometry types include point, multipoint and polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ loi: Geometry; /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ jobId: number; /** * The name of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ name: string; /** - * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** unassigned | user | group - * + * The name of the user that will own the job. Job ownership allows modification of job properties and not workflow execution. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ - assignedType: string; + ownedBy: string; /** * The unique id of the job that will be designated as the parent job of the new job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ parentJobId: number; /** * The name of the geodatabase version that will be the parent version of the new job's version. By default it will be the parent version of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ parentVersion: string; /** * The percentage of work completed on the job's current step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ percent: number; /** * The numeric value to denote priority of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ priority: number; /** * The date on which the job is scheduled to begin. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ startDate: Date; /** * The unique id of the job's new status. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ status: number; /** * The name of the geodatabase version to be used for the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ versionName: string; /** * The user name of the user who is requesting the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobUpdateParameters) */ user: string; @@ -38877,37 +41085,37 @@ declare namespace __esri { /** * JobVersionInfo represents a collection of properties for a job's version. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) */ export interface JobVersionInfo extends Object { /** * The unique id of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) */ dataWorkspaceId: string; /** * The name of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) */ name: string; /** * The parent version of the geodatabase. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) */ parent: string; /** * Indicates whether the version has been created or not. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) */ created: boolean; /** * The name of the version owner. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#JobVersionInfo) */ owner: string; @@ -38915,31 +41123,31 @@ declare namespace __esri { /** * QueryFieldInfo represents a collection of field properties that are returned as part of a query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) */ export interface QueryFieldInfo extends Object { /** * The alias name of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) */ alias: string; /** * The field length. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) */ length: string; /** * The name of the data workspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) */ name: string; /** * The type of data expected in the field. **Possible Values:** small-integer | integer | single | double | string | date | oid | geometry | blob | raster | guid | global-id | xml - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryFieldInfo) */ type: string; @@ -38947,19 +41155,19 @@ declare namespace __esri { /** * QueryResult contains the result of a query after it has been executed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryResult) */ export interface QueryResult extends Object { /** * An array of fields and field properties in the query. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryResult) */ fields: QueryFieldInfo[]; /** * The rows of results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-JobTask.html#QueryResult) */ rows: string[]; @@ -38968,116 +41176,116 @@ declare namespace __esri { interface NotificationTask extends Task { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#url) */ url: string; /** * Creates a new spatial notification change rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#addChangeRule) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.rule The [change rule](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) to be added. * @param params.user The username requesting the addition of the rule. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ addChangeRule(params: NotificationTaskAddChangeRuleParams, requestOptions?: any): IPromise; /** * Deletes a spatial notification change rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#deleteChangeRule) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.ruleId The unique id of the rule to be deleted. * @param params.user The username requesting the deletion of the rule. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ deleteChangeRule(params: NotificationTaskDeleteChangeRuleParams, requestOptions?: any): IPromise; /** * Get an array of all the spatial notification [change rules](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) configured in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getAllChangeRules) - * + * * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getAllChangeRules(requestOptions?: any): IPromise; /** * Get a single spatial notification [change rule](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) by ruleId. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getChangeRule) - * + * * @param ruleId The unique id of the [change rule](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule). * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getChangeRule(ruleId: string, requestOptions?: any): IPromise; /** * Get information about a [match](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) for a change and change rule related to a spatial notification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getChangeRuleMatch) - * + * * @param matchId The unique id of the spatial notification match. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getChangeRuleMatch(matchId: string, requestOptions?: any): IPromise; /** * Get the current time of the database. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getDatabaseTime) - * + * * @param dataWorkspaceId The unique id of the dataWorkspace. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getDatabaseTime(dataWorkspaceId: string, requestOptions?: any): IPromise; /** * Get an array of [matches](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) that match the change rule criteria in a specific editing session. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#getSessionMatches) - * + * * @param sessionId The unique id of the spatial notification session. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getSessionMatches(sessionId: string, requestOptions?: any): IPromise; /** * Sends the notifications configured for the matches found during a rule evaluation session. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#notifySession) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.sessionid The unique id of the spatial notification session. * @param params.deleteAfter Indicates whether to delete the session matches after sending any notifications. The default is false. * @param params.user The username requesting the sending of notification. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ notifySession(params: NotificationTaskNotifySessionParams, requestOptions?: any): IPromise; /** * Queries the array of spatial notification [change rules](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) based on specified criteria. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.name A search string to find within change rule names. * @param params.description A search string to find within change rule descriptions. * @param params.searchType The type of search to perform, default is contains. **Possible Values:** contains | exact | starts-with | ends-with * @param params.user The username requesting the search. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ queryChangeRules(params: NotificationTaskQueryChangeRulesParams, requestOptions?: any): IPromise; /** * Executes the configured spatial notification change rules on a data workspace by evaluating the geodatabase archive. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.dataWorkspaceId The unique id of the dataWorkspace. * @param params.from The starting time to query for new changes. @@ -39086,58 +41294,67 @@ declare namespace __esri { * @param params.send Indicates whether to the send notifications at the time matches are found. The default is false. * @param params.user The username requesting the execution of the rule. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ - runSpatialNotificationOnHistory(params: NotificationTaskRunSpatialNotificationOnHistoryParams, requestOptions?: any): IPromise; + runSpatialNotificationOnHistory( + params: NotificationTaskRunSpatialNotificationOnHistoryParams, + requestOptions?: any + ): IPromise; /** * Sends an email of the specified [notification type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#sendNotification) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.notificationType The name of the [notification type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) to be sent. * @param params.user The username requesting to send the notification. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ sendNotification(params: NotificationTaskSendNotificationParams, requestOptions?: any): IPromise; /** * Adds an email address to the subscriber list for a specific notification type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#subscribeToNotification) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.notificationTypeId The unique id of the notification type to which the email address will be added. * @param params.email The email address to add to the notification type's subscriber list. May contain tokens. * @param params.user The username requesting the addition of email address to the notification subscriber's list. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ - subscribeToNotification(params: NotificationTaskSubscribeToNotificationParams, requestOptions?: any): IPromise; + subscribeToNotification( + params: NotificationTaskSubscribeToNotificationParams, + requestOptions?: any + ): IPromise; /** * Removes an email address from the subscriber list for a specific notification type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#unsubscribeFromNotification) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.notificationTypeId The unique id of the notification type from which the email address will be removed. * @param params.email The email address to remove from the notification type's subscriber list. May contain tokens. * @param params.user The username requesting the removal of email address to the notification subscriber's list. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ - unsubscribeFromNotification(params: NotificationTaskUnsubscribeFromNotificationParams, requestOptions?: any): IPromise; + unsubscribeFromNotification( + params: NotificationTaskUnsubscribeFromNotificationParams, + requestOptions?: any + ): IPromise; } interface NotificationTaskConstructor { /** * Exposes functions to perform operations with Workflow Manager notifications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html) */ - new(properties?: NotificationTaskProperties): NotificationTask; + new (properties?: NotificationTaskProperties): NotificationTask; } export const NotificationTask: NotificationTaskConstructor; @@ -39145,7 +41362,7 @@ declare namespace __esri { interface NotificationTaskProperties extends TaskProperties { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#url) */ url?: string; @@ -39153,43 +41370,43 @@ declare namespace __esri { /** * AOIEvaluator represents the rules that triggers a spatial notification based on area of interest(AOI). This contains the geometric operation and the criteria to be used based on the AOI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) */ export interface AOIEvaluator extends Object { /** * The area of interest. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) */ aoi: Polygon; /** * Indicates whether to inverse the spatial relationship or not. For example, if the spatial relationship is inversed for operator Within, then features that are not within will be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) */ inverse: boolean; /** * The name of the AOI evaluator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) */ name: string; /** * The spatial relationship to be applied for evaluation of the rule. **Possible Values:** intersects | contains | crosses | envelope-intersects | index-intersects | overlaps | touches | within | relation - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) */ relation: string; /** * The type of the AOI evaluator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) */ type: string; /** * Indicates whether job AOI should be used as the extent or not for the evaluation of the rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) */ useJobAOI: boolean; @@ -39197,43 +41414,43 @@ declare namespace __esri { /** * ChangeRule represents a single change rule that triggers a spatial notification. When the criteria defined in the rule is met an email notification is sent to recipients. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) */ export interface ChangeRule extends Object { /** * The description of the change rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) */ description: string; /** * An array of [AOI](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#AOIEvaluator) and [Dataset](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) evaluators. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) */ evaluators: any[]; /** * The unique id of the change rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) */ id: number; /** * The name of the change rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) */ name: string; /** * The type of notifier, the default is [email notifier](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier). This can be extended to use your own notifiers like SMS, instant messaging. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) */ notifier: any; /** * Indicates whether to summarize email contents or not. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) */ summarize: boolean; @@ -39241,49 +41458,49 @@ declare namespace __esri { /** * ChangeRuleMatch represents information about the change and change rule related to a spatial notification match. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ export interface ChangeRuleMatch extends Object { /** * The time the change occurred to the data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ changeTime: Date; /** * The type of change that happened to the data. **Possible Values:** add | modify | delete | all - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ changeType: string; /** * The dataset that changed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ dataset: string; /** * The unique id of the data workspace containing the changed data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ dataWorkspaceId: string; /** * The unique id of the associated to the change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ id: string; /** * The unique id of the job where the change was made. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ jobID: string; /** * The unique id of the change rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRuleMatch) */ ruleID: string; @@ -39291,43 +41508,43 @@ declare namespace __esri { /** * DatasetConfiguration represents the criteria and dataset that the change rule applies to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) */ export interface DatasetConfiguration extends Object { /** * This indicates whether the notification will be sent always or if values change to defined in whereConditions or if values change from defined in whereConditions. **Possible Values:** always | changed-to | changed-from - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) */ changeCondition: number; /** * The name of the fields, changes to which trigger the notification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) */ changeFields: string; /** * The name of the dataset that will trigger the notification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) */ dataset: string; /** * The unique id of the data workspace containing the changed data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) */ dataWorkspaceId: string; /** * The name of the dataset configuration rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) */ name: string; /** * The [where conditions](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) defining the criteria to trigger the rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) */ whereConditions: WhereCondition[]; @@ -39335,25 +41552,25 @@ declare namespace __esri { /** * DataSetEvaluator represents the rules that triggers a spatial notification based on the changes in a dataset. This contains the specific features and feature class that are participating in a spatial notification rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) */ export interface DataSetEvaluator extends Object { /** * The array of [DatasetConfigurations](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) representing the dataset to which the rule applies. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) */ dataSetConfigurations: DatasetConfiguration[]; /** * The name of the dataset evaluator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) */ name: string; /** * The type of the dataset evaluator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) */ type: string; @@ -39361,243 +41578,235 @@ declare namespace __esri { /** * EmailNotifier represents the properties of a notification type that is configured in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ export interface EmailNotifier extends Object { /** * Indicates whether the job's file attachment will be attached to the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ attachJobAttachments: boolean; /** * The message content sent as part of the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ message: string; /** * The name of the notifier. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ name: string; /** * The sender's (from) email address. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ senderEmail: string; /** * The sender's (from) name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ senderName: string; /** * The subject of the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ subject: string; /** * The array of subscribers who will get the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ subscribers: string[]; /** * The type of notifier. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#EmailNotifier) */ type: string; } - export interface NotificationTaskAddChangeRuleParams extends Object { /** * The [change rule](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#ChangeRule) to be added. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#addChangeRule) */ rule: ChangeRule; /** * The username requesting the addition of the rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#addChangeRule) */ user: string; } - export interface NotificationTaskDeleteChangeRuleParams extends Object { /** * The unique id of the rule to be deleted. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#deleteChangeRule) */ ruleId: string; /** * The username requesting the deletion of the rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#deleteChangeRule) */ user: string; } - export interface NotificationTaskNotifySessionParams extends Object { /** * The unique id of the spatial notification session. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#notifySession) */ sessionid: string; /** * Indicates whether to delete the session matches after sending any notifications. The default is false. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#notifySession) */ deleteAfter: boolean; /** * The username requesting the sending of notification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#notifySession) */ user: string; } - export interface NotificationTaskQueryChangeRulesParams extends Object { /** * A search string to find within change rule names. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) */ name: string; /** * A search string to find within change rule descriptions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) */ description: string; /** * The type of search to perform, default is contains. **Possible Values:** contains | exact | starts-with | ends-with - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) */ searchType: string; /** * The username requesting the search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#queryChangeRules) */ user: string; } - export interface NotificationTaskRunSpatialNotificationOnHistoryParams extends Object { /** * The unique id of the dataWorkspace. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) */ dataWorkspaceId: string; /** * The starting time to query for new changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) */ from: Date; /** * The ending time to query for new changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) */ to: Date; /** * Indicates whether to keep the matches found, stored in the ArcGIS Workflow Manager repository. The default is false. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) */ logMatches: boolean; /** * Indicates whether to the send notifications at the time matches are found. The default is false. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) */ send: boolean; /** * The username requesting the execution of the rule. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#runSpatialNotificationOnHistory) */ user: string; } - export interface NotificationTaskSendNotificationParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#sendNotification) */ jobId: number; /** * The name of the [notification type](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) to be sent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#sendNotification) */ notificationType: string; /** * The username requesting to send the notification. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#sendNotification) */ user: string; } - export interface NotificationTaskSubscribeToNotificationParams extends Object { /** * The unique id of the notification type to which the email address will be added. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#subscribeToNotification) */ notificationTypeId: number; /** * The email address to add to the notification type's subscriber list. May contain tokens. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#subscribeToNotification) */ email: string; /** * The username requesting the addition of email address to the notification subscriber's list. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#subscribeToNotification) */ user: string; } - export interface NotificationTaskUnsubscribeFromNotificationParams extends Object { /** * The unique id of the notification type from which the email address will be removed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#unsubscribeFromNotification) */ notificationTypeId: number; /** * The email address to remove from the notification type's subscriber list. May contain tokens. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#unsubscribeFromNotification) */ email: string; /** * The username requesting the removal of email address to the notification subscriber's list. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#unsubscribeFromNotification) */ user: string; @@ -39605,55 +41814,55 @@ declare namespace __esri { /** * NotificationType represents the properties of a notification type that are sent when certain events happen in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ export interface NotificationType extends Object { /** * Indicates whether the job's file attachment will be attached to the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ attachJobAttachments: boolean; /** * The unique id of the notification type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ id: number; /** * The message content sent as part of the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ message: string; /** * The sender's (from) email address. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ senderEmail: string; /** * The sender's (from) name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ senderName: string; /** * The subject of the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ subject: string; /** * The array of subscribers who will get the email. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ subscribers: string[]; /** * The type of notifier. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#NotificationType) */ type: string; @@ -39661,25 +41870,25 @@ declare namespace __esri { /** * WhereCondition returns the condition set in [DatasetConfiguration](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DatasetConfiguration) for a [Dataset](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#DataSetEvaluator) evaluator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) */ export interface WhereCondition extends Object { /** * The value to be compared/evaluated with. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) */ compareValue: any; /** * The field name that contains the value to be compared. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) */ field: string; /** * The operator to be used for comparison. **Possible Values:** equal | not-equal | greater-than | greater-or-equal | less-than | less-or-equal | contains - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-NotificationTask.html#WhereCondition) */ operator: string; @@ -39688,63 +41897,63 @@ declare namespace __esri { interface ReportTask extends Task { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#url) */ url: string; /** * Generates a report and returns the output as formatted HTML. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#generateReport) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.reportId The id of the report. * @param params.user The user name requesting the report. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ generateReport(params: ReportTaskGenerateReportParams, requestOptions?: any): IPromise; /** * Gets all the [reports](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) that are configured in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getAllReports) - * + * * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getAllReports(requestOptions?: any): IPromise; /** * Returns the URL string for the report content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportContentUrl) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.reportId The id of the report. * @param params.user The username of the user requesting the report content. - * + * */ getReportContentUrl(params: ReportTaskGetReportContentUrlParams): string; /** * Executes a report and returns the raw [report data](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportData) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.reportId The id of the report. * @param params.user The username of the user requesting the report data. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getReportData(params: ReportTaskGetReportDataParams, requestOptions?: any): IPromise; /** * Gets the XSLT stylesheet for the specified report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportStylesheet) - * + * * @param reportId The id of the report. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getReportStylesheet(reportId: number, requestOptions?: any): IPromise; } @@ -39752,11 +41961,11 @@ declare namespace __esri { interface ReportTaskConstructor { /** * Helps you generate reports about the work being managed in your Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html) */ - new(properties?: ReportTaskProperties): ReportTask; + new (properties?: ReportTaskProperties): ReportTask; } export const ReportTask: ReportTaskConstructor; @@ -39764,7 +41973,7 @@ declare namespace __esri { interface ReportTaskProperties extends TaskProperties { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#url) */ url?: string; @@ -39772,37 +41981,37 @@ declare namespace __esri { /** * Report represents a configured report in the Workflow Manager system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) */ export interface Report extends Object { /** * A description of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) */ description: string; /** * The category to which the report belongs in the system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) */ hierarchy: string; /** * A unique id for the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) */ id: number; /** * The name of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) */ name: string; /** * The title of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#Report) */ title: string; @@ -39810,31 +42019,31 @@ declare namespace __esri { /** * ReportData is the generated result of a report after it has been executed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) */ export interface ReportData extends Object { /** * The name of columns returned as part of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) */ columns: string[]; /** * A description of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) */ description: string; /** * The [aggregation of the report data](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) into subcategories. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) */ groups: ReportDataGroup[]; /** * The title of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportData) */ title: string; @@ -39842,79 +42051,76 @@ declare namespace __esri { /** * ReportDataGroup aggregates the report results into user defined categories. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) */ export interface ReportDataGroup extends Object { /** * The label of the aggregate category as defined in the report, eg. Total Jobs. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) */ aggregateLabel: string; /** * The value of the aggregate category based on the calculation defined in the report section options. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) */ aggregateValue: string; /** * The rows containing the data returned in the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) */ row: string[]; /** * The data value based on which the section is created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#ReportDataGroup) */ value: string; } - export interface ReportTaskGenerateReportParams extends Object { /** * The id of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#generateReport) */ reportId: number; /** * The user name requesting the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#generateReport) */ user: string; } - export interface ReportTaskGetReportContentUrlParams extends Object { /** * The id of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportContentUrl) */ reportId: number; /** * The username of the user requesting the report content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportContentUrl) */ user: number; } - export interface ReportTaskGetReportDataParams extends Object { /** * The id of the report. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportData) */ reportId: number; /** * The username of the user requesting the report data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-ReportTask.html#getReportData) */ user: string; @@ -39923,15 +42129,15 @@ declare namespace __esri { interface TokenTask extends Task { /** * Parses a string with embedded tokens using user and job information. The string is returned with embedded tokens replaced by their actual values. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html#parseTokens) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId A unique id for the job. * @param params.stringToParse The string representing the tokens to be parsed. * @param params.user The username of the user requesting token parsing. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ parseTokens(params: TokenTaskParseTokensParams, requestOptions?: any): IPromise; } @@ -39939,36 +42145,33 @@ declare namespace __esri { interface TokenTaskConstructor { /** * Helps you parse Workflow Manager tokens to the actual value of tokens in the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html) */ - new(properties?: TokenTaskProperties): TokenTask; + new (properties?: TokenTaskProperties): TokenTask; } export const TokenTask: TokenTaskConstructor; - interface TokenTaskProperties extends TaskProperties { - - } - + interface TokenTaskProperties extends TaskProperties {} export interface TokenTaskParseTokensParams extends Object { /** * A unique id for the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html#parseTokens) */ jobId: any; /** * The string representing the tokens to be parsed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html#parseTokens) */ stringToParse: string; /** * The username of the user requesting token parsing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-TokenTask.html#parseTokens) */ user: string; @@ -39977,156 +42180,156 @@ declare namespace __esri { interface WorkflowTask extends Task { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#url) */ url: string; /** * Get the information which indicates whether this workflow step can be run. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#canRunStep) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepId The unique id of the step. * @param params.user The user name of the user wanting to run the step. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ canRunStep(params: WorkflowTaskCanRunStepParams, requestOptions?: any): IPromise; /** * Executes the specified steps in order and gets back [execution information](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) of the steps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepIds The array of unique step Ids. * @param params.auto Indicates whether to automatically execute as many steps as possible, based on the workflow configuration. The default is false, to execute only the current step. * @param params.user The user name of the user executing the step. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ executeSteps(params: WorkflowTaskExecuteStepsParams, requestOptions?: any): IPromise; /** * Gets all workflow [steps](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) of a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getAllSteps) - * + * * @param jobId The unique id of the job. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getAllSteps(jobId: number, requestOptions?: any): IPromise; /** * Gets all current [steps](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) of a job. A workflow will have more than one current step if it is configured to support parallel steps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getCurrentSteps) - * + * * @param jobId The unique id of the job. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getCurrentSteps(jobId: number, requestOptions?: any): IPromise; /** * Gets a specific workflow [step](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) of a job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStep) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepId The unique id of the step. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getStep(params: WorkflowTaskGetStepParams, requestOptions?: any): IPromise; /** * Get the help associated with a workflow step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepDescription) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepId The unique id of the step. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getStepDescription(params: WorkflowTaskGetStepDescriptionParams, requestOptions?: any): IPromise; /** * Gets a URL to access the file content of a file step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepFileUrl) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepId The unique id of the step. - * + * */ getStepFileUrl(params: WorkflowTaskGetStepFileUrlParams): string; /** * Get a job's [workflow display details](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getWorkflowDisplayDetails) - * + * * @param jobId The unique id of the job. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ getWorkflowDisplayDetails(jobId: number, requestOptions?: any): IPromise; /** * Gets a URL of an image depicting the current state of a job's workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getWorkflowImageUrl) - * + * * @param jobId The unique id of the job. - * + * */ getWorkflowImageUrl(jobId: number): string; /** * Marks the specified steps of a job workflow as completed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#markStepsAsDone) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepIds The array of unique step Ids. * @param params.user The user name of the user marking the step complete. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ markStepsAsDone(params: WorkflowTaskMarkStepsAsDoneParams, requestOptions?: any): IPromise; /** * Advances the workflow to the next step based on a return code value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job Id. * @param params.stepId The unique id of the step. * @param params.returnCode A numeric value representing the return code. * @param params.user The user name of the user advancing the workflow to the next step. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ moveToNextStep(params: WorkflowTaskMoveToNextStepParams, requestOptions?: any): IPromise; /** * The job workflow is updated with the latest workflow of job type, after the job has been created. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#recreateWorkflow) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.user The user name of the user recreating the workflow. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ recreateWorkflow(params: WorkflowTaskRecreateWorkflowParams, requestOptions?: any): IPromise; /** * Resolves workflow path conflicts resulting from executing or marking as complete a step, which can have two or more next steps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepId The unique id of the step. @@ -40134,20 +42337,20 @@ declare namespace __esri { * @param params.optionStepIds An array of unique step IDs of all the possible next steps. * @param params.user The user name of the user resolving the conflict. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ resolveConflict(params: WorkflowTaskResolveConflictParams, requestOptions?: any): IPromise; /** * Sets a step as the current active step of a job workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#setCurrentStep) - * + * * @param params See the object specifications in table below for the structure of the `params` object. * @param params.jobId The unique id of the job. * @param params.stepId The unique id of the step. * @param params.user The user name of the user setting the current step. * @param requestOptions Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest) to be used for the data request (will override requestOptions defined during construction). - * + * */ setCurrentStep(params: WorkflowTaskSetCurrentStepParams, requestOptions?: any): IPromise; } @@ -40155,11 +42358,11 @@ declare namespace __esri { interface WorkflowTaskConstructor { /** * Class to perform operations on Workflow Manager workflows and steps. The workflows are collections of steps that are executed while working on a job. Workflows are designed to organize and simplify tasks to ensure that no step is missed. The steps are the building blocks of your workflows and are connected using paths. Step and path properties determine the flow of the work. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html) */ - new(properties?: WorkflowTaskProperties): WorkflowTask; + new (properties?: WorkflowTaskProperties): WorkflowTask; } export const WorkflowTask: WorkflowTaskConstructor; @@ -40167,7 +42370,7 @@ declare namespace __esri { interface WorkflowTaskProperties extends TaskProperties { /** * URL to the ArcGIS Workflow Manager REST service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#url) */ url?: string; @@ -40175,67 +42378,67 @@ declare namespace __esri { /** * ExecuteInfo provides information on whether a step can be executed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ export interface ExecuteInfo extends Object { /** * Information about [conflicts](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) in workflow step progression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ conflicts: WorkflowConflicts; /** * The error code returned by the steps in the workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ errorCode: number; /** * The description for the errors returned by the steps in the workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ errorDescription: string; /** * The result of a step execution. **Possible Values:** executed | dependent-on-step | dependent-on-stage | dependent-on-status | job-on-hold | step-depends-on-step | check | step-assigned-to-other-user | step-assigned-to-other-group | job-assigned-to-others | job-closed | invalid-platform | invalid-step | dependent-on-job | not-current-step - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ executionResult: string; /** * Indicates whether a step has conflicts. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ hasConflicts: boolean; /** * Indicates whether a step has return code. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ hasReturnCode: boolean; /** * The unique id of current job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ jobID: number; /** * The return code for the current workflow step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ returnCode: number; /** * The unique id of the current step in the workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ stepID: number; /** * Indicates whether the step threw an error during execution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#ExecuteInfo) */ threwError: boolean; @@ -40243,109 +42446,109 @@ declare namespace __esri { /** * Step represents the properties of a step that is used in a job's workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ export interface Step extends Object { - /** - * Indicates whether the step has already been executed. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) - */ - hasBeenExecuted: boolean; /** * The user or group to whom the step is assigned. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ assignedTo: string; + /** + * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** none | unassigned | user | group + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) + */ + assignedType: string; /** * Indicates whether the step can be run asynchronously. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ async: boolean; /** * Indicates whether the step can be automatically executed when reached. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ autoRun: boolean; /** * Indicates whether the step can be skipped without executing it. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ canSkip: boolean; /** * Indicates whether the step can start parallel execution of other steps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ canSpawnConcurrency: boolean; /** * The unique id of step type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ commonId: number; /** * The default percentage completion of the job once step is reached. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ defaultPercentComplete: number; /** - * Indicates whether the job is assigned to a user, group or unassigned. **Possible Values:** none | unassigned | user | group - * + * Indicates whether the step has already been executed. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ - assignedType: string; + hasBeenExecuted: boolean; /** * Indicates whether the step has been started. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ hasBeenStarted: boolean; /** * The unique id generated as the step Id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ id: number; /** * The name of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ name: string; /** * Indicates whether the step will be automatically marked as complete when complete. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ selfCheck: boolean; /** * The unique numeric status value configured as the status of the job once step is reached. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ statusId: number; /** * The percentage completion of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ stepPercentComplete: number; /** * The type of notification that will be sent when the step finishes execution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ notificationType: string; /** * The [step template](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) for current step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#Step) */ stepType: StepType; @@ -40353,73 +42556,73 @@ declare namespace __esri { /** * StepType represents properties of step templates that are available in the Workflow Manager system for authoring workflows. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ export interface StepType extends Object { - /** - * The program/application/code that will be executed on this step. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) - */ - program: string; /** * The step arguments required at runtime. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ arguments: string; + /** + * The description of the step type. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) + */ + description: string; /** * The type of execution for the step. **Possible Values:** executable | function | procedural | launch-url | question | open-file - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ executionType: string; /** * The unique id for the step type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ id: number; /** * The name of the step type. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ name: string; /** - * The description of the step type. - * + * The program/application/code that will be executed on this step. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ - description: string; + program: string; /** * The path/URL of the step description. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ stepDescriptionLink: string; /** * The type of step description. **Possible Values:** none | embedded-html | link - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ stepDescriptionType: string; /** * The shape of the step as it will appear in a workflow graphic. **Possible Values:** rounded-rectangle | rectangle | oval | diamond | parallelogram - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ stepIndicatorType: string; /** * The platform on which the step can be executed. **Possible Values:** desktop | server | both - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ supportedPlatform: string; /** * Indicates whether Workflow Manager will be minimized and hidden during step execution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#StepType) */ visible: boolean; @@ -40427,55 +42630,55 @@ declare namespace __esri { /** * WorkflowAnnotationDisplayDetails represents properties of a workflow annotation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ export interface WorkflowAnnotationDisplayDetails extends Object { /** * The X coordinate of the annotation object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ centerX: number; /** * The Y coordinate of the annotation object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ centerY: number; /** * The fill color of the annotation object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ fillColor: Color; /** * The height of the annotation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ height: number; /** * The annotation text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ label: string; /** * The color of annotation label text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ labelColor: Color; /** * The outline color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ OutlineColor: Color; /** * The width of the annotation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails) */ width: number; @@ -40483,31 +42686,31 @@ declare namespace __esri { /** * WorkflowConflicts represents properties for workflows that have a conflicting path or multiple possible paths for progression. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) */ export interface WorkflowConflicts extends Object { /** * The unique id of currently active job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) */ jobID: number; /** * The information about the step in the workflow returned as [WorkflowOption](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowOption). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) */ options: WorkflowOption[]; /** * Indicates whether the step will begin a concurrent path in the workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) */ spawnsConcurrency: boolean; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowConflicts) */ stepId: number; @@ -40515,25 +42718,25 @@ declare namespace __esri { /** * WorkflowDisplayDetails represents a collection of properties that constitute a workflow - annotations, steps, and paths. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails) */ export interface WorkflowDisplayDetails extends Object { /** * The properties of how the [annotations are displayed](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowAnnotationDisplayDetails). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails) */ annotations: WorkflowAnnotationDisplayDetails[]; /** * The properties of how the [path are displayed](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails) */ paths: WorkflowPathDisplayDetails[]; /** * The properties of how the [step are displayed](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowDisplayDetails) */ steps: WorkflowStepDisplayDetails[]; @@ -40541,19 +42744,19 @@ declare namespace __esri { /** * WorkflowOption represents properties of a workflow that have return codes and step branches. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowOption) */ export interface WorkflowOption extends Object { /** * The return code generated from a step execution. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowOption) */ returnCode: number; /** * The collection of [descriptions for workflow steps](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepInfo). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowOption) */ steps: WorkflowStepInfo[]; @@ -40561,62 +42764,62 @@ declare namespace __esri { /** * WorkflowPathDisplayDetails represents properties of a workflow's path properties like location, destination steps, position on the workflow canvas. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ export interface WorkflowPathDisplayDetails extends Object { /** * The unique id of the step to which the path will lead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ destStepId: number; /** * The unique id of the step just executed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ sourceStepID: number; /** * The label associated with the path. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ label: string; /** * The color of the label on the path. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ labelColor: Color; /** * The X coordinate of the label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ labelX: number; /** * The Y coordinate of the label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ labelY: number; /** * The color of the line representing the path. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ lineColor: Color; /** - * An object with following properties. - * + * An object with following properties. + * * Name | Type | Description * ---------|--------|------------- * isDefault | Boolean | Indicates whether this is the default path(only path) from the source step. * numReturnValues | Number[] | The number of possible return values for the path. * returnValueX | Number[] | The return values associated with the path. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowPathDisplayDetails) */ pathObject: any; @@ -40624,73 +42827,73 @@ declare namespace __esri { /** * WorkflowStepDisplayDetails represents properties of a workflow step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ export interface WorkflowStepDisplayDetails extends Object { - /** - * The color of step label text. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) - */ - labelColor: Color; /** * The X coordinate of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ centerX: number; + /** + * The Y coordinate of the step. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) + */ + centerY: number; /** * The fill color of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ fillColor: Color; /** * The height of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ height: number; /** * The step text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ label: string; /** - * The Y coordinate of the step. - * + * The color of step label text. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ - centerY: number; + labelColor: Color; /** * The outline color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ OutlineColor: Color; /** * The shape of the step. **Possible Values:** rounded-rectangle | rectangle | oval | diamond | parallelogram - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ shape: string; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ stepId: number; /** * The step execution type. **Possible Values:** executable | function | procedural | launch-url | question | open-file - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ stepType: string; /** * The width of the annotation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepDisplayDetails) */ width: number; @@ -40698,239 +42901,229 @@ declare namespace __esri { /** * WorkflowStepInfo represents collection of descriptions for workflow's steps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepInfo) */ export interface WorkflowStepInfo extends Object { /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepInfo) */ id: number; /** * The name of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#WorkflowStepInfo) */ name: string; } - export interface WorkflowTaskCanRunStepParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#canRunStep) */ jobId: number; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#canRunStep) */ stepId: number; /** * The user name of the user wanting to run the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#canRunStep) */ user: string; } - export interface WorkflowTaskExecuteStepsParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) */ jobId: number; /** * The array of unique step Ids. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) */ stepIds: number[]; /** * Indicates whether to automatically execute as many steps as possible, based on the workflow configuration. The default is false, to execute only the current step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) */ auto: boolean; /** * The user name of the user executing the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#executeSteps) */ user: string; } - export interface WorkflowTaskGetStepDescriptionParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepDescription) */ jobId: number; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepDescription) */ stepId: number; } - export interface WorkflowTaskGetStepFileUrlParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepFileUrl) */ jobId: number; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStepFileUrl) */ stepId: number; } - export interface WorkflowTaskGetStepParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStep) */ jobId: number; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#getStep) */ stepId: number; } - export interface WorkflowTaskMarkStepsAsDoneParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#markStepsAsDone) */ jobId: number; /** * The array of unique step Ids. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#markStepsAsDone) */ stepIds: number[]; /** * The user name of the user marking the step complete. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#markStepsAsDone) */ user: string; } - export interface WorkflowTaskMoveToNextStepParams extends Object { /** * The unique id of the job Id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) */ jobId: number; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) */ stepId: number; /** * A numeric value representing the return code. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) */ returnCode: number; /** * The user name of the user advancing the workflow to the next step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#moveToNextStep) */ user: string; } - export interface WorkflowTaskRecreateWorkflowParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#recreateWorkflow) */ jobId: number; /** * The user name of the user recreating the workflow. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#recreateWorkflow) */ user: string; } - export interface WorkflowTaskResolveConflictParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) */ jobId: number; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) */ stepId: number; /** * A numeric value representing the return code from the step where the conflict was encountered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) */ optionReturnCode: number; /** * An array of unique step IDs of all the possible next steps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) */ optionStepIds: number[]; /** * The user name of the user resolving the conflict. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#resolveConflict) */ user: string; } - export interface WorkflowTaskSetCurrentStepParams extends Object { /** * The unique id of the job. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#setCurrentStep) */ jobId: number; /** * The unique id of the step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#setCurrentStep) */ stepId: number; /** * The user name of the user setting the current step. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-workflow-WorkflowTask.html#setCurrentStep) */ user: string; @@ -40938,48 +43131,46 @@ declare namespace __esri { interface Viewpoint extends Accessor, JSONSupport { /** - * The viewpoint camera (3D only). + * The viewpoint camera (3D only). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#camera) */ camera: Camera; /** * The rotation of due north in relation to the top of the view in degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#rotation) - * + * * @default 0 */ rotation: number; /** * The scale of the viewpoint. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#scale) */ scale: number; /** - * The target geometry framed by the viewpoint. + * The target geometry framed by the viewpoint. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#targetGeometry) */ targetGeometry: Geometry; /** * Create a deep clone of the viewpoint. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone) - * - * + * + * */ clone(): Viewpoint; } interface ViewpointConstructor { - - - new(properties?: ViewpointProperties): Viewpoint; + new (properties?: ViewpointProperties): Viewpoint; fromJSON(json: any): Viewpoint; } @@ -40988,30 +43179,30 @@ declare namespace __esri { interface ViewpointProperties { /** - * The viewpoint camera (3D only). + * The viewpoint camera (3D only). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#camera) */ camera?: CameraProperties; /** * The rotation of due north in relation to the top of the view in degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#rotation) - * + * * @default 0 */ rotation?: number; /** * The scale of the viewpoint. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#scale) */ scale?: number; /** - * The target geometry framed by the viewpoint. + * The target geometry framed by the viewpoint. * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#targetGeometry) */ targetGeometry?: GeometryProperties; @@ -41020,33 +43211,33 @@ declare namespace __esri { interface Draw extends Accessor { /** * A reference to the active [draw action](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html). An instance of the draw action is created when [create()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#create) method is called. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#activeAction) */ activeAction: DrawAction; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the draw to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#view) */ view: MapView; /** * Complete the current active drawing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#complete) - * - * + * + * */ complete(): void; /** * Creates an instance of the requested draw action. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#create) - * - * @param drawAction - * Name of the [draw action](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html) to create. See the table below for a list of possible values and type of draw action it creates. **Possible Values:** point | multipoint | polyline | polygon | rectangle | circle | ellipse - * + * + * @param drawAction + * Name of the [draw action](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html) to create. See the table below for a list of possible values and type of draw action it creates. **Possible Values:** point | multipoint | polyline | polygon | rectangle | circle | ellipse + * * Geometry type | Draw action instance * ------------- | -------------------- * point | [PointDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PointDrawAction.html) @@ -41055,23 +43246,23 @@ declare namespace __esri { * polygon | [PolygonDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html) * rectangle, circle, ellipse | [SegmentDrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html) * @param drawOptions Object of the drawing options for the geometry to be created. - * @param drawOptions.mode - * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `segment` draw actions. **Possible Values:** - * + * @param drawOptions.mode + * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `segment` draw actions. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline` draw actions. * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` and `segment` draw actions. Default for `segment` draw actions. * click | Vertices are added when the pointer is clicked. - * + * */ create(drawAction: string, drawOptions?: DrawCreateDrawOptions): DrawAction; /** * Resets the drawing by clearing the active action. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#reset) - * - * + * + * */ reset(): void; } @@ -41079,11 +43270,11 @@ declare namespace __esri { interface DrawConstructor { /** * The Draw class provides advanced drawing capabilities for developers who need complete control over creating temporary graphics with different geometries. For example, if you want to prevent users from drawing graphics with self-intersecting lines or overlapping polygons, then you can use this class to implement these rules. The draw experience is built upon draw actions, which use the view events to generate a set of coordinates for creating new geometries. Each geometry type has a corresponding draw action class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html) */ - new(properties?: DrawProperties): Draw; + new (properties?: DrawProperties): Draw; } export const Draw: DrawConstructor; @@ -41091,30 +43282,29 @@ declare namespace __esri { interface DrawProperties { /** * A reference to the active [draw action](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html). An instance of the draw action is created when [create()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#create) method is called. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#activeAction) */ activeAction?: DrawActionProperties; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the draw to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#view) */ view?: MapViewProperties; } - export interface DrawCreateDrawOptions extends Object { /** - * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `segment` draw actions. **Possible Values:** - * + * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `segment` draw actions. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline` draw actions. * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` and `segment` draw actions. Default for `segment` draw actions. * click | Vertices are added when the pointer is clicked. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-Draw.html#create) */ mode?: string; @@ -41123,41 +43313,41 @@ declare namespace __esri { interface DrawAction extends Accessor, Evented { /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#view) */ view: MapView; /** * Indicates if the [redo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#redo) method can be called on the action instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#canRedo) - * - * + * + * */ canRedo(): boolean; /** * Indicates if the [undo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#undo) method can be called on the action instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#canUndo) - * - * + * + * */ canUndo(): boolean; /** * Incrementally redo actions recorded in the stack. Call [canRedo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#canRedo) prior to calling this method to check if this method can be called on the action instance. Calling this method will fire the [vertex-add](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#event:vertex-add) or [vertex-remove](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#event:vertex-remove) events depending on the last action. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#redo) - * - * + * + * */ redo(): void; /** * Incrementally undo actions recorded in the stack. Call [canUndo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#canUndo) prior to calling this method to check if this method can be called on the action instance. Calling this method will fire the [vertex-add](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#event:vertex-add) or [vertex-remove](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#event:vertex-remove) events depending on the last action. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#undo) - * - * + * + * */ undo(): void; } @@ -41165,11 +43355,11 @@ declare namespace __esri { interface DrawActionConstructor { /** * DrawAction is the base class for all draw actions. DrawActions use the view events to generate a set of coordinates to create new geometries. Each serves a different purpose, allowing you to create a different type geometry such as [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), [multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html), [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html), and [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html) */ - new(properties?: DrawActionProperties): DrawAction; + new (properties?: DrawActionProperties): DrawAction; } export const DrawAction: DrawActionConstructor; @@ -41177,7 +43367,7 @@ declare namespace __esri { interface DrawActionProperties { /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html#view) */ view?: MapViewProperties; @@ -41186,117 +43376,107 @@ declare namespace __esri { interface MultipointDrawAction extends DrawAction { /** * Two-dimensional array of numbers representing the coordinates of each vertex that comprises the drawn geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html#vertices) */ readonly vertices: number[][]; /** * Completes drawing the [multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html) geometry and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html#event:draw-complete) event. Call this method if the drawing logic needs to be completed other than by double-clicking or pressing the "C" key. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-MultipointDrawAction.html#complete) - * - * + * + * */ complete(): void; } interface MultipointDrawActionConstructor { - - - new(properties?: MultipointDrawActionProperties): MultipointDrawAction; + new (properties?: MultipointDrawActionProperties): MultipointDrawAction; } export const MultipointDrawAction: MultipointDrawActionConstructor; - interface MultipointDrawActionProperties extends DrawActionProperties { - - } + interface MultipointDrawActionProperties extends DrawActionProperties {} interface PointDrawAction extends DrawAction { /** * An array of x,y coordinates for the [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PointDrawAction.html#coordinates) */ readonly coordinates: number[]; /** * Completes drawing the [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometry and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PointDrawAction.html#event:draw-complete) event. Call this method if the drawing logic needs to be completed other than by double-clicking or pressing the "C" key. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PointDrawAction.html#complete) - * - * + * + * */ complete(): void; } interface PointDrawActionConstructor { - - - new(properties?: PointDrawActionProperties): PointDrawAction; + new (properties?: PointDrawActionProperties): PointDrawAction; } export const PointDrawAction: PointDrawActionConstructor; - interface PointDrawActionProperties extends DrawActionProperties { - - } + interface PointDrawActionProperties extends DrawActionProperties {} interface PolygonDrawAction extends DrawAction { /** - * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** - * + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. * freehand | Vertices are added while the pointer is dragged. * click | Vertices are added when the pointer is clicked. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#mode) - * + * * @default hybrid */ mode: string; /** * Two-dimensional array of numbers representing the coordinates of each vertex comprising the geometry being drawn. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#vertices) */ readonly vertices: number[][]; /** * Completes drawing the polygon geometry and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#event:draw-complete) event. Call this method if the drawing logic needs to be completed other than by double-clicking or pressing the "C" key. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#complete) - * - * + * + * */ complete(): void; } interface PolygonDrawActionConstructor { - - - new(properties?: PolygonDrawActionProperties): PolygonDrawAction; + new (properties?: PolygonDrawActionProperties): PolygonDrawAction; } export const PolygonDrawAction: PolygonDrawActionConstructor; interface PolygonDrawActionProperties extends DrawActionProperties { /** - * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** - * + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. * freehand | Vertices are added while the pointer is dragged. * click | Vertices are added when the pointer is clicked. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolygonDrawAction.html#mode) - * + * * @default hybrid */ mode?: string; @@ -41304,58 +43484,56 @@ declare namespace __esri { interface PolylineDrawAction extends DrawAction { /** - * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** - * + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. * freehand | Vertices are added while the pointer is dragged. * click | Vertices are added when the pointer is clicked. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#mode) - * + * * @default hybrid */ mode: string; /** * Two-dimensional array of numbers representing the coordinates of each vertex that comprising the drawn geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#vertices) */ readonly vertices: number[][]; /** * Completes drawing the polyline geometry and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#event:draw-complete) event. Call this method if the drawing logic needs to be completed other than by double-clicking or pressing the "C" key. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#complete) - * - * + * + * */ complete(): void; } interface PolylineDrawActionConstructor { - - - new(properties?: PolylineDrawActionProperties): PolylineDrawAction; + new (properties?: PolylineDrawActionProperties): PolylineDrawAction; } export const PolylineDrawAction: PolylineDrawActionConstructor; interface PolylineDrawActionProperties extends DrawActionProperties { /** - * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** - * + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. * freehand | Vertices are added while the pointer is dragged. * click | Vertices are added when the pointer is clicked. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-PolylineDrawAction.html#mode) - * + * * @default hybrid */ mode?: string; @@ -41363,146 +43541,160 @@ declare namespace __esri { interface SegmentDrawAction extends DrawAction { /** - * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** - * + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * * Value | Description | * ----- | ----------- | * freehand | Vertices are added while the pointer is dragged. * click | Vertices are added when the pointer is clicked. SegmentDrawActions are created from 2 vertices. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#mode) - * + * * @default freehand */ mode: string; /** * Two-dimensional array of numbers representing the coordinates of each vertex comprising the geometry being drawn. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#vertices) */ readonly vertices: number[][]; /** * Completes drawing the polygon geometry and fires the [draw-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#event:draw-complete) event. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#complete) - * - * + * + * */ complete(): void; } interface SegmentDrawActionConstructor { - - - new(properties?: SegmentDrawActionProperties): SegmentDrawAction; + new (properties?: SegmentDrawActionProperties): SegmentDrawAction; } export const SegmentDrawAction: SegmentDrawActionConstructor; interface SegmentDrawActionProperties extends DrawActionProperties { /** - * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** - * + * The drawing mode. It is only relevant when the action is first created. Its value cannot be changed during the action lifecycle. **Possible Values:** + * * Value | Description | * ----- | ----------- | * freehand | Vertices are added while the pointer is dragged. * click | Vertices are added when the pointer is clicked. SegmentDrawActions are created from 2 vertices. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-SegmentDrawAction.html#mode) - * + * * @default freehand */ mode?: string; } - export class BaseLayerView2D { + /** + * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of a [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) with a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html) + */ + interface BaseLayerView2D { /** * References the layer this [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) represents. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#layer) */ layer: Layer; /** * The array of [Tile](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) objects computed to cover the MapView's visible area. This array is updated when the view is animating or the user is interacting with it. Then if tiles have been added or removed, [tilesChanged()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#tilesChanged) is called. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#tiles) */ tiles: Tile[]; /** * References the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) this [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) belongs to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#view) */ view: MapView; /** * Method called when after the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) is created and right before it's asked to draw the layer's content. Typically this method is implemented to start watching property changes on the layer for example. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#attach) - * - * + * + * */ attach(): void; /** * Method called after the layer is removed and the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) is about to be removed. Typically, this method is implemented to free resources like watchers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#detach) - * - * + * + * */ detach(): void; + /** + * Method to implement that is responsible for providing objects hit at the specified screen coordinates. This method is called internally by the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) each time its [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) method is called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#hitTest) + * + * @param x The x-coordinate in screen space of the desired hit. + * @param y The y-coordinate in screen space of the desired hit. + * + */ + hitTest(x: number, y: number): IPromise; /** * The method to implement that is responsible of drawing the content of the layer. This method is called every time the MapView's state changes, or if [requestRender()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#requestRender) has been called. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#render) - * + * * @param renderParameters * @param renderParameters.context The [canvas 2D context](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) in which to draw content. * @param renderParameters.stationary The stationary state of the `MapView`. * @param renderParameters.state The object that describes view state. - * + * */ render(renderParameters: BaseLayerView2DRenderRenderParameters): void; /** * The [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) can call this method to ask the MapView to schedule a new rendering frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#requestRender) - * - * + * + * */ - protected requestRender(): void; + requestRender(): void; /** * Method to implement, which notifies of tiles being added or removed for the current view state. This function can be implemented to start and stop fetching new data, or allocate and dispose resources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#tilesChanged) - * + * * @param added The tile objects added for the current view viewport. * @param removed The tile objects removed from the view viewport. - * + * */ tilesChanged(added: Tile[], removed: Tile[]): void; } + export const BaseLayerView2D: BaseLayerView2D; export interface BaseLayerView2DRenderRenderParameters extends Object { /** * The [canvas 2D context](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) in which to draw content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#render) */ context: CanvasRenderingContext2D; /** * The stationary state of the `MapView`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#render) */ stationary: boolean; /** * The object that describes view state. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#render) */ state: ViewState; @@ -41510,61 +43702,61 @@ declare namespace __esri { /** * Represents a tile reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ export interface Tile extends Object { /** * The tile string identifier in the format `level/row/col/world` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ id: string; /** * The level identifier of the [LOD](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html) to which the tile belongs - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ level: number; /** * The row identifier. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ row: number; /** * The column identifier. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ col: number; /** * When the projection allows world wrapping (e.g. Web Mercator), identifies the instance of the world this tile's `level`/`row`/`col`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ world: number; /** * The number of map units per pixel in the tile. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ resolution: number; /** * The map scale at the tile's level. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ scale: number; /** * The coordinates of the top-left corner of the tile as an array of two numbers. The coordinates are in un-normalized map units. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ coords: number[]; /** * The bounds of the tile as an array of four numbers that be readily converted to an [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-layers-BaseLayerView2D.html#Tile) */ bounds: number[]; @@ -41573,128 +43765,125 @@ declare namespace __esri { interface ViewState { /** * Represents the view's center point as an array of two numbers `[x, y]`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#center) */ readonly center: number[]; /** * The extent represents the visible portion of a map within the view as an instance of Extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#extent) */ readonly extent: Extent; /** * Represents the size of one pixel in map units. The value of `resolution` is the result of the division of the [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#extent) width by the [size](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#size). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#resolution) */ readonly resolution: number; /** * The clockwise rotation of due north in relation to the top of the view in degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#rotation) */ readonly rotation: number; /** * Represents the map scale at the center of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#scale) */ readonly scale: number; /** * Represents the width and height of the view in pixels, e.g. `[width, height]`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#size) */ readonly size: number[]; /** * Creates a deep clone of ViewState object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#clone) - * - * + * + * */ clone(): ViewState; /** * Copies the properties from a given view state. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#copy) - * + * * @param state The view state to copy the properties from. - * + * */ copy(state: ViewState): ViewState; /** * Converts the x and y screen coordinates to map coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#toMap) - * + * * @param out The receiving array of the conversion. * @param x The horizontal screen coordinate to convert. * @param y The vertical screen coordinate to convert. - * + * */ toMap(out: number[], x: number, y: number): number[]; /** * Converts the x and y map coordinates to screen coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#toScreen) - * + * * @param out The receiving array of the conversion. * @param x The horizontal screen coordinate to convert. * @param y The vertical screen coordinate to convert. - * + * */ toScreen(out: number[], x: number, y: number): number[]; /** * Converts the x and y map coordinates to screen coordinates. This method is similar to [toScreen](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#toScreen), without applying the view state rotation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-ViewState.html#toScreenNoRotation) - * + * * @param out The receiving array of the conversion. * @param x The horizontal screen coordinate to convert. * @param y The vertical screen coordinate to convert. - * + * */ toScreenNoRotation(out: number[], x: number, y: number): number[]; } interface ViewStateConstructor { - - - - new(properties?: any): ViewState; + new (): ViewState; } export const ViewState: ViewStateConstructor; /** * map/scene on screen. The ArcGIS API for JavaScript offers a low-level interface to access the SceneView's WebGL context, and thus enables creating custom visualizations that interact with the scene the same way as built-in layers. Developers can either write WebGL code directly, or integrate with third-party WebGL libraries. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html) */ interface externalRenderers { /** * Adds an external renderer to the view. The external renderer is defined by an object that contains certain methods and properties, as defined by [ExternalRenderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#add) - * + * * @param view The view to which to attach the external renderer. * @param renderer The external renderer. - * + * */ add(view: SceneView, renderer: ExternalRenderer): void; /** * Transforms positions from the internal rendering coordinate system to the output spatial reference. The allowable output spatial reference is limited and depends on the [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode): * * In `global` mode, it can either be Web Mercator or WGS84. * * In `local` mode, it has to match [view.spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#spatialReference), and the call to this function simply copies the coordinates from `srcCoordinates` to `destCoordinates`. - * - * + * + * * If these conditions are not met, nothing is written to `destCoordinates` and the function returns `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#fromRenderCoordinates) - * + * * @param view The view related to the input coordinates. * @param srcCoordinates A linear array of one or more vectors that are interpreted as XYZ coordinates. For example, two position vectors would be represented as `[x1, y1, z1, x2, y2, z2]`. This must contain at least `srcStart + 3 * count` elements. * @param srcStart An index in `srcCoordinates` from which the coordinates will start being read. @@ -41702,17 +43891,25 @@ declare namespace __esri { * @param destStart An index in `destCoordinates` in which the coordinates will start to be written. * @param destSpatialReference The spatial reference of the output coordinates. When `null`, `view.spatialReference` is used instead. * @param count The number of vertices to be transformed. - * + * */ - fromRenderCoordinates(view: SceneView, srcCoordinates: number[] | Float32Array, srcStart: number, destCoordinates: number[] | Float32Array, destStart: number, destSpatialReference: SpatialReference, count: number): number[] | Float32Array; + fromRenderCoordinates( + view: SceneView, + srcCoordinates: number[] | Float32Array, + srcStart: number, + destCoordinates: number[] | Float32Array, + destStart: number, + destSpatialReference: SpatialReference, + count: number + ): number[] | Float32Array; /** * Removes an external renderer from the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#remove) - * + * * @param view The view from which to remove the external renderer. * @param renderer The external renderer. - * + * */ remove(view: SceneView, renderer: ExternalRenderer): void; /** @@ -41720,43 +43917,48 @@ declare namespace __esri { * * X: Easting * * Y: Northing * * Z: Elevation - * - * + * + * * ![externalRenderers-renderCoordinateTransformAt](https://developers.arcgis.com/javascript/assets/img/apiref/views/3d/externalRenderers-renderCoordinateTransformAt.png) When [view.viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) is `global`, a linear transformation does not take the curvature of the globe or other non-linear projection aspects into account. Thus, the resulting coordinates will only appear correct within a small region around the origin of the local Cartesian system. The allowable spatial reference of `origin` depends on the [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode): * * In `global` mode, it can either be Web Mercator or WGS84. * * In `local` mode, it has to match [view.spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#spatialReference). - * - * + * + * * If these conditions are not met, nothing will be written to `dest` and the function will return `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#renderCoordinateTransformAt) - * + * * @param view The view for which the transformation will be used. * @param origin The global coordinates of the origin in the local Cartesian coordinate system. * @param srcSpatialReference The spatial reference of the origin coordinates. If undefined, `view.spatialReference` is used instead. * @param dest A reference to an array where the 16 matrix elements will be stored. The resulting matrix follows OpenGL conventions where the translation components occupy the 13th, 14th and 15th elements. If undefined, a newly created matrix returned. - * + * */ - renderCoordinateTransformAt(view: SceneView, origin: number[] | Float32Array, srcSpatialReference?: SpatialReference, dest?: number[] | Float32Array): number[] | Float32Array; + renderCoordinateTransformAt( + view: SceneView, + origin: number[] | Float32Array, + srcSpatialReference?: SpatialReference, + dest?: number[] | Float32Array + ): number[] | Float32Array; /** * Requests the view to be redrawn. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#requestRender) - * + * * @param view The view to which the external renderer is attached. - * + * */ requestRender(view: SceneView): void; /** * Transforms positions from the given spatial reference to the internal rendering coordinate system. The allowable input spatial reference is limited and depends on the [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode): * * In `global` mode, it can either be Web Mercator or WGS84. * * In `local` mode, it has to match [view.spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#spatialReference); the call to this function simply copies the coordinates from `srcCoordinates` to `destCoordinates`. - * - * + * + * * If these conditions are not met, nothing is written to `destCoordinates` and the function returns `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#toRenderCoordinates) - * + * * @param view The view in which the coordinates will be used. * @param srcCoordinates A linear array of one or more vectors which are interpreted as XYZ coordinates. For example, two position vectors would be represented as `[x1, y1, z1, x2, y2, z2]`. This must contain at least `srcStart + 3 * count` elements. * @param srcStart An index in `srcCoordinates` from which the coordinates start to be read. @@ -41764,28 +43966,36 @@ declare namespace __esri { * @param destCoordinates A reference to an array where the results will be written. * @param destStart An index in `destCoordinates` to which the coordinates will start to be written. * @param count The number of vertices to be transformed. - * + * */ - toRenderCoordinates(view: SceneView, srcCoordinates: number[] | Float32Array, srcStart: number, srcSpatialReference: SpatialReference, destCoordinates: number[] | Float32Array, destStart: number, count: number): number[] | Float32Array; + toRenderCoordinates( + view: SceneView, + srcCoordinates: number[] | Float32Array, + srcStart: number, + srcSpatialReference: SpatialReference, + destCoordinates: number[] | Float32Array, + destStart: number, + count: number + ): number[] | Float32Array; } export const externalRenderers: externalRenderers; /** * Tuple of an RGB color value and an intensity value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ColorAndIntensity) */ export interface ColorAndIntensity extends Object { /** * RGB color with values between 0 and 1. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ColorAndIntensity) */ color: ArrayLike; /** * Scalar intensity value by which the color should be scaled for compositing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ColorAndIntensity) */ intensity: number; @@ -41793,25 +44003,25 @@ declare namespace __esri { /** * Defines an external renderer using callbacks and properties. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer) */ export interface ExternalRenderer extends Object { /** * Typically called once after adding the external renderer to a view, or whenever the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) becomes [ready](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#ready). It may be called again if the ready state cycles, for example when a different [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) is assigned to the view. Receives a single parameter of type [RenderContext](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer) */ setup?: RenderContextCallback; /** * Called in every frame to execute the state update and draw calls. Receives a single parameter of type [RenderContext](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer) */ render?: RenderContextCallback; /** * Called when the external renderer is removed from a view, or when the [ready](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#ready) state of the view turns false. Receives a single parameter of type [RenderContext](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#ExternalRenderer) */ dispose?: RenderContextCallback; @@ -41819,67 +44029,67 @@ declare namespace __esri { /** * The camera object passed to renderer callbacks in [RenderContext](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext). This is not the same as [Camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html). All properties are read-only and defined in terms of the internal rendering coordinate system (see the [section on coordinate systems](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#coordinate-systems) at the top of this page). Vectors (`Vec3`) are presented as arrays with 3 elements (x, y, z). Matrices (`Mat4`) are presented as linear arrays with 16 elements following the OpenGL conventions where the translation components occupy the 13th, 14th, and 15th elements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ export interface RenderCamera extends Object { /** * A 4x4 matrix that transforms coordinates from world space to camera space. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ viewMatrix: ArrayLike; /** * The inverse transpose of `viewMatrix`, used to transform normals from world space to camera space. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ viewInverseTransposeMatrix: ArrayLike; /** * A 4x4 matrix that defines the perspective projection transformation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ projectionMatrix: ArrayLike; /** * The position of the camera in the internal Cartesian rendering coordinate system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ eye: ArrayLike; /** * The camera target ("look at") position in the internal Cartesian rendering coordinate system. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ center: ArrayLike; /** * The camera up vector. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ up: ArrayLike; /** * The distance to the near plane. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ near: number; /** * The distance to the far plane. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ far: number; /** * The horizontal field of view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ fovX: number; /** * The vertical field of view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderCamera) */ fovY: number; @@ -41887,43 +44097,43 @@ declare namespace __esri { /** * The object passed as a parameter to every call to `setup` and `render` the external renderer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) */ export interface RenderContext extends Object { /** * The WebGL rendering context. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) */ gl: WebGLRenderingContext; /** * The camera used to render the current frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) */ camera: RenderCamera; /** * The lighting used by [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) to render the current frame. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) */ sunLight: SunLight; /** * A convenience function provided to completely reset the WebGL state after using it. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) - * - * + * + * */ resetWebGLState(): void; /** * Binds the color and depth buffers an external renderer is supposed to render into. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#RenderContext) - * - * + * + * */ bindRenderTarget(): void; } @@ -41932,25 +44142,25 @@ declare namespace __esri { /** * Describes the lighting used by [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), derived from its sun lighting model. It consists of a directional Lambertian (`diffuse`) and a constant (`ambient`) term, which should be treated in the sense of the [Phong Reflection Model](https://en.wikipedia.org/wiki/Phong_reflection_model). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#SunLight) */ export interface SunLight extends Object { /** * The incident light direction in render coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#SunLight) */ direction: ArrayLike; /** * The diffuse light color and intensity. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#SunLight) */ diffuse: ColorAndIntensity; /** * The ambient light color and intensity. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-externalRenderers.html#SunLight) */ ambient: ColorAndIntensity; @@ -41958,16 +44168,16 @@ declare namespace __esri { interface BreakpointsOwner { /** - * A convenience property used for defining the breakpoints on the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) and [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view. The sizes specified here determine the values of the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties depending on the view's size. Setting up breakpoints can aid in responsive app design. It does this by watching width and height breakpoints. This is helpful as it removes the need for multiple [`@media` calls](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries). Instead of listening for the view's size and/or resizes property, you can set up a watch handler for either the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties of the view. + * A convenience property used for defining the breakpoints on the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) and [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view. The sizes specified here determine the values of the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties depending on the view's size. Setting up breakpoints can aid in responsive app design. It does this by watching width and height breakpoints. This is helpful as it removes the need for multiple [`@media` calls](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries). Instead of listening for the view's size and/or resizes property, you can set up a watch handler for either the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties of the view. * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) */ breakpoints: BreakpointsOwnerBreakpoints; /** - * A convenience property indicating the general size of the view's height. This value is determined based on where the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. + * A convenience property indicating the general size of the view's height. This value is determined based on where the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. - * + * * Possible Value | Description | Default thresholds (pixels) * ---------------|-------------|---------------------------- * xsmall | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is smaller than the value set in the `xsmall` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | < 545 @@ -41975,28 +44185,28 @@ declare namespace __esri { * medium | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is between the values set in the `small` and `medium` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 769 - 992 * large | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 993 - 1200 * xlarge | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | > 1200 - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) */ heightBreakpoint: string; /** - * A convenience property indicating the view's orientation. See the table below for a list of possible values. + * A convenience property indicating the view's orientation. See the table below for a list of possible values. * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. - * + * * Possible Value | Description * ---------------|------------ * landscape | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is greater than its [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height). * portrait | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is equal to or smaller than its [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height). - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#orientation) */ readonly orientation: string; /** - * A convenience property indicating the general size of the view's width. This value is determined based on where the view's [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. + * A convenience property indicating the general size of the view's width. This value is determined based on where the view's [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. - * + * * Possible Value | Description | Default thresholds (pixels) * ---------------|-------------|------------------- * xsmall | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is smaller than the value set in the `xsmall` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | < 545 @@ -42004,33 +44214,31 @@ declare namespace __esri { * medium | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is between the values set in the `small` and `medium` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 769 - 992 * large | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 993 - 1200 * xlarge | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | > 1200 - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) */ widthBreakpoint: string; } interface BreakpointsOwnerConstructor { - - - new(): BreakpointsOwner; + new (): BreakpointsOwner; } export const BreakpointsOwner: BreakpointsOwnerConstructor; interface BreakpointsOwnerProperties { /** - * A convenience property used for defining the breakpoints on the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) and [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view. The sizes specified here determine the values of the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties depending on the view's size. Setting up breakpoints can aid in responsive app design. It does this by watching width and height breakpoints. This is helpful as it removes the need for multiple [`@media` calls](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries). Instead of listening for the view's size and/or resizes property, you can set up a watch handler for either the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties of the view. + * A convenience property used for defining the breakpoints on the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) and [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view. The sizes specified here determine the values of the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties depending on the view's size. Setting up breakpoints can aid in responsive app design. It does this by watching width and height breakpoints. This is helpful as it removes the need for multiple [`@media` calls](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries). Instead of listening for the view's size and/or resizes property, you can set up a watch handler for either the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) properties of the view. * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) */ breakpoints?: BreakpointsOwnerBreakpoints; /** - * A convenience property indicating the general size of the view's height. This value is determined based on where the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. + * A convenience property indicating the general size of the view's height. This value is determined based on where the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. - * + * * Possible Value | Description | Default thresholds (pixels) * ---------------|-------------|---------------------------- * xsmall | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is smaller than the value set in the `xsmall` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | < 545 @@ -42038,15 +44246,15 @@ declare namespace __esri { * medium | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is between the values set in the `small` and `medium` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 769 - 992 * large | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 993 - 1200 * xlarge | The [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | > 1200 - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) */ heightBreakpoint?: string; /** - * A convenience property indicating the general size of the view's width. This value is determined based on where the view's [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. + * A convenience property indicating the general size of the view's width. This value is determined based on where the view's [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) falls in the ranges defined in the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property. See the table below for a list of possible values. Use the [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) property to override the default thresholds. * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/guide/styling/index.html#view-size-css-classes) for additional information on working with this. - * + * * Possible Value | Description | Default thresholds (pixels) * ---------------|-------------|------------------- * xsmall | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is smaller than the value set in the `xsmall` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | < 545 @@ -42054,50 +44262,49 @@ declare namespace __esri { * medium | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is between the values set in the `small` and `medium` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 769 - 992 * large | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | 993 - 1200 * xlarge | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints). | > 1200 - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) */ widthBreakpoint?: string; } - export interface BreakpointsOwnerBreakpoints extends Object { /** * Sets the `xsmall` breakpoint in pixels used by [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint). If the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) is smaller than this value, then the value of [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) will be `xsmall`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) - * + * * @default 544 */ xsmall?: number; /** * Sets the `small` breakpoint in pixels used by [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint). If the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) is between this value and the value of the `xsmall` property, then the value of [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) will be `small`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) - * + * * @default 768 */ small?: number; /** * Sets the `medium` breakpoint in pixels used by [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint). If the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) is between this value and the value of the `small` property, then the value of [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) will be `medium`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) - * + * * @default 992 */ medium?: number; /** * Sets the `large` breakpoint in pixels used by [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint). If the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) is between this value and the value of the `medium` property, then the value of [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) will be `large`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) - * + * * @default 1200 */ large?: number; /** * Sets the `xlarge` breakpoint in pixels used by [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint). If the view's [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#width) is greater than the value of the `large` property, then the value of [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) or [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint) will be `xlarge`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#breakpoints) */ xlarge?: number; @@ -42106,72 +44313,70 @@ declare namespace __esri { interface DOMContainer { /** * The `id` or node representing the DOM element containing the view. This is typically set in the view's constructor. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#container) */ container: HTMLDivElement; /** * Indicates if the browser focus is on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#focused) */ readonly focused: boolean; /** * The height of the view in pixels read from the view container element. The view container needs to have a height greater than 0 to be displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#height) - * + * * @default 0 */ readonly height: number; /** * A Popup object that displays general content or attributes from [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#map). The view has a default instance of [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) with predefined styles and a template for defining content. The content in this default instance may be modified directly in the [popup's content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) or in a layer's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). You may create a new [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) instance and set it to this property to customize the style, positioning, and content of the popup in favor of using the default popup instance on the view. In addition, if wanting to prevent any popups from opening, use the syntax below: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#popup) */ popup: Popup; /** * Indicates if the view is being resized. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#resizing) - * + * * @default false */ readonly resizing: boolean; /** * An array containing the width and height of the view in pixels, e.g. `[width, height]`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#size) */ readonly size: number[]; /** * Indicates if the view is visible on the page. Is `true` if the view has no [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#container), a [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#height) or [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#width) equal to 0, or the CSS `visibility` is `hidden`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#suspended) - * + * * @default true */ readonly suspended: boolean; /** * Exposes the default widgets available in the view and allows you to toggle them on and off. See [DefaultUI](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html) for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#ui) */ ui: DefaultUI; /** * The width of the view in pixels read from the view container element. The view container needs to have a width greater than 0 to be displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#width) - * + * * @default 0 */ readonly width: number; } interface DOMContainerConstructor { - - - new(): DOMContainer; + new (): DOMContainer; } export const DOMContainer: DOMContainerConstructor; @@ -42179,19 +44384,19 @@ declare namespace __esri { interface DOMContainerProperties { /** * The `id` or node representing the DOM element containing the view. This is typically set in the view's constructor. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#container) */ container?: HTMLDivElement | string; /** * A Popup object that displays general content or attributes from [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#map). The view has a default instance of [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) with predefined styles and a template for defining content. The content in this default instance may be modified directly in the [popup's content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) or in a layer's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). You may create a new [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) instance and set it to this property to customize the style, positioning, and content of the popup in favor of using the default popup instance on the view. In addition, if wanting to prevent any popups from opening, use the syntax below: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#popup) */ popup?: PopupProperties; /** * Exposes the default widgets available in the view and allows you to toggle them on and off. See [DefaultUI](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html) for more details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-DOMContainer.html#ui) */ ui?: DefaultUIProperties; @@ -42200,42 +44405,38 @@ declare namespace __esri { interface GroundView extends Accessor { /** * An elevation sampler that may be used to sample and query elevation values from the ground surface that is currently being displayed. The elevation sampler is not supported for [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) and may be `null` while the ground surface display is being initialized. The resolution of the sampled values depends on the ground elevation display resolution (high resolution close to the camera, low resolution far away from the camera). Because of the dynamic nature of the display resolution, the [demResolution](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-ElevationSampler.html#demResolution) property of the returned sampler will always return `{ min: -1, max: -1 }. If higher or more consistent sample resolution is required, then consider creating a sampler at the desired resolution using ElevationLayer.createSampler or Ground.createSampler. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-GroundView.html#elevationSampler) */ readonly elevationSampler: ElevationSampler; /** * A collection containing a hierarchical list of all the created [LayerViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of the [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) in the ground. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-GroundView.html#layerViews) */ readonly layerViews: Collection; /** * Value is `true` when any of the ground layer views are updating. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-GroundView.html#updating) - * + * * @default false */ readonly updating: boolean; } interface GroundViewConstructor { - - - new(properties?: GroundViewProperties): GroundView; + new (properties?: GroundViewProperties): GroundView; } export const GroundView: GroundViewConstructor; - interface GroundViewProperties { - - } + interface GroundViewProperties {} interface GamepadInputDevice extends Accessor { /** * The native Gamepad object exposed by the browser. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-input-gamepad-GamepadInputDevice.html#native) */ readonly native: Gamepad; @@ -42244,64 +44445,60 @@ declare namespace __esri { interface GamepadInputDeviceConstructor { /** * Properties and configuration of a gamepad. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-input-gamepad-GamepadInputDevice.html) */ - new(properties?: GamepadInputDeviceProperties): GamepadInputDevice; + new (properties?: GamepadInputDeviceProperties): GamepadInputDevice; } export const GamepadInputDevice: GamepadInputDeviceConstructor; - interface GamepadInputDeviceProperties { - - } + interface GamepadInputDeviceProperties {} interface GamepadSettings extends Accessor { /** * A readonly collection of all gamepads detected. Can be watched for gamepads to be connected or disconnected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-input-gamepad-GamepadSettings.html#devices) */ readonly devices: Collection; /** - * Determines what focus is required for gamepad events to be dispatched. Possible values: document | view | none - * + * Determines what focus is required for gamepad events to be dispatched. Possible values: document | view | none + * * Possible Value | Description * ---------------|------------ * document | Gamepad events are emitted when any part of the current webpage has focus. This allows for gamepad events being emitted even while a UI element is focused. * view | Gamepad events are emitted when the view [container element](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#container) has browser focus. This is useful when multiple views might be present on a single webpage. * none | Gamepad events are emitted independently of focus. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-input-gamepad-GamepadSettings.html#enabledFocusMode) - * + * * @default document */ enabledFocusMode: "document" | "view" | "none"; } interface GamepadSettingsConstructor { - - - new(properties?: GamepadSettingsProperties): GamepadSettings; + new (properties?: GamepadSettingsProperties): GamepadSettings; } export const GamepadSettings: GamepadSettingsConstructor; interface GamepadSettingsProperties { /** - * Determines what focus is required for gamepad events to be dispatched. Possible values: document | view | none - * + * Determines what focus is required for gamepad events to be dispatched. Possible values: document | view | none + * * Possible Value | Description * ---------------|------------ * document | Gamepad events are emitted when any part of the current webpage has focus. This allows for gamepad events being emitted even while a UI element is focused. * view | Gamepad events are emitted when the view [container element](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#container) has browser focus. This is useful when multiple views might be present on a single webpage. * none | Gamepad events are emitted independently of focus. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-input-gamepad-GamepadSettings.html#enabledFocusMode) - * + * * @default document */ enabledFocusMode?: "document" | "view" | "none"; @@ -42310,37 +44507,46 @@ declare namespace __esri { interface Input extends Accessor { /** * Gamepad input specific configuration settings. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-input-Input.html#gamepad) */ readonly gamepad: GamepadSettings; } interface InputConstructor { - - - new(properties?: InputProperties): Input; + new (properties?: InputProperties): Input; } export const Input: InputConstructor; - interface InputProperties { - - } + interface InputProperties {} interface CSVLayerView extends LayerView { + /** + * The maximum number of features that can be displayed at a time. This setting currently only applies to SceneView. By default, the maximum number of features is estimated automatically depending on the symbology, geometry complexity, memory consumption and display quality profile. Changing this setting to a higher value may lead to a significant decrease in performance and increase in memory usage. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#maximumNumberOfFeatures) + */ + maximumNumberOfFeatures: number; + /** + * Signifies whether the maximum number of features has been exceeded. Not all features could be displayed when this value is `true`. This setting currently only applies to SceneView. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#maximumNumberOfFeaturesExceeded) + */ + maximumNumberOfFeaturesExceeded: boolean; + /** * Highlights the given feature(s). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#highlight) - * + * * @param target The feature(s) to highlight. When passing a graphic or array of graphics, each feature must have a valid `objectID`. You may alternatively pass one or more objectIDs as a single number or an array. - * + * */ highlight(target?: Graphic | Graphic[] | number | number[]): any; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. + * > **Known Limitations** * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): @@ -42348,16 +44554,16 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryExtent) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryExtent(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all features available for drawing is returned. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all features available for drawing is returned. + * > **Known Limitations** * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): @@ -42365,16 +44571,16 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryFeatureCount) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryFeatureCount(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). If query parameters are not provided, all features available for drawing are returned. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). If query parameters are not provided, all features available for drawing are returned. + * > **Known Limitations** * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): @@ -42382,16 +44588,16 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryFeatures) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryFeatures(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all features available for drawing are returned. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all features available for drawing are returned. + * > **Known Limitations** * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. * * Spatial queries are not currently supported if the layer view has any of the following [SpatialReferences](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html): @@ -42399,47 +44605,68 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#queryObjectIds) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryObjectIds(params?: Query | QueryProperties): IPromise; } interface CSVLayerViewConstructor { - - - new(properties?: CSVLayerViewProperties): CSVLayerView; + new (properties?: CSVLayerViewProperties): CSVLayerView; } export const CSVLayerView: CSVLayerViewConstructor; interface CSVLayerViewProperties extends LayerViewProperties { - + /** + * The maximum number of features that can be displayed at a time. This setting currently only applies to SceneView. By default, the maximum number of features is estimated automatically depending on the symbology, geometry complexity, memory consumption and display quality profile. Changing this setting to a higher value may lead to a significant decrease in performance and increase in memory usage. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#maximumNumberOfFeatures) + */ + maximumNumberOfFeatures?: number; + /** + * Signifies whether the maximum number of features has been exceeded. Not all features could be displayed when this value is `true`. This setting currently only applies to SceneView. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-CSVLayerView.html#maximumNumberOfFeaturesExceeded) + */ + maximumNumberOfFeaturesExceeded?: boolean; } interface FeatureLayerView extends LayerView { /** * The layer being viewed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#layer) */ readonly layer: FeatureLayer; + /** + * The maximum number of features that can be displayed at a time. This setting currently only applies to SceneView. By default, the maximum number of features is estimated automatically depending on the symbology, geometry complexity, memory consumption and display quality profile. Changing this setting to a higher value may lead to a significant decrease in performance and increase in memory usage. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#maximumNumberOfFeatures) + */ + maximumNumberOfFeatures: number; + /** + * Signifies whether the maximum number of features has been exceeded. Not all features could be displayed when this value is `true`. This setting currently only applies to SceneView. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#maximumNumberOfFeaturesExceeded) + */ + maximumNumberOfFeaturesExceeded: boolean; /** * Highlights the given feature(s). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlight) - * + * * @param target The feature(s) to highlight. When passing a graphic or array of graphics, each feature must have a valid `objectID`. You may alternatively pass one or more objectIDs as a single number or an array. - * + * */ highlight(target?: Graphic | Graphic[] | number | number[]): any; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. Valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) on [arcgis.com](http://arcgis.com) and for ArcGIS Server 10.3.1 and later. If query parameters are not provided, the extent and count of all features available for drawing are returned. To query for the extent of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryExtent) method. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. Valid only for [hosted feature services](http://doc.arcgis.com/en/arcgis-online/share-maps/hosted-web-layers.htm) on [arcgis.com](http://arcgis.com) and for ArcGIS Server 10.3.1 and later. If query parameters are not provided, the extent and count of all features available for drawing are returned. To query for the extent of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryExtent) method. + * > **Known Limitations** * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. @@ -42448,16 +44675,16 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryExtent) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryExtent(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all features available for drawing is returned. To query for the count of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryFeatureCount()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatureCount) method. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all features available for drawing is returned. To query for the count of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryFeatureCount()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatureCount) method. + * > **Known Limitations** * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. @@ -42466,16 +44693,16 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatureCount) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryFeatureCount(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). If query parameters are not provided, all features available for drawing are returned. To execute a query against all the features in a Feature Service rather than only those in the client, you must use the [FeatureLayer.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) method. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). If query parameters are not provided, all features available for drawing are returned. To execute a query against all the features in a Feature Service rather than only those in the client, you must use the [FeatureLayer.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) method. + * > **Known Limitations** * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. @@ -42484,16 +44711,16 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryFeatures) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryFeatures(params?: Query | QueryProperties): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all features available for drawing are returned. To query for ObjectIDs of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryObjectIds()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryObjectIds) method. - * > **Known Limitations** + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features available for drawing in the layer view and returns array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all features available for drawing are returned. To query for ObjectIDs of features directly from a Feature Service rather than those visible in the view, you must use the [FeatureLayer.queryObjectIds()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryObjectIds) method. + * > **Known Limitations** * * Queries with `outStatistics` and any other parameter involving statistics are currently not supported in 3D [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). * * Spatial queries are executed against quantized geometries in the layer view. The resolution of layer view geometries, is only as precise as the scale resolution of the view. Therefore, the results of the same query could be different when executed at different scales. This also means that geometries returned from any layer view query will likewise be at the same scale resolution of the view. * * Spatial queries have the same limitations as those listed in the [projection engine](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html) documentation. @@ -42502,11 +44729,11 @@ declare namespace __esri { * * Gusterberg (Ferro) (8042) – Austria/Czech Republic * * ISN2016 (8086) - Iceland * * SVY21 (4757) - Singapore - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryObjectIds) - * + * * @param params Specifies the attributes and spatial filter of the query. When no parameters are passed to this method, all features in the client are returned. To only return features visible in the view, set the `geometry` parameter in the query object to the view's extent. - * + * */ queryObjectIds(params?: Query | QueryProperties): IPromise; } @@ -42514,60 +44741,69 @@ declare namespace __esri { interface FeatureLayerViewConstructor { /** * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html) */ - new(properties?: FeatureLayerViewProperties): FeatureLayerView; + new (properties?: FeatureLayerViewProperties): FeatureLayerView; } export const FeatureLayerView: FeatureLayerViewConstructor; interface FeatureLayerViewProperties extends LayerViewProperties { - + /** + * The maximum number of features that can be displayed at a time. This setting currently only applies to SceneView. By default, the maximum number of features is estimated automatically depending on the symbology, geometry complexity, memory consumption and display quality profile. Changing this setting to a higher value may lead to a significant decrease in performance and increase in memory usage. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#maximumNumberOfFeatures) + */ + maximumNumberOfFeatures?: number; + /** + * Signifies whether the maximum number of features has been exceeded. Not all features could be displayed when this value is `true`. This setting currently only applies to SceneView. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#maximumNumberOfFeaturesExceeded) + */ + maximumNumberOfFeaturesExceeded?: boolean; } interface GraphicsLayerView extends LayerView { /** - * Highlights the given feature(s). + * Highlights the given feature(s). * > **Known Limitations** Currently the highlight method is only supported in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GraphicsLayerView.html#highlight) - * + * * @param target The feature(s) to highlight. When passing a graphic or array of graphics, each feature must have a valid `objectID`. You may alternatively pass one or more objectIDs as a single number or an array. - * + * */ highlight(target?: Graphic | Graphic[] | number | number[]): any; /** - * Returns all graphics available for drawing in the layer view as an array of [Graphic[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). - * + * Returns all graphics available for drawing in the layer view as a [collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GraphicsLayerView.html#queryGraphics) - * - * + * + * */ - queryGraphics(): IPromise; + queryGraphics(): Collection; } interface GraphicsLayerViewConstructor { /** * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of a [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GraphicsLayerView.html) */ - new(properties?: GraphicsLayerViewProperties): GraphicsLayerView; + new (properties?: GraphicsLayerViewProperties): GraphicsLayerView; } export const GraphicsLayerView: GraphicsLayerViewConstructor; - interface GraphicsLayerViewProperties extends LayerViewProperties { - - } + interface GraphicsLayerViewProperties extends LayerViewProperties {} interface ImageryLayerView extends LayerView { /** * An object that provides the user access to [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) and their values in the layer. See the object specifications table below for details about each property. This object is used as input in the [pixelFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) function for filtering and processing each pixel in the block. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData) */ pixelData: ImageryLayerViewPixelData; @@ -42576,11 +44812,11 @@ declare namespace __esri { interface ImageryLayerViewConstructor { /** * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of an [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html) after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html) */ - new(properties?: ImageryLayerViewProperties): ImageryLayerView; + new (properties?: ImageryLayerViewProperties): ImageryLayerView; } export const ImageryLayerView: ImageryLayerViewConstructor; @@ -42588,23 +44824,22 @@ declare namespace __esri { interface ImageryLayerViewProperties extends LayerViewProperties { /** * An object that provides the user access to [pixels](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PixelBlock.html#pixels) and their values in the layer. See the object specifications table below for details about each property. This object is used as input in the [pixelFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html#pixelFilter) function for filtering and processing each pixel in the block. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData) */ pixelData?: ImageryLayerViewPixelData; } - export interface ImageryLayerViewPixelData extends Object { /** * The extent of the `pixelBlock`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData) */ extent?: Extent; /** * An object representing the pixels in the view. This provides the user access to each pixel on the client via the `pixels` property of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ImageryLayerView.html#pixelData) */ pixelBlock: PixelBlock; @@ -42613,69 +44848,65 @@ declare namespace __esri { interface KMLLayerView extends LayerView { /** * A collection of all the [MapImages](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) from visible sublayers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#allVisibleMapImages) */ readonly allVisibleMapImages: Collection; /** * A collection of all the points from visible sublayers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#allVisiblePoints) */ readonly allVisiblePoints: Collection; /** * A collection of all the polygons from visible sublayers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#allVisiblePolygons) */ readonly allVisiblePolygons: Collection; /** * A collection of all the polylines from visible sublayers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#allVisiblePolylines) */ readonly allVisiblePolylines: Collection; } interface KMLLayerViewConstructor { - - - new(properties?: KMLLayerViewProperties): KMLLayerView; + new (properties?: KMLLayerViewProperties): KMLLayerView; } export const KMLLayerView: KMLLayerViewConstructor; - interface KMLLayerViewProperties extends LayerViewProperties { - - } + interface KMLLayerViewProperties extends LayerViewProperties {} /** * **MapImage** represents an image overlay draped onto the terrain. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) */ export interface KMLLayerViewMapImage extends Object { /** * Map image id. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) */ id: number; /** * URL to the map image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) */ href: string; /** * The [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of the map image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) */ Extent: Extent; /** * Rotation of the map image about its center, in degrees. Values can be ±180. The default is 0 (north). Rotations are specified in a counterclockwise direction. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-KMLLayerView.html#MapImage) */ rotation: number; @@ -42684,38 +44915,36 @@ declare namespace __esri { interface LayerView extends Accessor, corePromise { /** * The layer being viewed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#layer) */ readonly layer: Layer; /** * Value is `true` if the layer is suspended (i.e., layer will not redraw or update itself when the extent changes). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#suspended) */ readonly suspended: boolean; /** * Value is `true` when the layer is updating; for example, if it is in the process of fetching data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#updating) - * + * * @default false */ readonly updating: boolean; /** * When `true`, the layer is visible in the view. Set this property to `false` to hide the layer from the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#visible) - * + * * @default true */ visible: boolean; } interface LayerViewConstructor { - - - new(properties?: LayerViewProperties): LayerView; + new (properties?: LayerViewProperties): LayerView; } export const LayerView: LayerViewConstructor; @@ -42723,9 +44952,9 @@ declare namespace __esri { interface LayerViewProperties { /** * When `true`, the layer is visible in the view. Set this property to `false` to hide the layer from the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html#visible) - * + * * @default true */ visible?: boolean; @@ -42734,51 +44963,51 @@ declare namespace __esri { interface SceneLayerView extends LayerView { /** * Highlights the given feature(s). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#highlight) - * + * * @param target The feature(s) to highlight. When passing a graphic or array of graphics, each feature must have a valid `objectID`. You may alternatively pass one or more objectIDs as a single number or an array. - * + * */ highlight(target?: Graphic | Graphic[] | number | number[]): any; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns the 3D [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. If query parameters are not provided, the extent and count of all loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns the 3D [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of features that satisfy the query. If query parameters are not provided, the extent and count of all loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. * > To query for the extent of features directly from a Scene Service rather than those loaded for the current view, you must use the [SceneLayer.queryExtent()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryExtent) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryExtent) - * + * * @param params Specifies the attributes of the query. Only the[objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) and [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) properties should be specified. Adding any other properties will return an error. If query parameters are not provided, all loaded features are returned. - * + * */ queryExtent(params?: Query): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all loaded features is returned. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns the number of features that satisfy the query. If query parameters are not provided, the count of all loaded features is returned. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. * > To query for the count of features directly from a Scene Service rather than those loaded for the current view, you must use the [SceneLayer.queryFeatureCount()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatureCount) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryFeatureCount) - * + * * @param params Specifies the attributes of the query. Only the[objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) and [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) properties should be specified. Adding any other properties will return an error. If query parameters are not provided, all loaded features are returned. - * + * */ queryFeatureCount(params?: Query): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). If query parameters are not provided, all loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. Querying more than 10.000 features returns an error, unless num is specified in the Query. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns a [FeatureSet](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-FeatureSet.html). If query parameters are not provided, all loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. Querying more than 10.000 features returns an error, unless num is specified in the Query. * > To execute a query against all the features in a Scene Service rather than only those loaded for the current view, you must use the [SceneLayer.queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryFeatures) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryFeatures) - * + * * @param params Specifies the attributes of the query. Only the [outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#outFields), [objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) and [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) properties should be specified. Adding any other properties will return an error. If query parameters are not provided, all loaded features are returned. - * + * */ queryFeatures(params?: Query): IPromise; /** - * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns an array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. + * Executes a [Query](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) against features in the layer view and returns an array of the ObjectIDs of features that satisfy the input query. If query parameters are not provided, the ObjectIDs of all loaded features are returned. This method is not yet supported when the associated scene layer has a [geometryType](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#geometryType) of `point`. Read more about queries in the Query section of the [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) class description. * > To query for ObjectIDs of features directly from a Scene Service rather than those loaded for the current view, you must use the [SceneLayer.queryObjectIds()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html#queryObjectIds) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html#queryObjectIds) - * + * * @param params Specifies the attributes of the query. Only the[objectIds](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#objectIds), [num](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#num) and [start](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start) properties should be specified. Adding any other properties will return an error. If query parameters are not provided, all loaded features are returned. - * + * */ queryObjectIds(params?: Query): IPromise; } @@ -42786,85 +45015,82 @@ declare namespace __esri { interface SceneLayerViewConstructor { /** * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of a [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-SceneLayerView.html) */ - new(properties?: SceneLayerViewProperties): SceneLayerView; + new (properties?: SceneLayerViewProperties): SceneLayerView; } export const SceneLayerView: SceneLayerViewConstructor; - interface SceneLayerViewProperties extends LayerViewProperties { - - } + interface SceneLayerViewProperties extends LayerViewProperties {} interface StreamLayerView extends LayerView, Evented { /** * The error that explains an unsuccessful attempt to connect to the stream service or an unexpected disconnection from the stream service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connectionError) */ readonly connectionError: Error; /** * The status of the Web Socket connection with the stream service. This property can be watched to see if the connection is lost unexpectedly. **Possible Values:** connected | disconnected - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connectionStatus) */ readonly connectionStatus: string; /** * Contains the attribute and spatial filters used to filter messages sent to the given layer view by a stream service. To change the filter for only a single layer view, use the [updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) method. The layer view's filter is always updated when the [updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) method of the associated stream layer instance is called. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter) */ readonly filter: StreamLayerViewFilter; /** * Contains the collection of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) visible in the layer view for the live stream. Graphics may be removed from the layer view by calling the [removeAll()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#removeAll) method from [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#graphics) */ graphics: Collection; /** * Opens a web socket connection with the stream service to start receiving messages. This is called internally when the StreamLayer is added to a view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connect) - * - * + * + * */ connect(): IPromise; /** * Closes the web socket connection with the stream service. This is called internally when the StreamLayer is removed from a view. To verify when the connection is closed, watch the [connectionStatus](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#connectionStatus) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#disconnect) - * - * + * + * */ disconnect(): void; /** * Updates the [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter) on the StreamLayerView. The filter is updated only on the layer view from which it is called. To update the filter on all layer views generated from a common layer, use the [StreamLayer.updateFilter()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html#updateFilter) method. If the input `filter` object is `undefined` or `null`, the spatial and attribute filters are removed. Filter changes only apply to incoming features. Features already displayed in the view will be removed automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) - * + * * @param filter Updates the spatial and attribute [filters](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter). If `null`, all filters are cleared. * @param filter.geometry A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view. If `null`, the spatial filter is cleared. * @param filter.where A SQL where clause used to filter features by attributes. If `null`, the attribute filter is cleared. - * + * */ updateFilter(filter: StreamLayerViewUpdateFilterFilter): IPromise; - on(name: "data-received", eventHandler: StreamLayerViewDataReceivedEventHandler): IHandle; } interface StreamLayerViewConstructor { /** * Represents the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of a [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html) after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html) */ - new(properties?: StreamLayerViewProperties): StreamLayerView; + new (properties?: StreamLayerViewProperties): StreamLayerView; } export const StreamLayerView: StreamLayerViewConstructor; @@ -42872,42 +45098,39 @@ declare namespace __esri { interface StreamLayerViewProperties extends LayerViewProperties { /** * Contains the collection of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) visible in the layer view for the live stream. Graphics may be removed from the layer view by calling the [removeAll()](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#removeAll) method from [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#graphics) */ graphics?: CollectionProperties; } - export interface StreamLayerViewDataReceivedEvent { - } - + export interface StreamLayerViewDataReceivedEvent {} export interface StreamLayerViewFilter extends Object { /** * A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter) */ geometry?: Extent; /** * A SQL where clause used to filter features by attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#filter) */ where?: string; } - export interface StreamLayerViewUpdateFilterFilter extends Object { /** * A spatial filter for filtering features. Only features that intersect the given geometry are displayed in the view. If `null`, the spatial filter is cleared. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) */ geometry?: Extent; /** * A SQL where clause used to filter features by attributes. If `null`, the attribute filter is cleared. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#updateFilter) */ where?: string; @@ -42916,71 +45139,71 @@ declare namespace __esri { interface MapView extends View, BreakpointsOwner { /** * Represents the view's center point; when setting the center, you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing a longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#viewpoint) or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent) properties are also set in the constructor. The returned [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) object is always in the spatial reference of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#map) and may be modified internally. To persist the returned object, create a clone using [Point.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) */ center: Point; /** * Specifies constraints to [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale), [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom), and [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) that may be applied to the MapView. See object specification below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ constraints: MapViewConstraints; /** * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). The returned [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object is an internal reference which may be modified internally. To persist the returned object, create a copy using [Extent.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent) - * + * * @default null */ extent: Extent; /** * Options for configuring the highlight. Use the highlight method on the appropriate [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) to highlight a feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) */ highlightOptions: MapViewHighlightOptions; /** * Defines which anchor stays still while resizing the browser window. The default, `center`, ensures the view's center point remains constantly visible as the window size changes. The other options allow the respective portion of the view to remain visible when the window's size is changed. **Possible values:** center | left | right | top | bottom | top-left | top-right | bottom-left | bottom-right - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#resizeAlign) - * + * * @default center */ resizeAlign: string; /** * The clockwise rotation of due north in relation to the top of the view in degrees. The view may be rotated by directly setting the rotation or by using the following mouse event: `Right-click + Drag`. Map rotation may be disabled by setting the `rotationEnabled` property in [constraints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) to `false`. See the code snippet below for an example of this. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) - * + * * @default 0 */ rotation: number; /** * Represents the map scale at the center of the view. Setting the scale immediately changes the view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) */ scale: number; /** * Represents the current view as a [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or point of observation on the view. Setting the viewpoint immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). The returned [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) object is an internal reference which may be modified internally. To persist the returned object, create a copy using [Viewpoint.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#viewpoint) */ viewpoint: Viewpoint; /** * Represents the level of detail (LOD) at the center of the view. Setting the zoom immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Setting this property in conjunction with [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) is a convenient way to set the initial extent of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) */ zoom: number; /** * Sets the focus on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#focus) - * - * + * + * */ focus(): void; /** @@ -42990,12 +45213,12 @@ declare namespace __esri { * * [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) (or array of [Graphic[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html)) * * [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) * * Object with a combination of `target`, `center` and `scale` properties (with `target` being any of the types listed above). The `center` property is provided as a convenience to animate the [MapView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) and is equivalent to specifying the `target` with the center [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * - * - * This function returns a promise which resolves as soon as the new view has been set to the target. If the transition is animated, then the ongoing animation can be obtained using [MapView.animation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#animation). If a tiled map service is used as the basemap and `snapToZoom` property is set to `true` in [constraints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints), the `goTo` method will zoom to the level of detail (LOD) of the basemap that is nearest to the defined `target`. If `snapToZoom` property is set to `false`, the `goTo` method will zoom to the exact `target`. - * + * + * + * This function returns a promise which resolves as soon as the new view has been set to the target. If the transition is animated, then the ongoing animation can be obtained using [MapView.animation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#animation). If a tiled map service is used as the basemap and `snapToZoom` property is set to `true` in [constraints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints), the `goTo` method will zoom in to fit the defined `target`. If `snapToZoom` property is set to `false`, the `goTo` method will zoom to the exact `target`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) - * + * * @param target The target location/viewpoint to animate to. When using an object for `target`, use the properties in the table below. * @param target.target The target of the animation. * @param target.center The [MapView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) to go to. @@ -43005,62 +45228,79 @@ declare namespace __esri { * @param options.animate Indicates if the transition to the new view should be animated. If set to false, `duration` and `easing` properties are ignored. * @param options.duration The duration of the animation in milliseconds. * @param options.easing The easing function used for the animation. See [easing functions](https://easings.net/) for graphical representations of these functions. **Possible Values:** linear | ease | ease-in | ease-out | ease-in-out - * + * */ - goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | MapViewGoToTarget, options?: MapViewGoToOptions): IPromise; + goTo( + target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | MapViewGoToTarget, + options?: MapViewGoToOptions + ): IPromise; /** * Indicates whether there is an event listener on the instance that matches the provided event name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hasEventListener) - * - * + * + * */ hasEventListener(): void; /** * Returns the topmost feature from each layer that intersects the specified screen coordinates. The following layer types will return a result if a hit is made on an intersecting feature: [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html), [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [GeoRSSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html), [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html). At 4.6 and later, a hit test will always return a result from [VectorTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html). However, the result will only indicate the ID and the name of the layer within the [vector tile style](https://doc.arcgis.com/en/arcgis-online/reference/tile-layers.htm#ESRI_SECTION1_8F68399EB47B48FF9EF46719FCC96978) that intersects the screen point. Detailed attribute and spatial information about the actual feature represented in the layer is not returned. HitTest results returned from VectorTileLayers are primarily used for [Vector tile style editor applications](https://maps.esri.com/jg/VectorBasemapStyleEditor/index.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) - * + * * @param screenPoint The screen coordinates of the click on the view. * @param screenPoint.x The horizontal screen coordinate of the click on the view. * @param screenPoint.y The vertical screen coordinate of the click on the view. - * + * */ hitTest(screenPoint: MapViewHitTestScreenPoint): IPromise; /** * Registers an event handler on the instance. Call this method to hook an event with a listener. See the [Events summary table](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#events-summary) for a list of listened events. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#on) - * + * * @param type The name of the event or events to listen for. * @param modifiersOrHandler Additional modifier keys to filter events. Please see [Key Values](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values) for possible values. All the standard key values are supported. Alternatively, if no modifiers are required, the function will call when the event fires. The following events don't support modifier keys: `blur`, `focus`, `layerview-create`, `layerview-destroy`, `resize`. * @param handler The function to call when the event is fired, if modifiers were specified. - * + * */ on(type: string | string[], modifiersOrHandler: string[] | EventHandler, handler?: EventHandler): IHandle; /** - * Converts the given screen point to a [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * + * Create a screenshot of the current view. Screenshots include only elements that are rendered on the canvas (all geographical elements), but excludes overlayed DOM elements (UI, popups, measurement labels, etc.). By default, a screenshot of the whole view is created. Different options allow for creating different types of screenshots, including taking screenshots at different aspect ratios, different resolutions and creating thumbnails. Screenshots are always taken inside the padded area of the view (see [padding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#padding)). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + * + * @param options Screenshot options. + * @param options.format The format of the resulting encoded data url. **Possible values**: jpg | png. + * @param options.layers When used, only the visible layers in this list will be included in the output. + * @param options.quality The quality (0 to 100) of the encoded image when encoding as `jpg`. + * @param options.width The width of the screenshot (defaults to the area width). The height will be derived automatically if left unspecified, according to the aspect ratio of the of the screenshot area. + * @param options.height The height of the screenshot (defaults to the area height). The width will be derived automatically if left unspecified, according to the aspect ratio of the screenshot area. + * @param options.area Specifies whether to take a screenshot of a specific area of the view. The area coordinates are relative to the origin of the padded view (see [padding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#padding)) and will be clipped to the view size. Defaults to the whole view (padding excluded). + * + */ + takeScreenshot(options?: MapViewTakeScreenshotOptions): IPromise; + /** + * Converts the given screen point to a [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). The [screen point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html) represents a point in terms of pixels relative to the top-left corner of the view. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toMap) - * + * * @param screenPoint The screen coordinates to convert. * @param screenPoint.x The horizontal screen coordinate to convert. * @param screenPoint.y The vertical screen coordinate to convert. - * + * */ toMap(screenPoint: MapViewToMapScreenPoint): Point; /** - * Converts the given [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) to a [screen point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html). - * + * Converts the given [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) to a [screen point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html). The [screen point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html) represents a point in terms of pixels relative to the top-left corner of the view. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toScreen) - * + * * @param point A point geometry. * @param screenPoint ScreenPoint object that will reference the result. - * + * */ toScreen(point: Point, screenPoint?: ScreenPoint): ScreenPoint; - on(name: "resize", eventHandler: MapViewResizeEventHandler): IHandle; on(name: "resize", modifiers: string[], eventHandler: MapViewResizeEventHandler): IHandle; @@ -43137,11 +45377,11 @@ declare namespace __esri { interface MapViewConstructor { /** * A MapView displays a 2D view of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) instance. An instance of MapView must be created to render a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) (along with its operational and base layers) in 2D. To render a map and its layers in 3D, see the documentation for [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). For a general overview of views, see [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) */ - new(properties?: MapViewProperties): MapView; + new (properties?: MapViewProperties): MapView; } export const MapView: MapViewConstructor; @@ -43149,75 +45389,73 @@ declare namespace __esri { interface MapViewProperties extends ViewProperties, BreakpointsOwnerProperties { /** * Represents the view's center point; when setting the center, you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing a longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#viewpoint) or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent) properties are also set in the constructor. The returned [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) object is always in the spatial reference of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#map) and may be modified internally. To persist the returned object, create a clone using [Point.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) */ center?: PointProperties | number[]; /** * Specifies constraints to [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale), [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom), and [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) that may be applied to the MapView. See object specification below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ constraints?: MapViewConstraints; /** * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). The returned [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) object is an internal reference which may be modified internally. To persist the returned object, create a copy using [Extent.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent) - * + * * @default null */ extent?: ExtentProperties; /** * Options for configuring the highlight. Use the highlight method on the appropriate [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) to highlight a feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) */ highlightOptions?: MapViewHighlightOptionsProperties; /** * Defines which anchor stays still while resizing the browser window. The default, `center`, ensures the view's center point remains constantly visible as the window size changes. The other options allow the respective portion of the view to remain visible when the window's size is changed. **Possible values:** center | left | right | top | bottom | top-left | top-right | bottom-left | bottom-right - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#resizeAlign) - * + * * @default center */ resizeAlign?: string; /** * The clockwise rotation of due north in relation to the top of the view in degrees. The view may be rotated by directly setting the rotation or by using the following mouse event: `Right-click + Drag`. Map rotation may be disabled by setting the `rotationEnabled` property in [constraints](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) to `false`. See the code snippet below for an example of this. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) - * + * * @default 0 */ rotation?: number; /** * Represents the map scale at the center of the view. Setting the scale immediately changes the view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) */ scale?: number; /** * Represents the current view as a [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or point of observation on the view. Setting the viewpoint immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). The returned [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) object is an internal reference which may be modified internally. To persist the returned object, create a copy using [Viewpoint.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#viewpoint) */ viewpoint?: ViewpointProperties; /** * Represents the level of detail (LOD) at the center of the view. Setting the zoom immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Setting this property in conjunction with [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) is a convenient way to set the initial extent of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) */ zoom?: number; } export interface MapViewBlurEvent { - native: any; target: View; } export interface MapViewClickEvent { - button: number; buttons: number; @@ -43238,7 +45476,6 @@ declare namespace __esri { } export interface MapViewDoubleClickEvent { - button: number; buttons: number; @@ -43259,7 +45496,6 @@ declare namespace __esri { } export interface MapViewDragEvent { - action: string; angle: number; @@ -43286,7 +45522,6 @@ declare namespace __esri { } export interface MapViewFocusEvent { - native: any; target: View; @@ -43294,20 +45529,19 @@ declare namespace __esri { /** * Object specification for the result of the [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#HitTestResult) */ export interface HitTestResult extends Object { /** * An array of result objects returned from the [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest). Results are returned when the location of the input screen coordinates intersect a [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the view. See the table below for the specification of each object in this array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#HitTestResult) */ results: HitTestResultResults[]; } export interface MapViewHoldEvent { - button: number; buttons: number; @@ -43328,7 +45562,6 @@ declare namespace __esri { } export interface MapViewImmediateClickEvent { - button: number; buttons: number; @@ -43349,7 +45582,6 @@ declare namespace __esri { } export interface MapViewKeyDownEvent { - key: string; native: any; @@ -43364,7 +45596,6 @@ declare namespace __esri { } export interface MapViewKeyUpEvent { - native: any; stopPropagation: Function; @@ -43375,178 +45606,172 @@ declare namespace __esri { } export interface MapViewLayerviewCreateEvent { - layer: Layer; layerView: LayerView; } export interface MapViewLayerviewDestroyEvent { - layer: Layer; layerView: LayerView; } - export interface MapViewConstraints extends Object { /** * An array of [LODs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-LOD.html). If not specified, this value is read from the [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). This property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ lods?: LOD[]; /** * The minimum [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) the user is allowed to zoom to within the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ minScale?: number; /** * The maximum [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) the user is allowed to zoom to within the view. Setting this value to `0` allows the user to overzoom layer tiles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ maxScale?: number; /** * The minimum [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) level the user is allowed to zoom to within the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ minZoom?: number; /** * The maximum [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) level the user is allowed to zoom to within the view. Setting this value to `0` allows the user to overzoom layer tiles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ maxZoom?: number; /** * When `true`, the view snaps to the next LOD when zooming in or out. When `false`, the zoom is continuous. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) - * + * * @default true */ snapToZoom?: boolean; /** * Indicates whether the user can rotate the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) - * + * * @default true */ rotationEnabled?: boolean; /** * A read-only property that specifies the levels of detail (LODs) read from the [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ effectiveLODs?: LOD[]; /** * A read-only property that specifies the minimum [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) level the user is allowed to zoom to within the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ effectiveMinZoom?: number; /** * A read-only property that specifies the maximum [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) level the user is allowed to zoom to within the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ effectiveMaxZoom?: number; /** * A read-only property that specifies the minimum [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) the user is allowed to zoom to within the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ effectiveMinScale?: number; /** * A read-only property that specifies the maximum [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) the user is allowed to zoom to within the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) */ effectiveMaxScale?: number; } - export interface MapViewGoToOptions extends Object { /** * Indicates if the transition to the new view should be animated. If set to false, `duration` and `easing` properties are ignored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) - * + * * @default true */ animate?: boolean; /** * The duration of the animation in milliseconds. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) - * + * * @default 200 */ duration?: number; /** * The easing function used for the animation. See [easing functions](https://easings.net/) for graphical representations of these functions. **Possible Values:** linear | ease | ease-in | ease-out | ease-in-out - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) - * + * * @default ease */ easing?: string | Function; } - export interface MapViewGoToTarget extends Object { /** * The target of the animation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) */ target?: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint; /** * The [MapView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) */ center?: number[]; /** * The [MapView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#scale) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) */ scale?: number; /** * The [MapView.zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#zoom) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) */ zoom?: number; } - export interface MapViewHighlightOptionsProperties extends Object { /** * The color of the highlight. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) - * + * * @default #00ffff */ color?: Color | number[] | string; /** * The opacity of the highlight halo. This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) - * + * * @default 1 */ haloOpacity?: number; /** * The opacity of the fill (area within the halo). This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) - * + * * @default 0.25 */ fillOpacity?: number; @@ -43555,64 +45780,131 @@ declare namespace __esri { export interface MapViewHighlightOptions extends AnonymousAccessor { /** * The color of the highlight. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) - * + * * @default #00ffff */ color?: Color; /** * The opacity of the highlight halo. This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) - * + * * @default 1 */ haloOpacity?: number; /** * The opacity of the fill (area within the halo). This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) - * + * * @default 0.25 */ fillOpacity?: number; } - export interface MapViewHitTestScreenPoint extends Object { /** * The horizontal screen coordinate of the click on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) */ x: number; /** * The vertical screen coordinate of the click on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) */ y: number; } + export interface MapViewTakeScreenshotOptions extends Object { + /** + * The format of the resulting encoded data url. **Possible values**: jpg | png. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + * + * @default jpg + */ + format?: string; + /** + * When used, only the visible layers in this list will be included in the output. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + */ + layers?: Layer[]; + /** + * The quality (0 to 100) of the encoded image when encoding as `jpg`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + * + * @default 98 + */ + quality?: number; + /** + * The width of the screenshot (defaults to the area width). The height will be derived automatically if left unspecified, according to the aspect ratio of the of the screenshot area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + */ + width?: number; + /** + * The height of the screenshot (defaults to the area height). The width will be derived automatically if left unspecified, according to the aspect ratio of the screenshot area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + */ + height?: number; + /** + * Specifies whether to take a screenshot of a specific area of the view. The area coordinates are relative to the origin of the padded view (see [padding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#padding)) and will be clipped to the view size. Defaults to the whole view (padding excluded). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + */ + area?: MapViewTakeScreenshotOptionsArea; + } + + export interface MapViewTakeScreenshotOptionsArea extends Object { + /** + * The x coordinate of the area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + */ + x?: number; + /** + * The y coordinate of the area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + */ + y?: number; + /** + * The width of the area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + */ + width?: number; + /** + * The height of the area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#takeScreenshot) + */ + height?: number; + } export interface MapViewToMapScreenPoint extends Object { /** * The horizontal screen coordinate to convert. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toMap) */ x: number; /** * The vertical screen coordinate to convert. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#toMap) */ y: number; } export interface MapViewMouseWheelEvent { - deltaY: number; native: any; @@ -43629,7 +45921,6 @@ declare namespace __esri { } export interface MapViewPointerDownEvent { - button: number; buttons: number; @@ -43652,7 +45943,6 @@ declare namespace __esri { } export interface MapViewPointerEnterEvent { - button: number; buttons: number; @@ -43675,7 +45965,6 @@ declare namespace __esri { } export interface MapViewPointerLeaveEvent { - button: number; buttons: number; @@ -43698,7 +45987,6 @@ declare namespace __esri { } export interface MapViewPointerMoveEvent { - button: number; buttons: number; @@ -43721,7 +46009,6 @@ declare namespace __esri { } export interface MapViewPointerUpEvent { - button: number; buttons: number; @@ -43744,7 +46031,6 @@ declare namespace __esri { } export interface MapViewResizeEvent { - height: number; oldHeight: number; @@ -43754,25 +46040,42 @@ declare namespace __esri { width: number; } + /** + * Object returned when [takeScreenshot()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) promise resolves: + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#Screenshot) + */ + export interface Screenshot extends Object { + /** + * A data url representing the screenshot. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#Screenshot) + */ + dataUrl: string; + /** + * The raw RGBA image data. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#Screenshot) + */ + data: ImageData; + } export interface MapViewDragEventOrigin extends Object { - x: number; y: number; } - export interface HitTestResultResults extends Object { /** * A graphic representing a feature in the view that intersects the input screen coordinates. If the graphic comes from a layer with an applied [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html), then the [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) property will be empty. Other properties may be empty based on the context in which the graphic is fetched. If the result comes from a [VectorTileLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-VectorTileLayer.html) then a static graphic is returned with two `attributes`: `layerId` and `layerName`. These correspond to the name and id of the style-layer in the [vector tile style](https://developers.arcgis.com/rest/services-reference/vector-tile-style.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#HitTestResult) */ graphic: Graphic; /** * The point geometry in the spatial reference of the view corresponding with the input screen coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#HitTestResult) */ mapPoint: Point; @@ -43781,42 +46084,40 @@ declare namespace __esri { interface gamepadGamepadSettings extends Accessor { /** * Use this property to explicitly select the gamepad device for map and scene navigation. If unspecified then all connected gamepads will be able to navigate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#device) - * + * * @default null */ device: GamepadInputDevice; /** * Whether gamepad navigation is enabled on the View. If this is enabled, but no `device` is specified, the first supported one will be selected automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#enabled) - * + * * @default true */ enabled: boolean; /** * This setting controls the behavior of forward and back movement of the left stick. If set to `pan`, movement will be at a constant altitude (panning the view forward and backward) whereas `zoom` will move the view in the viewing direction. Pan is best suited for exploring a scene as if on foot or in a car. Zoom mode provides great control to navigate the scene similar to a flight simulator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#mode) - * + * * @default pan */ mode: "pan" | "zoom"; /** * Determines whether pressing the tilt axis forwards make the view tilt down (towards the nadir), or up (towards the zenith). The default behavior is to tilt the view down when pressing the stick that controls tilt forwards. **Possible Values:** forward-down | forward-up - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#tiltDirection) - * + * * @default forward-down */ tiltDirection: "forward-down" | "forward-up"; } interface gamepadGamepadSettingsConstructor { - - - new(properties?: gamepadGamepadSettingsProperties): gamepadGamepadSettings; + new (properties?: gamepadGamepadSettingsProperties): gamepadGamepadSettings; } export const gamepadGamepadSettings: gamepadGamepadSettingsConstructor; @@ -43824,33 +46125,33 @@ declare namespace __esri { interface gamepadGamepadSettingsProperties { /** * Use this property to explicitly select the gamepad device for map and scene navigation. If unspecified then all connected gamepads will be able to navigate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#device) - * + * * @default null */ device?: GamepadInputDeviceProperties; /** * Whether gamepad navigation is enabled on the View. If this is enabled, but no `device` is specified, the first supported one will be selected automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#enabled) - * + * * @default true */ enabled?: boolean; /** * This setting controls the behavior of forward and back movement of the left stick. If set to `pan`, movement will be at a constant altitude (panning the view forward and backward) whereas `zoom` will move the view in the viewing direction. Pan is best suited for exploring a scene as if on foot or in a car. Zoom mode provides great control to navigate the scene similar to a flight simulator. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#mode) - * + * * @default pan */ mode?: "pan" | "zoom"; /** * Determines whether pressing the tilt axis forwards make the view tilt down (towards the nadir), or up (towards the zenith). The default behavior is to tilt the view down when pressing the stick that controls tilt forwards. **Possible Values:** forward-down | forward-up - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-gamepad-GamepadSettings.html#tiltDirection) - * + * * @default forward-down */ tiltDirection?: "forward-down" | "forward-up"; @@ -43859,75 +46160,71 @@ declare namespace __esri { interface Navigation extends Accessor { /** * Gamepad navigation specific configuration settings. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-Navigation.html#gamepad) */ readonly gamepad: gamepadGamepadSettings; } interface NavigationConstructor { - - - new(properties?: NavigationProperties): Navigation; + new (properties?: NavigationProperties): Navigation; } export const Navigation: NavigationConstructor; - interface NavigationProperties { - - } + interface NavigationProperties {} interface SceneView extends View, BreakpointsOwner { /** * Allows the view to be partially or fully transparent when composited with the webpage elements behind it. This property can only be set once at construction time. When alpha compositing is enabled, web scenes are less performant. It's important to set this property to `true` only when you need to apply transparency on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#alphaCompositingEnabled) - * + * * @default false */ alphaCompositingEnabled: boolean; /** - * The observation point from which the visible portion (or perspective) of the SceneView is determined. Contains properties including the elevation, tilt, and heading (in degrees) of the current view. Setting the camera immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. The camera property contains an internal reference which may be modified in the future. To persist or modify the camera, create a clone using [camera.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone). + * The observation point from which the visible portion (or perspective) of the SceneView is determined. Contains properties including the elevation, tilt, and heading (in degrees) of the current view. Setting the camera immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. The camera property contains an internal reference which may be modified in the future. To persist or modify the camera, create a clone using [camera.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) */ camera: Camera; /** - * Represents the view's center point; when setting the center you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing at longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. The center property contains an internal reference which may be modified in the future. To persist or modify the center, create a clone using [center.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). + * Represents the view's center point; when setting the center you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing at longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. The center property contains an internal reference which may be modified in the future. To persist or modify the center, create a clone using [center.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) */ center: Point; /** * Represents an optional clipping area used to define the visible [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of a local scene. If defined, only data (including the basemap) within the area will be displayed. The `clippingArea` property only applies to [local](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) scenes. ![scene-clipping-area](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-clipping-area.png%20%22Local%20scene%20with%20clippingArea%22) The clippingArea property contains an internal reference which may be modified in the future. To persist or modify the clippingArea, create a clone using [clippingArea.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) */ clippingArea: Extent; /** * Specifies constraints for [Camera tilt](esri-Camera.html#tilt) and altitude that may be applied to the SceneView. See the object specification table below for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ constraints: SceneViewConstraints; /** - * Specifies various properties of the environment's visualization in the view. The SceneView will redraw automatically when any property of environment changes. + * Specifies various properties of the environment's visualization in the view. The SceneView will redraw automatically when any property of environment changes. * ```js - * const view = new SceneView({ + * var view = new SceneView({ * map: map, * container: "viewDiv" * }); - * + * * // Set the sun position to reflect the current time * view.environment.lighting.date = Date.now(); - * + * * // Disable automatic lighting updates by camera tracking * view.environment.lighting.cameraTrackingEnabled = true; - * + * * // Set a background color - * const view = new SceneView({ + * var view = new SceneView({ * container: "view", * map: map, * environment: { @@ -43940,82 +46237,82 @@ declare namespace __esri { * } * }); * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ environment: SceneViewEnvironment; /** - * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Rather than using extent to change the visible portion of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in a SceneView, you should use [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) since it easily allows you to define the heading, elevation and tilt of the observation point from which the view's perspective is created. When set in the constructor, this property overrides the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) or [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) are also set in the constructor. The extent property contains an internal reference which may be modified in the future. To persist or modify the extent, create a clone using [extent.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). + * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Rather than using extent to change the visible portion of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in a SceneView, you should use [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) since it easily allows you to define the heading, elevation and tilt of the observation point from which the view's perspective is created. When set in the constructor, this property overrides the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) or [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) are also set in the constructor. The extent property contains an internal reference which may be modified in the future. To persist or modify the extent, create a clone using [extent.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) - * + * * @default null */ extent: Extent; /** * Options for configuring the highlight. Use the highlight method on the appropriate [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) to highlight a feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) */ highlightOptions: SceneViewHighlightOptions; /** - * SceneView can draw scenes in three different quality modes: `high`, `medium` and `low`. The `low` quality profile significantly increases performance on slower browsers and devices by reducing the memory limit and the visual quality in the following aspects: + * SceneView can draw scenes in three different quality modes: `high`, `medium` and `low`. The `low` quality profile significantly increases performance on slower browsers and devices by reducing the memory limit and the visual quality in the following aspects: * * Map resolution * * Scene layer detail level * * Anti-aliasing (edge smoothing) - * - * - * The high and medium quality profiles only differ in the maximum amount of memory which the view is allowed to use. A higher memory limit improves quality in complex web scenes with many layers, but can have a negative impact on drawing performance and stability. The default value is based on the detected browser: + * + * + * The high and medium quality profiles only differ in the maximum amount of memory which the view is allowed to use. A higher memory limit improves quality in complex web scenes with many layers, but can have a negative impact on drawing performance and stability. The default value is based on the detected browser: * * `low` for Internet Explorer 11 and certain mobile devices * * `medium` for any other browser - * - * + * + * * Overriding the default value is best done in the constructor (see example below). If the value is modified after construction, only a subset of the quality aspects are affected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#qualityProfile) */ qualityProfile: string; /** * Represents an approximation of the map scale at the center of the view. Setting the scale immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) property. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) */ scale: number; /** - * The viewing mode (`local` or `global`). Global scenes render the earth as a sphere. Local scenes render the earth on a flat plane and allow for navigation and feature display in a localized or [clipped](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) area. Users may also navigate the camera of a local scene below the surface of a basemap. - * + * The viewing mode (`local` or `global`). Global scenes render the earth as a sphere. Local scenes render the earth on a flat plane and allow for navigation and feature display in a localized or [clipped](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) area. Users may also navigate the camera of a local scene below the surface of a basemap. + * * Value | Example | Description * ------|-------|------------ * global | ![scene-global](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-global.png) | Global scenes allow the entire globe to render in the view, showing the curvature of the earth. * local | ![scene-local](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-local.png) | Local scenes render the earth on a flat surface. They can be constrained to only show a "local" area by setting the [clippingArea](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clipplingArea) property. Local scenes also allow for displaying and exploring data that would otherwise be hidden by the surface of the earth. - * + * * Depending on the viewing mode different [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) - * + * * @default global */ viewingMode: string; /** * Represents the current view as a [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or point of observation on the view. In SceneViews, [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) should be used in favor of viewpoint for watching or changing the point of view. Setting the viewpoint immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) is also set in the constructor. The viewpoint property contains an internal reference which may be modified in the future. To persist or modify the viewpoint, create a clone using [viewpoint.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) */ viewpoint: Viewpoint; /** * Represents the level of detail (LOD) at the center of the view. Setting the zoom immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). Setting this property in conjunction with [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) is a convenient way to set the initial extent of the view. If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), or [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) properties are also set in the constructor. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) */ zoom: number; /** * Sets the focus on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#focus) - * - * + * + * */ focus(): void; /** @@ -44026,12 +46323,12 @@ declare namespace __esri { * * [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) * * [Camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html) * * Object with a combination of `target`, `center`, `scale`, `position`, `heading` and `tilt` properties (with `target` being any of the types listed above). The `center` property is provided as a convenience to animate the [SceneView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) and is the equivalent of specifying the `target` with the center [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). The target must be provided in the spatial reference of the view. - * - * + * + * * This function returns a promise which resolves as soon as the new view has been set to the target. If the transition is animated, then the ongoing animation can be obtained using [SceneView.animation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#animation). If the given target is far away from the current camera position, then heading and tilt will be automatically set to their neutral values (facing north, looking top down). Tilt and heading can always be explicitly set to override this behavior. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) - * + * * @param target The target location/viewpoint to go to. When using an object for `target`, use the properties in the table below. * @param target.target The target of the animation. * @param target.center The [SceneView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) to go to. @@ -44046,77 +46343,79 @@ declare namespace __esri { * @param options.duration Set the exact duration (in milliseconds) of the animation. Note that by default, animation duration is calculated based on the time required to reach the target at a constant speed. Setting duration overrides the speedFactor option. Note that the resulting duration is still limited to the maxDuration. * @param options.maxDuration The maximum allowed duration (in milliseconds) of the animation. The default maxDuration value takes the specified speedFactor into account. * @param options.easing The easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: `linear`, `in-cubic`, `out-cubic`, `in-out-cubic`, `in-expo`, `out-expo`, `in-out-expo`, `in-out-coast-quadratic`. See [easing functions](https://easings.net/) for graphical representations of these functions. By default, animations that are less than 1000 ms use the `out-expo` easing function; longer animations use the `in-out-coast-quadratic` easing function. - * + * */ - goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera | SceneViewGoToTarget, options?: SceneViewGoToOptions): IPromise; + goTo( + target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera | SceneViewGoToTarget, + options?: SceneViewGoToOptions + ): IPromise; /** * Indicates whether there is an event listener on the instance that matches the provided event name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hasEventListener) - * - * + * + * */ hasEventListener(): void; /** * Returns the topmost feature from each layer that intersects the specified screen coordinates. The following layer types will return a result if a hit is made on an intersecting feature: [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html), [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html), [CSVLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-CSVLayer.html), [GeoRSSLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoRSSLayer.html), [KMLLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KMLLayer.html), and [StreamLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-StreamLayer.html). Draped graphics (i.e. graphics in layers where the [elevation mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#elevationInfo) is `on-the-ground`) are currently **not** returned from this method, even when they intersect the input screen point. When the ground surface is hit, but no graphic is found, then the result of hitTest will be a single object with its mapPoint set to the point on the surface that was hit, but its graphic will be set to `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) - * + * * @param screenPoint The screen coordinates of the click on the view. * @param screenPoint.x The horizontal screen coordinate of the click on the view. * @param screenPoint.y The vertical screen coordinate of the click on the view. - * + * */ hitTest(screenPoint: SceneViewHitTestScreenPoint): IPromise; /** * Registers an event handler on the instance. Call this method to hook an event with a listener. See the [Events summary table](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#events-summary) for a list of listened events. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#on) - * + * * @param type The name of the event or events to listen for. * @param modifiersOrHandler Additional modifier keys to filter events. Please see [Key Values](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values) for possible values. All the standard key values are supported. Alternatively, if no modifiers are required, the function will call when the event fires. The following events don't support modifier keys: `blur`, `focus`, `layerview-create`, `layerview-destroy`, `resize`. * @param handler The function to call when the event is fired, if modifiers were specified. - * + * */ on(type: string | string[], modifiersOrHandler: string[] | EventHandler, handler?: EventHandler): IHandle; /** * Create a screenshot of the current view. Screenshots include only elements that are rendered on the canvas (all geographical elements), but excludes overlayed DOM elements (UI, popups, measurement labels, etc.). By default, a screenshot of the whole view is created. Different options allow for creating different types of screenshots, including taking screenshots at different aspect ratios, different resolutions and creating thumbnails. Screenshots are always taken inside the padded area of the view (see [padding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#padding)). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) - * + * * @param options Screenshot options. * @param options.format The format of the resulting encoded data url. **Possible values**: jpg | png. * @param options.quality The quality (0 to 100) of the encoded image when encoding as `jpg`. * @param options.width The width of the screenshot (defaults to the area width). The height will be derived automatically if left unspecified, according to the aspect ratio of the of the screenshot area. * @param options.height The height of the screenshot (defaults to the area height). The width will be derived automatically if left unspecified, according to the aspect ratio of the screenshot area. * @param options.area Specifies whether to take a screenshot of a specific area of the view. The area coordinates are relative to the origin of the padded view (see [padding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#padding)) and will be clipped to the view size. Defaults to the whole view (padding excluded). - * + * */ - takeScreenshot(options?: SceneViewTakeScreenshotOptions): IPromise; + takeScreenshot(options?: SceneViewTakeScreenshotOptions): IPromise; /** * Converts the given screen point to a [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap) - * + * * @param screenPoint The screen coordinates to convert. * @param screenPoint.x The horizontal screen coordinate to convert. * @param screenPoint.y The vertical screen coordinate to convert. * @param mapPoint The point object that will reference the result. - * + * */ toMap(screenPoint: SceneViewToMapScreenPoint, mapPoint?: Point): Point; /** * Converts the given [map point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) to a [screen point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-ScreenPoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toScreen) - * + * * @param point A point geometry. * @param screenPoint ScreenPoint object that will reference the result. - * + * */ toScreen(point: Point, screenPoint?: ScreenPoint): ScreenPoint; - on(name: "resize", eventHandler: SceneViewResizeEventHandler): IHandle; on(name: "resize", modifiers: string[], eventHandler: SceneViewResizeEventHandler): IHandle; @@ -44193,11 +46492,11 @@ declare namespace __esri { interface SceneViewConstructor { /** * A SceneView displays a 3D view of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) or [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html) instance using WebGL. To render a map and its layers in 2D, see the documentation for [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). For a general overview of views, see [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) */ - new(properties?: SceneViewProperties): SceneView; + new (properties?: SceneViewProperties): SceneView; } export const SceneView: SceneViewConstructor; @@ -44205,54 +46504,54 @@ declare namespace __esri { interface SceneViewProperties extends ViewProperties, BreakpointsOwnerProperties { /** * Allows the view to be partially or fully transparent when composited with the webpage elements behind it. This property can only be set once at construction time. When alpha compositing is enabled, web scenes are less performant. It's important to set this property to `true` only when you need to apply transparency on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#alphaCompositingEnabled) - * + * * @default false */ alphaCompositingEnabled?: boolean; /** - * The observation point from which the visible portion (or perspective) of the SceneView is determined. Contains properties including the elevation, tilt, and heading (in degrees) of the current view. Setting the camera immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. The camera property contains an internal reference which may be modified in the future. To persist or modify the camera, create a clone using [camera.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone). + * The observation point from which the visible portion (or perspective) of the SceneView is determined. Contains properties including the elevation, tilt, and heading (in degrees) of the current view. Setting the camera immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. The camera property contains an internal reference which may be modified in the future. To persist or modify the camera, create a clone using [camera.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#clone). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) */ camera?: CameraProperties; /** - * Represents the view's center point; when setting the center you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing at longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. The center property contains an internal reference which may be modified in the future. To persist or modify the center, create a clone using [center.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). + * Represents the view's center point; when setting the center you may pass a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) instance or an array of numbers representing at longitude/latitude pair (`[-100.4593, 36.9014]`). Setting the center immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. The center property contains an internal reference which may be modified in the future. To persist or modify the center, create a clone using [center.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html#clone). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) */ center?: PointProperties | number[]; /** * Represents an optional clipping area used to define the visible [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of a local scene. If defined, only data (including the basemap) within the area will be displayed. The `clippingArea` property only applies to [local](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) scenes. ![scene-clipping-area](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-clipping-area.png%20%22Local%20scene%20with%20clippingArea%22) The clippingArea property contains an internal reference which may be modified in the future. To persist or modify the clippingArea, create a clone using [clippingArea.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) */ clippingArea?: ExtentProperties; /** * Specifies constraints for [Camera tilt](esri-Camera.html#tilt) and altitude that may be applied to the SceneView. See the object specification table below for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ constraints?: SceneViewConstraintsProperties; /** - * Specifies various properties of the environment's visualization in the view. The SceneView will redraw automatically when any property of environment changes. + * Specifies various properties of the environment's visualization in the view. The SceneView will redraw automatically when any property of environment changes. * ```js - * const view = new SceneView({ + * var view = new SceneView({ * map: map, * container: "viewDiv" * }); - * + * * // Set the sun position to reflect the current time * view.environment.lighting.date = Date.now(); - * + * * // Disable automatic lighting updates by camera tracking * view.environment.lighting.cameraTrackingEnabled = true; - * + * * // Set a background color - * const view = new SceneView({ + * var view = new SceneView({ * container: "view", * map: map, * environment: { @@ -44265,86 +46564,84 @@ declare namespace __esri { * } * }); * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ environment?: SceneViewEnvironmentProperties; /** - * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Rather than using extent to change the visible portion of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in a SceneView, you should use [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) since it easily allows you to define the heading, elevation and tilt of the observation point from which the view's perspective is created. When set in the constructor, this property overrides the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) or [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) are also set in the constructor. The extent property contains an internal reference which may be modified in the future. To persist or modify the extent, create a clone using [extent.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). + * The extent represents the visible portion of a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) within the view as an instance of [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html). Setting the extent immediately changes the view without animation. To animate the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). Rather than using extent to change the visible portion of the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) in a SceneView, you should use [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) since it easily allows you to define the heading, elevation and tilt of the observation point from which the view's perspective is created. When set in the constructor, this property overrides the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) or [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) are also set in the constructor. The extent property contains an internal reference which may be modified in the future. To persist or modify the extent, create a clone using [extent.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#clone). * > **Z-values** defined in a geographic or metric coordinate system are expressed in meters. However, in local scenes that use a projected coordinate system, vertical units are assumed to be the same as the horizontal units specified by the service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) - * + * * @default null */ extent?: ExtentProperties; /** * Options for configuring the highlight. Use the highlight method on the appropriate [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) to highlight a feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) */ highlightOptions?: SceneViewHighlightOptionsProperties; /** - * SceneView can draw scenes in three different quality modes: `high`, `medium` and `low`. The `low` quality profile significantly increases performance on slower browsers and devices by reducing the memory limit and the visual quality in the following aspects: + * SceneView can draw scenes in three different quality modes: `high`, `medium` and `low`. The `low` quality profile significantly increases performance on slower browsers and devices by reducing the memory limit and the visual quality in the following aspects: * * Map resolution * * Scene layer detail level * * Anti-aliasing (edge smoothing) - * - * - * The high and medium quality profiles only differ in the maximum amount of memory which the view is allowed to use. A higher memory limit improves quality in complex web scenes with many layers, but can have a negative impact on drawing performance and stability. The default value is based on the detected browser: + * + * + * The high and medium quality profiles only differ in the maximum amount of memory which the view is allowed to use. A higher memory limit improves quality in complex web scenes with many layers, but can have a negative impact on drawing performance and stability. The default value is based on the detected browser: * * `low` for Internet Explorer 11 and certain mobile devices * * `medium` for any other browser - * - * + * + * * Overriding the default value is best done in the constructor (see example below). If the value is modified after construction, only a subset of the quality aspects are affected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#qualityProfile) */ qualityProfile?: string; /** * Represents an approximation of the map scale at the center of the view. Setting the scale immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) property. This property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), or [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent) properties are also set in the constructor. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) */ scale?: number; /** - * The viewing mode (`local` or `global`). Global scenes render the earth as a sphere. Local scenes render the earth on a flat plane and allow for navigation and feature display in a localized or [clipped](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) area. Users may also navigate the camera of a local scene below the surface of a basemap. - * + * The viewing mode (`local` or `global`). Global scenes render the earth as a sphere. Local scenes render the earth on a flat plane and allow for navigation and feature display in a localized or [clipped](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clippingArea) area. Users may also navigate the camera of a local scene below the surface of a basemap. + * * Value | Example | Description * ------|-------|------------ * global | ![scene-global](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-global.png) | Global scenes allow the entire globe to render in the view, showing the curvature of the earth. * local | ![scene-local](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-local.png) | Local scenes render the earth on a flat surface. They can be constrained to only show a "local" area by setting the [clippingArea](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#clipplingArea) property. Local scenes also allow for displaying and exploring data that would otherwise be hidden by the surface of the earth. - * + * * Depending on the viewing mode different [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode) - * + * * @default global */ viewingMode?: string; /** * Represents the current view as a [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or point of observation on the view. In SceneViews, [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) should be used in favor of viewpoint for watching or changing the point of view. Setting the viewpoint immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). When set in the constructor, this property overrides the [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center), [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale), and [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) properties. This property will be ignored if [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera) is also set in the constructor. The viewpoint property contains an internal reference which may be modified in the future. To persist or modify the viewpoint, create a clone using [viewpoint.clone()](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html#clone). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint) */ viewpoint?: ViewpointProperties; /** * Represents the level of detail (LOD) at the center of the view. Setting the zoom immediately changes the current view. For animating the view, see [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo). Setting this property in conjunction with [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) is a convenient way to set the initial extent of the view. If set in the constructor, this property will be ignored if the [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewpoint), [camera](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#camera), [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#extent), or [scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) properties are also set in the constructor. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) */ zoom?: number; } export interface SceneViewBlurEvent { - native: any; target: View; } export interface SceneViewClickEvent { - button: number; buttons: number; @@ -44365,7 +46662,6 @@ declare namespace __esri { } export interface SceneViewDoubleClickEvent { - button: number; buttons: number; @@ -44386,7 +46682,6 @@ declare namespace __esri { } export interface SceneViewDragEvent { - action: string; angle: number; @@ -44415,7 +46710,6 @@ declare namespace __esri { export type EasingFunction = (t: number, duration: number) => number; export interface SceneViewFocusEvent { - native: any; target: View; @@ -44423,20 +46717,19 @@ declare namespace __esri { /** * Object specification for the result of the [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) */ export interface SceneViewHitTestResult extends Object { /** * An array of result objects returned from the [hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest). Results are returned when the location of the input screen coordinates intersect a [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) in the view. See the table below for the specification of each object in this array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) */ results: SceneViewHitTestResultResults[]; } export interface SceneViewHoldEvent { - button: number; buttons: number; @@ -44457,7 +46750,6 @@ declare namespace __esri { } export interface SceneViewImmediateClickEvent { - button: number; buttons: number; @@ -44478,7 +46770,6 @@ declare namespace __esri { } export interface SceneViewKeyDownEvent { - key: string; native: any; @@ -44493,7 +46784,6 @@ declare namespace __esri { } export interface SceneViewKeyUpEvent { - native: any; stopPropagation: Function; @@ -44504,21 +46794,18 @@ declare namespace __esri { } export interface SceneViewLayerviewCreateEvent { - layer: Layer; layerView: LayerView; } export interface SceneViewLayerviewDestroyEvent { - layer: Layer; layerView: LayerView; } export interface SceneViewMouseWheelEvent { - deltaY: number; native: any; @@ -44535,7 +46822,6 @@ declare namespace __esri { } export interface SceneViewPointerDownEvent { - button: number; buttons: number; @@ -44558,7 +46844,6 @@ declare namespace __esri { } export interface SceneViewPointerEnterEvent { - button: number; buttons: number; @@ -44581,7 +46866,6 @@ declare namespace __esri { } export interface SceneViewPointerLeaveEvent { - button: number; buttons: number; @@ -44604,7 +46888,6 @@ declare namespace __esri { } export interface SceneViewPointerMoveEvent { - button: number; buttons: number; @@ -44627,7 +46910,6 @@ declare namespace __esri { } export interface SceneViewPointerUpEvent { - button: number; buttons: number; @@ -44650,7 +46932,6 @@ declare namespace __esri { } export interface SceneViewResizeEvent { - height: number; oldHeight: number; @@ -44660,29 +46941,28 @@ declare namespace __esri { width: number; } - export interface SceneViewConstraintsProperties extends Object { /** - * Specifies a constraint on the minimum and maximum allowed camera altitude. - * + * Specifies a constraint on the minimum and maximum allowed camera altitude. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ altitude?: SceneViewConstraintsAltitudeProperties; /** * Specifies the near and far webgl clip distances. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ clipDistance?: SceneViewConstraintsClipDistanceProperties; /** * When enabled, prevents the user from navigating below the surface in a local SceneView. This property is deprecated, please use [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) instead. **Deprecated since version 4.8** - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ collision?: SceneViewConstraintsCollision; /** * Specifies a constraint on the amount of allowed tilting of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ tilt?: SceneViewConstraintsTiltProperties; @@ -44690,46 +46970,45 @@ declare namespace __esri { export interface SceneViewConstraints extends AnonymousAccessor { /** - * Specifies a constraint on the minimum and maximum allowed camera altitude. - * + * Specifies a constraint on the minimum and maximum allowed camera altitude. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ altitude?: SceneViewConstraintsAltitude; /** * Specifies the near and far webgl clip distances. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ clipDistance?: SceneViewConstraintsClipDistance; /** * When enabled, prevents the user from navigating below the surface in a local SceneView. This property is deprecated, please use [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#navigationConstraint) instead. **Deprecated since version 4.8** - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ collision?: SceneViewConstraintsCollision; /** * Specifies a constraint on the amount of allowed tilting of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ tilt?: SceneViewConstraintsTilt; } - export interface SceneViewConstraintsAltitudeProperties extends Object { /** * The minimum allowed camera altitude (in meters). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default -∞ */ min?: number; /** * The maximum allowed camera altitude (in meters). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default EARTH_RADIUS * 4 */ max?: number; @@ -44738,41 +47017,40 @@ declare namespace __esri { export interface SceneViewConstraintsAltitude extends AnonymousAccessor { /** * The minimum allowed camera altitude (in meters). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default -∞ */ min?: number; /** * The maximum allowed camera altitude (in meters). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default EARTH_RADIUS * 4 */ max?: number; } - export interface SceneViewConstraintsClipDistanceProperties extends Object { /** * The near clip distance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ near?: number; /** * The far clip distance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ far?: number; /** * Specifies the mode of the constraint which is either `auto` or `manual`. In `auto` mode, the near and far clip distance values are automatically determined. In `manual` mode, the near and far clip distance values are user defined, constant values. Note that the mode automatically changes to `manual` whenever the `near` or `far` property is set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default auto */ mode?: string; @@ -44781,51 +47059,49 @@ declare namespace __esri { export interface SceneViewConstraintsClipDistance extends AnonymousAccessor { /** * The near clip distance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ near?: number; /** * The far clip distance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ far?: number; /** * Specifies the mode of the constraint which is either `auto` or `manual`. In `auto` mode, the near and far clip distance values are automatically determined. In `manual` mode, the near and far clip distance values are user defined, constant values. Note that the mode automatically changes to `manual` whenever the `near` or `far` property is set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default auto */ mode?: string; } - export interface SceneViewConstraintsCollision extends Object { /** * Set to `false` to permit the user to navigate below the surface in a local SceneView. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default true */ enabled?: boolean; } - export interface SceneViewConstraintsTiltProperties extends Object { /** * Specifies the maximum amount of tilt (in degrees) allowed in the view and may range from 0.5 to 179.5 degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ max?: number; /** * Specifies the mode of the constraint. There are two possible values: `auto` or `manual`. In `auto` mode, the maximum tilt value is automatically determined based on the altitude of the view camera. In `manual` mode, the maximum tilt value is a user defined, constant value. **Note:** The mode automatically changes to `manual` whenever the `max` property is set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default auto */ mode?: string; @@ -44834,51 +47110,50 @@ declare namespace __esri { export interface SceneViewConstraintsTilt extends AnonymousAccessor { /** * Specifies the maximum amount of tilt (in degrees) allowed in the view and may range from 0.5 to 179.5 degrees. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) */ max?: number; /** * Specifies the mode of the constraint. There are two possible values: `auto` or `manual`. In `auto` mode, the maximum tilt value is automatically determined based on the altitude of the view camera. In `manual` mode, the maximum tilt value is a user defined, constant value. **Note:** The mode automatically changes to `manual` whenever the `max` property is set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#constraints) - * + * * @default auto */ mode?: string; } - export interface SceneViewEnvironmentProperties extends Object { /** * Specifies how the background of the scene (which lies behind sky, stars and atmosphere) should be displayed. By default this is simply a single, fully opaque, black color. Currently [ColorBackground](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html) is the only type of background supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ background?: BackgroundProperties; /** * Lighting conditions of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ lighting?: SceneViewEnvironmentLightingProperties; /** * Indicates whether atmosphere visualization is enabled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ atmosphereEnabled?: boolean; /** * Atmosphere conditions of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ atmosphere?: SceneViewEnvironmentAtmosphereProperties; /** * Indicates whether stars visualization is enabled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default true */ starsEnabled?: boolean; @@ -44887,51 +47162,50 @@ declare namespace __esri { export interface SceneViewEnvironment extends AnonymousAccessor { /** * Specifies how the background of the scene (which lies behind sky, stars and atmosphere) should be displayed. By default this is simply a single, fully opaque, black color. Currently [ColorBackground](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html) is the only type of background supported. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ background?: Background; /** * Lighting conditions of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ lighting?: SceneViewEnvironmentLighting; /** * Indicates whether atmosphere visualization is enabled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ atmosphereEnabled?: boolean; /** * Atmosphere conditions of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) */ atmosphere?: SceneViewEnvironmentAtmosphere; /** * Indicates whether stars visualization is enabled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default true */ starsEnabled?: boolean; } - export interface SceneViewEnvironmentAtmosphereProperties extends Object { /** - * Indicates the quality of the atmosphere visualization. The quality of the atmosphere may have a significant impact on performance. This setting does not have any effect in [local scenes](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode). - * + * Indicates the quality of the atmosphere visualization. The quality of the atmosphere may have a significant impact on performance. This setting does not have any effect in [local scenes](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode). + * * Known Value | Example * ------------|--------- * low | ![scene-atmosphere](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-atmosphere.png) * high | ![scene-atmosphere](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-atmosphere-realistic.png) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default low */ quality?: string; @@ -44939,52 +47213,51 @@ declare namespace __esri { export interface SceneViewEnvironmentAtmosphere extends AnonymousAccessor { /** - * Indicates the quality of the atmosphere visualization. The quality of the atmosphere may have a significant impact on performance. This setting does not have any effect in [local scenes](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode). - * + * Indicates the quality of the atmosphere visualization. The quality of the atmosphere may have a significant impact on performance. This setting does not have any effect in [local scenes](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#viewingMode). + * * Known Value | Example * ------------|--------- * low | ![scene-atmosphere](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-atmosphere.png) * high | ![scene-atmosphere](https://developers.arcgis.com/javascript/assets/img/apiref/views/scene-atmosphere-realistic.png) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default low */ quality?: string; } - export interface SceneViewEnvironmentLightingProperties extends Object { /** * The current date and time of the simulated sun. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default new Date("March 15, 2015 12:00:00") */ date?: DateProperties; /** * Indicates whether to show shadows cast by the sun. Shadows are only displayed for real world 3D objects. Terrain doesn't cast shadows. In local scenes at small zoom levels, shadows are not displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default false */ directShadowsEnabled?: boolean; /** * Indicates whether to show ambient occlusion shading. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default false */ ambientOcclusionEnabled?: boolean; /** * Indicates whether the date and time of the simulated sun is automatically updated to maintain the current time of day while the camera changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default true */ cameraTrackingEnabled?: boolean; @@ -44993,147 +47266,144 @@ declare namespace __esri { export interface SceneViewEnvironmentLighting extends AnonymousAccessor { /** * The current date and time of the simulated sun. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default new Date("March 15, 2015 12:00:00") */ date?: Date; /** * Indicates whether to show shadows cast by the sun. Shadows are only displayed for real world 3D objects. Terrain doesn't cast shadows. In local scenes at small zoom levels, shadows are not displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default false */ directShadowsEnabled?: boolean; /** * Indicates whether to show ambient occlusion shading. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default false */ ambientOcclusionEnabled?: boolean; /** * Indicates whether the date and time of the simulated sun is automatically updated to maintain the current time of day while the camera changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) - * + * * @default true */ cameraTrackingEnabled?: boolean; } - export interface SceneViewGoToOptions extends Object { /** * Indicates if the transition to the new view should be animated. If set to false, `speedFactor`, `duration`, `maxDuration`, and `easing` properties are ignored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) - * + * * @default true */ animate?: boolean; /** * Increases or decreases the animation speed by the specified factor. A speedFactor of 2 will make the animation twice as fast, while a speedFactor of 0.5 will make the animation half as fast. Setting the speed factor will automatically adapt the default maxDuration accordingly. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) - * + * * @default 1 */ speedFactor?: number; /** * Set the exact duration (in milliseconds) of the animation. Note that by default, animation duration is calculated based on the time required to reach the target at a constant speed. Setting duration overrides the speedFactor option. Note that the resulting duration is still limited to the maxDuration. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ duration?: number; /** * The maximum allowed duration (in milliseconds) of the animation. The default maxDuration value takes the specified speedFactor into account. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) - * + * * @default 8000 */ maxDuration?: number; /** * The easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: `linear`, `in-cubic`, `out-cubic`, `in-out-cubic`, `in-expo`, `out-expo`, `in-out-expo`, `in-out-coast-quadratic`. See [easing functions](https://easings.net/) for graphical representations of these functions. By default, animations that are less than 1000 ms use the `out-expo` easing function; longer animations use the `in-out-coast-quadratic` easing function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ easing?: string | EasingFunction; } - export interface SceneViewGoToTarget extends Object { /** * The target of the animation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ target?: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera; /** * The [SceneView.center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#center) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ center?: number[] | Point; /** * The [SceneView.scale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#scale) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ scale?: number; /** * The final [zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#zoom) value to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ zoom?: number; /** * The [Camera.heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ heading?: number; /** * The [Camera.tilt](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ tilt?: number; /** * The [Camera.position](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#position) to go to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) */ position?: Point; } - export interface SceneViewHighlightOptionsProperties extends Object { /** * The color of the highlight. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) - * + * * @default #00ffff */ color?: Color | number[] | string; /** * The opacity of the highlight halo. This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) - * + * * @default 1 */ haloOpacity?: number; /** * The opacity of the fill (area within the halo). This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) - * + * * @default 0.25 */ fillOpacity?: number; @@ -45142,123 +47412,119 @@ declare namespace __esri { export interface SceneViewHighlightOptions extends AnonymousAccessor { /** * The color of the highlight. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) - * + * * @default #00ffff */ color?: Color; /** * The opacity of the highlight halo. This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) - * + * * @default 1 */ haloOpacity?: number; /** * The opacity of the fill (area within the halo). This will be multiplied with the opacity specified in `color`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) - * + * * @default 0.25 */ fillOpacity?: number; } - export interface SceneViewHitTestScreenPoint extends Object { /** * The horizontal screen coordinate of the click on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) */ x: number; /** * The vertical screen coordinate of the click on the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) */ y: number; } - export interface SceneViewTakeScreenshotOptions extends Object { /** * The format of the resulting encoded data url. **Possible values**: jpg | png. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) - * + * * @default jpg */ format?: string; /** * The quality (0 to 100) of the encoded image when encoding as `jpg`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) - * + * * @default 98 */ quality?: number; /** * The width of the screenshot (defaults to the area width). The height will be derived automatically if left unspecified, according to the aspect ratio of the of the screenshot area. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) */ width?: number; /** * The height of the screenshot (defaults to the area height). The width will be derived automatically if left unspecified, according to the aspect ratio of the screenshot area. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) */ height?: number; /** * Specifies whether to take a screenshot of a specific area of the view. The area coordinates are relative to the origin of the padded view (see [padding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#padding)) and will be clipped to the view size. Defaults to the whole view (padding excluded). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) */ area?: SceneViewTakeScreenshotOptionsArea; } - export interface SceneViewTakeScreenshotOptionsArea extends Object { /** * The x coordinate of the area. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) */ x?: number; /** * The y coordinate of the area. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) */ y?: number; /** * The width of the area. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) */ width?: number; /** * The height of the area. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) */ height?: number; } - export interface SceneViewToMapScreenPoint extends Object { /** * The horizontal screen coordinate to convert. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap) */ x: number; /** * The vertical screen coordinate to convert. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap) */ y: number; @@ -45266,43 +47532,40 @@ declare namespace __esri { /** * Object returned when [takeScreenshot()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#takeScreenshot) promise resolves: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#Screenshot) */ - export interface Screenshot extends Object { + export interface SceneViewScreenshot extends Object { /** * A data url representing the screenshot. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#Screenshot) */ dataUrl: string; /** * The raw RGBA image data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#Screenshot) */ data: ImageData; } - export interface SceneViewDragEventOrigin extends Object { - x: number; y: number; } - export interface SceneViewHitTestResultResults extends Object { /** * A graphic present in the view that intersects the input screen coordinates. If the graphic comes from a layer with an applied [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html), then the [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#symbol) property will be empty. Other properties will be empty based on the context in which the graphic is fetched. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) */ graphic: Graphic; /** * The point geometry in the spatial reference of the view corresponding with the input screen coordinates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#HitTestResult) */ mapPoint: Point; @@ -45310,9 +47573,9 @@ declare namespace __esri { interface DefaultUI extends UI { /** - * An array of strings representing the default widgets visible when a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is created. The default widgets differ between MapView and SceneView. The following are the default components in each view: **MapView:** `["attribution", "zoom"]` **SceneView:** `["attribution", "navigation-toggle", "compass", "zoom"]` + * An array of strings representing the default widgets visible when a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is created. The default widgets differ between MapView and SceneView. The following are the default components in each view: **MapView:** `["attribution", "zoom"]` **SceneView:** `["attribution", "navigation-toggle", "compass", "zoom"]` * > Esri requires that when you use an ArcGIS Online basemap in your app, the map must include Esri attribution and you must be licensed to use the content. For detailed guidelines on working with attribution, please visit the official [attribution in your app](https://developers.arcgis.com/terms/attribution/) documentation. For information on terms of use, see the [Terms of Use FAQ](https://developers.arcgis.com/terms/faq/). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#components) */ components: string[]; @@ -45321,20 +47584,20 @@ declare namespace __esri { interface DefaultUIConstructor { /** * The DefaultUI class exposes the default [widget](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) [components](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#components) available in either a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This class also provides a simple API for [adding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#add), [moving](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#move) and [removing](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#remove) [widgets](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) and other HTML components from the view's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html) */ - new(properties?: DefaultUIProperties): DefaultUI; + new (properties?: DefaultUIProperties): DefaultUI; } export const DefaultUI: DefaultUIConstructor; interface DefaultUIProperties extends UIProperties { /** - * An array of strings representing the default widgets visible when a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is created. The default widgets differ between MapView and SceneView. The following are the default components in each view: **MapView:** `["attribution", "zoom"]` **SceneView:** `["attribution", "navigation-toggle", "compass", "zoom"]` + * An array of strings representing the default widgets visible when a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) is created. The default widgets differ between MapView and SceneView. The following are the default components in each view: **MapView:** `["attribution", "zoom"]` **SceneView:** `["attribution", "navigation-toggle", "compass", "zoom"]` * > Esri requires that when you use an ArcGIS Online basemap in your app, the map must include Esri attribution and you must be licensed to use the content. For detailed guidelines on working with attribution, please visit the official [attribution in your app](https://developers.arcgis.com/terms/attribution/) documentation. For information on terms of use, see the [Terms of Use FAQ](https://developers.arcgis.com/terms/faq/). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#components) */ components?: string[]; @@ -45343,42 +47606,42 @@ declare namespace __esri { interface UI extends Accessor { /** * The HTML Element that contains the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) */ container: HTMLElement; /** * The height of the UI container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#height) */ readonly height: number; /** * Defines the padding for the UI from the top, left, right, and bottom sides of the container or [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). If the value is a number, it will be used to pad all sides of the container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#padding) - * + * * @default { left: 15, top: 15, right: 15, bottom: 15 } */ padding: any | number; /** * The view associated with the UI components. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#view) */ view: MapView | SceneView; /** * The width of the UI container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#width) */ readonly width: number; /** * Adds one or more HTML component(s) or [widgets](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) to the UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) - * + * * @param component The component(s) to add to the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID, or an array containing a combination of any of those types. See the example snippets below for code examples. Alternatively, you can pass an array of objects with the following specification. * @param component.component The component to add to the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID. * @param component.position The position in the view at which to add the component. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual @@ -45386,37 +47649,37 @@ declare namespace __esri { * @param position The position in the view at which to add the component. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * @param position.position The position in the view at which to add the component(s). If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * @param position.index The placement index of the component(s). This index shows where to place the component relative to other components. For example a value of `0` would place it topmost when position is top-*, leftmost for bottom-left and right most for bottom-right. - * + * */ add(component: Widget | HTMLElement | string | any[] | UIAddComponent, position?: string | UIAddPosition): void; /** * Removes all components from a given position. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#empty) - * + * * @param position The position from which to remove all components. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual - * + * */ empty(position?: string): void; /** * Moves one or more UI component(s) to the specified position. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#move) - * + * * @param component The component(s) to move. This value can be a widget instance, HTML element, a string value representing a DOM node ID, or an array containing a combination of any of those types. See the example snippets below for code examples. Alternatively, you can pass an array of objects with the following specification. * @param component.component The component to move. This can be a widget instance, HTML element, a string value representing a DOM node ID. * @param component.position The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual * @param position The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual - * + * */ move(component: Widget | HTMLElement | string | any[] | UIMoveComponent, position?: string): void; /** * Removes one or more HTML component(s) or [widgets](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) from the UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#remove) - * + * * @param component The component(s) to remove from the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID, or an array containing a combination of any of those types. See the example snippets below for code examples. - * + * */ remove(component: Widget | HTMLElement | string | any[]): void; } @@ -45424,11 +47687,11 @@ declare namespace __esri { interface UIConstructor { /** * This class provides a simple interface for [adding](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add), [moving](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#move) and [removing](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#remove) components from a view's user interface (UI). In most cases, you will work with the view's [DefaultUI](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html) which places default [widgets](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html), such as [Zoom](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html) and [Attribution](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html) in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html) */ - new(properties?: UIProperties): UI; + new (properties?: UIProperties): UI; } export const UI: UIConstructor; @@ -45436,75 +47699,72 @@ declare namespace __esri { interface UIProperties { /** * The HTML Element that contains the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) */ container?: HTMLElement; /** * Defines the padding for the UI from the top, left, right, and bottom sides of the container or [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). If the value is a number, it will be used to pad all sides of the container. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#padding) - * + * * @default { left: 15, top: 15, right: 15, bottom: 15 } */ padding?: any | number; /** * The view associated with the UI components. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#view) */ view?: MapViewProperties | SceneViewProperties; } - export interface UIAddComponent extends Object { /** * The component to add to the UI. This can be a widget instance, HTML element, a string value representing a DOM node ID. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) */ component: Widget | HTMLElement | string; /** * The position in the view at which to add the component. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) */ position?: string; /** * The placement index of the component. This index shows where to place the component relative to other components. For example a value of `0` would place it topmost when position is top-*, leftmost for bottom-left and right most for bottom-right. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) */ index?: number; } - export interface UIAddPosition extends Object { /** * The position in the view at which to add the component(s). If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) */ position?: string; /** * The placement index of the component(s). This index shows where to place the component relative to other components. For example a value of `0` would place it topmost when position is top-*, leftmost for bottom-left and right most for bottom-right. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#add) */ index: number; } - export interface UIMoveComponent extends Object { /** * The component to move. This can be a widget instance, HTML element, a string value representing a DOM node ID. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#move) */ component: Widget | HTMLElement | string; /** * The destination position. The component will be placed in the UI [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#container) when not provided. If not specified, `manual` is used by default. **Possible Values:** top-left | top-right | bottom-left | bottom-right | manual - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-UI.html#move) */ position?: string; @@ -45513,134 +47773,134 @@ declare namespace __esri { interface View extends Accessor, corePromise, DOMContainer { /** * Collection containing a flat list of all the created [LayerViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) related to the basemap, operational layers, and group layers in this view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#allLayerViews) */ allLayerViews: Collection; /** * Represents an ongoing view animation initialized by [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). You may [watch](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch) this property to be notified when the view's extent changes . - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#animation) */ animation: ViewAnimation; /** * Allows for adding [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) directly to the default graphics in the View. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics) */ graphics: Collection; /** * The view for the ground of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#groundView) */ readonly groundView: GroundView; /** * Options to configure input handling of the View. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#input) */ readonly input: Input; /** * Indication whether the view is being interacted with (for example when panning). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#interacting) - * + * * @default false */ readonly interacting: boolean; /** * A collection containing a hierarchical list of all the created [LayerViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of the [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#layerViews) */ layerViews: Collection; /** * An instance of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) object to display in the view. A view may only display one map at a time. On the other hand, one [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) may be viewed by multiple [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) and/or [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) simultaneously. This property is typically set in the constructor of the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [class description](#) for examples demonstrating the relationship between the map and the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) */ map: Map; /** * Options to configure the navigation behavior of the View. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#navigation) */ readonly navigation: Navigation; /** * Use the padding property to make the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center), and [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent), etc. work off a subsection of the full view. This is particularly useful when layering UI elements or semi-transparent content on top of portions of the view. See the [view padding sample](https://developers.arcgis.com/javascript/latest/sample-code/view-padding/index.html) for an example of how this works. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) - * + * * @default {left: 0, top: 0, right: 0, bottom: 0} */ padding: ViewPadding; /** - * When `true`, this property indicates whether the view successfully satisfied all dependencies, signaling that the following conditions are met. + * When `true`, this property indicates whether the view successfully satisfied all dependencies, signaling that the following conditions are met. * * The view has a [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map). If [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) is a [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html) or a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html), then the map or scene must be [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loaded). * * The view has a [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#container) with a size greater than `0`. * * The view has a [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference). - * - * + * + * * When a view becomes ready it will resolve itself and invoke the callback defined in [when()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#when) where code can execute on a working view. Subsequent changes to a view's readiness would typically be handled by watching `view.ready` and providing logic for cases where the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) or [container](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#container) change. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ready) - * + * * @default false */ readonly ready: boolean; /** * Represents the current value of one pixel in the unit of the view's [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference). The value of resolution is calculated by dividing the view's [extent width](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html#width) by [its width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#width). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#resolution) */ readonly resolution: number; /** - * The spatial reference of the view. This indicates the [Projected Coordinate System](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) or the [Geographic Coordinate System](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) used to locate geographic features in the map. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) the following [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. The spatial reference can either be set explicitly or automatically derived from the following: + * The spatial reference of the view. This indicates the [Projected Coordinate System](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) or the [Geographic Coordinate System](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) used to locate geographic features in the map. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) the following [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. The spatial reference can either be set explicitly or automatically derived from the following: * * In the case of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), if the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#map) is a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html) instance, the [WebScene.initialViewProperties.spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#initialViewProperties) is used. * * In all other cases, the spatial reference is derived from the first layer that loads in this order: * * [map.basemap.baseLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) * * [map.layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) * * [map.ground.layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) - * - * + * + * * When using an [Esri basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap), the default spatial reference is Web Mercator Auxiliary Sphere. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference) - * + * * @default null */ spatialReference: SpatialReference; /** * Indication whether the view is animating, being interacted with or resizing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#stationary) - * + * * @default true */ readonly stationary: boolean; /** * The type of the view is either `2d` (indicating a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html)) or `3d` (indicating a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html)). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#type) */ readonly type: string; /** * Indicates whether the view is being updated by additional data requests to the network, or by processing received data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#updating) - * + * * @default false */ readonly updating: boolean; /** * Gets the [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) created on the view for the given layer. The returned promise resolves when the layer view for the given layer has been created, or rejects with an error (for example if the layer is not part of the view, or if the layer type is not supported in this view). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView) - * + * * @param layer The layer for which to obtain its LayerView. - * + * */ whenLayerView(layer: Layer): IPromise; } @@ -45648,11 +47908,11 @@ declare namespace __esri { interface ViewConstructor { /** * A view provides the means of viewing and interacting with the components of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html). The [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) is merely a container, storing the geographic information contained in base layers and operational layers. The View renders the [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) and its various [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers), making them visible to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) */ - new(properties?: ViewProperties): View; + new (properties?: ViewProperties): View; } export const View: ViewConstructor; @@ -45660,83 +47920,82 @@ declare namespace __esri { interface ViewProperties extends DOMContainerProperties { /** * Collection containing a flat list of all the created [LayerViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) related to the basemap, operational layers, and group layers in this view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#allLayerViews) */ allLayerViews?: CollectionProperties; /** * Represents an ongoing view animation initialized by [goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo). You may [watch](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Accessor.html#watch) this property to be notified when the view's extent changes . - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#animation) */ animation?: ViewAnimationProperties; /** * Allows for adding [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) directly to the default graphics in the View. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics) */ graphics?: CollectionProperties; /** * A collection containing a hierarchical list of all the created [LayerViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) of the [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) in the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#layerViews) */ layerViews?: CollectionProperties; /** * An instance of a [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) object to display in the view. A view may only display one map at a time. On the other hand, one [Map](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html) may be viewed by multiple [MapViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) and/or [SceneViews](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) simultaneously. This property is typically set in the constructor of the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). See the [class description](#) for examples demonstrating the relationship between the map and the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) */ map?: MapProperties; /** * Use the padding property to make the [center](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#center), and [extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#extent), etc. work off a subsection of the full view. This is particularly useful when layering UI elements or semi-transparent content on top of portions of the view. See the [view padding sample](https://developers.arcgis.com/javascript/latest/sample-code/view-padding/index.html) for an example of how this works. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) - * + * * @default {left: 0, top: 0, right: 0, bottom: 0} */ padding?: ViewPadding; /** - * The spatial reference of the view. This indicates the [Projected Coordinate System](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) or the [Geographic Coordinate System](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) used to locate geographic features in the map. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) the following [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. The spatial reference can either be set explicitly or automatically derived from the following: + * The spatial reference of the view. This indicates the [Projected Coordinate System](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) or the [Geographic Coordinate System](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) used to locate geographic features in the map. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) the following [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. The spatial reference can either be set explicitly or automatically derived from the following: * * In the case of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), if the [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#map) is a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html) instance, the [WebScene.initialViewProperties.spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#initialViewProperties) is used. * * In all other cases, the spatial reference is derived from the first layer that loads in this order: * * [map.basemap.baseLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) * * [map.layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#layers) * * [map.ground.layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) - * - * + * + * * When using an [Esri basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap), the default spatial reference is Web Mercator Auxiliary Sphere. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#spatialReference) - * + * * @default null */ spatialReference?: SpatialReferenceProperties; } - export interface ViewPadding extends Object { /** * The left padding (in pixels). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) */ left?: number; /** * The top padding (in pixels). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) */ top?: number; /** * The right padding (in pixels). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) */ right?: number; /** * The bottom padding (in pixels). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#padding) */ bottom?: number; @@ -45744,34 +48003,34 @@ declare namespace __esri { interface ViewAnimation extends Accessor, corePromise { /** - * The state of the animation. The animation terminates when the state is either `finished` or `stopped` and cannot transition again to `running`. The `finished` state indicates the animation has successfully ended, while the `stopped` state indicates that the animation was interrupted before it reached its final target. **Possible Values:** running | finished | stopped - * + * The state of the animation. The animation terminates when the state is either `finished` or `stopped` and cannot transition again to `running`. The `finished` state indicates the animation has successfully ended, while the `stopped` state indicates that the animation was interrupted before it reached its final target. **Possible Values:** running | finished | stopped | waiting-for-target + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#state) - * + * * @default running */ readonly state: string; /** * The target of the animation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#target) */ target: Viewpoint; /** * Finishes the view animation by immediately going to the target and sets the state of the animation to `finished`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#finish) - * - * + * + * */ finish(): void; /** * Stops the view animation at its current state and sets the state of the animation to `stopped`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#stop) - * - * + * + * */ stop(): void; } @@ -45779,11 +48038,11 @@ declare namespace __esri { interface ViewAnimationConstructor { /** * Contains a [state](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#state) property used for checking the state of the animation. The view animation is resolved when the animation has `finished` and is rejected if it is `stopped`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html) */ - new(properties?: ViewAnimationProperties): ViewAnimation; + new (properties?: ViewAnimationProperties): ViewAnimation; } export const ViewAnimation: ViewAnimationConstructor; @@ -45791,7 +48050,7 @@ declare namespace __esri { interface ViewAnimationProperties { /** * The target of the animation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ViewAnimation.html#target) */ target?: ViewpointProperties; @@ -45800,99 +48059,99 @@ declare namespace __esri { interface WebMap extends Map, corePromise { /** * Object responsible for containing the viewing and editing properties of the WebMap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#applicationProperties) */ applicationProperties: any; /** * An array of saved geographic extents that allow end users to quickly navigate to a particular area of interest. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#bookmarks) */ bookmarks: Collection; /** * The initial view of the WebMap. This object contains properties such as [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#viewpoint), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#spatialReference), that should be applied to the view when the WebMap loads. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#initialViewProperties) */ initialViewProperties: InitialViewProperties; /** * Indicates whether the instance has loaded. When `true`, the properties of the object can be accessed. A WebMap is considered loaded when its [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#layers) and [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#basemap) are created, but not yet loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loaded) - * + * * @default false */ readonly loaded: boolean; /** * The Error object returned if an error occurred while loading. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loadError) - * + * * @default null */ readonly loadError: Error; /** - * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#load) operation. - * + * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#load) operation. + * * Value | Description * ------|------------ * not-loaded | The object's resources have not loaded. * loading | The object's resources are currently loading. * loaded | The object's resources have loaded without errors. * failed | The object's resources failed to load. See [loadError](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loadError) for more details. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loadStatus) - * + * * @default not-loaded */ readonly loadStatus: string; /** * The portal item from which the WebMap is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#portalItem) */ portalItem: PortalItem; /** * Provides multiple slides. Each slide has a different "title", "extent", "basemap", "layers" etc. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#presentation) */ presentation: any; /** * The version of the source document from which the WebMap was read. The WebMap must be version 2.x to load into an app. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#sourceVersion) */ readonly sourceVersion: WebMapSourceVersion; /** * An array of table objects in the WebMap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#tables) */ tables: any[]; /** * The widgets object contains widgets that should be exposed to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#widgets) */ widgets: any; /** * Triggers the loading of the WebMap instance. A WebMap is considered [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loaded) when its [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#layers) and [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#basemap) are fully created. When created with a [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#portalItem), `load()` will first fetch its data to create the content, otherwise it resolves immediately. The [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) automatically calls the `load()` method when a WebMap instance is added to its [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#map) property so it can display in the view and load each individual layer. If the WebMap is used outside of a view, for example to preload it, you must call `load()` explicitly to interact with its resources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#load) - * - * + * + * */ load(): IPromise; /** * Loads all the externally loadable resources associated with the webmap. For the webmap this will load the ground, basemap and layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#loadAll) - * - * + * + * */ loadAll(): IPromise; } @@ -45900,11 +48159,11 @@ declare namespace __esri { interface WebMapConstructor { /** * Loads a [WebMap](https://doc.arcgis.com/en/arcgis-online/create-maps/make-your-first-map.htm) from [ArcGIS Online](https://www.arcgis.com/home/) or [ArcGIS Enterprise portal](https://enterprise.arcgis.com/en/portal/latest/administer/windows/what-is-portal-for-arcgis-.htm) into a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html) */ - new(properties?: WebMapProperties): WebMap; + new (properties?: WebMapProperties): WebMap; } export const WebMap: WebMapConstructor; @@ -45912,43 +48171,43 @@ declare namespace __esri { interface WebMapProperties extends MapProperties { /** * Object responsible for containing the viewing and editing properties of the WebMap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#applicationProperties) */ applicationProperties?: any; /** * An array of saved geographic extents that allow end users to quickly navigate to a particular area of interest. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#bookmarks) */ bookmarks?: CollectionProperties; /** * The initial view of the WebMap. This object contains properties such as [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#viewpoint), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#spatialReference), that should be applied to the view when the WebMap loads. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#initialViewProperties) */ initialViewProperties?: InitialViewPropertiesProperties; /** * The portal item from which the WebMap is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#portalItem) */ portalItem?: PortalItemProperties; /** * Provides multiple slides. Each slide has a different "title", "extent", "basemap", "layers" etc. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#presentation) */ presentation?: any; /** * An array of table objects in the WebMap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#tables) */ tables?: any[]; /** * The widgets object contains widgets that should be exposed to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#widgets) */ widgets?: any; @@ -45957,28 +48216,26 @@ declare namespace __esri { interface Bookmark extends Accessor { /** * The extent of the specified bookmark item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html#extent) */ extent: Extent; /** * The name of the bookmark item. Used as a label in the [Bookmarks](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html#name) */ name: string; /** * The URL for a thumbnail image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html#thumbnail) */ thumbnail: BookmarkThumbnail; } interface BookmarkConstructor { - - - new(properties?: BookmarkProperties): Bookmark; + new (properties?: BookmarkProperties): Bookmark; } export const Bookmark: BookmarkConstructor; @@ -45986,29 +48243,28 @@ declare namespace __esri { interface BookmarkProperties { /** * The extent of the specified bookmark item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html#extent) */ extent?: ExtentProperties; /** * The name of the bookmark item. Used as a label in the [Bookmarks](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html#name) */ name?: string; /** * The URL for a thumbnail image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html#thumbnail) */ thumbnail?: BookmarkThumbnail; } - export interface BookmarkThumbnail extends Object { /** * URL to a thumbnail to display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html#thumbnail) */ url?: string; @@ -46017,31 +48273,29 @@ declare namespace __esri { interface InitialViewProperties extends Accessor, corePromise { /** * The spatial reference of the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html). This indicates the [Projected Coordinate System](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) or the [Geographic Coordinate System](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) used to locate geographic features in the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#spatialReference) */ spatialReference: SpatialReference; /** * The initial viewpoint of the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#viewpoint) */ viewpoint: Viewpoint; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#clone) - * - * + * + * */ clone(): InitialViewProperties; } interface InitialViewPropertiesConstructor { - - - new(properties?: InitialViewPropertiesProperties): InitialViewProperties; + new (properties?: InitialViewPropertiesProperties): InitialViewProperties; } export const InitialViewProperties: InitialViewPropertiesConstructor; @@ -46049,29 +48303,28 @@ declare namespace __esri { interface InitialViewPropertiesProperties { /** * The spatial reference of the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html). This indicates the [Projected Coordinate System](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) or the [Geographic Coordinate System](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) used to locate geographic features in the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; /** * The initial viewpoint of the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-InitialViewProperties.html#viewpoint) */ viewpoint?: ViewpointProperties; } - export interface WebMapSourceVersion extends Object { /** * The major version of the WebMap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#sourceVersion) */ major: number; /** * The minor version of the WebMap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#sourceVersion) */ minor: number; @@ -46080,151 +48333,151 @@ declare namespace __esri { interface WebScene extends Map, corePromise { /** * Configuration of application and UI elements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#applicationProperties) */ applicationProperties: ApplicationProperties; /** * *This property only applies to local scenes.* Represents an optional clipping area used to define the bounds or [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of a local scene. If defined, only data (including the basemap) within the area will be displayed. Set the [clippingEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingEnabled) property to `true` to apply the specified clippingArea to the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingArea) */ clippingArea: Extent; /** * *This property only applies to local scenes.* Determines whether clipping using the [clippingArea](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingArea) is enabled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingEnabled) - * + * * @default false */ clippingEnabled: boolean; /** * The height model info of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). This object defines the characteristics of the vertical coordinate system used by the scene. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), the height model info is used to avoid combining layers that have incompatible vertical coordinate systems. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#heightModelInfo) */ heightModelInfo: HeightModelInfo; /** * The initial view of the WebScene. This object contains properties such as [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewpoint), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#spatialReference), [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewingMode), and [environment](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#environment) that should be applied to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) when the scene loads. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#initialViewProperties) */ initialViewProperties: websceneInitialViewProperties; /** * Indicates whether the instance has loaded. When `true`, the properties of the object can be accessed. A WebScene is considered loaded when its [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) and [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#basemap) are fully created, but not yet loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loaded) - * + * * @default false */ readonly loaded: boolean; /** * The Error object returned if an error occurred while loading. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loadError) - * + * * @default null */ readonly loadError: Error; /** - * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#load) operation. - * + * Represents the status of a [load](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#load) operation. + * * Value | Description * ------|------------ * not-loaded | The object's resources have not loaded. * loading | The object's resources are currently loading. * loaded | The object's resources have loaded without errors. * failed | The object's resources failed to load. See [loadError](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loadError) for more details. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loadStatus) - * + * * @default not-loaded */ readonly loadStatus: string; /** * The portal item from which the WebScene is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#portalItem) */ portalItem: PortalItem; /** * Provides a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of slides that act as bookmarks for saving predefined [viewpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) and visible layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#presentation) */ presentation: Presentation; /** * The version of the source document from which the WebScene was read. The WebScene must be version 1.x to load into an app. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#sourceVersion) */ readonly sourceVersion: WebSceneSourceVersion; /** * The URL to the thumbnail used for the web scene. The thumbnail will by default be the thumbnail URL from the portal item associated to the web scene. The thumbnail of the web scene may be updated by changing the thumbnail URL and saving the web scene. Use #updateFrom to update the thumbnail automatically from a specified view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#thumbnailUrl) */ thumbnailUrl: string; /** * Triggers the loading of the WebScene instance. A WebScene is considered [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loaded) when its [operational layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers), [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#basemap) and [ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#ground) are fully created. When created with a [portalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#portalItem), `load()` will first fetch its data to create the content, otherwise it resolves immediately. The [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) automatically calls the `load()` method when a WebScene instance is added to its [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#map) property so it can display in the view and load each individual layer. If the WebScene is used outside of a view, for example to preload it, you must call `load()` explicitly to interact with its resources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#load) - * - * + * + * */ load(): IPromise; /** * Loads all the externally loadable resources associated with the webscene. For the webscene this will load the ground, basemap, layers and slide basemaps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#loadAll) - * - * + * + * */ loadAll(): IPromise; /** * Saves the webscene to its associated portal item. The portal item to save to must already exist and be valid. This is a convenience method that will use [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#update) to store the webscene in the item. The web scene is saved according to [web scene specification](https://developers.arcgis.com/web-scene-specification/) standards. Use [updateFrom](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) to store the current view properties in the webscene before saving it. Note that this saves the webscene to its existing item. Depending on how the scene is shared, users that do not own the scene may modify it. To save an existing scene as a new item owned by the user signed into the portal instance, use [saveAs()](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#saveAs). The webscene will be automatically loaded if it is not already before saving. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#save) - * + * * @param options Additional options. * @param options.ignoreUnsupported When `true`, the scene will save even if it contains unsupported content (layers, renderers, symbols). Any content that is not supported will not be saved and the scene may appear different when reloaded from its portal item. - * + * */ save(options?: WebSceneSaveOptions): IPromise; /** * Saves the webscene to a new portal item. If saving has completed successfully, then the saved portal item will be set in the portalItem property of the WebScene. This is a convenience method that will create a new [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html) and use [PortalUser.addItem()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html#addItem) to store the webscene in a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html). Use [updateFrom](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) to store the current view properties in the webscene before saving it. Note that this always saves the webscene as a new portal item owned by the user performing the edits and executing the `saveAs()` method. If you want to modify the existing item without changing its ownership use [save()](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#save). The webscene will be automatically loaded if it is not already before saving. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#saveAs) - * + * * @param portalItem The new portal item to which the scene will be saved. Portal item properties such as the title or description need to be explicitly set on the item and will not be automatically copied from the current associated scene portal item (if any). * @param options additional save options. * @param options.folder the folder in which to save the item. * @param options.ignoreUnsupported allow the scene to be saved even in the case it contains unsupported content (layers, renderers, symbols). Any content that is not supported will not be saved and the scene may appear different when reloaded from its portal item. - * + * */ saveAs(portalItem: PortalItem | PortalItemProperties, options?: WebSceneSaveAsOptions): IPromise; /** * Converts an instance of [this class]() to its ArcGIS portal JSON representation. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide and the [web scene specification](https://developers.arcgis.com/web-scene-specification/) for more information. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#toJSON) - * - * + * + * */ toJSON(): any; /** * Update properties of the WebScene related to the view. This should usually be called just before saving a scene. The following properties are updated from the view: 1. `initialViewProperties.spatialReference` 2. `initialViewProperties.viewingMode` 3. `clippingArea` 4. `heightModelInfo` Depending on the provided options, the following properties are also updated: 1. `initialViewProperties.environment` 2. `initialViewProperties.viewpoint` 3. `thumbnail` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) - * + * * @param view the view to update from. * @param options update options. * @param options.environmentExcluded do not update the initial environment from the view, defaults to false. * @param options.viewpointExcluded do not update the initial viewpoint from the view, defaults to false. * @param options.thumbnailExcluded do not update the thumbnail from the view, defaults to viewpointExcluded. * @param options.thumbnailSize the size of the thumbnail. Defaults to 600x400 (ratio 1.5:1). Note that the thumbnail size may currently not be larger than the size of the view. - * + * */ updateFrom(view: SceneView, options?: WebSceneUpdateFromOptions): IPromise; } @@ -46232,20 +48485,19 @@ declare namespace __esri { interface WebSceneConstructor { /** * The web scene is the core element of 3D mapping across the ArcGIS platform. It defines the content, style, environment, and slides of your scene and it can be shared across multiple ArcGIS web and desktop applications. Web scenes can be created, published, and consumed in [ArcGIS Pro](http://pro.arcgis.com/en/pro-app/help/mapping/map-authoring/author-a-web-scene.htm) and ArcGIS Online with the [Scene Viewer](http://server.arcgis.com/en/portal/latest/use/make-your-first-scene.htm). The web scene is saved as a JSON document that can be consumed by the ArcGIS API for JavaScript via the WebScene class to easily create compelling 3D applications. The JSON document is written according to the [web scene specification](https://developers.arcgis.com/web-scene-specification/). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html) */ - new(properties?: WebSceneProperties): WebScene; - + new (properties?: WebSceneProperties): WebScene; /** * Creates a new instance of [this class]() and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input `json` parameter often comes from a response to a query operation in the REST API or a [toJSON()](http://pro.arcgis.com/en/pro-app/tool-reference/conversion/features-to-json.htm) method from another ArcGIS product. If the [WebScene]() is used outside of a view, you must call [load()](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#load) explicitly to interact with its resources. See the [Using fromJSON()](https://developers.arcgis.com/javascript/latest/guide/using-fromjson/index.html) topic in the Guide for details and examples of when and how to use this function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#fromJSON) - * + * * @param json A JSON representation of the instance in the ArcGIS format. See the [web scene specification](https://developers.arcgis.com/web-scene-specification/) for more detailed information on serializing web scenes to JSON. - * + * */ fromJSON(json: any): any; } @@ -46255,51 +48507,51 @@ declare namespace __esri { interface WebSceneProperties extends MapProperties { /** * Configuration of application and UI elements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#applicationProperties) */ applicationProperties?: ApplicationPropertiesProperties; /** * *This property only applies to local scenes.* Represents an optional clipping area used to define the bounds or [Extent](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Extent.html) of a local scene. If defined, only data (including the basemap) within the area will be displayed. Set the [clippingEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingEnabled) property to `true` to apply the specified clippingArea to the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingArea) */ clippingArea?: ExtentProperties; /** * *This property only applies to local scenes.* Determines whether clipping using the [clippingArea](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingArea) is enabled. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#clippingEnabled) - * + * * @default false */ clippingEnabled?: boolean; /** * The height model info of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). This object defines the characteristics of the vertical coordinate system used by the scene. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), the height model info is used to avoid combining layers that have incompatible vertical coordinate systems. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#heightModelInfo) */ heightModelInfo?: HeightModelInfoProperties; /** * The initial view of the WebScene. This object contains properties such as [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewpoint), [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#spatialReference), [viewingMode](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewingMode), and [environment](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#environment) that should be applied to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) when the scene loads. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#initialViewProperties) */ initialViewProperties?: websceneInitialViewPropertiesProperties; /** * The portal item from which the WebScene is loaded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#portalItem) */ portalItem?: PortalItemProperties; /** * Provides a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of slides that act as bookmarks for saving predefined [viewpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) and visible layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#presentation) */ presentation?: PresentationProperties; /** * The URL to the thumbnail used for the web scene. The thumbnail will by default be the thumbnail URL from the portal item associated to the web scene. The thumbnail of the web scene may be updated by changing the thumbnail URL and saving the web scene. Use #updateFrom to update the thumbnail automatically from a specified view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#thumbnailUrl) */ thumbnailUrl?: string; @@ -46308,25 +48560,23 @@ declare namespace __esri { interface ApplicationProperties extends Accessor { /** * View-specific properties of application and UI elements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-ApplicationProperties.html#viewing) */ viewing: Viewing; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-ApplicationProperties.html#clone) - * - * + * + * */ clone(): ApplicationProperties; } interface ApplicationPropertiesConstructor { - - - new(properties?: ApplicationPropertiesProperties): ApplicationProperties; + new (properties?: ApplicationPropertiesProperties): ApplicationProperties; } export const ApplicationProperties: ApplicationPropertiesConstructor; @@ -46334,7 +48584,7 @@ declare namespace __esri { interface ApplicationPropertiesProperties { /** * View-specific properties of application and UI elements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-ApplicationProperties.html#viewing) */ viewing?: ViewingProperties; @@ -46343,37 +48593,35 @@ declare namespace __esri { interface Search extends Accessor { /** * Whether search functionality is enabled in the web scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Search.html#enabled) */ enabled: boolean; /** * The hint provided with the search dialog. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Search.html#hintText) */ hintText: string; /** * A collection of layers to be included in search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Search.html#layers) */ layers: Collection; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Search.html#clone) - * - * + * + * */ clone(): Search; } interface SearchConstructor { - - - new(properties?: SearchProperties): Search; + new (properties?: SearchProperties): Search; } export const Search: SearchConstructor; @@ -46381,19 +48629,19 @@ declare namespace __esri { interface SearchProperties { /** * Whether search functionality is enabled in the web scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Search.html#enabled) */ enabled?: boolean; /** * The hint provided with the search dialog. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Search.html#hintText) */ hintText?: string; /** * A collection of layers to be included in search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Search.html#layers) */ layers?: CollectionProperties; @@ -46402,37 +48650,35 @@ declare namespace __esri { interface SearchLayer extends Accessor { /** * The field to use for search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayer.html#field) */ field: SearchLayerField; /** * The id of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayer.html#id) */ id: string; /** * The sub layer index. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayer.html#subLayer) */ subLayer: number; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayer.html#clone) - * - * + * + * */ clone(): SearchLayer; } interface SearchLayerConstructor { - - - new(properties?: SearchLayerProperties): SearchLayer; + new (properties?: SearchLayerProperties): SearchLayer; } export const SearchLayer: SearchLayerConstructor; @@ -46440,19 +48686,19 @@ declare namespace __esri { interface SearchLayerProperties { /** * The field to use for search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayer.html#field) */ field?: SearchLayerFieldProperties; /** * The id of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayer.html#id) */ id?: string; /** * The sub layer index. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayer.html#subLayer) */ subLayer?: number; @@ -46461,37 +48707,35 @@ declare namespace __esri { interface SearchLayerField extends Accessor { /** * Whether or not the field is an exact match. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayerField.html#exactMatch) */ exactMatch: boolean; /** * The name of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayerField.html#name) */ name: string; /** * The data type of the field. **Possible Values:** small-integer | integer | single | double | long | string | date | oid | geometry | blob | raster | guid | global-id | xml - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayerField.html#type) */ type: string; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayerField.html#clone) - * - * + * + * */ clone(): SearchLayerField; } interface SearchLayerFieldConstructor { - - - new(properties?: SearchLayerFieldProperties): SearchLayerField; + new (properties?: SearchLayerFieldProperties): SearchLayerField; } export const SearchLayerField: SearchLayerFieldConstructor; @@ -46499,19 +48743,19 @@ declare namespace __esri { interface SearchLayerFieldProperties { /** * Whether or not the field is an exact match. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayerField.html#exactMatch) */ exactMatch?: boolean; /** * The name of the field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayerField.html#name) */ name?: string; /** * The data type of the field. **Possible Values:** small-integer | integer | single | double | long | string | date | oid | geometry | blob | raster | guid | global-id | xml - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-SearchLayerField.html#type) */ type?: string; @@ -46520,25 +48764,23 @@ declare namespace __esri { interface Viewing extends Accessor { /** * An object specifying the search parameters set within the web scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Viewing.html#search) */ search: Search; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Viewing.html#clone) - * - * + * + * */ clone(): Viewing; } interface ViewingConstructor { - - - new(properties?: ViewingProperties): Viewing; + new (properties?: ViewingProperties): Viewing; } export const Viewing: ViewingConstructor; @@ -46546,7 +48788,7 @@ declare namespace __esri { interface ViewingProperties { /** * An object specifying the search parameters set within the web scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-applicationProperties-Viewing.html#search) */ search?: SearchProperties; @@ -46555,10 +48797,10 @@ declare namespace __esri { interface Background extends Accessor, JSONSupport { /** * Creates a deep clone of the Background. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-Background.html#clone) - * - * + * + * */ clone(): Background; } @@ -46566,37 +48808,35 @@ declare namespace __esri { interface BackgroundConstructor { /** * The background of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) that lies behind the sky, atmosphere and stars. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-Background.html) */ - new(properties?: BackgroundProperties): Background; + new (properties?: BackgroundProperties): Background; fromJSON(json: any): Background; } export const Background: BackgroundConstructor; - interface BackgroundProperties { - - } + interface BackgroundProperties {} interface ColorBackground extends Background, JSONSupport { /** * The color of the background. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html#color) - * + * * @default black */ color: Color; /** * Creates a deep clone of the object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html#clone) - * - * + * + * */ clone(): ColorBackground; } @@ -46604,11 +48844,11 @@ declare namespace __esri { interface ColorBackgroundConstructor { /** * This type of [Background](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-Background.html) allows to set a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) as the background of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). The view environment stars and atmosphere will show on top of the background when enabled. To have a clear background color only, make sure to set both the [view.environment.starsEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) and [view.environment.atmosphereEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#environment) properties to `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html) */ - new(properties?: ColorBackgroundProperties): ColorBackground; + new (properties?: ColorBackgroundProperties): ColorBackground; fromJSON(json: any): ColorBackground; } @@ -46618,9 +48858,9 @@ declare namespace __esri { interface ColorBackgroundProperties extends BackgroundProperties { /** * The color of the background. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with `r`, `g`, `b`, and `a` properties, or a [Color](https://developers.arcgis.com/javascript/latest/api-reference/esri-Color.html) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-background-ColorBackground.html#color) - * + * * @default black */ color?: Color | number[] | string; @@ -46629,49 +48869,47 @@ declare namespace __esri { interface Environment extends Accessor { /** * Specifies whether the atmosphere should be displayed. Typically this consists of haze and sky. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#atmosphereEnabled) - * + * * @default true */ atmosphereEnabled: boolean; /** * Specifies how the background of the scene (which lies behind sky, stars and atmosphere) should be displayed. The default value of `null` displays a single, fully opaque, black color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#background) - * + * * @default null */ background: Background; /** * Settings for defining the lighting of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#lighting) */ lighting: Lighting; /** * Specifies whether stars should be displayed in the sky. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#starsEnabled) - * + * * @default true */ starsEnabled: boolean; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#clone) - * - * + * + * */ clone(): Environment; } interface EnvironmentConstructor { - - - new(properties?: EnvironmentProperties): Environment; + new (properties?: EnvironmentProperties): Environment; } export const Environment: EnvironmentConstructor; @@ -46679,31 +48917,31 @@ declare namespace __esri { interface EnvironmentProperties { /** * Specifies whether the atmosphere should be displayed. Typically this consists of haze and sky. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#atmosphereEnabled) - * + * * @default true */ atmosphereEnabled?: boolean; /** * Specifies how the background of the scene (which lies behind sky, stars and atmosphere) should be displayed. The default value of `null` displays a single, fully opaque, black color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#background) - * + * * @default null */ background?: BackgroundProperties; /** * Settings for defining the lighting of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#lighting) */ lighting?: LightingProperties; /** * Specifies whether stars should be displayed in the sky. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Environment.html#starsEnabled) - * + * * @default true */ starsEnabled?: boolean; @@ -46712,45 +48950,43 @@ declare namespace __esri { interface websceneInitialViewProperties extends Accessor, corePromise { /** * The initial environment settings of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#environment) */ environment: Environment; /** * The spatial reference of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). This indicates the [Projected Coordinate System](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) or the [Geographic Coordinate System](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) used to locate geographic features in the map. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) the following [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#spatialReference) */ spatialReference: SpatialReference; /** * The viewing mode of the scene. Global scenes allow the user to navigate the globe. Local scenes allow for navigation and feature display in a particular "localized" area. Users may also navigate the view's camera below the surface of a basemap in local scenes. **Possible Values:** global | local - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewingMode) - * + * * @default global */ viewingMode: string; /** * The initial viewpoint of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewpoint) */ viewpoint: Viewpoint; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#clone) - * - * + * + * */ clone(): websceneInitialViewProperties; } interface websceneInitialViewPropertiesConstructor { - - - new(properties?: websceneInitialViewPropertiesProperties): websceneInitialViewProperties; + new (properties?: websceneInitialViewPropertiesProperties): websceneInitialViewProperties; } export const websceneInitialViewProperties: websceneInitialViewPropertiesConstructor; @@ -46758,27 +48994,27 @@ declare namespace __esri { interface websceneInitialViewPropertiesProperties { /** * The initial environment settings of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#environment) */ environment?: EnvironmentProperties; /** * The spatial reference of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). This indicates the [Projected Coordinate System](https://developers.arcgis.com/rest/services-reference/projected-coordinate-systems.htm) or the [Geographic Coordinate System](https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm) used to locate geographic features in the map. In a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) the following [supported coordinate systems](esri-views-SceneView.html#supported-coordinate-systems) are available. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#spatialReference) */ spatialReference?: SpatialReferenceProperties; /** * The viewing mode of the scene. Global scenes allow the user to navigate the globe. Local scenes allow for navigation and feature display in a particular "localized" area. Users may also navigate the view's camera below the surface of a basemap in local scenes. **Possible Values:** global | local - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewingMode) - * + * * @default global */ viewingMode?: string; /** * The initial viewpoint of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-InitialViewProperties.html#viewpoint) */ viewpoint?: ViewpointProperties; @@ -46787,43 +49023,41 @@ declare namespace __esri { interface Lighting extends Accessor, corePromise { /** * The time and date for which the sun position and light direction is computed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#date) - * + * * @default null */ date: Date; /** * Indicates whether to show shadows cast by the sun. Shadows are only displayed for real world 3D objects. Terrain doesn't cast shadows. In local scenes at small zoom levels, shadows are not displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#directShadowsEnabled) - * + * * @default false */ directShadowsEnabled: boolean; /** * The UTC time zone offset in hours that should be displayed in the UI to represent the date. This value does not have an impact on the actual lighting of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#displayUTCOffset) - * + * * @default null */ displayUTCOffset: number; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#clone) - * - * + * + * */ clone(): Lighting; } interface LightingConstructor { - - - new(properties?: LightingProperties): Lighting; + new (properties?: LightingProperties): Lighting; } export const Lighting: LightingConstructor; @@ -46831,25 +49065,25 @@ declare namespace __esri { interface LightingProperties { /** * The time and date for which the sun position and light direction is computed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#date) - * + * * @default null */ date?: DateProperties; /** * Indicates whether to show shadows cast by the sun. Shadows are only displayed for real world 3D objects. Terrain doesn't cast shadows. In local scenes at small zoom levels, shadows are not displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#directShadowsEnabled) - * + * * @default false */ directShadowsEnabled?: boolean; /** * The UTC time zone offset in hours that should be displayed in the UI to represent the date. This value does not have an impact on the actual lighting of the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Lighting.html#displayUTCOffset) - * + * * @default null */ displayUTCOffset?: number; @@ -46858,25 +49092,23 @@ declare namespace __esri { interface Presentation extends Accessor { /** * A collection of [slides](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html) that bookmark [viewpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), visible layers, and other settings previously defined in a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) */ slides: Collection; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#clone) - * - * + * + * */ clone(): Presentation; } interface PresentationConstructor { - - - new(properties?: PresentationProperties): Presentation; + new (properties?: PresentationProperties): Presentation; } export const Presentation: PresentationConstructor; @@ -46884,7 +49116,7 @@ declare namespace __esri { interface PresentationProperties { /** * A collection of [slides](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html) that bookmark [viewpoints](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), visible layers, and other settings previously defined in a [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) */ slides?: CollectionProperties; @@ -46892,8 +49124,8 @@ declare namespace __esri { interface Slide extends Accessor { /** - * The basemap of the scene. Only the [base](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) and [reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) layers of the basemap are stored in a slide. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. - * + * The basemap of the scene. Only the [base](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) and [reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) layers of the basemap are stored in a slide. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. + * * Value | Description * ------|------------ * streets | ![basemap-streets](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) @@ -46906,70 +49138,70 @@ declare namespace __esri { * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/national-geographic.jpg) * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/terrain.jpg) * osm | ![basemap-osm](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/osm.jpg) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#basemap) */ basemap: Basemap; /** * The description of the slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#description) */ description: SlideDescription; /** * Represents settings that affect the environment in which the WebScene is displayed (such as lighting). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#environment) */ environment: Environment; /** * Ground properties for this slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#ground) */ ground: SlideGround; /** * The unique id of a slide within the [slides property](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) of a [Presentation](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#id) */ id: string; /** * A data URI encoded thumbnail. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#thumbnail) */ thumbnail: SlideThumbnail; /** * The title of the slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#title) */ title: SlideTitle; /** * The viewpoint of the slide. This acts like a bookmark, saving a predefined location or point of view from which to view the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#viewpoint) */ viewpoint: Viewpoint; /** - * The visible layers of the scene. This is a collection of objects that stores references (by ID) to the [scene layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) and [ground layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that are set as `visible` when a slide is applied to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When assigning visible layers, the following types of values will be automatically casted: + * The visible layers of the scene. This is a collection of objects that stores references (by ID) to the [scene layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) and [ground layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that are set as `visible` when a slide is applied to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When assigning visible layers, the following types of values will be automatically casted: * * Array (or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html)) of [Layer instances](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html): `[layerInstance, layerInstance]` * * Array (or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html)) of [Layer IDs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id): `["layer-1", "layer-2"]` - * - * + * + * * The specification for each object in the collection is outlined in the table below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) */ visibleLayers: Collection; /** * Applies a slide's settings to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) - * + * * @param view The SceneView the slide should be applied to. * @param options Animation options. See properties below for object specifications. * @param options.animate Indicates whether to animate the slide transition. @@ -46977,26 +49209,26 @@ declare namespace __esri { * @param options.duration Set the exact duration (in milliseconds) of the animation. Note that by default, animation duration is calculated based on the time required to reach the target at a constant speed. Setting duration overrides the speedFactor option. Note that the resulting duration is still limited to the maxDuration. * @param options.maxDuration The maximum allowed duration (in milliseconds) of the animation. The default maxDuration value takes the specified speedFactor into account. * @param options.easing The easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: `linear`, `in-cubic`, `out-cubic`, `in-out-cubic`, `in-expo`, `out-expo`, `in-out-expo` By default, animations that are less than 1000 ms use an out easing function; longer animations use an in-out function. - * + * */ applyTo(view: SceneView, options?: SlideApplyToOptions): IPromise; /** * Creates a deep clone of this object. Note that the basemap instance is cloned, but the layers within the basemap are copied. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#clone) - * - * + * + * */ clone(): Slide; /** * Updates a slide from a [WebScene's slides](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides). Updating the slide is asynchronous and a snapshot of the view is only complete once the returned promise has resolved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) - * + * * @param view The SceneView from which the slide should update. * @param options Update options. See properties below for object specifications. * @param options.screenshot Screenshot options to use. See properties below for object specifications. - * + * */ updateFrom(view: SceneView, options?: SlideUpdateFromOptions): IPromise; } @@ -47004,22 +49236,21 @@ declare namespace __esri { interface SlideConstructor { /** * A slide stores a snapshot of several pre-set properties of the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html) and [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), such as the [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#basemap), [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#viewpoint) and [visible layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers). The [visible layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) may contain references (by [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id)) to both operational layers from the [scene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) as well as elevation layers from the [ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers), which affect the surface elevation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html) */ - new(properties?: SlideProperties): Slide; - + new (properties?: SlideProperties): Slide; /** * Creates a slide from a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), which may be added to the [slides](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) in the WebScene's [presentation](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#presentation). Updating the slide is asynchronous and a snapshot of the view is only complete once the returned promise has resolved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) - * + * * @param view The SceneView from which the slide should be created. * @param options Creation options. See properties below for object specifications. * @param options.screenshot Screenshot options to use. See properties below for object specifications. - * + * */ createFrom(view: SceneView, options?: SlideCreateFromOptions): IPromise; } @@ -47028,8 +49259,8 @@ declare namespace __esri { interface SlideProperties { /** - * The basemap of the scene. Only the [base](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) and [reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) layers of the basemap are stored in a slide. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. - * + * The basemap of the scene. Only the [base](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#baseLayers) and [reference](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html#referenceLayers) layers of the basemap are stored in a slide. This value can be an instance of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) or one of the strings listed in the table below. + * * Value | Description * ------|------------ * streets | ![basemap-streets](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/streets.jpg) @@ -47042,157 +49273,153 @@ declare namespace __esri { * national-geographic | ![basemap-national-geographic](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/national-geographic.jpg) * terrain | ![basemap-terrain](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/terrain.jpg) * osm | ![basemap-osm](https://developers.arcgis.com/javascript/assets/img/apiref/basemap/osm.jpg) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#basemap) */ basemap?: BasemapProperties | string; /** * The description of the slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#description) */ description?: SlideDescriptionProperties | string; /** * Represents settings that affect the environment in which the WebScene is displayed (such as lighting). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#environment) */ environment?: EnvironmentProperties; /** * Ground properties for this slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#ground) */ ground?: SlideGroundProperties; /** * The unique id of a slide within the [slides property](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html#slides) of a [Presentation](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#id) */ id?: string; /** * A data URI encoded thumbnail. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#thumbnail) */ thumbnail?: SlideThumbnailProperties | string; /** * The title of the slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#title) */ title?: SlideTitleProperties | string; /** * The viewpoint of the slide. This acts like a bookmark, saving a predefined location or point of view from which to view the scene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#viewpoint) */ viewpoint?: ViewpointProperties; /** - * The visible layers of the scene. This is a collection of objects that stores references (by ID) to the [scene layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) and [ground layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that are set as `visible` when a slide is applied to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When assigning visible layers, the following types of values will be automatically casted: + * The visible layers of the scene. This is a collection of objects that stores references (by ID) to the [scene layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) and [ground layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that are set as `visible` when a slide is applied to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). When assigning visible layers, the following types of values will be automatically casted: * * Array (or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html)) of [Layer instances](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html): `[layerInstance, layerInstance]` * * Array (or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html)) of [Layer IDs](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id): `["layer-1", "layer-2"]` - * - * + * + * * The specification for each object in the collection is outlined in the table below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) */ visibleLayers?: CollectionProperties; } - export interface SlideApplyToOptions extends Object { /** * Indicates whether to animate the slide transition. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) - * + * * @default true */ animate?: boolean; /** * Increases or decreases the animation speed by the specified factor. A speedFactor of 2 will make the animation twice as fast, while a speedFactor of 0.5 will make the animation half as fast. Setting the speed factor will automatically adapt the default maxDuration accordingly. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) - * + * * @default 1 */ speedFactor?: number; /** * Set the exact duration (in milliseconds) of the animation. Note that by default, animation duration is calculated based on the time required to reach the target at a constant speed. Setting duration overrides the speedFactor option. Note that the resulting duration is still limited to the maxDuration. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) */ duration?: number; /** * The maximum allowed duration (in milliseconds) of the animation. The default maxDuration value takes the specified speedFactor into account. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) - * + * * @default 8000 */ maxDuration?: number; /** * The easing function to use for the animation. This may either be a preset (named) function, or a user specified function. Supported named presets are: `linear`, `in-cubic`, `out-cubic`, `in-out-cubic`, `in-expo`, `out-expo`, `in-out-expo` By default, animations that are less than 1000 ms use an out easing function; longer animations use an in-out function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#applyTo) */ easing?: string | EasingFunction; } - export interface SlideCreateFromOptions extends Object { /** * Screenshot options to use. See properties below for object specifications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) */ screenshot?: SlideCreateFromOptionsScreenshot; } - export interface SlideCreateFromOptionsScreenshot extends Object { /** * The image format. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) - * + * * @default jpeg */ format?: string; /** * The image quality (due to compression). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) - * + * * @default 80 */ quality?: number; /** * The image width. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) - * + * * @default 120 */ width?: number; /** * The image height. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#createFrom) - * + * * @default 75 */ height?: number; } - export interface SlideDescriptionProperties extends Object { /** * The description. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#description) */ text?: string; @@ -47201,17 +49428,16 @@ declare namespace __esri { export interface SlideDescription extends AnonymousAccessor { /** * The description. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#description) */ text?: string; } - export interface SlideGroundProperties extends Object { /** * Ground opacity - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#ground) */ opacity?: number; @@ -47220,17 +49446,16 @@ declare namespace __esri { export interface SlideGround extends AnonymousAccessor { /** * Ground opacity - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#ground) */ opacity?: number; } - export interface SlideThumbnailProperties extends Object { /** * The URI pointing to the thumbnail image representing the slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#thumbnail) */ url?: string; @@ -47239,17 +49464,16 @@ declare namespace __esri { export interface SlideThumbnail extends AnonymousAccessor { /** * The URI pointing to the thumbnail image representing the slide. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#thumbnail) */ url?: string; } - export interface SlideTitleProperties extends Object { /** * The title. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#title) */ text?: string; @@ -47258,197 +49482,451 @@ declare namespace __esri { export interface SlideTitle extends AnonymousAccessor { /** * The title. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#title) */ text?: string; } - export interface SlideUpdateFromOptions extends Object { /** * Screenshot options to use. See properties below for object specifications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) */ screenshot: SlideUpdateFromOptionsScreenshot; } - export interface SlideUpdateFromOptionsScreenshot extends Object { /** * The image format. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) - * + * * @default jpeg */ format?: string; /** * The image quality (due to compression). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) - * + * * @default 80 */ quality?: number; /** * The image width. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) - * + * * @default 120 */ width?: number; /** * The image height. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#updateFrom) - * + * * @default 75 */ height?: number; } - export interface SlideVisibleLayersProperties extends Object { /** * The ID of a [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id) in the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) or [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that is made `visible` in the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) when the slide is applied to the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) */ id?: string; + /** + * The service ids of the visible sublayers on the layer specified by the layer id. If this is not present, the visibilities of the sublayers are not changed when applying the slide. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) + */ + sublayerIds?: number[]; } export interface SlideVisibleLayers extends AnonymousAccessor { /** * The ID of a [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#id) in the [WebScene](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#layers) or [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#layers) that is made `visible` in the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) when the slide is applied to the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) */ id: string; + /** + * The service ids of the visible sublayers on the layer specified by the layer id. If this is not present, the visibilities of the sublayers are not changed when applying the slide. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers) + */ + sublayerIds: number[]; } - export interface WebSceneSaveAsOptions extends Object { /** * the folder in which to save the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#saveAs) */ folder?: PortalFolder; /** * allow the scene to be saved even in the case it contains unsupported content (layers, renderers, symbols). Any content that is not supported will not be saved and the scene may appear different when reloaded from its portal item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#saveAs) */ ignoreUnsupported?: boolean; } - export interface WebSceneSaveOptions extends Object { /** * When `true`, the scene will save even if it contains unsupported content (layers, renderers, symbols). Any content that is not supported will not be saved and the scene may appear different when reloaded from its portal item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#save) */ ignoreUnsupported?: boolean; } - export interface WebSceneSourceVersion extends Object { /** * The major version of the WebScene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#sourceVersion) */ major: number; /** * The minor version of the WebScene. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#sourceVersion) */ minor: number; } - export interface WebSceneUpdateFromOptions extends Object { /** * do not update the initial environment from the view, defaults to false. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) */ environmentExcluded?: boolean; /** * do not update the initial viewpoint from the view, defaults to false. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) */ viewpointExcluded?: boolean; /** * do not update the thumbnail from the view, defaults to viewpointExcluded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) */ thumbnailExcluded?: boolean; /** * the size of the thumbnail. Defaults to 600x400 (ratio 1.5:1). Note that the thumbnail size may currently not be larger than the size of the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) */ thumbnailSize?: WebSceneUpdateFromOptionsThumbnailSize; } - export interface WebSceneUpdateFromOptionsThumbnailSize extends Object { /** * the width of the thumbnail. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) */ width: number; /** * the height of the thumbnail. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebScene.html#updateFrom) */ height: number; } + interface AreaMeasurement2D extends Widget { + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#iconClass) + */ + readonly iconClass: string; + /** + * The widget's default label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#label) + */ + readonly label: string; + /** + * Unit system (imperial, metric) or specific unit used for displaying the area values. **Possible Values:** metric | imperial | square-inches | square-feet | square-us-feet | square-yards | square-miles | square-meters | square-kilometers | acres | ares | hectares + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#unit) + */ + unit: + | "metric" + | "imperial" + | "square-inches" + | "square-feet" + | "square-us-feet" + | "square-yards" + | "square-miles" + | "square-meters" + | "square-kilometers" + | "acres" + | "ares" + | "hectares"; + /** + * List of available units and unit systems (imperial, metric) for displaying the area values. By default, the following units are included: `metric`, `imperial`, `square-inches`, `square-feet`, `square-us-feet`, `square-yards`, `square-miles`, `square-meters`, `square-kilometers`, `acres`, `ares`, `hectares`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#unitOptions) + */ + unitOptions: string[]; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#view) + */ + view: MapView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [AreaMeasurement2DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#viewModel) + */ + viewModel: AreaMeasurement2DViewModel; + + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#render) + * + * + */ + render(): any; + } + + interface AreaMeasurement2DConstructor { + /** + * The AreaMeasurement2D widget calculates and displays the area and perimeter of a polygon in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). When the perimeter is less than 100 km, the default [mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#mode) is `planar`. When the perimeter is greater than or equal to 100 km, the default [mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#mode) is `geodesic`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html) + */ + + new (properties?: AreaMeasurement2DProperties): AreaMeasurement2D; + } + + export const AreaMeasurement2D: AreaMeasurement2DConstructor; + + interface AreaMeasurement2DProperties extends WidgetProperties { + /** + * Unit system (imperial, metric) or specific unit used for displaying the area values. **Possible Values:** metric | imperial | square-inches | square-feet | square-us-feet | square-yards | square-miles | square-meters | square-kilometers | acres | ares | hectares + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#unit) + */ + unit?: + | "metric" + | "imperial" + | "square-inches" + | "square-feet" + | "square-us-feet" + | "square-yards" + | "square-miles" + | "square-meters" + | "square-kilometers" + | "acres" + | "ares" + | "hectares"; + /** + * List of available units and unit systems (imperial, metric) for displaying the area values. By default, the following units are included: `metric`, `imperial`, `square-inches`, `square-feet`, `square-us-feet`, `square-yards`, `square-miles`, `square-meters`, `square-kilometers`, `acres`, `ares`, `hectares`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#unitOptions) + */ + unitOptions?: string[]; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#view) + */ + view?: MapViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [AreaMeasurement2DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D.html#viewModel) + */ + viewModel?: AreaMeasurement2DViewModel; + } + + interface AreaMeasurement2DViewModel { + /** + * The threshold distance used by the "auto" mode to switch between planar and geodesic linear computations. The threshold is measured in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#geodesicDistanceThreshold) + * + * @default 100000 + */ + geodesicDistanceThreshold: number; + /** + * The area and perimeter of the measurement polygon in square meters and meters respectively. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurement) + */ + readonly measurement: AreaMeasurement2DViewModelMeasurement; + /** + * This property returns the locale specific representation of the area and perimeter. Areas and perimeters are rounded to two decimal places. Areas are sourced from the [measurement](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurement) property (in square meters) and converted to the user defined units/system and mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurementLabel) + */ + readonly measurementLabel: AreaMeasurement2DViewModelMeasurementLabel; + /** + * The mode used to calculate the area and perimeter of a polygon. **Possible Values:** auto | planar | geodesic + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#mode) + * + * @default auto + */ + mode: "auto" | "planar" | "geodesic"; + /** + * An array of valid mode values. By default, the following units are included: `auto`, `planar`, `geodesic`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#modes) + */ + readonly modes: string[]; + /** + * The ViewModel's state. **Possible Values:** disabled | ready | measuring + * + * Value | Description + * ------------|------------- + * disabled | not ready yet + * ready | ready for measuring + * measuring | measuring has started + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * Unit system (imperial, metric) or specific unit used for displaying the area values. **Possible Values:** metric | imperial | square-inches | square-feet | square-us-feet | square-yards | square-miles | square-meters | square-kilometers | acres | ares | hectares + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#unit) + */ + unit: + | "metric" + | "imperial" + | "square-inches" + | "square-feet" + | "square-us-feet" + | "square-yards" + | "square-miles" + | "square-meters" + | "square-kilometers" + | "acres" + | "ares" + | "hectares"; + /** + * List of available units and unit systems (imperial, metric) for displaying the area values. By default, the following units are included: `metric`, `imperial`, `square-inches`, `square-feet`, `square-us-feet`, `square-yards`, `square-miles`, `square-meters`, `square-kilometers`, `acres`, `ares`, `hectares`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#unitOptions) + */ + unitOptions: string[]; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#view) + */ + view: MapView; + + /** + * Clears the current measurement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#clearMeasurement) + * + * + */ + clearMeasurement(): void; + /** + * Starts a new measurement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#newMeasurement) + * + * + */ + newMeasurement(): void; + } + + interface AreaMeasurement2DViewModelConstructor { + new (properties?: any): AreaMeasurement2DViewModel; + } + + export const AreaMeasurement2DViewModel: AreaMeasurement2DViewModelConstructor; + + export interface AreaMeasurement2DViewModelMeasurement extends Object { + /** + * The area (m²). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurement) + */ + area: number; + /** + * The perimeter (m). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurement) + */ + perimeter: number; + /** + * Measurement area. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurement) + */ + geometry: any; + } + + export interface AreaMeasurement2DViewModelMeasurementLabel extends Object { + /** + * The area (m²). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurementLabel) + */ + area: number; + /** + * The perimeter (m). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement2D-AreaMeasurement2DViewModel.html#measurementLabel) + */ + perimeter: number; + } + interface AreaMeasurement3D extends Widget { /** - * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | square-inches | square-feet | square-yards | square-miles | square-meters | square-kilometers | square-us-feet | acres | ares | hectares - * + * Unit system (imperial, metric) or specific unit used for displaying the area values. **Possible Values:** metric | imperial | square-inches | square-feet | square-us-feet | square-yards | square-miles | square-meters | square-kilometers | acres | ares | hectares + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#unit) */ unit: string; /** - * List of unit options in the widget drop down list. - * + * List of available units and unit systems (imperial, metric) for displaying the area values. By default, the following units are included: `metric`, `imperial`, `square-inches`, `square-feet`, `square-us-feet`, `square-yards`, `square-miles`, `square-meters`, `square-kilometers`, `acres`, `ares`, `hectares`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#unitOptions) - * - * @default ["metric", "imperial", "square-inches", "square-feet", "square-yards", "square-miles", "square-us-feet", "square-meters", "square-kilometers", "acres", "ares", "hectares"] */ unitOptions: string[]; /** * A reference to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#view) */ view: SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [AreaMeasurement3DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#viewModel) */ viewModel: AreaMeasurement3DViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#render) - * - * + * + * */ render(): any; } @@ -47456,39 +49934,37 @@ declare namespace __esri { interface AreaMeasurement3DConstructor { /** * The AreaMeasurement3D widget calculates and displays the area and perimeter of a polygon. This widget can be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) to measure the area and perimeter of a polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html) */ - new(properties?: AreaMeasurement3DProperties): AreaMeasurement3D; + new (properties?: AreaMeasurement3DProperties): AreaMeasurement3D; } export const AreaMeasurement3D: AreaMeasurement3DConstructor; interface AreaMeasurement3DProperties extends WidgetProperties { /** - * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | square-inches | square-feet | square-yards | square-miles | square-meters | square-kilometers | square-us-feet | acres | ares | hectares - * + * Unit system (imperial, metric) or specific unit used for displaying the area values. **Possible Values:** metric | imperial | square-inches | square-feet | square-us-feet | square-yards | square-miles | square-meters | square-kilometers | acres | ares | hectares + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#unit) */ unit?: string; /** - * List of unit options in the widget drop down list. - * + * List of available units and unit systems (imperial, metric) for displaying the area values. By default, the following units are included: `metric`, `imperial`, `square-inches`, `square-feet`, `square-us-feet`, `square-yards`, `square-miles`, `square-meters`, `square-kilometers`, `acres`, `ares`, `hectares`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#unitOptions) - * - * @default ["metric", "imperial", "square-inches", "square-feet", "square-yards", "square-miles", "square-us-feet", "square-meters", "square-kilometers", "acres", "ares", "hectares"] */ unitOptions?: string[]; /** * A reference to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#view) */ view?: SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [AreaMeasurement3DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D.html#viewModel) */ viewModel?: AreaMeasurement3DViewModelProperties; @@ -47497,104 +49973,105 @@ declare namespace __esri { interface AreaMeasurement3DViewModel extends Accessor { /** * The current measurement of the area. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#measurement) */ readonly measurement: AreaMeasurement3DViewModelMeasurement; /** - * The view model's state. - * + * The view model's state. + * * Value | Description * ------------|------------- * disabled | not ready yet * ready | ready for measuring * measuring | currently measuring - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** - * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | square-inches | square-feet | square-yards | square-miles | square-meters | square-kilometers | square-us-feet | acres | ares | hectares - * + * Unit system (imperial, metric) or specific unit used for displaying the area values. **Possible Values:** metric | imperial | square-inches | square-feet | square-us-feet | square-yards | square-miles | square-meters | square-kilometers | acres | ares | hectares + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#unit) */ unit: string; /** - * List of unit systems (imperial, metric) and specific units for displaying the area values. - * + * List of available units and unit systems (imperial, metric) for displaying the area values. By default, the following units are included: `metric`, `imperial`, `square-inches`, `square-feet`, `square-us-feet`, `square-yards`, `square-miles`, `square-meters`, `square-kilometers`, `acres`, `ares`, `hectares`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#unitOptions) - * - * @default ["metric", "imperial", "square-inches", "square-feet", "square-yards", "square-miles", "square-us-feet", "square-meters", "square-kilometers", "acres", "ares", "hectares"] */ unitOptions: string[]; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#view) */ view: SceneView; /** * Clears the current measurement. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#clearMeasurement) - * - * + * + * */ clearMeasurement(): void; + /** + * Starts a new measurement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#newMeasurement) + * + * + */ + newMeasurement(): void; } interface AreaMeasurement3DViewModelConstructor { - - - new(properties?: AreaMeasurement3DViewModelProperties): AreaMeasurement3DViewModel; + new (properties?: AreaMeasurement3DViewModelProperties): AreaMeasurement3DViewModel; } export const AreaMeasurement3DViewModel: AreaMeasurement3DViewModelConstructor; interface AreaMeasurement3DViewModelProperties { /** - * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | square-inches | square-feet | square-yards | square-miles | square-meters | square-kilometers | square-us-feet | acres | ares | hectares - * + * Unit system (imperial, metric) or specific unit used for displaying the area values. **Possible Values:** metric | imperial | square-inches | square-feet | square-us-feet | square-yards | square-miles | square-meters | square-kilometers | acres | ares | hectares + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#unit) */ unit?: string; /** - * List of unit systems (imperial, metric) and specific units for displaying the area values. - * + * List of available units and unit systems (imperial, metric) for displaying the area values. By default, the following units are included: `metric`, `imperial`, `square-inches`, `square-feet`, `square-us-feet`, `square-yards`, `square-miles`, `square-meters`, `square-kilometers`, `acres`, `ares`, `hectares`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#unitOptions) - * - * @default ["metric", "imperial", "square-inches", "square-feet", "square-yards", "square-miles", "square-us-feet", "square-meters", "square-kilometers", "acres", "ares", "hectares"] */ unitOptions?: string[]; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#view) */ view?: SceneViewProperties; } - export interface AreaMeasurement3DViewModelMeasurement extends Object { /** * Describes the mode in which the measurement was taken. In `euclidean` mode, the area and perimeter length are computed from a flat polygon with straight segments on the perimeter in the [ECEF](https://en.wikipedia.org/wiki/ECEF) coordinate system. In `geodesic` mode, the area and perimeter length are computed from a geodesic polygon on the WGS84 ellipsoid. **Possible Values:** euclidean | geodesic - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#measurement) */ measurementMode: string; /** * The area of the polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#measurement) */ area: MeasurementValue; /** * The perimeter length of the polygon. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#measurement) */ perimeterLength: MeasurementValue; @@ -47602,26 +50079,26 @@ declare namespace __esri { /** * Measurement value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#MeasurementValue) */ export interface MeasurementValue extends Object { /** * Textual representation of the measured value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#MeasurementValue) */ text: string; /** - * State of the measured value. - * + * State of the measured value. + * * Value | Description * ------------|------------- * available | measured value is available * unavailable | measured value is not available due an incomplete measurement * invalid | measured value is not available due to an invalid measurement configuration (e.g. self-intersecting polygon) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-AreaMeasurement3D-AreaMeasurement3DViewModel.html#MeasurementValue) */ state: string; @@ -47630,49 +50107,49 @@ declare namespace __esri { interface Attribution extends Widget { /** * Full attribution text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#attributionText) */ readonly attributionText: string; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#iconClass) */ readonly iconClass: string; /** * Text used to split attribution by [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#itemDelimiter) - * + * * @default | */ itemDelimiter: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#label) */ readonly label: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#view) */ view: MapView | SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [AttributionViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#viewModel) */ viewModel: AttributionViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#render) - * - * + * + * */ render(): any; } @@ -47680,11 +50157,11 @@ declare namespace __esri { interface AttributionConstructor { /** * The Attribution displays attribution text for the layers in a map. The text displayed for the layers is either a list of data providers or sources as defined in the layer's custom attribution data, or the copyright text. This widget automatically updates based on layer visibility and map extent and displays a single line of attribution that can be expanded with a single click to view all data sources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html) */ - new(properties?: AttributionProperties): Attribution; + new (properties?: AttributionProperties): Attribution; } export const Attribution: AttributionConstructor; @@ -47692,21 +50169,21 @@ declare namespace __esri { interface AttributionProperties extends WidgetProperties { /** * Text used to split attribution by [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#itemDelimiter) - * + * * @default | */ itemDelimiter?: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [AttributionViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html#viewModel) */ viewModel?: AttributionViewModelProperties; @@ -47715,21 +50192,21 @@ declare namespace __esri { interface AttributionViewModel extends Accessor { /** * A collection of [AttributionItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#AttributionItem)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#items) */ readonly items: Collection; /** * The view model's state. **Possible Values:** ready | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view from which the view model will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#view) */ view: MapView | SceneView; @@ -47738,11 +50215,11 @@ declare namespace __esri { interface AttributionViewModelConstructor { /** * Provides the logic for the [Attribution](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution.html) widget. Displays attribution text for the layers in a map. The text displayed for the layers is either a list of data providers or sources as defined in the layer's custom attribution data, or the copyright text. The attribution is automatically updated based on layer visibility and map extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html) */ - new(properties?: AttributionViewModelProperties): AttributionViewModel; + new (properties?: AttributionViewModelProperties): AttributionViewModel; } export const AttributionViewModel: AttributionViewModelConstructor; @@ -47750,7 +50227,7 @@ declare namespace __esri { interface AttributionViewModelProperties { /** * The view from which the view model will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -47758,19 +50235,19 @@ declare namespace __esri { /** * The following properties define an attribution item that contains the attribution text for a layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#AttributionItem) */ export interface AttributionItem extends Object { /** * The attribution text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#AttributionItem) */ text: string; /** * The layer that has the attribution text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#AttributionItem) */ layer: Layer; @@ -47779,47 +50256,47 @@ declare namespace __esri { interface BasemapGallery extends Widget { /** * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#activeBasemap) */ activeBasemap: Basemap; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#iconClass) */ iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#label) */ readonly label: string; /** * The source for basemaps that the widget will display. This property can be autocast with an array or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s, a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) instance, or a URL to a portal instance. The default source is a [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html) that points to the default portal instance set in [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#source) */ source: LocalBasemapsSource | PortalBasemapsSource; /** * The view from which the widget will operate. This view provides access to the active [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#view) */ view: MapView | SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [BasemapGalleryViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#viewModel) */ viewModel: BasemapGalleryViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#render) - * - * + * + * */ render(): any; } @@ -47827,11 +50304,11 @@ declare namespace __esri { interface BasemapGalleryConstructor { /** * The BasemapGallery widget displays a collection images representing basemaps from ArcGIS.com or a user-defined set of map or image services. When a new basemap is selected from the BasemapGallery, the map's basemap layers are removed and replaced with the basemap layers of the associated basemap selected in the gallery. By default, the BasemapGallery widget looks like the following image. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) */ - new(properties?: BasemapGalleryProperties): BasemapGallery; + new (properties?: BasemapGalleryProperties): BasemapGallery; } export const BasemapGallery: BasemapGalleryConstructor; @@ -47839,31 +50316,31 @@ declare namespace __esri { interface BasemapGalleryProperties extends WidgetProperties { /** * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#activeBasemap) */ activeBasemap?: BasemapProperties; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#iconClass) */ iconClass?: string; /** * The source for basemaps that the widget will display. This property can be autocast with an array or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s, a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) instance, or a URL to a portal instance. The default source is a [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html) that points to the default portal instance set in [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#source) */ source?: LocalBasemapsSourceProperties | PortalBasemapsSourceProperties; /** * The view from which the widget will operate. This view provides access to the active [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [BasemapGalleryViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html#viewModel) */ viewModel?: BasemapGalleryViewModelProperties; @@ -47872,53 +50349,51 @@ declare namespace __esri { interface BasemapGalleryViewModel extends Accessor { /** * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#activeBasemap) */ activeBasemap: Basemap; /** * A collection of [BasemapGalleryItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html)s representing basemaps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#items) */ items: Collection; /** * The source for basemaps that the widget will display. This property can be autocast with an array or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s, a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) instance or a URL to a portal instance. The default source is a [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html) that points to the default portal instance set in [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#source) */ source: LocalBasemapsSource | PortalBasemapsSource; /** * The view model's state. **Possible Values:** ready | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view from which the widget will operate. This view provides access to the active [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#view) */ view: MapView | SceneView; /** * A convenience function to check basemap equality. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#basemapEquals) - * + * * @param basemap1 The basemap to compare against `basemap2`. * @param basemap2 The basemap to compare against `basemap1`. - * + * */ basemapEquals(basemap1: Basemap, basemap2: Basemap): boolean; } interface BasemapGalleryViewModelConstructor { - - - new(properties?: BasemapGalleryViewModelProperties): BasemapGalleryViewModel; + new (properties?: BasemapGalleryViewModelProperties): BasemapGalleryViewModel; } export const BasemapGalleryViewModel: BasemapGalleryViewModelConstructor; @@ -47926,25 +50401,25 @@ declare namespace __esri { interface BasemapGalleryViewModelProperties { /** * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#activeBasemap) */ activeBasemap?: BasemapProperties; /** * A collection of [BasemapGalleryItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html)s representing basemaps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#items) */ items?: CollectionProperties; /** * The source for basemaps that the widget will display. This property can be autocast with an array or [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s, a [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) instance or a URL to a portal instance. The default source is a [PortalBasemapsSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html) that points to the default portal instance set in [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#source) */ source?: LocalBasemapsSourceProperties | PortalBasemapsSourceProperties; /** * The view from which the widget will operate. This view provides access to the active [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-BasemapGalleryViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -47953,36 +50428,34 @@ declare namespace __esri { interface BasemapGalleryItem extends Accessor { /** * The item's associated basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#basemap) */ basemap: Basemap; /** * The Error object returned if an error occurred. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#error) */ readonly error: Error; /** * The item's state. **Possible Values:** loading | ready | error - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#state) - * + * * @default loading */ readonly state: string; /** * The view associated with this item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#view) */ view: MapView | SceneView; } interface BasemapGalleryItemConstructor { - - - new(properties?: BasemapGalleryItemProperties): BasemapGalleryItem; + new (properties?: BasemapGalleryItemProperties): BasemapGalleryItem; } export const BasemapGalleryItem: BasemapGalleryItemConstructor; @@ -47990,13 +50463,13 @@ declare namespace __esri { interface BasemapGalleryItemProperties { /** * The item's associated basemap. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#basemap) */ basemap?: BasemapProperties; /** * The view associated with this item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-BasemapGalleryItem.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -48005,31 +50478,29 @@ declare namespace __esri { interface LocalBasemapsSource extends Accessor { /** * A collection of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-LocalBasemapsSource.html#basemaps) */ basemaps: Collection; /** * The source's state. The state is always `ready`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-LocalBasemapsSource.html#state) */ readonly state: string; /** * Refreshes the source basemaps. Note: `refresh` will not affect LocalBasemapsSource. Modify basemaps directly instead. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-LocalBasemapsSource.html#refresh) - * - * + * + * */ refresh(): void; } interface LocalBasemapsSourceConstructor { - - - new(properties?: LocalBasemapsSourceProperties): LocalBasemapsSource; + new (properties?: LocalBasemapsSourceProperties): LocalBasemapsSource; } export const LocalBasemapsSource: LocalBasemapsSourceConstructor; @@ -48037,7 +50508,7 @@ declare namespace __esri { interface LocalBasemapsSourceProperties { /** * A collection of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-LocalBasemapsSource.html#basemaps) */ basemaps?: CollectionProperties; @@ -48046,34 +50517,32 @@ declare namespace __esri { interface PortalBasemapsSource extends LocalBasemapsSource { /** * Function used to filter basemaps after being fetched from the Portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#filterFunction) */ filterFunction: Function; /** * The Portal from which to fetch basemaps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#portal) */ portal: Portal; /** * An object with key-value pairs used to create a custom basemap gallery group query. Note that all parameters will be joined using the `AND` operator. A query string can also be provided for more advanced use cases. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#query) */ query: any | string; /** * Callback for updating basemaps after being fetched and filtered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#updateBasemapsCallback) */ updateBasemapsCallback: Function; } interface PortalBasemapsSourceConstructor { - - - new(properties?: PortalBasemapsSourceProperties): PortalBasemapsSource; + new (properties?: PortalBasemapsSourceProperties): PortalBasemapsSource; } export const PortalBasemapsSource: PortalBasemapsSourceConstructor; @@ -48081,25 +50550,25 @@ declare namespace __esri { interface PortalBasemapsSourceProperties extends LocalBasemapsSourceProperties { /** * Function used to filter basemaps after being fetched from the Portal. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#filterFunction) */ filterFunction?: Function; /** * The Portal from which to fetch basemaps. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#portal) */ portal?: PortalProperties; /** * An object with key-value pairs used to create a custom basemap gallery group query. Note that all parameters will be joined using the `AND` operator. A query string can also be provided for more advanced use cases. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#query) */ query?: any | string; /** * Callback for updating basemaps after being fetched and filtered. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery-support-PortalBasemapsSource.html#updateBasemapsCallback) */ updateBasemapsCallback?: Function; @@ -48108,53 +50577,53 @@ declare namespace __esri { interface BasemapToggle extends Widget { /** * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#activeBasemap) */ readonly activeBasemap: Basemap; /** - * The next basemap for toggling. One of the following values may be set to this property: + * The next basemap for toggling. One of the following values may be set to this property: * * The [string ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of any Esri basemap. * * A custom [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) object. Since this property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html), the [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) module does not need to be included in the `require()` function in most applications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#nextBasemap) */ nextBasemap: Basemap; /** * Indicates if the title of the basemap is visible in the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#titleVisible) - * + * * @default false */ titleVisible: boolean; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This view provides the BasemapToggle widget with access to the initial [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) to toggle from via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#view) */ view: MapView | SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [BasemapToggleViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#viewModel) */ viewModel: BasemapToggleViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#render) - * - * + * + * */ render(): any; /** * Toggles to the [next basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#nextBasemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#toggle) - * - * + * + * */ toggle(): void; } @@ -48162,41 +50631,41 @@ declare namespace __esri { interface BasemapToggleConstructor { /** * The BasemapToggle provides a widget which allows an end-user to switch between two basemaps. The toggled basemap is set inside the [view's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#view) [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html) */ - new(properties?: BasemapToggleProperties): BasemapToggle; + new (properties?: BasemapToggleProperties): BasemapToggle; } export const BasemapToggle: BasemapToggleConstructor; interface BasemapToggleProperties extends WidgetProperties { /** - * The next basemap for toggling. One of the following values may be set to this property: + * The next basemap for toggling. One of the following values may be set to this property: * * The [string ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of any Esri basemap. * * A custom [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) object. Since this property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html), the [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) module does not need to be included in the `require()` function in most applications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#nextBasemap) */ nextBasemap?: BasemapProperties | string; /** * Indicates if the title of the basemap is visible in the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#titleVisible) - * + * * @default false */ titleVisible?: boolean; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). This view provides the BasemapToggle widget with access to the initial [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) to toggle from via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [BasemapToggleViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html#viewModel) */ viewModel?: BasemapToggleViewModelProperties; @@ -48205,56 +50674,53 @@ declare namespace __esri { interface BasemapToggleViewModel extends Accessor, Evented { /** * The map's [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#activeBasemap) */ readonly activeBasemap: Basemap; /** - * The next basemap for toggling. One of the following values may be set to this property: + * The next basemap for toggling. One of the following values may be set to this property: * * The [string ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of any Esri basemap. * * A custom [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) object. Since this property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html), the [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) module does not need to be included in the `require()` function in most applications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#nextBasemap) */ nextBasemap: Basemap; /** * The view model's state. **Possible Values:** ready | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view from which the widget will operate. This view provides access to the initial [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) to toggle from via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#view) */ view: MapView | SceneView; /** * Toggles to the [next basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#nextBasemap). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#toggle) - * - * + * + * */ toggle(): void; } interface BasemapToggleViewModelConstructor { - - - new(properties?: BasemapToggleViewModelProperties): BasemapToggleViewModel; - + new (properties?: BasemapToggleViewModelProperties): BasemapToggleViewModel; /** * Helper method to find a basemap's thumbnail URL. If the basemap does not have a thumbnail URL defined, this utility will try to find a thumbnail URL from the best matching well-known basemap. If no match is found, a thumbnail URL from the basemap's base layers will be used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#getThumbnailUrl) - * + * * @param basemap The basemap used to retrieve the thumbnail URL. - * + * */ getThumbnailUrl(basemap: Basemap): string; } @@ -48263,16 +50729,16 @@ declare namespace __esri { interface BasemapToggleViewModelProperties { /** - * The next basemap for toggling. One of the following values may be set to this property: + * The next basemap for toggling. One of the following values may be set to this property: * * The [string ID](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) of any Esri basemap. * * A custom [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) object. Since this property may be [autocast](https://developers.arcgis.com/javascript/latest/guide/autocasting/index.html), the [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) module does not need to be included in the `require()` function in most applications. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#nextBasemap) */ nextBasemap?: BasemapProperties | string; /** * The view from which the widget will operate. This view provides access to the initial [basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#basemap) to toggle from via the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#map) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle-BasemapToggleViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -48281,50 +50747,50 @@ declare namespace __esri { interface Bookmarks extends Widget, GoTo { /** * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#bookmarks) */ readonly bookmarks: Collection; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#label) */ readonly label: string; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#view) */ view: MapView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [BookmarksViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#viewModel) */ viewModel: BookmarksViewModel; /** * Zoom to a specific bookmark. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#goTo) - * + * * @param Bookmark The bookmark to zoom to. - * + * */ goTo(Bookmark: Bookmark): IPromise; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#render) - * - * + * + * */ render(): any; } @@ -48332,11 +50798,11 @@ declare namespace __esri { interface BookmarksConstructor { /** * The Bookmarks widget allows end users to quickly navigate to a particular area of interest. It displays a list of [bookmarks](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html), which typically are defined inside the [WebMap](https://developers.arcgis.com/javascript/latest/api-reference/esri-WebMap.html#bookmarks). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html) */ - new(properties?: BookmarksProperties): Bookmarks; + new (properties?: BookmarksProperties): Bookmarks; } export const Bookmarks: BookmarksConstructor; @@ -48344,13 +50810,13 @@ declare namespace __esri { interface BookmarksProperties extends WidgetProperties, GoToProperties { /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#view) */ view?: MapViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [BookmarksViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks.html#viewModel) */ viewModel?: BookmarksViewModelProperties; @@ -48359,46 +50825,44 @@ declare namespace __esri { interface BookmarksViewModel extends Accessor, GoTo { /** * The [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html) that is being navigated to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#activeBookmark) */ readonly activeBookmark: Bookmark; /** * A collection of [Bookmark](https://developers.arcgis.com/javascript/latest/api-reference/esri-webmap-Bookmark.html)s. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#bookmarks) */ readonly bookmarks: Collection; /** * The view model's state. **Possible Values:** loading | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#view) */ view: MapView; /** * Zoom to a specific bookmark. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#goTo) - * + * * @param Bookmark The bookmark to zoom to. - * + * */ goTo(Bookmark: Bookmark): IPromise; } interface BookmarksViewModelConstructor { - - - new(properties?: BookmarksViewModelProperties): BookmarksViewModel; + new (properties?: BookmarksViewModelProperties): BookmarksViewModel; } export const BookmarksViewModel: BookmarksViewModelConstructor; @@ -48406,7 +50870,7 @@ declare namespace __esri { interface BookmarksViewModelProperties extends GoToProperties { /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Bookmarks-BookmarksViewModel.html#view) */ view?: MapViewProperties; @@ -48415,114 +50879,114 @@ declare namespace __esri { interface ColorSlider extends Accessor, Widgette { /** * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#handlesVisible) - * + * * @default true */ handlesVisible: boolean; /** * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram) */ histogram: HistogramResult; /** * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogramVisible) - * + * * @default true */ histogramVisible: boolean; /** * The width of the histogram in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogramWidth) - * + * * @default 100 */ histogramWidth: number; /** * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#labelsVisible) - * + * * @default true */ labelsVisible: boolean; /** * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics), but may not be less than the value of the maximum stop of the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable). This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue) */ maxValue: number; /** * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics), but may not be greater than the value of the minimum stop of the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable). This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) */ minValue: number; /** * Indicates the number of handles to show on the slider. Acceptable values are `2` or `3`. If `3` handles are specified, then the [syncedHandles](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#syncedHandles) property may be enabled to sync the movement of the outside handles with the middle, or primary, handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#numHandles) - * + * * @default {"value":2,"set":""} */ numHandles: number; /** * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue) of the slider if values for those properties are not already provided. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) */ statistics: ColorSliderStatistics; /** * Indicates whether to show the average in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statisticsVisible) - * + * * @default true */ statisticsVisible: boolean; /** * Only applicable when [numHandles](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#numHandles) is set to `3`. This property indicates whether the outside handles are synced with the middle, or primary, handle. If the primary handle is dragged then the outside handles are dragged while maintaining the same distance from the primary handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#syncedHandles) - * + * * @default false */ syncedHandles: boolean; /** * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#ticksVisible) - * + * * @default true */ ticksVisible: boolean; /** * Each object in this array represents a stop in the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable) associated with the slider. The properties of each object describe whether the stop has a slider handle, the value of the handle and its associated color. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#values) */ readonly values: ColorSliderValues[]; /** * The color visual variable represented by the slider. This must be set initially on the slider for it to render in the view. This may be created manually (see snippet below) or generated from the [colorRendererCreator](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html) helper methods. A new color visual variable is created each time the user slides handles or changes the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) or the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable) */ - visualVariable: ColorVisualVariable; + visualVariable: ColorVariable; } interface ColorSliderConstructor { /** * The ColorSlider is a widget intended for authoring and exploring data-driven visualizations in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) using color. To display properly, this slider requires a [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable) and a [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) object. Other optional properties may be used, including adding a [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram). Most of the various options that affect the UI of the slider are labeled in the image below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html) */ - new(properties?: ColorSliderProperties): ColorSlider; + new (properties?: ColorSliderProperties): ColorSlider; } export const ColorSlider: ColorSliderConstructor; @@ -48530,145 +50994,143 @@ declare namespace __esri { interface ColorSliderProperties extends WidgetteProperties { /** * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#handlesVisible) - * + * * @default true */ handlesVisible?: boolean; /** * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram) */ histogram?: HistogramResult; /** * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogramVisible) - * + * * @default true */ histogramVisible?: boolean; /** * The width of the histogram in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#histogramWidth) - * + * * @default 100 */ histogramWidth?: number; /** * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#labelsVisible) - * + * * @default true */ labelsVisible?: boolean; /** * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics), but may not be less than the value of the maximum stop of the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable). This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue) */ maxValue?: number; /** * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics), but may not be greater than the value of the minimum stop of the [color visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable). This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) */ minValue?: number; /** * Indicates the number of handles to show on the slider. Acceptable values are `2` or `3`. If `3` handles are specified, then the [syncedHandles](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#syncedHandles) property may be enabled to sync the movement of the outside handles with the middle, or primary, handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#numHandles) - * + * * @default {"value":2,"set":""} */ numHandles?: number; /** * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue) of the slider if values for those properties are not already provided. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) */ statistics?: ColorSliderStatistics; /** * Indicates whether to show the average in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statisticsVisible) - * + * * @default true */ statisticsVisible?: boolean; /** * Only applicable when [numHandles](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#numHandles) is set to `3`. This property indicates whether the outside handles are synced with the middle, or primary, handle. If the primary handle is dragged then the outside handles are dragged while maintaining the same distance from the primary handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#syncedHandles) - * + * * @default false */ syncedHandles?: boolean; /** * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#ticksVisible) - * + * * @default true */ ticksVisible?: boolean; /** * The color visual variable represented by the slider. This must be set initially on the slider for it to render in the view. This may be created manually (see snippet below) or generated from the [colorRendererCreator](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-color.html) helper methods. A new color visual variable is created each time the user slides handles or changes the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#minValue) or the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#maxValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#visualVariable) */ - visualVariable?: ColorVisualVariable; + visualVariable?: ColorVariableProperties; } - export interface ColorSliderStatistics extends Object { /** * The average of all data values represented in the color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) */ avg: number; /** * The maximum of all data values represented in the color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) */ max: number; /** * The minimum of all data values represented in the color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) */ min: number; /** * The standard deviation calculated from all data values represented in the color visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#statistics) */ stddev: number; } - export interface ColorSliderValues extends Object { /** * The color used to represent features with values at the associated stop. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#values) */ color: Color; /** * The value of the stop for the associated handle. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#values) */ value: number; /** * The label used to display the value to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ColorSlider.html#values) */ label: string; @@ -48677,43 +51139,43 @@ declare namespace __esri { interface Compass extends Widget, GoTo { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#label) */ readonly label: string; /** * The view in which the Compass obtains and indicates camera [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading), using a (SceneView) or rotation (MapView). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#view) */ view: MapView | SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [CompassViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#viewModel) */ viewModel: CompassViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#render) - * - * + * + * */ render(): any; /** * If working in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), sets the view's [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) to `0`. If working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), sets the camera's [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) to `0`. This method is executed each time the [Compass](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html) is clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#reset) - * - * + * + * */ reset(): void; } @@ -48721,11 +51183,11 @@ declare namespace __esri { interface CompassConstructor { /** * The Compass widget indicates where north is in relation to the current view [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) or [camera heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading). Clicking the Compass widget rotates the view to face north (heading = 0). This widget is added to a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) by default. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html) */ - new(properties?: CompassProperties): Compass; + new (properties?: CompassProperties): Compass; } export const Compass: CompassConstructor; @@ -48733,13 +51195,13 @@ declare namespace __esri { interface CompassProperties extends WidgetProperties, GoToProperties { /** * The view in which the Compass obtains and indicates camera [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading), using a (SceneView) or rotation (MapView). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [CompassViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html#viewModel) */ viewModel?: CompassViewModelProperties; @@ -48748,33 +51210,33 @@ declare namespace __esri { interface CompassViewModel extends Accessor, GoTo { /** * The orientation axes (x, y, z). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#orientation) - * + * * @default { x: 0, y: 0, z: 0 } */ orientation: any; /** * The view model's state. **Possible Values:** compass | rotation | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view in which the Compass obtains and indicates camera [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading), using a (SceneView) or rotation (MapView). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#view) */ view: MapView | SceneView; /** * If working in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), sets the view's [rotation](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#rotation) is to `0`. If working in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html), sets the camera's [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading) to `0`. This method is executed each time the [Compass](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html) is clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#reset) - * - * + * + * */ reset(): void; } @@ -48782,11 +51244,11 @@ declare namespace __esri { interface CompassViewModelConstructor { /** * Provides the logic for the [Compass](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html) */ - new(properties?: CompassViewModelProperties): CompassViewModel; + new (properties?: CompassViewModelProperties): CompassViewModel; } export const CompassViewModel: CompassViewModelConstructor; @@ -48794,15 +51256,15 @@ declare namespace __esri { interface CompassViewModelProperties extends GoToProperties { /** * The orientation axes (x, y, z). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#orientation) - * + * * @default { x: 0, y: 0, z: 0 } */ orientation?: any; /** * The view in which the Compass obtains and indicates camera [heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html#heading), using a (SceneView) or rotation (MapView). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Compass-CompassViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -48811,85 +51273,85 @@ declare namespace __esri { interface CoordinateConversion extends Widget, GoTo { /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Conversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html) that the widget is currently displaying. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#conversions) */ conversions: Collection; /** * Describes the location of the coordinates currently displayed by the widget as a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). Setting this property will update all [conversions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#conversions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#currentLocation) */ currentLocation: Point; /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Format](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html) that the widget is capable of displaying. The default formats are `basemap`, `dd`, `ddm`, `dms`, `mgrs`, `usng`, `utm`, and `xy`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#formats) */ formats: Collection; /** - * Describes the current mode of the widget. **Possible Values:** live | capture + * Describes the current mode of the widget. **Possible Values:** live | capture * * While in `live` mode, the widget will update as the cursor moves. * * While in `capture` mode, the widget will update on mouse click and display a graphic marking the current location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#mode) - * + * * @default live */ mode: string; /** * If this property is set to `true`, multiple conversions can be displayed. For a simpler experience with only one conversion at a time, this property can be set to `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#multipleConversions) - * + * * @default true */ multipleConversions: boolean; /** * Determines whether the widget should expand up or down. If set to `auto` the widget will be oriented based on its position in the view. **Possible Values:** auto | expand-up | expand-down - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#orientation) - * + * * @default auto */ orientation: string; /** * The number of milliseconds of delay before conversion requests will be sent to the [GeometryService](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html). This only affects conversions that cannot be performed in the browser. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#requestDelay) - * + * * @default 300 */ requestDelay: number; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#view) */ view: MapView | SceneView; /** * The view model for this widget. The view model contains the logic that controls the Coordinate Widget's behavior. See the [CoordinateConversionViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#viewModel) */ viewModel: CoordinateConversionViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#render) - * - * + * + * */ render(): any; /** * Attempt to convert a string into a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). The format of the string must be specified. A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of available formats can be obtained from the [formats](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#formats) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#reverseConvert) - * + * * @param coordinate The coordinate string. * @param format Specifies the format of the input coordinate. - * + * */ reverseConvert(coordinate: string, format: Format): IPromise; } @@ -48897,11 +51359,11 @@ declare namespace __esri { interface CoordinateConversionConstructor { /** * The CoordinateConversion widget provides a way to display user cursor position either as map coordinates or as any of several popular coordinate notations. Additionally, the widget provides a way to convert user input coordinates into a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html) */ - new(properties?: CoordinateConversionProperties): CoordinateConversion; + new (properties?: CoordinateConversionProperties): CoordinateConversion; } export const CoordinateConversion: CoordinateConversionConstructor; @@ -48909,65 +51371,65 @@ declare namespace __esri { interface CoordinateConversionProperties extends WidgetProperties, GoToProperties { /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Conversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html) that the widget is currently displaying. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#conversions) */ conversions?: CollectionProperties; /** * Describes the location of the coordinates currently displayed by the widget as a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). Setting this property will update all [conversions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#conversions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#currentLocation) */ currentLocation?: PointProperties; /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Format](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html) that the widget is capable of displaying. The default formats are `basemap`, `dd`, `ddm`, `dms`, `mgrs`, `usng`, `utm`, and `xy`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#formats) */ formats?: CollectionProperties; /** - * Describes the current mode of the widget. **Possible Values:** live | capture + * Describes the current mode of the widget. **Possible Values:** live | capture * * While in `live` mode, the widget will update as the cursor moves. * * While in `capture` mode, the widget will update on mouse click and display a graphic marking the current location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#mode) - * + * * @default live */ mode?: string; /** * If this property is set to `true`, multiple conversions can be displayed. For a simpler experience with only one conversion at a time, this property can be set to `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#multipleConversions) - * + * * @default true */ multipleConversions?: boolean; /** * Determines whether the widget should expand up or down. If set to `auto` the widget will be oriented based on its position in the view. **Possible Values:** auto | expand-up | expand-down - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#orientation) - * + * * @default auto */ orientation?: string; /** * The number of milliseconds of delay before conversion requests will be sent to the [GeometryService](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html). This only affects conversions that cannot be performed in the browser. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#requestDelay) - * + * * @default 300 */ requestDelay?: number; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. The view model contains the logic that controls the Coordinate Widget's behavior. See the [CoordinateConversionViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html#viewModel) */ viewModel?: CoordinateConversionViewModelProperties; @@ -48976,97 +51438,95 @@ declare namespace __esri { interface CoordinateConversionViewModel extends Accessor, GoTo { /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Conversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html) that the widget is currently displaying. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#conversions) */ conversions: Collection; /** * Describes the location of the coordinates currently displayed by the widget as a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). Setting this property will update all [conversions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#conversions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#currentLocation) */ currentLocation: Point; /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Format](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html) that the widget is capable of displaying. The default formats are `basemap`, `dd`, `ddm`, `dms`, `mgrs`, `usng`, `utm`, and `xy`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#formats) */ formats: Collection; /** * This symbol is used to visualize the location currently described by the widget when `capture` mode is active. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#locationSymbol) */ locationSymbol: SimpleMarkerSymbol | PictureMarkerSymbol; /** - * Describes the current mode of the widget. **Possible Values:** live | capture + * Describes the current mode of the widget. **Possible Values:** live | capture * * While in `live` mode, the widget will update as the cursor moves. * * While in `capture` mode, the widget will update on mouse click and display a graphic marking the current location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#mode) - * + * * @default live */ mode: string; /** * The number of milliseconds of delay before conversion requests will be sent to the [GeometryService](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html). This only affects conversions that cannot be performed in the browser. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#requestDelay) - * + * * @default 300 */ requestDelay: number; /** * The view model's state. **Possible Values:** ready | loading | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#view) */ view: MapView | SceneView; /** * Attempt to convert a point into a [Position](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#Position). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#convert) - * + * * @param point The point to convert. * @param format The format that describes how the point should be converted. - * + * */ convert(point: Point, format: Format): IPromise; /** * Attempt to convert a string into a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). The format of the string must be specified. A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of available formats can be obtained from the [formats](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#formats) property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#reverseConvert) - * + * * @param coordinate The coordinate string. * @param format Specifies the format of the input coordinate. - * + * */ reverseConvert(coordinate: string, format: Format): IPromise; /** * Update the input conversions based on the input point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#updateConversions) - * + * * @param location A point that will be used to update each input conversion. * @param conversions An array of [Conversions](esri-widgets-CoordinateConversion-support-Conversion.html) to be updated. - * + * */ updateConversions(location: Point, conversions: Conversion[]): IPromise; } interface CoordinateConversionViewModelConstructor { - - - new(properties?: CoordinateConversionViewModelProperties): CoordinateConversionViewModel; + new (properties?: CoordinateConversionViewModelProperties): CoordinateConversionViewModel; } export const CoordinateConversionViewModel: CoordinateConversionViewModelConstructor; @@ -49074,49 +51534,49 @@ declare namespace __esri { interface CoordinateConversionViewModelProperties extends GoToProperties { /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Conversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html) that the widget is currently displaying. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#conversions) */ conversions?: CollectionProperties; /** * Describes the location of the coordinates currently displayed by the widget as a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html). Setting this property will update all [conversions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#conversions). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#currentLocation) */ currentLocation?: PointProperties; /** * A [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) containing every [Format](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html) that the widget is capable of displaying. The default formats are `basemap`, `dd`, `ddm`, `dms`, `mgrs`, `usng`, `utm`, and `xy`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#formats) */ formats?: CollectionProperties; /** * This symbol is used to visualize the location currently described by the widget when `capture` mode is active. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#locationSymbol) */ locationSymbol?: SimpleMarkerSymbolProperties | PictureMarkerSymbolProperties; /** - * Describes the current mode of the widget. **Possible Values:** live | capture + * Describes the current mode of the widget. **Possible Values:** live | capture * * While in `live` mode, the widget will update as the cursor moves. * * While in `capture` mode, the widget will update on mouse click and display a graphic marking the current location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#mode) - * + * * @default live */ mode?: string; /** * The number of milliseconds of delay before conversion requests will be sent to the [GeometryService](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-GeometryService.html). This only affects conversions that cannot be performed in the browser. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#requestDelay) - * + * * @default 300 */ requestDelay?: number; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -49124,41 +51584,40 @@ declare namespace __esri { /** * Describes a point in terms of a location, a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), and a coordinate, a string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#Position) */ export interface Position extends Object { /** * A point geometry representing the location described by the conversion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#Position) */ location: Point; /** * A string representing the location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-CoordinateConversionViewModel.html#Position) */ coordinate: string; } - interface Conversion { /** * A formatted string based on the current [position](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#position) and display information on the [format](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#format). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#displayCoordinate) */ readonly displayCoordinate: string; /** * The [Format](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html) for this conversion. The Format contains information detailing how the Conversion should be performed and how it will be displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#format) */ format: Format; /** * The position property contains the location information for this conversion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#position) */ position: ConversionPosition; @@ -49168,75 +51627,74 @@ declare namespace __esri { /** * Describes a point in terms of a location, a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), and a coordinate, a string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#Position) */ export interface ConversionPosition extends Object { /** * A point geometry representing the location described by the conversion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#Position) */ location: Point; /** * A string representing the location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Conversion.html#Position) */ coordinate: string; } - interface Format { /** * Contains information that describes how this Format should be converted. This property should only be set when creating a custom Format. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#conversionInfo) - * + * * @default null */ conversionInfo: ConversionInfo; /** * A array of [Coordinate Segments](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#CoordinateSegment). Each segment represents a section of the Format's coordinate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#coordinateSegments) - * + * * @default null */ coordinateSegments: CoordinateSegment[]; /** * A string that serves as a pattern describing how this Format should be displayed. The pattern should contain all of aliases specified by the Format's [coordinateSegments property](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#coordinateSegments). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#currentPattern) - * + * * @default null */ currentPattern: string; /** * The default pattern describing how this Format should be displayed. See [currentPattern](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#currentPattern). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#defaultPattern) - * + * * @default null */ defaultPattern: string; /** * The name of the coordinate. A [CoordinateConversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html) widget should not contain multiple Formats with the same name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#name) - * + * * @default null */ name: string; /** * The [SpatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) for this format. Coordinates generated for a format will be derived from points in this spatial reference. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#spatialReference) */ spatialReference: SpatialReference; /** * The view model of the [CoordinateConversion](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion.html) widget that is utilizing this format. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#viewModel) */ viewModel: CoordinateConversionViewModel; @@ -49246,50 +51704,50 @@ declare namespace __esri { /** * This object describes how a Format should be projected and formatted for display. Used to define custom Formats that require custom conversion and/or projection logic. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#ConversionInfo) */ export interface ConversionInfo extends Object { /** * A function that takes a point and returns a [position](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#Position). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#ConversionInfo) - * - * + * + * */ convert(): void; /** * A function that takes a string and returns a Point. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#ConversionInfo) - * - * + * + * */ reverseConvert(): void; } /** - * A coordinate segment represents one piece of a coordinate string. + * A coordinate segment represents one piece of a coordinate string. * > A MGRS coordinate, for example `30UVG898998`, is described by four segments: 1. Alias `Z`, the gridzone: `30U` 2. Alias `S`, the 100,000 meter square designator: `VG` 3. Alias `X`, the easting (x coordinate with respect to the 10,000 meter square): `898` 4. Alias `Y`, the northing (y coordinate with respect to the 10,000 meter square): `998` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#CoordinateSegment) */ export interface CoordinateSegment extends Object { /** * A string that provides the name for this segment of a coordinate string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#CoordinateSegment) */ alias: string; /** * A string that describes the role of this segment. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#CoordinateSegment) */ description: string; /** * A regular expression that should extract this segment from the complete coordinate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#CoordinateSegment) */ searchPattern: RegExp; @@ -49297,19 +51755,19 @@ declare namespace __esri { /** * Describes a point in terms of a location, a [Point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html), and a coordinate, a string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#Position) */ export interface FormatPosition extends Object { /** * A point geometry representing the location described by the conversion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#Position) */ location: Point; /** * A string representing the location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-CoordinateConversion-support-Format.html#Position) */ coordinate: string; @@ -49318,87 +51776,87 @@ declare namespace __esri { interface Directions extends Widget, GoTo { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#label) */ readonly label: string; /** * The maximum number of stops allowed for routing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#maxStops) - * + * * @default 50 */ maxStops: number; /** * The URL of the REST endpoint of the Route service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#routeServiceUrl) - * + * * @default "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World" */ routeServiceUrl: string; /** * Defines the symbol used to draw the route on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#routeSymbol) */ routeSymbol: SimpleLineSymbol; /** * Controls the default properties used when [searching](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html). Note that the default `searchProperties` differ slightly from the [Search widget](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#searchProperties) - * + * * @default null */ searchProperties: DirectionsSearchProperties; /** * The default stop symbols used to display locations between the origin and final destination. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) */ stopSymbols: DirectionsStopSymbols; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#view) */ view: MapView | SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [DirectionsViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#viewModel) */ viewModel: DirectionsViewModel; /** * Calculate the route to the input locations and display the list of directions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#getDirections) - * - * + * + * */ getDirections(): IPromise; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#render) - * - * + * + * */ render(): any; /** * Zoom so that the full route is displayed within the current map extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#zoomToRoute) - * - * + * + * */ zoomToRoute(): void; } @@ -49406,11 +51864,11 @@ declare namespace __esri { interface DirectionsConstructor { /** * The Directions Widget provides a way to build driving and walking directions using ArcGIS online and custom Network Analysis Route services. Similar to how the [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html) works, this widget generates a route finding a least-cost path between multiple points using a specified network. The resulting directions are displayed with detailed turn-by-turn instructions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html) */ - new(properties?: DirectionsProperties): Directions; + new (properties?: DirectionsProperties): Directions; } export const Directions: DirectionsConstructor; @@ -49418,49 +51876,49 @@ declare namespace __esri { interface DirectionsProperties extends WidgetProperties, GoToProperties { /** * The maximum number of stops allowed for routing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#maxStops) - * + * * @default 50 */ maxStops?: number; /** * The URL of the REST endpoint of the Route service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#routeServiceUrl) - * + * * @default "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World" */ routeServiceUrl?: string; /** * Defines the symbol used to draw the route on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#routeSymbol) */ routeSymbol?: SimpleLineSymbolProperties; /** * Controls the default properties used when [searching](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html). Note that the default `searchProperties` differ slightly from the [Search widget](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#searchProperties) - * + * * @default null */ searchProperties?: DirectionsSearchProperties; /** * The default stop symbols used to display locations between the origin and final destination. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) */ stopSymbols?: DirectionsStopSymbols; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [DirectionsViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#viewModel) */ viewModel?: DirectionsViewModelProperties; @@ -49469,166 +51927,166 @@ declare namespace __esri { interface DirectionsViewModel extends Accessor, GoTo { /** * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#impedanceAttribute) */ impedanceAttribute: string; /** * The most recent route result. Returns an object containing properties for any barriers used when generating the route, messages that may arise when solving the route, and finally an array of returned [RouteResults](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) - * + * * @default null */ readonly lastRoute: DirectionsViewModelLastRoute; /** * The maximum number of stops allowed for routing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#maxStops) - * + * * @default 50 */ maxStops: number; /** * Route Parameters object used to call the service. Please refer to the [RouteParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html) documentation for the list of available settings. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeParameters) */ routeParameters: RouteParameters; /** * The URL of the REST endpoint of the Route service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeServiceUrl) - * + * * @default "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World" */ routeServiceUrl: string; /** * Defines the symbol used to draw the route on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeSymbol) */ routeSymbol: SimpleLineSymbol; /** * The selected travel mode. More information can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) - * + * * @default null | 'Driving Time' */ readonly selectedTravelMode: DirectionsViewModelSelectedTravelMode; /** * The Service Description object returned by the Route REST Endpoint. This object contains service specific details like available Cost attributes, supported Restrictions, default Attribute Parameter Values, Service Limits (like maximum input stop count), default Impedance Attribute, etc. This information is useful when implementing complex logistics scenarios operating with limitations or preferences on vehicle or stop properties, for example avoiding toll roads, dealing with hazardous materials, working with stop service times, etc. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#serviceDescription) - * + * * @default null */ readonly serviceDescription: any; /** * The current state of the view model. **Possible Values:** disabled | ready - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * An array of graphics that define the stop locations along the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stops) */ stops: Collection; /** * The default stop symbols used to display locations between the origin and final destination. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) */ stopSymbols: DirectionsViewModelStopSymbols; /** * The name of the network attribute to use for the drive time when computing directions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#timeAttribute) */ timeAttribute: DirectionsViewModelTimeAttribute; /** * Array of objects containing properties specific to either an ArcGIS service or organization's travel modes. More information can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#travelModes) */ readonly travelModes: TravelMode[]; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#view) */ view: MapView | SceneView; /** * Centers the map at the specified maneuver or stop. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#centerAt) - * + * * @param stopOrManeuver The stop or maneuver where the map should be centered. - * + * */ centerAt(stopOrManeuver: Graphic): void; /** * Clears any highlighted route segments. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#clearHighlights) - * - * + * + * */ clearHighlights(): void; /** * Removes the route directions from the directions list, leaving the inputs untouched. The route and locations persist on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#clearResults) - * - * + * + * */ clearResults(): void; /** * Returns cost attribute name specific to a particular route service. This can be used as a [travel mode impedance](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#getCostAttribute) - * + * * @param attributeName The attribute name specifying the cost attribute used as an impedance. - * + * */ getCostAttribute(attributeName: string): string; /** * Calculate the route to the input locations and display the list of directions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#getDirections) - * - * + * + * */ getDirections(): IPromise; /** * Highlights the specified route segment on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#highlightSegment) - * + * * @param maneuver The route segment to highlight. - * + * */ highlightSegment(maneuver: Graphic): void; /** * Resets the state of the ViewModel, clearing off all the input stops, and results in the widget. The results persist in the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#reset) - * - * + * + * */ reset(): void; /** * Zoom so that the full route is displayed within the current map extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#zoomToRoute) - * - * + * + * */ zoomToRoute(): void; } @@ -49636,11 +52094,11 @@ declare namespace __esri { interface DirectionsViewModelConstructor { /** * Provides the communication and data manipulation logic for the [Directions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html) */ - new(properties?: DirectionsViewModelProperties): DirectionsViewModel; + new (properties?: DirectionsViewModelProperties): DirectionsViewModel; } export const DirectionsViewModel: DirectionsViewModelConstructor; @@ -49648,109 +52106,107 @@ declare namespace __esri { interface DirectionsViewModelProperties extends GoToProperties { /** * The network attribute name to be used as the impedance attribute in the analysis. The default is as defined in the specific routing network layer used in your [RouteTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-RouteTask.html). You can specify any attribute names listed in the Service Directory under `Network Dataset -> Network Attributes` as `Usage Type: esriNAUTCost`. You can also specify a value of `none` to indicate that no network attributes should be used for impedance. If you specify an empty array, it will default to the default of the service. For example, set `impedanceAttribute = "Time"` for the quickest route and `impedanceAttribute = "Length"` for shortest drive, assuming the service has those two esriNAUTCost attributes. For more information, see [Understanding the network attribute](http://resources.arcgis.com/en/help/main/10.2/index.html#//00470000000m000000). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#impedanceAttribute) */ impedanceAttribute?: string; /** * The maximum number of stops allowed for routing. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#maxStops) - * + * * @default 50 */ maxStops?: number; /** * Route Parameters object used to call the service. Please refer to the [RouteParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteParameters.html) documentation for the list of available settings. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeParameters) */ routeParameters?: RouteParametersProperties; /** * The URL of the REST endpoint of the Route service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeServiceUrl) - * + * * @default "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World" */ routeServiceUrl?: string; /** * Defines the symbol used to draw the route on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#routeSymbol) */ routeSymbol?: SimpleLineSymbolProperties; /** * An array of graphics that define the stop locations along the route. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stops) */ stops?: CollectionProperties; /** * The default stop symbols used to display locations between the origin and final destination. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) */ stopSymbols?: DirectionsViewModelStopSymbols; /** * The name of the network attribute to use for the drive time when computing directions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#timeAttribute) */ timeAttribute?: DirectionsViewModelTimeAttribute; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; } - export interface DirectionsViewModelLastRoute extends Object { /** * Array of graphics representing the point barriers. For a list of properties returned for each barrier, see the [barriers](https://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/barriers.htm) help documentation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) */ barriers: Graphic[]; /** * An array of messages serialized to JSON. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) */ messages: DirectionsViewModelLastRouteMessages[]; /** * Array of graphics representing the polygon barriers. For a list of properties returned for each barrier, see the [barriers](https://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/barriers.htm) help documentation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) */ polygonBarriers: Graphic[]; /** * Array of graphics representing the polygon barriers. For a list of properties returned for each barrier, see the [barriers](https://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/barriers.htm) help documentation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) */ polylineBarriers: Graphic[]; /** * An array of [RouteResults](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-RouteResult.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) */ routeResults: RouteResult; } - export interface DirectionsViewModelLastRouteMessages extends Object { /** * A descriptive message of the returned mesage. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) */ description: string; /** * Number indicating the message type returned from the service. This number correlates to one of the possible values listed below. - * + * * Number | Value * ------|------------ * 0 | informative @@ -49761,92 +52217,89 @@ declare namespace __esri { * 100 | error * 101 | empty * 200 | abort - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#lastRoute) */ type: number; } - export interface DirectionsViewModelSelectedTravelMode extends TravelMode { /** * The description explaining the selected travel mode. A listing of these descriptions can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) */ description: string; /** * The unique identifier specific for this travel mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) */ id: string; /** * The cost attribute on which to optimize the analysis. For example `Miles`, `Minutes`, `Travel Time`, `Kilometers`, `TimeAt1KPH`, `WalkTime`, and `TruckTravelTime`. Take note that attribute names are specific to the network dataset. They may be different if using another Network Analysis service besides the one hosted via ArcGIS Online. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) */ impedanceAttributeName: string; /** * Name of the travel mode. Users of ArcGIS Online or ArcGIS Enterprise can define custom travel modes inside their Organization settings. Authors of stand alone Network Analysis Services can define their own travel modes inside a network dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) */ name: string; /** * The time-based cost attribute for reporting directions. For example, `Minutes`, `Travel Time`, `TimeAt1KPH`, `WalkTime`, and `TruckTravelTime`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#selectedTravelMode) */ timeAttributeName: string; } - export interface DirectionsViewModelStopSymbols extends Object { /** * The first stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) */ first?: Symbol; /** * The middle stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) */ middle?: Symbol; /** * The last stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) */ last?: Symbol; /** * An unlocated stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) */ unlocated?: Symbol; /** * A waypoint stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#stopSymbols) */ waypoint?: Symbol; } - export interface DirectionsViewModelTimeAttribute extends Object { /** * The name of the network attribute to use for the drive time when computing directions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#timeAttribute) */ name: string; /** * The units to use when calculating drive time for directions. **Possible Values:** feet | kilometers | meters | miles | nautical-miles | yards - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#timeAttribute) */ units?: string; @@ -49854,71 +52307,70 @@ declare namespace __esri { /** * Array of objects containing properties specific to either an ArcGIS service or organization's travel modes. More information can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) */ export interface TravelMode extends Object { /** * The description explaining the selected travel mode. A listing of these descriptions can be found in the [ArcGIS Online documentation](https://doc.arcgis.com/en/arcgis-online/reference/travel-modes.htm#GUID-96DF7F50-E0B2-4BF3-8271-EB515D3F0107). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) */ description?: string; /** * The unique identifier specific for this travel mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) */ id?: string; /** * The cost attribute on which to optimize the analysis. For example `Miles`, `Minutes`, `Travel Time`, `Kilometers`, `TimeAt1KPH`, `WalkTime`, and `TruckTravelTime`. Take note that attribute names are specific to the network dataset. They may be different if using another Network Analysis service besides the one hosted via ArcGIS Online. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) */ impedanceAttributeName?: string; /** * Name of the travel mode. Users of ArcGIS Online or ArcGIS Enterprise can define custom travel modes inside their Organization settings. Authors of stand alone Network Analysis Services can define their own travel modes inside a network dataset. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) */ name?: string; /** * The time-based cost attribute for reporting directions. For example, `Minutes`, `Travel Time`, `TimeAt1KPH`, `WalkTime`, and `TruckTravelTime`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions-DirectionsViewModel.html#TravelMode) */ timeAttributeName?: string; } - export interface DirectionsStopSymbols extends Object { /** * The first stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) */ first?: Symbol; /** * The middle stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) */ middle?: Symbol; /** * The last stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) */ last?: Symbol; /** * An unlocated stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) */ unlocated?: Symbol; /** * A waypoint stop symbol. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#stopSymbols) */ waypoint?: Symbol; @@ -49926,109 +52378,109 @@ declare namespace __esri { /** * Configurable Search properties of the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ export interface DirectionsSearchProperties extends Object { - /** - * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) - */ - popupOpenOnSelect?: boolean; /** * Number index indicating the current selected source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ activeSourceIndex?: number; + /** + * String value used as a hint for input text when searching on multiple sources. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) + */ + allPlaceholder?: string; /** * Indicates whether to automatically navigate to the selected result once selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ autoNavigate?: boolean; /** * Indicates whether to automatically select and zoom to the first geocoded result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ autoSelect?: boolean; /** * Indicates the maximum number of search results to return. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ maxResults?: number; /** * Indicates the maximum number of suggestions to return for the widget's input. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ maxSuggestions?: number; /** * Indicates the minimum number of characters required before querying for a suggestion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ minSuggestCharacters?: number; /** * Indicates whether to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a selected result is clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ popupEnabled?: boolean; /** - * String value used as a hint for input text when searching on multiple sources. - * + * Indicates whether to show the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a result is selected. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ - allPlaceholder?: string; + popupOpenOnSelect?: boolean; /** * A customized PopupTemplate for the selected feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ popupTemplate?: PopupTemplate; /** * Indicates whether to show a graphic on the map for the selected source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ resultGraphicEnabled?: boolean; /** * Indicates whether to display the option to search all sources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ searchAllEnabled?: boolean; /** * The value of the search box input text string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ searchTerm?: string; /** * Specifies the sources to search in the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#view). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ sources?: Collection; /** * Indicates whether to display suggestions as the user enters input text in the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ suggestionsEnabled?: boolean; /** * The view of the widget. - * + * * [Read more...](global.html) */ view?: MapView | SceneView; /** * The Search widget's view model. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Directions.html#SearchProperties) */ viewModel?: SearchViewModel; @@ -50036,38 +52488,36 @@ declare namespace __esri { interface DirectLineMeasurement3D extends Widget { /** - * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | inches | feet | yards | miles | nautical-miles | meters | kilometers | us-feet - * + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** metric | imperial | inches | feet | us-feet | yards | miles | nautical-miles | meters | kilometers + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#unit) */ unit: string; /** - * List of unit options in the widget drop down list. - * + * List of unit systems (imperial, metric) and specific units for displaying the distance values. By default, the following units are included: `metric`, `imperial`, `inches`, `feet`, `us-feet`, `yards`, `miles`, `nautical-miles`, `meters`, `kilometers`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#unitOptions) - * - * @default ["metric", "imperial", "inches", "feet", "yards", "miles", "nautical-miles", "us-feet", "meters", "kilometers"] */ unitOptions: string[]; /** * A reference to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#view) */ view: SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [DirectLineMeasurement3DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#viewModel) */ viewModel: DirectLineMeasurement3DViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#render) - * - * + * + * */ render(): any; } @@ -50075,39 +52525,37 @@ declare namespace __esri { interface DirectLineMeasurement3DConstructor { /** * The DirectLineMeasurement3D widget calculates and displays the 3D distance between two points. This widget can be used in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) to measure the vertical, horizontal, and direct distance between two points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html) */ - new(properties?: DirectLineMeasurement3DProperties): DirectLineMeasurement3D; + new (properties?: DirectLineMeasurement3DProperties): DirectLineMeasurement3D; } export const DirectLineMeasurement3D: DirectLineMeasurement3DConstructor; interface DirectLineMeasurement3DProperties extends WidgetProperties { /** - * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | inches | feet | yards | miles | nautical-miles | meters | kilometers | us-feet - * + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** metric | imperial | inches | feet | us-feet | yards | miles | nautical-miles | meters | kilometers + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#unit) */ unit?: string; /** - * List of unit options in the widget drop down list. - * + * List of unit systems (imperial, metric) and specific units for displaying the distance values. By default, the following units are included: `metric`, `imperial`, `inches`, `feet`, `us-feet`, `yards`, `miles`, `nautical-miles`, `meters`, `kilometers`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#unitOptions) - * - * @default ["metric", "imperial", "inches", "feet", "yards", "miles", "nautical-miles", "us-feet", "meters", "kilometers"] */ unitOptions?: string[]; /** * A reference to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#view) */ view?: SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [DirectLineMeasurement3DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D.html#viewModel) */ viewModel?: DirectLineMeasurement3DViewModelProperties; @@ -50116,110 +52564,111 @@ declare namespace __esri { interface DirectLineMeasurement3DViewModel extends Accessor { /** * The current measurement calculated between the two points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#measurement) */ readonly measurement: DirectLineMeasurement3DViewModelMeasurement; /** - * The view model's state. - * + * The view model's state. + * * Value | Description * ------------|------------- * disabled | not ready yet * ready | ready for measuring * measuring | currently measuring - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** - * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | inches | feet | yards | miles | nautical-miles | meters | kilometers | us-feet - * + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** metric | imperial | inches | feet | us-feet | yards | miles | nautical-miles | meters | kilometers + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#unit) */ unit: string; /** - * List of unit systems (imperial, metric) and specific units for displaying the distance values. - * + * List of unit systems (imperial, metric) and specific units for displaying the distance values. By default, the following units are included: `metric`, `imperial`, `inches`, `feet`, `us-feet`, `yards`, `miles`, `nautical-miles`, `meters`, `kilometers`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#unitOptions) - * - * @default ["metric", "imperial", "inches", "feet", "yards", "miles", "nautical-miles", "us-feet", "meters", "kilometers"] */ unitOptions: string[]; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#view) */ view: SceneView; /** * Clears the current measurement. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#clearMeasurement) - * - * + * + * */ clearMeasurement(): void; + /** + * Starts a new measurement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#newMeasurement) + * + * + */ + newMeasurement(): void; } interface DirectLineMeasurement3DViewModelConstructor { - - - new(properties?: DirectLineMeasurement3DViewModelProperties): DirectLineMeasurement3DViewModel; + new (properties?: DirectLineMeasurement3DViewModelProperties): DirectLineMeasurement3DViewModel; } export const DirectLineMeasurement3DViewModel: DirectLineMeasurement3DViewModelConstructor; interface DirectLineMeasurement3DViewModelProperties { /** - * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** imperial | metric | inches | feet | yards | miles | nautical-miles | meters | kilometers | us-feet - * + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** metric | imperial | inches | feet | us-feet | yards | miles | nautical-miles | meters | kilometers + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#unit) */ unit?: string; /** - * List of unit systems (imperial, metric) and specific units for displaying the distance values. - * + * List of unit systems (imperial, metric) and specific units for displaying the distance values. By default, the following units are included: `metric`, `imperial`, `inches`, `feet`, `us-feet`, `yards`, `miles`, `nautical-miles`, `meters`, `kilometers`. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#unitOptions) - * - * @default ["metric", "imperial", "inches", "feet", "yards", "miles", "nautical-miles", "us-feet", "meters", "kilometers"] */ unitOptions?: string[]; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#view) */ view?: SceneViewProperties; } - export interface DirectLineMeasurement3DViewModelMeasurement extends Object { /** * Describes the mode in which the measurement was taken. In `euclidean` mode, the distances are measured as straight lines in the [ECEF](https://en.wikipedia.org/wiki/ECEF) coordinate system. In `geodesic` mode, the distances are measured as geodesic lines on the WGS84 ellipsoid. **Possible Values:** euclidean | geodesic - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#measurement) */ measurementMode: string; /** * The direct distance between the two points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#measurement) */ directDistance: DirectLineMeasurement3DViewModelMeasurementValue; /** * The horizontal distance between the two points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#measurement) */ horizontalDistance: DirectLineMeasurement3DViewModelMeasurementValue; /** * The vertical distance between the two points. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#measurement) */ verticalDistance: DirectLineMeasurement3DViewModelMeasurementValue; @@ -50227,159 +52676,382 @@ declare namespace __esri { /** * Measurement value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#MeasurementValue) */ export interface DirectLineMeasurement3DViewModelMeasurementValue extends Object { /** * Textual representation of the measured value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#MeasurementValue) */ text: string; /** - * State of the measured value. - * + * State of the measured value. + * * Value | Description * ------------|------------- * available | measured value is available * unavailable | measured value is not available due an incomplete measurement or because the value is not available for the given measurement configuration (e.g. direct distance is unavailable in `geodesic` mode) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DirectLineMeasurement3D-DirectLineMeasurement3DViewModel.html#MeasurementValue) */ state: string; } + interface DistanceMeasurement2D extends Widget { + /** + * The widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#iconClass) + */ + readonly iconClass: string; + /** + * The widget's default label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#label) + */ + readonly label: string; + /** + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** metric | imperial | inches | feet | us-feet | yards | miles | nautical-miles | meters | kilometers + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#unit) + */ + unit: + | "metric" + | "imperial" + | "inches" + | "feet" + | "us-feet" + | "yards" + | "miles" + | "nautical-miles" + | "meters" + | "kilometers"; + /** + * List of available units and unit systems (imperial, metric) for displaying the distance values. By default, the following units are included: `metric`, `imperial`, `inches`, `feet`, `us-feet`, `yards`, `miles`, `nautical-miles`, `meters`, `kilometers`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#unitOptions) + */ + unitOptions: string[]; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#view) + */ + view: MapView; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [DistanceMeasurement2DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#viewModel) + */ + viewModel: DistanceMeasurement2DViewModel; + + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#render) + * + * + */ + render(): any; + } + + interface DistanceMeasurement2DConstructor { + /** + * The DistanceMeasurement2D widget calculates and displays the distance between two or more points in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). When the distance is less than 100 km, the default [mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#mode) is `planar`. When the distance is greater than or equal to 100 km, the default [mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#mode) is `geodesic`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html) + */ + + new (properties?: DistanceMeasurement2DProperties): DistanceMeasurement2D; + } + + export const DistanceMeasurement2D: DistanceMeasurement2DConstructor; + + interface DistanceMeasurement2DProperties extends WidgetProperties { + /** + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** metric | imperial | inches | feet | us-feet | yards | miles | nautical-miles | meters | kilometers + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#unit) + */ + unit?: + | "metric" + | "imperial" + | "inches" + | "feet" + | "us-feet" + | "yards" + | "miles" + | "nautical-miles" + | "meters" + | "kilometers"; + /** + * List of available units and unit systems (imperial, metric) for displaying the distance values. By default, the following units are included: `metric`, `imperial`, `inches`, `feet`, `us-feet`, `yards`, `miles`, `nautical-miles`, `meters`, `kilometers`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#unitOptions) + */ + unitOptions?: string[]; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#view) + */ + view?: MapViewProperties; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [DistanceMeasurement2DViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#viewModel) + */ + viewModel?: DistanceMeasurement2DViewModel; + } + + interface DistanceMeasurement2DViewModel { + /** + * The threshold distance used by the "auto" mode to switch between planar and geodesic linear computations. The threshold is measured in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#geodesicDistanceThreshold) + * + * @default 100000 + */ + geodesicDistanceThreshold: number; + /** + * The length and geometry of the measurement polyline in meters. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#measurement) + */ + readonly measurement: DistanceMeasurement2DViewModelMeasurement; + /** + * This property returns the locale specific representation of the length. Lengths are rounded to two decimal places. Lengths are sourced from the [measurement](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#measurement) property (in meters) and converted to the user defined units or system and mode. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#measurementLabel) + */ + readonly measurementLabel: string; + /** + * The mode used to calculate the length of lines. **Possible Values:** auto | planar | geodesic + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#mode) + * + * @default auto + */ + mode: "auto" | "planar" | "geodesic"; + /** + * An array of valid mode values. By default, the following units are included: `auto`, `planar`, `geodesic`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#modes) + */ + readonly modes: string[]; + /** + * The view model's state. **Possible Values:** disabled | ready | measuring + * + * Value | Description + * ------------|------------- + * disabled | not ready yet + * ready | ready for measuring + * measuring | measuring has started + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + /** + * Unit system (imperial, metric) or specific unit used for displaying the distance values. **Possible Values:** metric | imperial | inches | feet | us-feet | yards | miles | nautical-miles | meters | kilometers + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#unit) + */ + unit: + | "metric" + | "imperial" + | "inches" + | "feet" + | "us-feet" + | "yards" + | "miles" + | "nautical-miles" + | "meters" + | "kilometers"; + /** + * List of available units and unit systems (imperial, metric) for displaying the distance values. By default, the following units are included: `metric`, `imperial`, `inches`, `feet`, `us-feet`, `yards`, `miles`, `nautical-miles`, `meters`, `kilometers`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#unitOptions) + */ + unitOptions: string[]; + /** + * The view from which the widget will operate. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#view) + */ + view: MapView; + + /** + * Clears the current measurement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#clearMeasurement) + * + * + */ + clearMeasurement(): void; + /** + * Starts a new measurement. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#newMeasurement) + * + * + */ + newMeasurement(): void; + } + + interface DistanceMeasurement2DViewModelConstructor { + new (properties?: any): DistanceMeasurement2DViewModel; + } + + export const DistanceMeasurement2DViewModel: DistanceMeasurement2DViewModelConstructor; + + export interface DistanceMeasurement2DViewModelMeasurement extends Object { + /** + * Line length (m). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#measurement) + */ + length: number; + /** + * Measurement line. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D-DistanceMeasurement2DViewModel.html#measurement) + */ + geometry: any; + } + interface Expand extends Widget { /** * Automatically collapses the expand widget instance when the view's viewpoint updates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#autoCollapse) - * + * * @default false */ autoCollapse: boolean; /** * Icon font used to style the Expand button. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapseIconClass) */ collapseIconClass: string; /** * Tooltip to display to indicate Expand widget can be collapsed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapseTooltip) - * + * * @default "Collapse" (English locale) */ collapseTooltip: string; /** * The content to display within the expanded Expand widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#content) */ content: Node | string | Widget; /** * Indicates whether the widget is currently expanded or not. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expanded) - * + * * @default false */ expanded: boolean; /** * Icon font used to style the Expand button. Will automatically use the [content's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#content) iconClass if it has one. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandIconClass) */ expandIconClass: string; /** * Tooltip to display to indicate Expand widget can be expanded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandTooltip) - * + * * @default "Expand" (English locale) */ expandTooltip: string; /** * This value associates two or more Expand widget instances with each other, allowing one instance to auto collapse when another instance in the same group is expanded. For auto collapsing to take effect, all instances of the group must be included in the [view.ui](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ui). For example, if you place multiple Expand instances in the top-left of the view's ui, you can assign them to a group called `top-left`. If one Expand instance is expanded and the user clicks on a different instance in the `top-left` group, then the first instance is collapsed, allowing the content of the second instance to be fully visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#group) */ group: string; /** * A number to display at the corner of the widget to indicate the number of, for example, open issues or unread notices. ![expand widget icon number](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/expand-with-iconnumber.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#iconNumber) */ iconNumber: number; /** - * The mode in which the widget displays. These modes are listed below. - * + * The mode in which the widget displays. These modes are listed below. + * * mode | description * ---------------|------------ * auto | This is the default mode. It is responsive to browser size changes and will update based on whether the widget is viewed in a desktop or mobile application. * floating | Use this mode if you wish to always display the widget as floating regardless of browser size. * drawer | Use this mode if you wish to always display the widget in a panel regardless of browser size. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#mode) - * + * * @default "auto" */ mode: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#view) */ view: MapView | SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [ExpandViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#viewModel) */ viewModel: ExpandViewModel; /** * Collapse the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapse) - * - * + * + * */ collapse(): void; /** * Expand the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expand) - * - * + * + * */ expand(): void; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#render) - * - * + * + * */ render(): any; /** * Toggle the widget by expanding it if it's collapsed, or collapsing it if it's expanded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#toggle) - * - * + * + * */ toggle(): void; } interface ExpandConstructor { - - - new(properties?: ExpandProperties): Expand; + new (properties?: ExpandProperties): Expand; } export const Expand: ExpandConstructor; @@ -50387,90 +53059,90 @@ declare namespace __esri { interface ExpandProperties extends WidgetProperties { /** * Automatically collapses the expand widget instance when the view's viewpoint updates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#autoCollapse) - * + * * @default false */ autoCollapse?: boolean; /** * Icon font used to style the Expand button. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapseIconClass) */ collapseIconClass?: string; /** * Tooltip to display to indicate Expand widget can be collapsed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#collapseTooltip) - * + * * @default "Collapse" (English locale) */ collapseTooltip?: string; /** * The content to display within the expanded Expand widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#content) */ content?: Node | string | WidgetProperties; /** * Indicates whether the widget is currently expanded or not. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expanded) - * + * * @default false */ expanded?: boolean; /** * Icon font used to style the Expand button. Will automatically use the [content's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#content) iconClass if it has one. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandIconClass) */ expandIconClass?: string; /** * Tooltip to display to indicate Expand widget can be expanded. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#expandTooltip) - * + * * @default "Expand" (English locale) */ expandTooltip?: string; /** * This value associates two or more Expand widget instances with each other, allowing one instance to auto collapse when another instance in the same group is expanded. For auto collapsing to take effect, all instances of the group must be included in the [view.ui](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ui). For example, if you place multiple Expand instances in the top-left of the view's ui, you can assign them to a group called `top-left`. If one Expand instance is expanded and the user clicks on a different instance in the `top-left` group, then the first instance is collapsed, allowing the content of the second instance to be fully visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#group) */ group?: string; /** * A number to display at the corner of the widget to indicate the number of, for example, open issues or unread notices. ![expand widget icon number](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/expand-with-iconnumber.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#iconNumber) */ iconNumber?: number; /** - * The mode in which the widget displays. These modes are listed below. - * + * The mode in which the widget displays. These modes are listed below. + * * mode | description * ---------------|------------ * auto | This is the default mode. It is responsive to browser size changes and will update based on whether the widget is viewed in a desktop or mobile application. * floating | Use this mode if you wish to always display the widget as floating regardless of browser size. * drawer | Use this mode if you wish to always display the widget in a panel regardless of browser size. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#mode) - * + * * @default "auto" */ mode?: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [ExpandViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#viewModel) */ viewModel?: ExpandViewModelProperties; @@ -50479,46 +53151,44 @@ declare namespace __esri { interface ExpandViewModel extends Accessor { /** * Automatically collapses the expand widget instance when the view's viewpoint updates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#autoCollapse) - * + * * @default false */ autoCollapse: boolean; /** * Whether the widget is currently expanded or not. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#expanded) - * + * * @default false */ readonly expanded: boolean; /** * This value associates two or more Expand widget instances with each other, allowing one instance to auto collapse when another instance in the same group is expanded. For auto collapsing to take effect, all instances of the group must be included in the [view.ui](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ui). For example, if you place multiple Expand instances in the top-left of the view's ui, you can assign them to a group called `top-left`. If one Expand instance is expanded and the user clicks on a different instance in the `top-left` group, then the first instance is collapsed, allowing the content of the second instance to be fully visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#group) */ group: string; /** * The view model's state. **Possible Values:** ready | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view in which the Expand is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#view) */ view: MapView | SceneView; } interface ExpandViewModelConstructor { - - - new(properties?: ExpandViewModelProperties): ExpandViewModel; + new (properties?: ExpandViewModelProperties): ExpandViewModel; } export const ExpandViewModel: ExpandViewModelConstructor; @@ -50526,21 +53196,21 @@ declare namespace __esri { interface ExpandViewModelProperties { /** * Automatically collapses the expand widget instance when the view's viewpoint updates. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#autoCollapse) - * + * * @default false */ autoCollapse?: boolean; /** * This value associates two or more Expand widget instances with each other, allowing one instance to auto collapse when another instance in the same group is expanded. For auto collapsing to take effect, all instances of the group must be included in the [view.ui](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#ui). For example, if you place multiple Expand instances in the top-left of the view's ui, you can assign them to a group called `top-left`. If one Expand instance is expanded and the user clicks on a different instance in the `top-left` group, then the first instance is collapsed, allowing the content of the second instance to be fully visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#group) */ group?: string; /** * The view in which the Expand is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand-ExpandViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -50549,77 +53219,75 @@ declare namespace __esri { interface Feature extends Widget { /** * The [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) used to represent the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#graphic) - * + * * @default null */ graphic: Graphic; /** * The title for the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#title) - * + * * @default null */ readonly title: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#view) - * + * * @default null */ view: MapView | SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [FeatureViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#viewModel) */ viewModel: FeatureViewModel; /** * Paginates to a specified [media](esri-PopupTemplate.html#media) info object. For example, you may have [media](esri-PopupTemplate.html#media) content which contains multiple `mediaInfos`. This method allows you to specify the index of the `mediaInfos` you wish to display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#goToMedia) - * + * * @param contentElementIndex The index position of the [media](esri-PopupTemplate.html#media) content element to be updated. * @param mediaInfoIndex The index position of the [media](esri-PopupTemplate.html#media) info object you wish to display. - * + * */ goToMedia(contentElementIndex: number, mediaInfoIndex: number): void; /** * Paginates to the next [media](esri-PopupTemplate.html#media) info. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#nextMedia) - * + * * @param contentElementIndex The index position of the [media](esri-PopupTemplate.html#media) content element. - * + * */ nextMedia(contentElementIndex: number): void; /** * Paginates to the previous [media](esri-PopupTemplate.html#media) info in the specified [media](esri-PopupTemplate.html#media) content element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#previousMedia) - * + * * @param contentElementIndex The index position of the [media](esri-PopupTemplate.html#media) content element. - * + * */ previousMedia(contentElementIndex: number): void; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#render) - * - * + * + * */ render(): any; } interface FeatureConstructor { - - - new(properties?: FeatureProperties): Feature; + new (properties?: FeatureProperties): Feature; } export const Feature: FeatureConstructor; @@ -50627,23 +53295,23 @@ declare namespace __esri { interface FeatureProperties extends WidgetProperties { /** * The [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) used to represent the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#graphic) - * + * * @default null */ graphic?: GraphicProperties; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#view) - * + * * @default null */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [FeatureViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature.html#viewModel) */ viewModel?: FeatureViewModelProperties; @@ -50652,9 +53320,9 @@ declare namespace __esri { interface FeatureViewModel extends Accessor { /** * The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) of the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#content) - * + * * @default null */ readonly content: string | any[] | HTMLElement | Widget; @@ -50662,50 +53330,48 @@ declare namespace __esri { * The formatted attributes calculated from `fieldInfo` [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) content. They are obtained from the feature's [graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#graphic) attribute values and can be read: * * globally using the [fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property directly at the root level of the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), or * * per an individual content element. This element is defined with a type of fields on the PopupTemplate's content property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#formattedAttributes) - * + * * @default null */ readonly formattedAttributes: FeatureViewModelFormattedAttributes; /** * The [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) used to represent the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#graphic) - * + * * @default null */ graphic: Graphic; /** * The title for the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#title) - * + * * @default null */ readonly title: string; /** * The view associated with the Feature instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#view) - * + * * @default null */ view: MapView | SceneView; /** * Indicates whether the feature is currently waiting for all of its content to finish loading. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#waitingForContent) - * + * * @default true */ readonly waitingForContent: boolean; } interface FeatureViewModelConstructor { - - - new(properties?: FeatureViewModelProperties): FeatureViewModel; + new (properties?: FeatureViewModelProperties): FeatureViewModel; } export const FeatureViewModel: FeatureViewModelConstructor; @@ -50713,33 +53379,32 @@ declare namespace __esri { interface FeatureViewModelProperties { /** * The [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) used to represent the feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#graphic) - * + * * @default null */ graphic?: GraphicProperties; /** * The view associated with the Feature instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#view) - * + * * @default null */ view?: MapViewProperties | SceneViewProperties; } - export interface FeatureViewModelFormattedAttributes extends Object { /** * The formatted attributes specified at the root level of the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) using the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#fieldInfos) property. - * + * * [Read more...](global.html) */ global?: any; /** * The formatted attributes for an individual content element. This is derived from the module:esri/PopupTemplate#fields content property of the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) defined as type `fields`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Feature-FeatureViewModel.html#formattedAttributes) */ content?: any; @@ -50748,64 +53413,78 @@ declare namespace __esri { interface FeatureForm extends Widget { /** * The associated feature containing the editable attributes. A common way to access this is via the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) or [SceneView's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) `hitTest()` method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#feature) */ feature: Graphic; /** - * Array of field configuration objects. This is where you specify what fields to display and how you wish to display them. + * Array of individual or grouped field configuration objects. This is where you specify what fields to display and how you wish to display them. It is possible to configure individual or [grouped fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html). For an example of individual field configurations, please refer to the [Update FeatureLayer using ApplyEdits](https://developers.arcgis.com/javascript/latest/sample-code/editing-applyedits/index.html) sample. For an example of grouped field configurations, please refer to the [Update Feature Attributes](https://developers.arcgis.com/javascript/latest/sample-code/editing-groupedfeatureform/index.html) sample. * > When not set, all fields except for `editor`, `globalID`, and `objectID` fields will be included, otherwise it is up to the developer to set the right field(s) to override and display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#fieldConfig) */ - fieldConfig: FieldConfig[]; + fieldConfig: FieldConfig[] | FieldGroupConfig[]; + /** + * Defines how groups will be displayed to the user. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * all | All groups will be expanded. + * sequential | A single group will be expanded at a time. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#groupDisplay) + * + * @default all + */ + groupDisplay: string; /** * Layer containing the editable feature attributes. If this layer is not specified, it is the same as the [graphic's layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#layer) */ layer: FeatureLayer; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [FeatureFormViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#viewModel) */ viewModel: FeatureFormViewModel; /** * Returns all of the field values, regardless of whether or not they were updated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#getValues) - * - * + * + * */ getValues(): any; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#render) - * - * + * + * */ render(): any; /** * Fires the [submit](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#event:submit) event. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#submit) - * - * + * + * */ submit(): void; } interface FeatureFormConstructor { /** - * The FeatureForm widget displays attributes of a feature. This widget renders input fields based on the feature's attributes and whether the field allows editing. Use this widget, in combination with [FeatureLayer.applyEdits](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits), to enable an end user to update a feature's attribute on a specified editable feature layer(s). - * + * The FeatureForm widget displays attributes of a feature. This widget renders input fields based on the feature's attributes and whether the field allows editing. You can configure field groupings to aid in display and organization of form data. Use this widget, in combination with [FeatureLayer.applyEdits](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits), to enable an end user to update a feature's attribute on a specified editable feature layer(s). + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) */ - new(properties?: FeatureFormProperties): FeatureForm; + new (properties?: FeatureFormProperties): FeatureForm; } export const FeatureForm: FeatureFormConstructor; @@ -50813,26 +53492,40 @@ declare namespace __esri { interface FeatureFormProperties extends WidgetProperties { /** * The associated feature containing the editable attributes. A common way to access this is via the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) or [SceneView's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) `hitTest()` method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#feature) */ feature?: GraphicProperties; /** - * Array of field configuration objects. This is where you specify what fields to display and how you wish to display them. + * Array of individual or grouped field configuration objects. This is where you specify what fields to display and how you wish to display them. It is possible to configure individual or [grouped fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html). For an example of individual field configurations, please refer to the [Update FeatureLayer using ApplyEdits](https://developers.arcgis.com/javascript/latest/sample-code/editing-applyedits/index.html) sample. For an example of grouped field configurations, please refer to the [Update Feature Attributes](https://developers.arcgis.com/javascript/latest/sample-code/editing-groupedfeatureform/index.html) sample. * > When not set, all fields except for `editor`, `globalID`, and `objectID` fields will be included, otherwise it is up to the developer to set the right field(s) to override and display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#fieldConfig) */ - fieldConfig?: FieldConfigProperties[]; + fieldConfig?: FieldConfigProperties[] | FieldGroupConfigProperties[]; + /** + * Defines how groups will be displayed to the user. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * all | All groups will be expanded. + * sequential | A single group will be expanded at a time. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#groupDisplay) + * + * @default all + */ + groupDisplay?: string; /** * Layer containing the editable feature attributes. If this layer is not specified, it is the same as the [graphic's layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#layer) */ layer?: FeatureLayerProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [FeatureFormViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html#viewModel) */ viewModel?: FeatureFormViewModelProperties; @@ -50841,58 +53534,67 @@ declare namespace __esri { interface FeatureFormViewModel extends Accessor, Evented { /** * The associated feature containing the editable attributes. A common way to access this is via the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) or [SceneView's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) `hitTest()` method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#feature) */ feature: Graphic; /** - * Array of field configuration objects. This is where you specify what fields to display and how you wish to display them. + * Array of individual or grouped field configuration objects. This is where you specify what fields to display and how you wish to display them. It is possible to configure individual or [grouped fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html). For an example of individual field configurations, please refer to the [Update FeatureLayer using ApplyEdits](https://developers.arcgis.com/javascript/latest/sample-code/editing-applyedits/index.html) sample. For an example of grouped field configurations, please refer to the [Update Feature Attributes](https://developers.arcgis.com/javascript/latest/sample-code/editing-groupedfeatureform/index.html) sample. * > When not set, all fields except for `editor`, `globalID`, and `objectID` fields will be included, otherwise it is up to the developer to set the right field(s) to override and display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#fieldConfig) */ - fieldConfig: FieldConfig[]; + fieldConfig: FieldConfig[] | FieldGroupConfig[]; /** - * The input fields to be rendered by the [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) widget. - * + * The input fields and/or grouped field rendered by the [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) widget. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#inputField) */ - readonly inputField: InputField[]; + readonly inputField: InputField[] | InputFieldGroup[]; /** * Layer containing the editable feature attributes. If this layer is not specified, it is the same as the [graphic's layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#layer) */ layer: FeatureLayer; /** - * The widget's state. Possible values are in the table below. - * + * The widget's state. Possible values are in the table below. + * * Value | Description * ------|------------ * ready | Dependencies are met and has valid property values. * disabled | Dependencies are missing and cannot provide valid inputs. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#state) - * + * * @default disabled */ readonly state: string; + /** + * Convenience method to find input fields. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#findField) + * + * @param fieldName The input field to find. + * + */ + findField(fieldName: string): InputField; /** * Returns all of the field values, regardless of whether or not they were updated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#getValues) - * - * + * + * */ getValues(): any; /** * Fires the [submit](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#event:submit) event. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#submit) - * - * + * + * */ submit(): void; } @@ -50900,11 +53602,11 @@ declare namespace __esri { interface FeatureFormViewModelConstructor { /** * Provides the logic for the [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html) */ - new(properties?: FeatureFormViewModelProperties): FeatureFormViewModel; + new (properties?: FeatureFormViewModelProperties): FeatureFormViewModel; } export const FeatureFormViewModel: FeatureFormViewModelConstructor; @@ -50912,372 +53614,735 @@ declare namespace __esri { interface FeatureFormViewModelProperties { /** * The associated feature containing the editable attributes. A common way to access this is via the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) or [SceneView's](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) `hitTest()` method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#feature) */ feature?: GraphicProperties; /** - * Array of field configuration objects. This is where you specify what fields to display and how you wish to display them. + * Array of individual or grouped field configuration objects. This is where you specify what fields to display and how you wish to display them. It is possible to configure individual or [grouped fields](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html). For an example of individual field configurations, please refer to the [Update FeatureLayer using ApplyEdits](https://developers.arcgis.com/javascript/latest/sample-code/editing-applyedits/index.html) sample. For an example of grouped field configurations, please refer to the [Update Feature Attributes](https://developers.arcgis.com/javascript/latest/sample-code/editing-groupedfeatureform/index.html) sample. * > When not set, all fields except for `editor`, `globalID`, and `objectID` fields will be included, otherwise it is up to the developer to set the right field(s) to override and display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#fieldConfig) */ - fieldConfig?: FieldConfigProperties[]; + fieldConfig?: FieldConfigProperties[] | FieldGroupConfigProperties[]; /** * Layer containing the editable feature attributes. If this layer is not specified, it is the same as the [graphic's layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#layer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html#layer) */ layer?: FeatureLayerProperties; } interface FieldConfig extends Accessor { + /** + * The field's description. The description is shown below the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#description) + */ + description: string; + /** + * The field's domain. This is used to constrain the allowable values of the layer. + * > This only applies to relevant field types. For example, [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html) only applies to `numeric` and `date` field types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#domain) + */ + domain: CodedValueDomain | RangeDomain; + /** + * Indicates whether the field can be edited. + * > This does not change the underlying service's field and whether it can be edited. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#editable) + * + * @default true + */ + editable: boolean; + /** + * The type of editor to use for `string` field types. Possible values are in the table below. + * + * Value | Description + * ------|------------ + * text-box | An HTML textbox will be used to capture input. + * text-area | An HTML textarea will be used to capture input. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#editorType) + * + * @default "text-box" + */ + editorType: string; + /** + * This property is rendered as a tooltip in the [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) widget. It displays a hint for the attribute field's value. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#hint) + */ + hint: string; + /** + * The field's label. The label is shown above the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#label) + */ + label: string; + /** + * Restricts the input length. + * > This only applies to `numeric` and `text` field types. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#maxLength) + * + * @default -1 + */ + maxLength: number; /** * The field name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#name) */ name: string; /** - * The field options. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#options) + * Indicates whether the field is required. + * > This cannot change the underlying service's field requirements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#required) + * + * @default false */ - options: FieldOptions; + required: boolean; } interface FieldConfigConstructor { - - - new(properties?: FieldConfigProperties): FieldConfig; + new (properties?: FieldConfigProperties): FieldConfig; } export const FieldConfig: FieldConfigConstructor; interface FieldConfigProperties { - /** - * The field name. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#name) - */ - name?: string; - /** - * The field options. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#options) - */ - options?: FieldOptionsProperties; - } - - interface FieldOptions extends Accessor { /** * The field's description. The description is shown below the field. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#description) - */ - description: string; - /** - * The field's domain. This is used to constrain the allowable values of the layer. - * > This only applies to relevant field types. For example, [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html) only applies to `numeric` and `date` field types. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#domain) - */ - domain: CodedValueDomain | RangeDomain; - /** - * Indicates whether the field is editable. - * > This does not change the underlying service's field and whether it is editable. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#editable) - * - * @default true - */ - editable: boolean; - /** - * The type of editor to use for `string` field types. Possible values are in the table below. - * - * Value | Description - * ------|------------ - * text-box | An HTML textbox will be used to capture input. - * text-area | An HTML textarea will be used to capture input. - * - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#editorType) - * - * @default "text-box" - */ - editorType: string; - /** - * This property is rendered as a tooltip in the [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) widget. It displays a hint for the attribute field's value. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#hint) - */ - hint: string; - /** - * The field's label. The label is shown above the field. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#label) - */ - label: string; - /** - * Restricts the input length. - * > This only applies to `numeric` and `text` field types. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#maxLength) - * - * @default -1 - */ - maxLength: number; - /** - * Indicates whether the field is required. - * > This cannot change the underlying service's field requirements. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#required) - * - * @default false - */ - required: boolean; - /** - * When `true`, the field is displayed. Otherwise, it is hidden. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#visible) - * - * @default true - */ - visible: boolean; - } - - interface FieldOptionsConstructor { - - - new(properties?: FieldOptionsProperties): FieldOptions; - } - - export const FieldOptions: FieldOptionsConstructor; - - interface FieldOptionsProperties { - /** - * The field's description. The description is shown below the field. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#description) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#description) */ description?: string; /** - * The field's domain. This is used to constrain the allowable values of the layer. + * The field's domain. This is used to constrain the allowable values of the layer. * > This only applies to relevant field types. For example, [RangeDomain](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-RangeDomain.html) only applies to `numeric` and `date` field types. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#domain) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#domain) */ domain?: CodedValueDomainProperties | RangeDomainProperties; /** - * Indicates whether the field is editable. - * > This does not change the underlying service's field and whether it is editable. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#editable) - * + * Indicates whether the field can be edited. + * > This does not change the underlying service's field and whether it can be edited. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#editable) + * * @default true */ editable?: boolean; /** - * The type of editor to use for `string` field types. Possible values are in the table below. - * + * The type of editor to use for `string` field types. Possible values are in the table below. + * * Value | Description * ------|------------ * text-box | An HTML textbox will be used to capture input. * text-area | An HTML textarea will be used to capture input. - * - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#editorType) - * + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#editorType) + * * @default "text-box" */ editorType?: string; /** * This property is rendered as a tooltip in the [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) widget. It displays a hint for the attribute field's value. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#hint) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#hint) */ hint?: string; /** * The field's label. The label is shown above the field. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#label) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#label) */ label?: string; /** - * Restricts the input length. + * Restricts the input length. * > This only applies to `numeric` and `text` field types. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#maxLength) - * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#maxLength) + * * @default -1 */ maxLength?: number; /** - * Indicates whether the field is required. - * > This cannot change the underlying service's field requirements. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#required) - * + * The field name. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#name) + */ + name?: string; + /** + * Indicates whether the field is required. + * > This cannot change the underlying service's field requirements. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldConfig.html#required) + * * @default false */ required?: boolean; + } + + interface FieldGroupConfig extends Accessor { /** - * When `true`, the field is displayed. Otherwise, it is hidden. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldOptions.html#visible) - * - * @default true + * The field's description. The description is shown below the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#description) */ - visible?: boolean; + description: string; + /** + * The field configurations belonging to a group. For an example of grouped field configurations, please refer to the [Update Feature Attributes](https://developers.arcgis.com/javascript/latest/sample-code/editing-groupedfeatureform/index.html) sample. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#fieldConfig) + */ + fieldConfig: FieldConfig[]; + /** + * The field's label. The label is shown above the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#label) + */ + label: string; + } + + interface FieldGroupConfigConstructor { + new (properties?: FieldGroupConfigProperties): FieldGroupConfig; + } + + export const FieldGroupConfig: FieldGroupConfigConstructor; + + interface FieldGroupConfigProperties { + /** + * The field's description. The description is shown below the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#description) + */ + description?: string; + /** + * The field configurations belonging to a group. For an example of grouped field configurations, please refer to the [Update Feature Attributes](https://developers.arcgis.com/javascript/latest/sample-code/editing-groupedfeatureform/index.html) sample. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#fieldConfig) + */ + fieldConfig?: FieldConfigProperties[]; + /** + * The field's label. The label is shown above the field. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FieldGroupConfig.html#label) + */ + label?: string; } interface InputField extends Accessor { /** * The field's description. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#description) */ readonly description: string; /** * The input value's domain. This is used to constrain the allowable values of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#domain) */ readonly domain: CodedValueDomain | RangeDomain; /** - * When true, the field is editable. - * + * When true, the field can be edited. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#editable) */ readonly editable: boolean; /** - * The type of editor used when working with `string` fields. Possible values are in the table below. - * + * The type of editor used when working with `string` fields. Possible values are in the table below. + * * Value | Description * ------|------------ * text-box | An HTML textbox used to capture input. * text-area | An HTML textarea used to capture input. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#editorType) - * - * @default "text-box" + * + * @default text-box */ readonly editorType: string; /** * If the input field's value is invalid, this property returns validation error code. Otherwise, it is `null`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#error) */ readonly error: string; /** * A user-friendly formatted error message based on the [validation error code](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#error). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#errorMessage) */ readonly errorMessage: string; + /** + * The group this input field belongs to. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#group) + */ + readonly group: InputFieldGroup; /** * A hint for the field's value. This property is rendered as a tooltip. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#hint) */ readonly hint: string; /** * The field's label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#label) */ readonly label: string; /** * Restricts the input length. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#maxLength) */ readonly maxLength: number; /** * The associated field name. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#name) */ readonly name: string; /** * Indicates whether the field is required. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#required) */ readonly required: boolean; /** - * The type of input field. Possible values are listed below. - * + * The type of input field. Possible values are listed below. + * * Value | Description * ------|------------ * number | Input represents a number. * text | Input represents text. * date | Input represents a date. * unsupported | The field represents an unsupported value. A `blob` field type is an example of this. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#type) */ readonly type: string; /** * When `true`, the input value is invalid. Otherwise, it is valid. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#valid) */ readonly valid: boolean; /** * The input's value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#value) */ readonly value: number | string | any; /** * When `true`, the field is displayed. Otherwise, it is hidden. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputField.html#visible) */ readonly visible: boolean; } interface InputFieldConstructor { - - - new(properties?: InputFieldProperties): InputField; + new (properties?: InputFieldProperties): InputField; } export const InputField: InputFieldConstructor; - interface InputFieldProperties { + interface InputFieldProperties {} + interface InputFieldGroup extends Accessor { + /** + * The group's description. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#description) + */ + description: string; + /** + * The input fields belonging to this group. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#inputFields) + */ + readonly inputFields: InputField[]; + /** + * The group's label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#label) + */ + readonly label: string; + /** + * The group's visibility. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#visible) + */ + readonly visible: boolean; } + interface InputFieldGroupConstructor { + new (properties?: InputFieldGroupProperties): InputFieldGroup; + } + + export const InputFieldGroup: InputFieldGroupConstructor; + + interface InputFieldGroupProperties { + /** + * The group's description. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-InputFieldGroup.html#description) + */ + description?: string; + } + + interface FeatureTemplates extends Widget { + /** + * When `true`, displays the template [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterFunction). ![featureTemplatesFilter](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureTemplatesFilter.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterEnabled) + * + * @default true + */ + filterEnabled: boolean; + /** + * [Function](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#FilterFunction) can be defined to help filter [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html) within the widget. A custom function can be used to aid when searching for templates. It takes a function which passes in an object containing a [name](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#label) property of the [template item](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). ![featureTemplatesFilterFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureTemplatesFilterFunction.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterFunction) + */ + filterFunction: FilterFunction; + /** + * It is possible to group [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). This can aid in managing various template items and how they display within the widget. The values are discussed below. + * + * Type | Description | Example + * ----- | ----------- | ------- + * layer | This is the *default* grouping. Groups template items by layers. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByLayers.png) + * geometry | Groups template items by geometry type. | ![FeatureTemplatesGroupByGeometry](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByGeometry.png) + * none | The widget displays everything in one list with no grouping. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByNone.png) + * [GroupByFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#GroupByFunction) | Custom function that takes an object containing a [FeatureTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). | ![FeatureTemplatesGroupByCustomGroupFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupCustomGroup.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#groupBy) + * + * @default layer + */ + groupBy: string | GroupByFunction; + /** + * An array of [Featurelayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) to display within the widget. The order in which these layers are set in the array dictates how they display within the widget. + * > The widget is designed to only display layers that are enabled for editing. It will not display layers that are enabled to only edit attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#layers) + */ + layers: FeatureLayer[]; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [FeatureTemplatesViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#viewModel) + */ + viewModel: FeatureTemplatesViewModel; + + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#render) + * + * + */ + render(): any; + } + + interface FeatureTemplatesConstructor { + /** + * The FeatureTemplates widget is part of the overall editing workflow. Its main purpose is to display [templates](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#templates) from one or more [feature layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). In addition to displaying feature layer templates, it is also possible to [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterFunction) and [group](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#groupBy) templates for an easier editing experience. The widget listens for an end user to select a specific template in the widget. Its [select](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#event:select) event is fired and the resulting template information is returned. This widget can be used in conjunction with [FeatureLayer.applyEdits](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) to enable an end user to update one of its feature layers. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html) + */ + + new (properties?: FeatureTemplatesProperties): FeatureTemplates; + } + + export const FeatureTemplates: FeatureTemplatesConstructor; + + interface FeatureTemplatesProperties extends WidgetProperties { + /** + * When `true`, displays the template [filter](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterFunction). ![featureTemplatesFilter](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureTemplatesFilter.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterEnabled) + * + * @default true + */ + filterEnabled?: boolean; + /** + * [Function](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#FilterFunction) can be defined to help filter [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html) within the widget. A custom function can be used to aid when searching for templates. It takes a function which passes in an object containing a [name](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#label) property of the [template item](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). ![featureTemplatesFilterFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureTemplatesFilterFunction.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#filterFunction) + */ + filterFunction?: FilterFunction; + /** + * It is possible to group [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). This can aid in managing various template items and how they display within the widget. The values are discussed below. + * + * Type | Description | Example + * ----- | ----------- | ------- + * layer | This is the *default* grouping. Groups template items by layers. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByLayers.png) + * geometry | Groups template items by geometry type. | ![FeatureTemplatesGroupByGeometry](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByGeometry.png) + * none | The widget displays everything in one list with no grouping. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByNone.png) + * [GroupByFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#GroupByFunction) | Custom function that takes an object containing a [FeatureTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). | ![FeatureTemplatesGroupByCustomGroupFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupCustomGroup.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#groupBy) + * + * @default layer + */ + groupBy?: string | GroupByFunction; + /** + * An array of [Featurelayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) to display within the widget. The order in which these layers are set in the array dictates how they display within the widget. + * > The widget is designed to only display layers that are enabled for editing. It will not display layers that are enabled to only edit attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#layers) + */ + layers?: FeatureLayerProperties[]; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [FeatureTemplatesViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#viewModel) + */ + viewModel?: FeatureTemplatesViewModelProperties; + } + + interface FeatureTemplatesViewModel extends Accessor { + /** + * [Function](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#FilterFunction) can be defined to help filter [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html) within the widget. A custom function can be used to aid when searching for templates. It takes a function which passes in an object containing a [name](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#label) property of the [template item](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). ![featureTemplatesFilterFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureTemplatesFilterFunction.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#filterFunction) + */ + filterFunction: FilterFunction; + /** + * It is possible to group [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). This can aid in managing various template items and how they display within the widget. The values are discussed below. + * + * Type | Description | Example + * ----- | ----------- | ------- + * layer | This is the *default* grouping. Groups template items by layers. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByLayers.png) + * geometry | Groups template items by geometry type. | ![FeatureTemplatesGroupByGeometry](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByGeometry.png) + * none | The widget displays everything in one list with no grouping. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByNone.png) + * [GroupByFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#GroupByFunction) | Custom function that takes an object containing a [FeatureTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). | ![FeatureTemplatesGroupByCustomGroupFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupCustomGroup.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#groupBy) + * + * @default layer + */ + groupBy: string | GroupByFunction; + /** + * The template items or grouped template items. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#items) + */ + readonly items: TemplateItem | TemplateItemGroup; + /** + * An array of [Featurelayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) that are associated with the widget. The order in which these layers are set in the array dictates how they display within the widget. + * > The widget is designed to only display layers that are enabled for editing. It will not display layers that are enabled to only edit attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#layers) + */ + layers: FeatureLayer[]; + /** + * The widget's state. Possible values are in the table below. + * + * Value | Description + * ------|------------ + * ready | Dependencies are met and has valid property values. + * loading | Layers are still loading and not ready yet. + * disabled | No layers are available to load. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + + /** + * Use this method to apply a filter on the items. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#refresh) + * + * + */ + refresh(): void; + } + + interface FeatureTemplatesViewModelConstructor { + new (properties?: FeatureTemplatesViewModelProperties): FeatureTemplatesViewModel; + } + + export const FeatureTemplatesViewModel: FeatureTemplatesViewModelConstructor; + + interface FeatureTemplatesViewModelProperties { + /** + * [Function](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#FilterFunction) can be defined to help filter [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html) within the widget. A custom function can be used to aid when searching for templates. It takes a function which passes in an object containing a [name](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#label) property of the [template item](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). ![featureTemplatesFilterFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/featureTemplatesFilterFunction.png) + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#filterFunction) + */ + filterFunction?: FilterFunction; + /** + * It is possible to group [template items](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). This can aid in managing various template items and how they display within the widget. The values are discussed below. + * + * Type | Description | Example + * ----- | ----------- | ------- + * layer | This is the *default* grouping. Groups template items by layers. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByLayers.png) + * geometry | Groups template items by geometry type. | ![FeatureTemplatesGroupByGeometry](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByGeometry.png) + * none | The widget displays everything in one list with no grouping. | ![featureTemplatesGroupByLayer](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupByNone.png) + * [GroupByFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html#GroupByFunction) | Custom function that takes an object containing a [FeatureTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) and [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html). | ![FeatureTemplatesGroupByCustomGroupFunction](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/groupCustomGroup.png) + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#groupBy) + * + * @default layer + */ + groupBy?: string | GroupByFunction; + /** + * An array of [Featurelayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) that are associated with the widget. The order in which these layers are set in the array dictates how they display within the widget. + * > The widget is designed to only display layers that are enabled for editing. It will not display layers that are enabled to only edit attributes. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-FeatureTemplatesViewModel.html#layers) + */ + layers?: FeatureLayerProperties[]; + } + + interface TemplateItem extends Accessor { + /** + * The description that is displayed for the template item. This is similar to the description provided in [FeatureTemplate.description](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#description). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#description) + */ + description: string; + /** + * The label that is displayed for the template item. This is similar to the name provided in [FeatureTemplate.name](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#name). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#label) + */ + label: string; + /** + * The [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) associated with the template item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#layer) + */ + layer: FeatureLayer; + /** + * The associated [FeatureTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) for the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#template) + */ + template: FeatureTemplate; + /** + * An object used to create a thumbnail image that represents a feature type in the feature template. This is similar to [FeatureTemplate.thumbnail](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#thumbnail). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#thumbnail) + */ + readonly thumbnail: HTMLElement; + + /** + * Fetches the thumbnail used to display the template item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#fetchThumbnail) + * + * + */ + fetchThumbnail(): IPromise; + } + + interface TemplateItemConstructor { + new (properties?: TemplateItemProperties): TemplateItem; + } + + export const TemplateItem: TemplateItemConstructor; + + interface TemplateItemProperties { + /** + * The description that is displayed for the template item. This is similar to the description provided in [FeatureTemplate.description](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#description). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#description) + */ + description?: string; + /** + * The label that is displayed for the template item. This is similar to the name provided in [FeatureTemplate.name](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html#name). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#label) + */ + label?: string; + /** + * The [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) associated with the template item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#layer) + */ + layer?: FeatureLayerProperties; + /** + * The associated [FeatureTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureTemplate.html) for the item. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html#template) + */ + template?: FeatureTemplateProperties; + } + + interface TemplateItemGroup extends Accessor { + /** + * An array of [TemplateItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html) grouped to display in the [FeatureTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html) widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItemGroup.html#items) + */ + readonly items: TemplateItem[]; + /** + * The name displayed in the [FeatureTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates.html) widget indicating the grouped [TemplateItems](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItem.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTemplates-TemplateItemGroup.html#label) + */ + readonly label: string; + } + + interface TemplateItemGroupConstructor { + new (properties?: TemplateItemGroupProperties): TemplateItemGroup; + } + + export const TemplateItemGroup: TemplateItemGroupConstructor; + + interface TemplateItemGroupProperties {} + + export type FilterFunction = (filterName: any) => boolean; + + export type GroupByFunction = (grouping: any) => string | any; + interface Fullscreen extends Widget { /** * The [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) to present in fullscreen mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#element) */ element: HTMLElement; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#view) */ view: MapView | SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [FullscreenViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#viewModel) */ viewModel: FullscreenViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#render) - * - * + * + * */ render(): any; } @@ -51285,11 +54350,11 @@ declare namespace __esri { interface FullscreenConstructor { /** * Provides a simple widget to present the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) or a user-defined [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) using the entire screen. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html) */ - new(properties?: FullscreenProperties): Fullscreen; + new (properties?: FullscreenProperties): Fullscreen; } export const Fullscreen: FullscreenConstructor; @@ -51297,19 +54362,19 @@ declare namespace __esri { interface FullscreenProperties extends WidgetProperties { /** * The [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) to present in fullscreen mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#element) */ element?: HTMLElement; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [FullscreenViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen.html#viewModel) */ viewModel?: FullscreenViewModelProperties; @@ -51318,55 +54383,53 @@ declare namespace __esri { interface FullscreenViewModel extends Accessor { /** * The [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) to present in fullscreen mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#element) */ element: HTMLElement; /** * The view model's state. **Possible Values:** active | ready | feature-unsupported | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view associated with the widget instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#view) */ view: MapView | SceneView; /** * Enter fullscreen - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#enter) - * - * + * + * */ enter(): void; /** * Exit fullscreen - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#exit) - * - * + * + * */ exit(): void; /** * Toggle fullscreen - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#toggle) - * - * + * + * */ toggle(): void; } interface FullscreenViewModelConstructor { - - - new(properties?: FullscreenViewModelProperties): FullscreenViewModel; + new (properties?: FullscreenViewModelProperties): FullscreenViewModel; } export const FullscreenViewModel: FullscreenViewModelConstructor; @@ -51374,13 +54437,13 @@ declare namespace __esri { interface FullscreenViewModelProperties { /** * The [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) to present in fullscreen mode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#element) */ element?: HTMLElement; /** * The view associated with the widget instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Fullscreen-FullscreenViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -51389,60 +54452,60 @@ declare namespace __esri { interface Home extends Widget, GoTo { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#label) */ readonly label: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#view) */ view: MapView | SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [HomeViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewModel) */ viewModel: HomeViewModel; /** - * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: + * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: * * If no [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is provided, the value is `null`. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready, but the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is not defined, the initial value of the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is determined when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) became ready. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready and the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is defined by the user, the initial viewpoint value is the user-defined [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewpoint) */ viewpoint: Viewpoint; /** * This function provides the ability to interrupt and cancel the process of navigating the view back to the view's initial extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#cancelGo) - * - * + * + * */ cancelGo(): void; /** * Animates the view to the initial Viewpoint of the view or the value of [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewpoint). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#go) - * - * + * + * */ go(): void; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#render) - * - * + * + * */ render(): any; } @@ -51450,11 +54513,11 @@ declare namespace __esri { interface HomeConstructor { /** * Provides a simple widget that switches the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to its initial [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) or a previously defined [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewpoint). By default this button looks like the following: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html) */ - new(properties?: HomeProperties): Home; + new (properties?: HomeProperties): Home; } export const Home: HomeConstructor; @@ -51462,22 +54525,22 @@ declare namespace __esri { interface HomeProperties extends WidgetProperties, GoToProperties { /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [HomeViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewModel) */ viewModel?: HomeViewModelProperties; /** - * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: + * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: * * If no [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is provided, the value is `null`. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready, but the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is not defined, the initial value of the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is determined when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) became ready. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready and the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is defined by the user, the initial viewpoint value is the user-defined [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home.html#viewpoint) */ viewpoint?: ViewpointProperties; @@ -51486,52 +54549,50 @@ declare namespace __esri { interface HomeViewModel extends Accessor, Evented, GoTo { /** * The current state of the widget. **Possible Values:** disabled | ready | going-home - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view associated with the widget instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#view) */ view: MapView | SceneView; /** - * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: + * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: * * If no [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is provided, the value is `null`. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready, but the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is not defined, the initial value of the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is determined when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) became ready. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready and the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is defined by the user, the initial viewpoint value is the user-defined [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#viewpoint) - * + * * @default null */ viewpoint: Viewpoint; /** * This function provides the ability to interrupt and cancel the process of navigating the view back to the view's initial extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#cancelGo) - * - * + * + * */ cancelGo(): void; /** * Animates the view to the initial [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) of the view or the value of [viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#viewpoint). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#go) - * - * + * + * */ go(): void; } interface HomeViewModelConstructor { - - - new(properties?: HomeViewModelProperties): HomeViewModel; + new (properties?: HomeViewModelProperties): HomeViewModel; } export const HomeViewModel: HomeViewModelConstructor; @@ -51539,18 +54600,18 @@ declare namespace __esri { interface HomeViewModelProperties extends GoToProperties { /** * The view associated with the widget instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; /** - * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: + * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html), or point of view, to zoom to when going home. The initial value is determined a few different ways: * * If no [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is provided, the value is `null`. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready, but the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is not defined, the initial value of the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is determined when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) became ready. * * If the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) is ready and the [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) is defined by the user, the initial viewpoint value is the user-defined [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Home-HomeViewModel.html#viewpoint) - * + * * @default null */ viewpoint?: ViewpointProperties; @@ -51559,73 +54620,71 @@ declare namespace __esri { interface LayerList extends Widget { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#label) */ readonly label: string; /** * Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Each list item can be modified according to its modifiable properties. Actions can be added to list items using the [actionsSections](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) property of the ListItem. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction) */ listItemCreatedFunction: ListItemCreatedHandler; /** * A collection of [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html)s representing operational layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#operationalItems) */ readonly operationalItems: Collection; /** * Option for enabling status indicators, which indicate whether or not each layer is loading resources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#statusIndicatorsVisible) - * + * * @default true */ statusIndicatorsVisible: boolean; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#view) */ view: MapView | SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [LayerListViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#viewModel) */ viewModel: LayerListViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#render) - * - * + * + * */ render(): any; /** * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#event:trigger-action) event and executes the given [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#triggerAction) - * + * * @param action The action to execute. * @param item An item associated with the action. - * + * */ triggerAction(action: ActionButton | ActionToggle, item: ListItem): void; } interface LayerListConstructor { - - - new(properties?: LayerListProperties): LayerList; + new (properties?: LayerListProperties): LayerList; } export const LayerList: LayerListConstructor; @@ -51633,27 +54692,27 @@ declare namespace __esri { interface LayerListProperties extends WidgetProperties { /** * Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Each list item can be modified according to its modifiable properties. Actions can be added to list items using the [actionsSections](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) property of the ListItem. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction) */ listItemCreatedFunction?: ListItemCreatedHandler; /** * Option for enabling status indicators, which indicate whether or not each layer is loading resources. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#statusIndicatorsVisible) - * + * * @default true */ statusIndicatorsVisible?: boolean; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [LayerListViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#viewModel) */ viewModel?: LayerListViewModelProperties; @@ -51662,47 +54721,45 @@ declare namespace __esri { interface LayerListViewModel extends Accessor { /** * Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Each list item can be modified according to its modifiable propeties. Actions can be added to list items using the [actionsSections](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) property of the ListItem. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#listItemCreatedFunction) */ listItemCreatedFunction: Function; /** * A collection of [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html)s representing operational layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#operationalItems) */ readonly operationalItems: Collection; /** * The view model's state. **Possible Values:** loading | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#view) */ view: MapView | SceneView; /** * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#event:trigger-action) event and executes the given [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#triggerAction) - * + * * @param action The action to execute. * @param item An item associated with the action. - * + * */ triggerAction(action: ActionButton | ActionToggle, item: ListItem): void; } interface LayerListViewModelConstructor { - - - new(properties?: LayerListViewModelProperties): LayerListViewModel; + new (properties?: LayerListViewModelProperties): LayerListViewModel; } export const LayerListViewModel: LayerListViewModelConstructor; @@ -51710,13 +54767,13 @@ declare namespace __esri { interface LayerListViewModelProperties { /** * Specifies a function that accesses each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html). Each list item can be modified according to its modifiable propeties. Actions can be added to list items using the [actionsSections](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) property of the ListItem. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#listItemCreatedFunction) */ listItemCreatedFunction?: Function; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-LayerListViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -51725,124 +54782,121 @@ declare namespace __esri { interface ListItem { /** * Whether the actional panel is open in the LayerList. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsOpen) - * + * * @default false */ actionsOpen: boolean; /** * A nested 2-dimensional collection of actions that could be triggered on the item. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#actionsSections) */ actionsSections: Collection>; /** * When a layer contains sublayers, this property is a Collection of ListItem objects belonging to the given layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#children) */ children: Collection; /** * The Error object returned if an error occurred. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#error) */ readonly error: Error; /** * The layer associated with the triggered action. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#layer) - * + * * @default null */ layer: Layer; /** * The [LayerView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) displaying data for the associated [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#layer). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#layerView) */ readonly layerView: LayerView; /** * Whether the layer is open in the LayerList. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#open) - * + * * @default false */ open: boolean; /** * Allows you to display custom content for each ListItem in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. A common scenario for using ListItemPanel is to display a [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget within each list item. The `legend` keyword can be used in the [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#content) property of the panel to display a legend for each layer in the LayerList. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#panel) */ panel: ListItemPanel; /** * The parent of this item - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#parent) - * + * * @default null */ parent: ListItem; /** * The title of the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#title) */ title: string; /** * Value is `true` when the layer is updating; for example, if it is in the process of fetching data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#updating) - * + * * @default false */ readonly updating: boolean; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#view) */ view: MapView | SceneView; /** * Indicates how to manage the visibility of the children layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#visibilityMode) */ readonly visibilityMode: string; /** * Indicates if the ListItem is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#visible) - * + * * @default true */ visible: boolean; /** * Whether the layer is visible at the current scale or not. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#visibleAtCurrentScale) - * + * * @default true */ readonly visibleAtCurrentScale: boolean; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html#clone) - * - * + * + * */ clone(): ListItem; } interface ListItemConstructor { - - - - new(): ListItem; + new (): ListItem; } export const ListItem: ListItemConstructor; @@ -51850,49 +54904,49 @@ declare namespace __esri { interface ListItemPanel { /** * Adds a CSS class used to style a node that represents the panel. Clicking the node will open and close the panel. Typically, an icon font is used for this property. [Esri Icon Fonts](https://developers.arcgis.com/javascript/latest/guide/esri-icon-font/index.html) are automatically made available and can be used to represent this content. To use one of these provided icon fonts, you must prefix the class name with `esri-`. For example, the default icon font is `esri-icon-layer-list`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#className) - * + * * @default esri-icon-layer-list */ className: string; /** * The content displayed in the ListItem panel. This can be raw text, a [Widget](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) instance, an HTML Element, or an array of any of those elements. If the text `legend` is used, then an instance of the [Legend](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) widget is placed in the content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#content) */ content: Widget | HTMLElement | string | any[]; /** * The URL or data URI of an image used to represent the panel. This property will be used as a background image for the node. If neither `image` nor `className` are specified, a default icon ![default icon](https://developers.arcgis.com/javascript/assets/img/guide/whats-new/41/default-action.png) will display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#image) */ image: string; /** * The panel's parent ListItem that represents a layer in the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#listItem) */ listItem: ListItem; /** * Indicates if the panel's content is open and visible to the user. This is different from the [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#visible) property, which is used for toggling the visibility of the icon used to control whether the content is expanded or collapsed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#open) - * + * * @default false */ open: boolean; /** * The title of the panel. By default, this title matches the ListItem's title. Changing this value will not change the title of the ListItem in the LayerList. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#title) */ title: string; /** * Indicates if the node containing the [image](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#image) or [icon font](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#className) is visible to the user. Setting this value to `false` will prevent the user from toggling the visibility of the panel's content. Use [open](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#open) to programmatically set the visibility of the panel's content. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html#visible) - * + * * @default true */ visible: boolean; @@ -51901,12 +54955,11 @@ declare namespace __esri { interface ListItemPanelConstructor { /** * This class allows you to display custom content for each [ListItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItem.html) in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. ListItemPanel objects typically aren't constructed. Rather, they are modified using the [listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction) property in the [LayerList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html) widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList-ListItemPanel.html) */ - - new(): ListItemPanel; + new (): ListItemPanel; } export const ListItemPanel: ListItemPanelConstructor; @@ -51916,43 +54969,43 @@ declare namespace __esri { interface Legend extends Widget { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#label) */ readonly label: string; /** * Specifies a subset of the layers to display in the legend. If this property is not set, all layers in the map will display in the legend. Objects in this array are defined with the properties listed below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos) */ layerInfos: LegendLayerInfos[]; /** * Indicates the style of the legend. The style determines the legend's layout and behavior. You can either specify a string or an object to indicate the style. The known string values are the same values listed in the table within the `type` property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#style) - * + * * @default classic */ style: string | LegendStyle; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#view) */ view: MapView | SceneView; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#render) - * - * + * + * */ render(): any; } @@ -51960,11 +55013,11 @@ declare namespace __esri { interface LegendConstructor { /** * The Legend widget displays labels and symbols for layers in a map. Labels and their corresponding symbols depend on the values set in the [Renderer](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html) of the layer. The legend will only display layers and sublayers that are visible in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html) */ - new(properties?: LegendProperties): Legend; + new (properties?: LegendProperties): Legend; } export const Legend: LegendConstructor; @@ -51972,68 +55025,66 @@ declare namespace __esri { interface LegendProperties extends WidgetProperties { /** * Specifies a subset of the layers to display in the legend. If this property is not set, all layers in the map will display in the legend. Objects in this array are defined with the properties listed below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos) */ layerInfos?: LegendLayerInfos[]; /** * Indicates the style of the legend. The style determines the legend's layout and behavior. You can either specify a string or an object to indicate the style. The known string values are the same values listed in the table within the `type` property. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#style) - * + * * @default classic */ style?: string | LegendStyle; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#view) */ view?: MapViewProperties | SceneViewProperties; } - export interface LegendLayerInfos extends Object { /** * Specifies a title for the layer to display above its symbols and descriptions. If no title is specified the service name is used. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos) */ title?: string; /** * A layer to display in the legend. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos) */ layer: Layer; } - export interface LegendStyle extends Object { /** - * Specifies the style of the legend. There are two possible values listed in the table below: - * + * Specifies the style of the legend. There are two possible values listed in the table below: + * * Value | Description * ------|------------ * classic | The legend has a portrait orientation. The user can scroll vertically when many elements are included in the legend's content. * card | In wide views, the legend has a landscape orientation that allows users to scroll horizontally to view all legend elements. This style can be responsive, making it ideal for mobile web apps. In smaller views, the legend collapses to occupy less space. One element is shown at a time in a card-style layout, which the user can navigate horizontally. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#style) */ type: string; /** - * When a `card` type is specified, you can specify one of the following layout options. - * + * When a `card` type is specified, you can specify one of the following layout options. + * * Value | Description * ------|------------ * auto | This layout is responsive so that in wide views the legend has a `side-by-side` layout, and a `stack` layout in smaller (mobile) views. * side-by-side | The legend has a landscape orientation that allows users to scroll horizontally to view multiple legend cards at a time. * stack | The legend cards are stacked, which conserves space, but restricts the user to seeing only one card at a time. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#style) - * + * * @default stack */ layout?: string; @@ -52042,89 +55093,89 @@ declare namespace __esri { interface Locate extends Widget, GoTo { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#geolocationOptions) - * + * * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } */ geolocationOptions: any; /** * Indicates whether the widget should navigate the view to the position and scale of the geolocated result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#goToLocationEnabled) - * + * * @default true */ goToLocationEnabled: boolean; /** * The graphic used to show the user's location on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#graphic) */ graphic: Graphic; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#iconClass) */ iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#label) */ readonly label: string; /** * Indicates the scale to set on the view when navigating to the position of the geolocated result once a location is returned from the [track](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#event:track) event. If a scale value is not explicitly set, then the view will navigate to a default scale of `2500`. For 2D views the value should be within the [effectiveMinScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) and [effectiveMaxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#scale) - * + * * @default null */ scale: number; /** * Indicates whether the widget will automatically [rotate to user's direction](https://www.w3.org/TR/geolocation-API/#coordinates_interface). Set to `false` to disable this behavior. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#useHeadingEnabled) - * + * * @default true */ useHeadingEnabled: boolean; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#view) */ view: MapView | SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [LocateViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#viewModel) */ viewModel: LocateViewModel; /** * This function provides the ability to interrupt and cancel the process of programmatically obtaining the location of the user's device. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#cancelLocate) - * - * + * + * */ cancelLocate(): void; /** * Animates the view to the user's location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#locate) - * - * + * + * */ locate(): IPromise; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#render) - * - * + * + * */ render(): any; } @@ -52132,11 +55183,11 @@ declare namespace __esri { interface LocateConstructor { /** * Provides a simple widget that animates the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to the user's current location. The view rotates according to the direction where the tracked device is heading towards. By default the widget looks like the following: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html) */ - new(properties?: LocateProperties): Locate; + new (properties?: LocateProperties): Locate; } export const Locate: LocateConstructor; @@ -52144,57 +55195,57 @@ declare namespace __esri { interface LocateProperties extends WidgetProperties, GoToProperties { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#geolocationOptions) - * + * * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } */ geolocationOptions?: any; /** * Indicates whether the widget should navigate the view to the position and scale of the geolocated result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#goToLocationEnabled) - * + * * @default true */ goToLocationEnabled?: boolean; /** * The graphic used to show the user's location on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#graphic) */ graphic?: GraphicProperties; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#iconClass) */ iconClass?: string; /** * Indicates the scale to set on the view when navigating to the position of the geolocated result once a location is returned from the [track](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#event:track) event. If a scale value is not explicitly set, then the view will navigate to a default scale of `2500`. For 2D views the value should be within the [effectiveMinScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) and [effectiveMaxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#scale) - * + * * @default null */ scale?: number; /** * Indicates whether the widget will automatically [rotate to user's direction](https://www.w3.org/TR/geolocation-API/#coordinates_interface). Set to `false` to disable this behavior. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#useHeadingEnabled) - * + * * @default true */ useHeadingEnabled?: boolean; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [LocateViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html#viewModel) */ viewModel?: LocateViewModelProperties; @@ -52203,27 +55254,27 @@ declare namespace __esri { interface LocateViewModel extends Accessor, Evented, GeolocationPositioning, GoTo { /** * The current state of the widget. **Possible Values:** disabled | ready | locating - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * This function provides the ability to interrupt and cancel the process of programmatically obtaining the location of the user's device. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#cancelLocate) - * - * + * + * */ cancelLocate(): void; /** * Animates the view to the user's location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html#locate) - * - * + * + * */ locate(): IPromise; } @@ -52231,73 +55282,71 @@ declare namespace __esri { interface LocateViewModelConstructor { /** * Provides the logic for the [Locate](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate.html) widget, which animates the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to the user's current location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Locate-LocateViewModel.html) */ - new(properties?: LocateViewModelProperties): LocateViewModel; + new (properties?: LocateViewModelProperties): LocateViewModel; } export const LocateViewModel: LocateViewModelConstructor; - interface LocateViewModelProperties extends GeolocationPositioningProperties, GoToProperties { - - } + interface LocateViewModelProperties extends GeolocationPositioningProperties, GoToProperties {} interface NavigationToggle extends Widget { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#label) */ readonly label: string; /** - * Sets the layout of the widget to either `horizontal` or `vertical`. See the table below for a list of possible values. - * + * Sets the layout of the widget to either `horizontal` or `vertical`. See the table below for a list of possible values. + * * Possible Value | Example * ---------------|-------- * vertical | ![navigation-toggle](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/navigation-toggle.png) * horizontal | ![navigation-toggle-horizontal](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/navigation-toggle-horizontal.png) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#layout) - * + * * @default vertical */ layout: string; /** * A reference to the SceneView. Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#view) */ view: SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [NavigationToggleViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#viewModel) */ viewModel: NavigationToggleViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#render) - * - * + * + * */ render(): any; /** * Toggles the navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#view) from `pan` to `rotate` or vice versa. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#toggle) - * - * + * + * */ toggle(): void; } @@ -52305,39 +55354,39 @@ declare namespace __esri { interface NavigationToggleConstructor { /** * Provides two simple buttons for toggling the [navigation mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#navigationMode) of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Note that this widget is designed only for 3D mouse interaction in a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). It has no effect on touch navigation and it should not be used with 2D mouse interaction in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html) */ - new(properties?: NavigationToggleProperties): NavigationToggle; + new (properties?: NavigationToggleProperties): NavigationToggle; } export const NavigationToggle: NavigationToggleConstructor; interface NavigationToggleProperties extends WidgetProperties { /** - * Sets the layout of the widget to either `horizontal` or `vertical`. See the table below for a list of possible values. - * + * Sets the layout of the widget to either `horizontal` or `vertical`. See the table below for a list of possible values. + * * Possible Value | Example * ---------------|-------- * vertical | ![navigation-toggle](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/navigation-toggle.png) * horizontal | ![navigation-toggle-horizontal](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/navigation-toggle-horizontal.png) - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#layout) - * + * * @default vertical */ layout?: string; /** * A reference to the SceneView. Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#view) */ view?: SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [NavigationToggleViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html#viewModel) */ viewModel?: NavigationToggleViewModelProperties; @@ -52345,40 +55394,40 @@ declare namespace __esri { interface NavigationToggleViewModel extends Accessor { /** - * The navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view). See the table below for a list of possible values. - * + * The navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view). See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------- * pan | The mouse drag gesture pans the view. Right-click + drag allows the user to perform a 3D rotate around the center of the view. * rotate | The mouse drag gesture performs a 3D rotate around the center of the view and the right-click + drag gesture pans the view. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#navigationMode) - * + * * @default pan */ navigationMode: string; /** * The state of the widget. **Possible Values:** disabled | ready - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view associated with the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view) */ view: SceneView; /** * Toggles the navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view) from `pan` to `rotate` or vice versa. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#toggle) - * - * + * + * */ toggle(): void; } @@ -52386,33 +55435,33 @@ declare namespace __esri { interface NavigationToggleViewModelConstructor { /** * Provides the logic for the [NavigationToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle.html) widget, which provides two simple buttons for toggling the [navigation mode](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#navigationMode) of a [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Note that this is not designed for 2D mouse interaction in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html), nor for touch navigation. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html) */ - new(properties?: NavigationToggleViewModelProperties): NavigationToggleViewModel; + new (properties?: NavigationToggleViewModelProperties): NavigationToggleViewModel; } export const NavigationToggleViewModel: NavigationToggleViewModelConstructor; interface NavigationToggleViewModelProperties { /** - * The navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view). See the table below for a list of possible values. - * + * The navigation mode of the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view). See the table below for a list of possible values. + * * Possible Value | Description * ---------------|------------- * pan | The mouse drag gesture pans the view. Right-click + drag allows the user to perform a 3D rotate around the center of the view. * rotate | The mouse drag gesture performs a 3D rotate around the center of the view and the right-click + drag gesture pans the view. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#navigationMode) - * + * * @default pan */ navigationMode?: string; /** * The view associated with the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-NavigationToggle-NavigationToggleViewModel.html#view) */ view?: SceneViewProperties; @@ -52421,196 +55470,204 @@ declare namespace __esri { interface Popup extends Widget, GoTo, Evented { /** * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) classes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) */ actions: Collection; /** * Position of the popup in relation to the selected feature. **Possible Values:** auto | top-center | top-right | bottom-left | bottom-center | bottom-right | Function - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#alignment) - * + * * @default "auto" */ alignment: string | Function; /** * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#autoCloseEnabled) - * + * * @default false */ autoCloseEnabled: boolean; + /** + * This property indicates to the `Popup` that it needs to allow or disallow the click event propagation. Use `view.popup.autoOpenEnabled = false;` when needing to stop the click event propagation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#autoOpenEnabled) + * + * @default true + */ + autoOpenEnabled: boolean; /** * Indicates whether the popup displays its content. If `true`, only the header displays. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#collapsed) - * + * * @default false */ collapsed: boolean; /** * Indicates whether to enable collapse functionality for the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#collapseEnabled) - * + * * @default true */ collapseEnabled: boolean; /** * The content of the popup. When set directly on the Popup, this content is static and cannot use fields to set content templates. To set a template for the content based on field or attribute names, see [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) */ content: string | HTMLElement | Widget; /** * Dock position in the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html). **Possible Values:** top-left | top-center | top-right | bottom-left | bottom-center | bottom-right - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#currentDockPosition) */ readonly currentDockPosition: string; /** * Indicates whether the placement of the popup is docked to the side of the view. Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices. When a popup is "dockEnabled" it means the popup no longer points to the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) assigned to it. Rather it is attached to a side, the top, or the bottom of the view. See [dockOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) to override default options related to docking the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockEnabled) - * + * * @default false */ dockEnabled: boolean; /** * Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices. When a popup is "dockEnabled" it means the popup no longer points to the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) assigned to it. Rather it is placed in one of the corners of the view or to the top or bottom of it. This property allows the developer to set various options for docking the popup. See the object specification table below to override default docking properties on the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) */ dockOptions: PopupDockOptions; /** * The number of selected [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) available to the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#featureCount) - * + * * @default 0 */ readonly featureCount: number; /** * Shows pagination for the popup if available. This allows the user to scroll through various [selected features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) using either arrows ![popup-pagination-arrows](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popup-pagination-arrows.png) or a menu. ![popup-feature-menu](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popup-pagination-menu.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#featureNavigationEnabled) */ featureNavigationEnabled: boolean; /** * An array of features associated with the popup. Each graphic in this array must have a valid [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) set. They may share the same [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) or have unique [PopupTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) depending on their attributes. The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) and [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) of the popup is set based on the `content` and `title` properties of each graphic's respective [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). When more than one graphic exists in this array, the current content of the Popup is set based on the value of the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature). This value is `null` if no features are associated with the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) */ features: Graphic[]; /** * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#highlightEnabled) - * + * * @default true */ highlightEnabled: boolean; /** * Point used to position the popup. This is automatically set when viewing the popup by selecting a feature. If using the Popup to display content not related to features in the map, such as the results from a task, then you must set this property before making the popup [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) */ location: Point; /** * An array of pending Promises that have not yet been fulfilled. If there are no pending promises, the value is `null`. When the pending promises are resolved they are removed from this array and the features they return are pushed into the [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#promises) */ promises: IPromise[]; /** * The selected feature accessed by the popup. The content of the Popup is determined based on the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) assigned to this feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) */ readonly selectedFeature: Graphic; /** * Index of the feature that is [selected](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature). When [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) are set, the first index is automatically selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeatureIndex) */ selectedFeatureIndex: number; /** * Indicates whether to display a spinner at the popup location prior to its display when it has pending promises. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#spinnerEnabled) */ spinnerEnabled: boolean; /** * The title of the popup. This can be set generically on the popup no matter the features that are selected. If the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) has a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), then the title set in the corresponding template is used here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) */ title: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#view) */ view: MapView | SceneView; /** * This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [PopupViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#viewModel) */ viewModel: PopupViewModel; /** * Indicates whether the popup is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) */ visible: boolean; /** * Use this method to remove focus from the Widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#blur) - * - * + * + * */ blur(): void; /** * Removes [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#promises), [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features), [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content), [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) and [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) from the Popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#clear) - * - * + * + * */ clear(): void; /** * Closes the popup by setting its [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) property to `false`. Users can alternatively close the popup by directly setting the [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) property to `false`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#close) - * - * + * + * */ close(): void; /** * Use this method to give focus to the Widget if the widget is able to be focused. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#focus) - * - * + * + * */ focus(): void; /** * Selects the feature at the next index in relation to the selected feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#next) - * - * + * + * */ next(): PopupViewModel; /** * Opens the popup at the given location with content defined either explicitly with `content` or driven from the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) of input features. This method sets the popup's [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) property to `true`. Users can alternatively open the popup by directly setting the [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) property to `true`. The popup will only display if the view's size constraints in [dockOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) are met or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) property is set to a geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) - * + * * @param options Defines the location and content of the popup when opened. * @param options.title Sets the [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) of the popup. * @param options.content Sets the the [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) of the popup. @@ -52620,40 +55677,40 @@ declare namespace __esri { * @param options.featureMenuOpen **Since:** 4.5 This property enables multiple features in a popup to display in a list rather than displaying the first selected feature. Setting this to `true` allows the user to scroll through the list of features returned from the query and choose the selection they want to display within the popup. * @param options.updateLocationEnabled When `true` indicates the popup should update its [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) for each paginated feature based on the [selected feature's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) geometry. * @param options.collapsed **Since:** 4.5 When `true`, indicates that only the popup header will display. - * + * */ open(options?: PopupOpenOptions): void; /** * Selects the feature at the previous index in relation to the selected feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#previous) - * - * + * + * */ previous(): PopupViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#render) - * - * + * + * */ render(): any; /** * Positions the popup on the view. Moves the popup into the view's extent if the popup is partially or fully outside the view's extent. If the popup is partially out of view, the view will move to fully show the popup. If the popup is fully out of view, the view will move to the popup's location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#reposition) - * - * + * + * */ reposition(): void; /** * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event and executes the [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) at the specified index in the [actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#triggerAction) - * + * * @param actionIndex The index of the [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) to execute. - * + * */ triggerAction(actionIndex: number): void; } @@ -52661,11 +55718,11 @@ declare namespace __esri { interface PopupConstructor { /** * The popup widget allows users to view content from feature attributes. Popups enhance web applications by providing users with a simple way to interact with and view attributes in a layer. They play an important role in relaying information to the user, which improves the storytelling capabilities of the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) */ - new(properties?: PopupProperties): Popup; + new (properties?: PopupProperties): Popup; } export const Popup: PopupConstructor; @@ -52673,127 +55730,135 @@ declare namespace __esri { interface PopupProperties extends WidgetProperties, GoToProperties { /** * Defines actions that may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the `actions` array or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the array. The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) classes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#actions) */ actions?: CollectionProperties; /** * Position of the popup in relation to the selected feature. **Possible Values:** auto | top-center | top-right | bottom-left | bottom-center | bottom-right | Function - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#alignment) - * + * * @default "auto" */ alignment?: string | Function; /** * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#autoCloseEnabled) - * + * * @default false */ autoCloseEnabled?: boolean; + /** + * This property indicates to the `Popup` that it needs to allow or disallow the click event propagation. Use `view.popup.autoOpenEnabled = false;` when needing to stop the click event propagation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#autoOpenEnabled) + * + * @default true + */ + autoOpenEnabled?: boolean; /** * Indicates whether the popup displays its content. If `true`, only the header displays. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#collapsed) - * + * * @default false */ collapsed?: boolean; /** * Indicates whether to enable collapse functionality for the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#collapseEnabled) - * + * * @default true */ collapseEnabled?: boolean; /** * The content of the popup. When set directly on the Popup, this content is static and cannot use fields to set content templates. To set a template for the content based on field or attribute names, see [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) */ content?: string | HTMLElement | WidgetProperties; /** * Indicates whether the placement of the popup is docked to the side of the view. Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices. When a popup is "dockEnabled" it means the popup no longer points to the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) assigned to it. Rather it is attached to a side, the top, or the bottom of the view. See [dockOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) to override default options related to docking the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockEnabled) - * + * * @default false */ dockEnabled?: boolean; /** * Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices. When a popup is "dockEnabled" it means the popup no longer points to the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) assigned to it. Rather it is placed in one of the corners of the view or to the top or bottom of it. This property allows the developer to set various options for docking the popup. See the object specification table below to override default docking properties on the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) */ dockOptions?: PopupDockOptions; /** * Shows pagination for the popup if available. This allows the user to scroll through various [selected features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) using either arrows ![popup-pagination-arrows](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popup-pagination-arrows.png) or a menu. ![popup-feature-menu](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popup-pagination-menu.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#featureNavigationEnabled) */ featureNavigationEnabled?: boolean; /** * An array of features associated with the popup. Each graphic in this array must have a valid [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) set. They may share the same [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) or have unique [PopupTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) depending on their attributes. The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) and [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) of the popup is set based on the `content` and `title` properties of each graphic's respective [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). When more than one graphic exists in this array, the current content of the Popup is set based on the value of the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature). This value is `null` if no features are associated with the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) */ features?: GraphicProperties[]; /** * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#highlightEnabled) - * + * * @default true */ highlightEnabled?: boolean; /** * Point used to position the popup. This is automatically set when viewing the popup by selecting a feature. If using the Popup to display content not related to features in the map, such as the results from a task, then you must set this property before making the popup [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) */ location?: PointProperties; /** * An array of pending Promises that have not yet been fulfilled. If there are no pending promises, the value is `null`. When the pending promises are resolved they are removed from this array and the features they return are pushed into the [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#promises) */ promises?: IPromise[]; /** * Index of the feature that is [selected](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature). When [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features) are set, the first index is automatically selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeatureIndex) */ selectedFeatureIndex?: number; /** * Indicates whether to display a spinner at the popup location prior to its display when it has pending promises. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#spinnerEnabled) */ spinnerEnabled?: boolean; /** * The title of the popup. This can be set generically on the popup no matter the features that are selected. If the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) has a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), then the title set in the corresponding template is used here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) */ title?: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [PopupViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#viewModel) */ viewModel?: PopupViewModelProperties; /** * Indicates whether the popup is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#visible) */ visible?: boolean; @@ -52802,165 +55867,188 @@ declare namespace __esri { interface PopupViewModel extends Accessor, Evented, GoTo { /** * [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) */ actions: Collection; /** * A collection of [actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggles](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) used within the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#allActions) */ readonly allActions: Collection; /** * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#autoCloseEnabled) - * + * * @default false */ autoCloseEnabled: boolean; + /** + * This property indicates to the `Popup` that it needs to allow or disallow the click event propagation. Use `view.popup.autoOpenEnabled = false;` when needing to stop the click event propagation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#autoOpenEnabled) + * + * @default true + */ + autoOpenEnabled: boolean; /** * The content of the popup. When set directly on the Popup, this content may only be static and cannot use fields to set content templates. To set a template for the content based on field or attribute names, see [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) */ content: string | HTMLElement | Widget; /** * The number of selected [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) available to the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#featureCount) - * + * * @default 0 */ readonly featureCount: number; /** * An array of features associated with the popup. Each graphic in this array must have a valid [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) set. They may share the same [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) or have unique [PopupTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) depending on their attributes. The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) and [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) of the poup is set based on the `content` and `title` properties of each graphic's respective [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). When more than one graphic exists in this array, the current content of the Popup is set based on the value of the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature). This value is `null` if no features are associated with the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) */ features: Graphic[]; /** * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#highlightEnabled) - * + * * @default true */ highlightEnabled: boolean; /** * Geometry used to position the popup. This is automatically set when viewing the popup by selecting a feature. If using the Popup to display content not related to features in the map, such as the results from a task, then you must set this property before making the popup [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) */ location: Point; /** * The number of [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) remaining to be resolved. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#pendingPromisesCount) - * + * * @default 0 */ readonly pendingPromisesCount: number; /** * The number of selected [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) available to the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promiseCount) - * + * * @default 0 */ readonly promiseCount: number; /** * An array of pending Promises that have not yet been fulfilled. If there are no pending Promises, the value is `null`. When the pending Promises are resolved they are removed from this array and the features they return are pushed into the [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) */ promises: IPromise[]; /** * The selected feature accessed by the popup. The content of the Popup is determined based on the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) assigned to this feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature) */ readonly selectedFeature: Graphic; /** * Index of the feature that is [selected](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature). When [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) are set, the first index is automatically selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeatureIndex) */ selectedFeatureIndex: number; /** * The view model's state. **Possible Values:** ready | disabled - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The title of the popup. This can be set generically on the popup no matter the features that are selected. If the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature) has a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), then the title set in the corresponding template is used here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) */ title: string; /** * The view associated with the Popup instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#view) */ view: MapView | SceneView; /** * Indicates whether the popup is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) */ visible: boolean; /** * Removes [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises), [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features), [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content), [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) and [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) from the Popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#clear) - * - * + * + * */ clear(): void; /** * Selects the feature at the next index in relation to the selected feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#next) - * - * + * + * */ next(): PopupViewModel; + /** + * Opens the popup at the given location with content defined either explicitly with `content` or driven from the [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) of input features. This method sets the popup's [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) property to `true`. Users can alternatively open the popup by directly setting the [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) property to `true`. The popup will only display if the view's size constraints in [dockOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#dockOptions) are met or the [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) property is set to a geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + * + * @param options Defines the location and content of the popup when opened. + * @param options.title Sets the [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) of the popup. + * @param options.content Sets the the [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) of the popup. + * @param options.location Sets the popup's [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location), which is the geometry used to position the popup. + * @param options.features Sets the popup's [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features), which populate the title and content of the popup based on each graphic's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). + * @param options.promises Sets pending [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) on the popup. The popup will display once the promises resolve. Each promise must resolve to an array of [Graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). allows the user to scroll through the list of features returned from the query and choose the selection they want to display within the popup. + * @param options.updateLocationEnabled When `true` indicates the popup should update its [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) for each paginated feature based on the [selected feature's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature) geometry. + * @param options.collapsed **Since:** 4.5 When `true`, indicates that only the popup header will display. + * + */ + open(options?: PopupViewModelOpenOptions): void; /** * Selects the feature at the previous index in relation to the selected feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#previous) - * - * + * + * */ previous(): PopupViewModel; /** * Triggers the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event and executes the [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) at the specified index in the [actions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#triggerAction) - * + * * @param actionIndex The index of the [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) to execute. - * + * */ triggerAction(actionIndex: number): void; - on(name: "trigger-action", eventHandler: PopupViewModelTriggerActionEventHandler): IHandle; } interface PopupViewModelConstructor { /** * Provides the logic for the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) widget, which allows users to view content from feature attributes. Popups enhance web applications by providing users with a simple way to interact with and view attributes in a layer. They play an important role in relaying information to the user, which improves the storytelling capabilities of the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html) */ - new(properties?: PopupViewModelProperties): PopupViewModel; + new (properties?: PopupViewModelProperties): PopupViewModel; } export const PopupViewModel: PopupViewModelConstructor; @@ -52968,100 +56056,155 @@ declare namespace __esri { interface PopupViewModelProperties extends GoToProperties { /** * [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of [action](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [action toggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) objects. Each action may be executed by clicking the icon or image symbolizing them in the popup. By default, every popup has a `zoom-to` action styled with a magnifying glass icon ![popupTemplate-zoom-action](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/popuptemplate-zoom-action.png). When this icon is clicked, the view zooms in four LODs and centers on the selected feature. You may override this action by removing it from the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) or by setting the [overwriteActions](esri-PopupTemplate.html#overwriteActions) property to `true` in a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). The order of each action in the popup is the order in which they appear in the actions [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html). The [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event fires each time an action in the popup is clicked. This event should be used to execute custom code for each action clicked. For example, if you would like to add a `zoom-out` action to the popup that zooms the view out several LODs, you would define the zoom-out code in a separate function. Then you would call the custom `zoom-out` function in the [trigger-action](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#event:trigger-action) event handler. See the sample code snippet below for more details on how this works. Actions are defined with the properties listed in the [ActionButton](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html) or [ActionToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionToggle.html) class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#actions) */ actions?: CollectionProperties; /** * This closes the popup when the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) camera or [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) changes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#autoCloseEnabled) - * + * * @default false */ autoCloseEnabled?: boolean; + /** + * This property indicates to the `Popup` that it needs to allow or disallow the click event propagation. Use `view.popup.autoOpenEnabled = false;` when needing to stop the click event propagation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#autoOpenEnabled) + * + * @default true + */ + autoOpenEnabled?: boolean; /** * The content of the popup. When set directly on the Popup, this content may only be static and cannot use fields to set content templates. To set a template for the content based on field or attribute names, see [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html#content). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) */ content?: string | HTMLElement | WidgetProperties; /** * An array of features associated with the popup. Each graphic in this array must have a valid [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) set. They may share the same [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) or have unique [PopupTemplates](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) depending on their attributes. The [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) and [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) of the poup is set based on the `content` and `title` properties of each graphic's respective [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). When more than one graphic exists in this array, the current content of the Popup is set based on the value of the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature). This value is `null` if no features are associated with the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) */ features?: GraphicProperties[]; /** * Highlight the selected popup feature using the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#highlightOptions) set on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or the [highlightOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#highlightOptions) set on the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#highlightEnabled) - * + * * @default true */ highlightEnabled?: boolean; /** * Geometry used to position the popup. This is automatically set when viewing the popup by selecting a feature. If using the Popup to display content not related to features in the map, such as the results from a task, then you must set this property before making the popup [visible](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) to the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) */ location?: PointProperties; /** * An array of pending Promises that have not yet been fulfilled. If there are no pending Promises, the value is `null`. When the pending Promises are resolved they are removed from this array and the features they return are pushed into the [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) array. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) */ promises?: IPromise[]; /** * Index of the feature that is [selected](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature). When [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features) are set, the first index is automatically selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeatureIndex) */ selectedFeatureIndex?: number; /** * The title of the popup. This can be set generically on the popup no matter the features that are selected. If the [selected feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature) has a [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html), then the title set in the corresponding template is used here. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) */ title?: string; /** * The view associated with the Popup instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * Indicates whether the popup is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#visible) */ visible?: boolean; } - export interface PopupViewModelTriggerActionEvent { - - action: ActionButton | ActionToggle; + export interface PopupViewModelOpenOptions extends Object { + /** + * Sets the [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#title) of the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + */ + title?: string; + /** + * Sets the the [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#content) of the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + */ + content?: string; + /** + * Sets the popup's [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location), which is the geometry used to position the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + */ + location?: Geometry; + /** + * Sets the popup's [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#features), which populate the title and content of the popup based on each graphic's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + */ + features?: Graphic[]; + /** + * Sets pending [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#promises) on the popup. The popup will display once the promises resolve. Each promise must resolve to an array of [Graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). allows the user to scroll through the list of features returned from the query and choose the selection they want to display within the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + */ + promises?: IPromise[]; + /** + * When `true` indicates the popup should update its [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#location) for each paginated feature based on the [selected feature's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#selectedFeature) geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + * + * @default false + */ + updateLocationEnabled?: boolean; + /** + * **Since:** 4.5 When `true`, indicates that only the popup header will display. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup-PopupViewModel.html#open) + * + * @default false + */ + collapsed?: boolean; } + export interface PopupViewModelTriggerActionEvent { + action: ActionButton | ActionToggle; + } export interface PopupDockOptions extends Object { /** * Defines the dimensions of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) at which to dock the popup. Set to `false` to disable docking at a breakpoint. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) - * + * * @default true */ breakpoint?: boolean | PopupDockOptionsBreakpoint; /** * If `true`, displays the dock button. If `false`, hides the dock button from the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) */ buttonEnabled?: boolean; /** - * The position in the view at which to dock the popup. Can be set as either a string or function. See the table below for known string values and their position in the view based on the view's size. - * + * The position in the view at which to dock the popup. Can be set as either a string or function. See the table below for known string values and their position in the view based on the view's size. + * * Known Value | View size > breakpoint | View size < breakpoint * --------------- | ------------------------------- | ------------- * auto | top-right | bottom 100% @@ -53071,88 +56214,86 @@ declare namespace __esri { * bottom-left | bottom-left | bottom 100% * bottom-center | bottom-center | bottom 100% * bottom-right | bottom-right | bottom 100% - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) - * + * * @default auto */ position?: string | Function; } - export interface PopupDockOptionsBreakpoint extends Object { /** * The maximum width of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) at which the popup will be set to dockEnabled automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) - * + * * @default 544 */ width?: number; /** * The maximum height of the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) at which the popup will be set to dockEnabled automatically. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#dockOptions) - * + * * @default 544 */ height?: number; } - export interface PopupOpenOptions extends Object { /** * Sets the [title](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#title) of the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) */ title?: string; /** * Sets the the [content](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#content) of the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) */ content?: string | HTMLElement | Widget; /** * Sets the popup's [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location), which is the geometry used to position the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) */ location?: Geometry; /** * Sets the popup's [features](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#features), which populate the title and content of the popup based on each graphic's [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) */ features?: Graphic[]; /** * Sets pending [promises](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#promises) on the popup. The popup will display once the promises resolve. Each promise must resolve to an array of [Graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) */ promises?: IPromise[]; /** * **Since:** 4.5 This property enables multiple features in a popup to display in a list rather than displaying the first selected feature. Setting this to `true` allows the user to scroll through the list of features returned from the query and choose the selection they want to display within the popup. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) - * + * * @default false */ featureMenuOpen?: boolean; /** * When `true` indicates the popup should update its [location](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#location) for each paginated feature based on the [selected feature's](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature) geometry. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) - * + * * @default false */ updateLocationEnabled?: boolean; /** * **Since:** 4.5 When `true`, indicates that only the popup header will display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#open) - * + * * @default false */ collapsed?: boolean; @@ -53161,47 +56302,47 @@ declare namespace __esri { interface Print extends Widget { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#label) */ readonly label: string; /** * The URL of the REST endpoint of the Export Web Map Task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#printServiceUrl) */ printServiceUrl: string; /** * Defines the layout template options used by the [Print](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html) widget to generate the print page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#templateOptions) */ templateOptions: TemplateOptions; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#view) */ view: MapView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [PrintViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#viewModel) */ viewModel: PrintViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#render) - * - * + * + * */ render(): any; } @@ -53209,11 +56350,11 @@ declare namespace __esri { interface PrintConstructor { /** * The Print widget connects your application with a [printing service](https://server.arcgis.com/en/portal/latest/administer/windows/configure-the-portal-to-print-maps.htm) to allow the map to be printed. It takes advantage of server-side, high-quality, full cartographic print functionality using the ExportWebMap service of ArcGIS, which can be configured with custom layout templates. One is provided that shows the map only, while another provides a layout with legend, etc. The Print widget works with the [PrintTask](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-PrintTask.html) which generates a printer-ready version of the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html) */ - new(properties?: PrintProperties): Print; + new (properties?: PrintProperties): Print; } export const Print: PrintConstructor; @@ -53221,25 +56362,25 @@ declare namespace __esri { interface PrintProperties extends WidgetProperties { /** * The URL of the REST endpoint of the Export Web Map Task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#printServiceUrl) */ printServiceUrl?: string; /** * Defines the layout template options used by the [Print](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html) widget to generate the print page. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#templateOptions) */ templateOptions?: TemplateOptionsProperties; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#view) */ view?: MapViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [PrintViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#viewModel) */ viewModel?: PrintViewModelProperties; @@ -53248,40 +56389,38 @@ declare namespace __esri { interface PrintViewModel extends Accessor { /** * The URL of the REST endpoint of the Export Web Map Task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#printServiceUrl) */ printServiceUrl: string; /** * The time interval in milliseconds between each job status request sent to an asynchronous GP task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#updateDelay) - * + * * @default 1000 */ updateDelay: number; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#view) */ view: MapView; /** * Prints (exports) the current MapView according to selected options. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#print) - * + * * @param printTemplate The [PrintTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-PrintTemplate.html) is used to specify the layout template options which is then used by the PrintTask to generate the print page. - * + * */ print(printTemplate: PrintTemplate): IPromise; } interface PrintViewModelConstructor { - - - new(properties?: PrintViewModelProperties): PrintViewModel; + new (properties?: PrintViewModelProperties): PrintViewModel; } export const PrintViewModel: PrintViewModelConstructor; @@ -53289,21 +56428,21 @@ declare namespace __esri { interface PrintViewModelProperties { /** * The URL of the REST endpoint of the Export Web Map Task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#printServiceUrl) */ printServiceUrl?: string; /** * The time interval in milliseconds between each job status request sent to an asynchronous GP task. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#updateDelay) - * + * * @default 1000 */ updateDelay?: number; /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#view) */ view?: MapViewProperties; @@ -53312,57 +56451,57 @@ declare namespace __esri { interface TemplateOptions extends Accessor { /** * When `false`, the attribution is not displayed on the printout. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. Reference our policies on [Licensing & Attribution](https://developers.arcgis.com/javascript/latest/guide/licensing/) for specific attribution requirements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#attributionEnabled) - * + * * @default true */ attributionEnabled: boolean; /** * The text used for the author if the specified layout contains an author text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#author) */ author: string; /** * The text used for the copyright if the specified layout contains an copyright text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#copyright) */ copyright: string; /** * Resolution in dots per inch. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#dpi) - * + * * @default 96 */ dpi: string; /** * When true, the feature's attributes are included in feature collection layers even when they are not needed for rendering. By default they are removed to reduce the request size. Only applicable to custom print services which use the feature attributes, for example to display a table of features and their attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#forceFeatureAttributes) - * + * * @default false */ forceFeatureAttributes: boolean; /** * The output format for the printed map. **Possible Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#format) - * + * * @default pdf */ format: string; /** * Map height. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#height) */ height: number; /** * The layout used for the print output. When the value is `map-only` or is empty, the output map does not contain any page layout surroundings (for example, title, legend, scale bar and so forth). The print service provides out-of-the-box templates listed in possible values. The server administrator can add additional templates to the print service. Possible values are listed below: - * + * * Value | Description * | --- | --- * map-only | Map does not contain any layout elements. Only map image is printed. @@ -53374,47 +56513,45 @@ declare namespace __esri { * letter-ansi-a-portrait | Letter ANSI A Portrait * tabloid-ansi-b-landscape| Tabloid ANSI B Landscape * tabloid-ansi-b-portrait | Tabloid ANSI B Portrait - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) - * + * * @default letter-ansi-a-landscape */ layout: string; /** * When `false`, the legend is not displayed on the printout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#legendEnabled) - * + * * @default true */ legendEnabled: boolean; /** * When `true`, scale is used in the printed map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#scaleEnabled) - * + * * @default false */ scaleEnabled: boolean; /** * The text used for the map title if the specified layout contains a title text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#title) */ title: string; /** * Map width. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#width) */ width: number; } interface TemplateOptionsConstructor { - - - new(properties?: TemplateOptionsProperties): TemplateOptions; + new (properties?: TemplateOptionsProperties): TemplateOptions; } export const TemplateOptions: TemplateOptionsConstructor; @@ -53422,57 +56559,57 @@ declare namespace __esri { interface TemplateOptionsProperties { /** * When `false`, the attribution is not displayed on the printout. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. Reference our policies on [Licensing & Attribution](https://developers.arcgis.com/javascript/latest/guide/licensing/) for specific attribution requirements. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#attributionEnabled) - * + * * @default true */ attributionEnabled?: boolean; /** * The text used for the author if the specified layout contains an author text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#author) */ author?: string; /** * The text used for the copyright if the specified layout contains an copyright text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#copyright) */ copyright?: string; /** * Resolution in dots per inch. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#dpi) - * + * * @default 96 */ dpi?: string; /** * When true, the feature's attributes are included in feature collection layers even when they are not needed for rendering. By default they are removed to reduce the request size. Only applicable to custom print services which use the feature attributes, for example to display a table of features and their attributes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#forceFeatureAttributes) - * + * * @default false */ forceFeatureAttributes?: boolean; /** * The output format for the printed map. **Possible Values:** pdf | png32 | png8 | jpg | gif | eps | svg | svgz - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#format) - * + * * @default pdf */ format?: string; /** * Map height. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#height) */ height?: number; /** * The layout used for the print output. When the value is `map-only` or is empty, the output map does not contain any page layout surroundings (for example, title, legend, scale bar and so forth). The print service provides out-of-the-box templates listed in possible values. The server administrator can add additional templates to the print service. Possible values are listed below: - * + * * Value | Description * | --- | --- * map-only | Map does not contain any layout elements. Only map image is printed. @@ -53484,38 +56621,38 @@ declare namespace __esri { * letter-ansi-a-portrait | Letter ANSI A Portrait * tabloid-ansi-b-landscape| Tabloid ANSI B Landscape * tabloid-ansi-b-portrait | Tabloid ANSI B Portrait - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) - * + * * @default letter-ansi-a-landscape */ layout?: string; /** * When `false`, the legend is not displayed on the printout. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#legendEnabled) - * + * * @default true */ legendEnabled?: boolean; /** * When `true`, scale is used in the printed map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#scaleEnabled) - * + * * @default false */ scaleEnabled?: boolean; /** * The text used for the map title if the specified layout contains a title text element. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#title) */ title?: string; /** * Map width. This only applies when the [layout](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#layout) value is `map-only`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#width) */ width?: number; @@ -53524,37 +56661,37 @@ declare namespace __esri { interface ScaleBar extends Widget { /** * The style for the scale bar. When `unit` is set to `dual`, the style will always be `line`. **Possible Values:** ruler | line - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#style) */ style: string; /** - * Units to use for the scale bar. When using `dual`, the scale bar displays both metric and non-metric units. Metric values shows either kilometers or meters depending on the scale, and similarly non-metric values shows miles and feet depending on the scale. **Possible Values:** non-metric | metric | dual - * + * Units to use for the scale bar. When using `dual`, the scale bar displays both metric and non-metric units. Metric values show either kilometers or meters depending on the scale, and non-metric values show either miles or feet depending on the scale. **Possible Values:** non-metric | metric | dual + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#unit) - * - * @default non-metric (i.e. miles and feet) + * + * @default non-metric */ unit: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#view) */ view: MapView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [ScaleBarViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar-ScaleBarViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#viewModel) */ viewModel: ScaleBarViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#render) - * - * + * + * */ render(): any; } @@ -53562,11 +56699,11 @@ declare namespace __esri { interface ScaleBarConstructor { /** * The ScaleBar widget displays a scale bar on the map or in a specified HTML node. The widget respects various coordinate systems and displays units in metric or non-metric values. Metric values shows either kilometers or meters depending on the scale, and likewise non-metric values shows miles and feet depending on the scale. When working with Web Mercator or geographic coordinate systems the scale bar takes into account projection distortion and dynamically adjusts the scale bar. The ScaleBar sample, which uses a map using the Web Mercator projection, shows this behavior. Open the sample and note that as you pan the map south towards the equator the scale bar gets shorter and as you pan north it gets longer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html) */ - new(properties?: ScaleBarProperties): ScaleBar; + new (properties?: ScaleBarProperties): ScaleBar; } export const ScaleBar: ScaleBarConstructor; @@ -53574,27 +56711,27 @@ declare namespace __esri { interface ScaleBarProperties extends WidgetProperties { /** * The style for the scale bar. When `unit` is set to `dual`, the style will always be `line`. **Possible Values:** ruler | line - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#style) */ style?: string; /** - * Units to use for the scale bar. When using `dual`, the scale bar displays both metric and non-metric units. Metric values shows either kilometers or meters depending on the scale, and similarly non-metric values shows miles and feet depending on the scale. **Possible Values:** non-metric | metric | dual - * + * Units to use for the scale bar. When using `dual`, the scale bar displays both metric and non-metric units. Metric values show either kilometers or meters depending on the scale, and non-metric values show either miles or feet depending on the scale. **Possible Values:** non-metric | metric | dual + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#unit) - * - * @default non-metric (i.e. miles and feet) + * + * @default non-metric */ unit?: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#view) */ view?: MapViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [ScaleBarViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar-ScaleBarViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar.html#viewModel) */ viewModel?: ScaleBarViewModelProperties; @@ -53603,16 +56740,14 @@ declare namespace __esri { interface ScaleBarViewModel extends Accessor { /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar-ScaleBarViewModel.html#view) */ view: MapView; } interface ScaleBarViewModelConstructor { - - - new(properties?: ScaleBarViewModelProperties): ScaleBarViewModel; + new (properties?: ScaleBarViewModelProperties): ScaleBarViewModel; } export const ScaleBarViewModel: ScaleBarViewModelConstructor; @@ -53620,7 +56755,7 @@ declare namespace __esri { interface ScaleBarViewModelProperties { /** * The view from which the widget will operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-ScaleBar-ScaleBarViewModel.html#view) */ view?: MapViewProperties; @@ -53629,238 +56764,239 @@ declare namespace __esri { interface widgetsSearch extends Widget, GoTo { /** * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) object currently selected. Can be either a [FeatureLayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) or a module:esri/widget/Search/LocatorSearchSource. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#activeSource) - * + * * @default null */ readonly activeSource: FeatureLayerSearchSource | LocatorSearchSource; /** * The selected source's index. This value is `-1` when all sources are selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#activeSourceIndex) - * + * * @default 0 */ activeSourceIndex: number; /** * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-allplaceholder.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#allPlaceholder) - * + * * @default "Find address or place" */ allPlaceholder: string; /** * Indicates whether to automatically select and zoom to the first geocoded result. If `false`, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation will still geocode the input string, but the top result will not be selected. To work with the geocoded results, you can set up a [search-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#event:search-complete) event handler and get the results through the event object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#autoSelect) - * + * * @default true */ autoSelect: boolean; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#iconClass) */ readonly iconClass: string; /** * Indicates whether or not to include [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) in the Search UI. This can be a boolean value or a function that returns an array of Search [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#includeDefaultSources) - * + * * @default true */ includeDefaultSources: boolean | Function; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#label) */ readonly label: string; /** - * Enables location services within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-locationEnabled.png) + * Enables location services within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-locationEnabled.png) * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#locationEnabled) - * + * * @default true */ locationEnabled: boolean; /** * The maximum number of results returned by the widget if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#maxResults) - * + * * @default 6 */ maxResults: number; /** * The maximum number of suggestions returned by the widget if not specified by the source. If working with the default [ArcGIS Online Geocoding service](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm), the default remains at `5`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#maxSuggestions) - * + * * @default 6 */ maxSuggestions: number; /** * The minimum number of characters needed for the search if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#minSuggestCharacters) - * + * * @default 1 */ minSuggestCharacters: number; /** * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupEnabled) - * + * * @default true */ popupEnabled: boolean; /** * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupTemplate) - * + * * @default null */ popupTemplate: PopupTemplate; /** * It is possible to search a specified portal instance's [locator services](http://enterprise.arcgis.com/en/portal/latest/administer/windows/configure-portal-to-geocode-addresses.htm) Use this property to set this [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) instance to search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#portal) */ portal: Portal; /** - * The graphic used to highlight the resulting feature or location. + * The graphic used to highlight the resulting feature or location. * A graphic will be placed in the View's [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics) for [layer views](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) that do not support the `highlight` method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphic) */ readonly resultGraphic: Graphic; /** * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphic) will display at the location of the selected feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphicEnabled) - * + * * @default true */ resultGraphicEnabled: boolean; /** * An array of objects, each containing a [SearchResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) from the search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#results) */ readonly results: any[]; /** * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-false](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-false.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#searchAllEnabled) - * + * * @default true */ searchAllEnabled: boolean; /** * The value of the search box input text string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#searchTerm) */ searchTerm: string; /** * The result selected from a search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#selectedResult) */ readonly selectedResult: SearchResult; /** - * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) specified by the Search widget instance. There are two types of sources: + * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) specified by the Search widget instance. There are two types of sources: * * [FeatureLayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) * * [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html) - * - * + * + * * Any combination of these sources may be used together in the same instance of the Search widget. - * + * > Feature layers created from client-side graphics are not supported. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) */ sources: Collection; /** * An array of results from the [suggest method](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest). This is available if working with a 10.3 or greater geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e. `supportsPagination = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggestions) */ readonly suggestions: SuggestResult[]; /** * Enable suggestions for the widget. This is only available if working with a 10.3 or greater geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e. `supportsPagination = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggestionsEnabled) - * + * * @default true */ suggestionsEnabled: boolean; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) */ view: MapView | SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#viewModel) */ viewModel: SearchViewModel; /** * Unfocuses the widget's text input. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#blur) - * - * + * + * */ blur(): void; /** * Clears the current searchTerm, search results, suggest results, graphic, and graphics layer. It also hides any open menus. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#clear) - * - * + * + * */ clear(): void; /** * Brings focus to the widget's text input. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#focus) - * - * + * + * */ focus(): void; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#render) - * - * + * + * */ render(): any; /** * Depending on the sources specified, search() queries the feature layer(s) and/or performs address matching using any specified [Locator(s)](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) and returns any applicable results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#search) - * + * * @param searchTerm This searchTerm can be a string, geometry, suggest candidate object, or an array of [longitude,latitude] coordinate pairs. If a geometry is supplied, then it will reverse geocode (locator) or findAddressCandidates with geometry instead of text. - * + * */ search(searchTerm?: string | Geometry | SuggestResult | number[][]): IPromise; /** * Performs a suggest() request on the active Locator. It also uses the current value of the widget or one that is passed in. Suggestions are available if working with a 10.3 or greater geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e. `supportsPagination = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest) - * + * * @param value The string value used to suggest() on an active Locator or feature layer. If nothing is passed in, takes the current value of the widget. - * + * */ suggest(value?: string): IPromise; } @@ -53868,11 +57004,11 @@ declare namespace __esri { interface widgetsSearchConstructor { /** * The Search widget provides a way to perform search operations on [locator service(s)](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) and/or [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html)/[feature](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) service feature layer(s). If using a locator with a geocoding service, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation is used, whereas [queries](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html) are used on feature layers. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html) */ - new(properties?: widgetsSearchProperties): widgetsSearch; + new (properties?: widgetsSearchProperties): widgetsSearch; } export const widgetsSearch: widgetsSearchConstructor; @@ -53880,141 +57016,142 @@ declare namespace __esri { interface widgetsSearchProperties extends WidgetProperties, GoToProperties { /** * The selected source's index. This value is `-1` when all sources are selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#activeSourceIndex) - * + * * @default 0 */ activeSourceIndex?: number; /** * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-allplaceholder.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#allPlaceholder) - * + * * @default "Find address or place" */ allPlaceholder?: string; /** * Indicates whether to automatically select and zoom to the first geocoded result. If `false`, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation will still geocode the input string, but the top result will not be selected. To work with the geocoded results, you can set up a [search-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#event:search-complete) event handler and get the results through the event object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#autoSelect) - * + * * @default true */ autoSelect?: boolean; /** * Indicates whether or not to include [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) in the Search UI. This can be a boolean value or a function that returns an array of Search [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#includeDefaultSources) - * + * * @default true */ includeDefaultSources?: boolean | Function; /** - * Enables location services within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-locationEnabled.png) + * Enables location services within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-locationEnabled.png) * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#locationEnabled) - * + * * @default true */ locationEnabled?: boolean; /** * The maximum number of results returned by the widget if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#maxResults) - * + * * @default 6 */ maxResults?: number; /** * The maximum number of suggestions returned by the widget if not specified by the source. If working with the default [ArcGIS Online Geocoding service](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm), the default remains at `5`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#maxSuggestions) - * + * * @default 6 */ maxSuggestions?: number; /** * The minimum number of characters needed for the search if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#minSuggestCharacters) - * + * * @default 1 */ minSuggestCharacters?: number; /** * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupEnabled) - * + * * @default true */ popupEnabled?: boolean; /** * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#popupTemplate) - * + * * @default null */ popupTemplate?: PopupTemplateProperties; /** * It is possible to search a specified portal instance's [locator services](http://enterprise.arcgis.com/en/portal/latest/administer/windows/configure-portal-to-geocode-addresses.htm) Use this property to set this [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) instance to search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#portal) */ portal?: PortalProperties; /** * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphic) will display at the location of the selected feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#resultGraphicEnabled) - * + * * @default true */ resultGraphicEnabled?: boolean; /** * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-false](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-false.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#searchAllEnabled) - * + * * @default true */ searchAllEnabled?: boolean; /** * The value of the search box input text string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#searchTerm) */ searchTerm?: string; /** - * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) specified by the Search widget instance. There are two types of sources: + * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) specified by the Search widget instance. There are two types of sources: * * [FeatureLayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) * * [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html) - * - * + * + * * Any combination of these sources may be used together in the same instance of the Search widget. - * + * > Feature layers created from client-side graphics are not supported. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) */ sources?: CollectionProperties; /** * Enable suggestions for the widget. This is only available if working with a 10.3 or greater geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e. `supportsPagination = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggestionsEnabled) - * + * * @default true */ suggestionsEnabled?: boolean; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#viewModel) */ viewModel?: SearchViewModelProperties; @@ -54023,63 +57160,68 @@ declare namespace __esri { interface FeatureLayerSearchSource extends SearchSource, JSONSupport { /** * The results are displayed using this field. Defaults to the layer's `displayField` or the first string field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#displayField) */ displayField: string; /** * Indicates to only return results that match the search value exactly. This property only applies to `string` field searches. `exactMatch` is always `true` when searching fields of type `number`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#exactMatch) - * + * * @default false */ exactMatch: boolean; /** * The feature layer queried in the search. This is **required**. - * + * > Feature layers created from client-side graphics are not supported. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#featureLayer) */ featureLayer: FeatureLayer; /** * The name of the source for display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#name) */ name: string; /** * An array of string values representing the names of fields in the feature layer to search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#searchFields) */ searchFields: string[]; /** * A template string used to display multiple fields in a defined order when results are displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#searchTemplate) */ searchTemplate: string; /** * A template string used to display multiple fields in a defined order when suggestions are displayed. This takes precedence over `displayField`. Field names in the template must have the following format: `{FieldName}`. An example suggestionTemplate could look something like: `Name: {OWNER}, Parcel: {PARCEL_ID}`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#suggestionTemplate) */ suggestionTemplate: string; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#clone) - * - * + * + * */ clone(): FeatureLayerSearchSource; } interface FeatureLayerSearchSourceConstructor { + /** + * The following properties define a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html)-based [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) whose features may be searched by a [Search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html) widget instance. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) + */ - - new(properties?: FeatureLayerSearchSourceProperties): FeatureLayerSearchSource; + new (properties?: FeatureLayerSearchSourceProperties): FeatureLayerSearchSource; fromJSON(json: any): FeatureLayerSearchSource; } @@ -54089,45 +57231,46 @@ declare namespace __esri { interface FeatureLayerSearchSourceProperties extends SearchSourceProperties { /** * The results are displayed using this field. Defaults to the layer's `displayField` or the first string field. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#displayField) */ displayField?: string; /** * Indicates to only return results that match the search value exactly. This property only applies to `string` field searches. `exactMatch` is always `true` when searching fields of type `number`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#exactMatch) - * + * * @default false */ exactMatch?: boolean; /** * The feature layer queried in the search. This is **required**. - * + * > Feature layers created from client-side graphics are not supported. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#featureLayer) */ featureLayer?: FeatureLayerProperties; /** * The name of the source for display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#name) */ name?: string; /** * An array of string values representing the names of fields in the feature layer to search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#searchFields) */ searchFields?: string[]; /** * A template string used to display multiple fields in a defined order when results are displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#searchTemplate) */ searchTemplate?: string; /** * A template string used to display multiple fields in a defined order when suggestions are displayed. This takes precedence over `displayField`. Field names in the template must have the following format: `{FieldName}`. An example suggestionTemplate could look something like: `Name: {OWNER}, Parcel: {PARCEL_ID}`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html#suggestionTemplate) */ suggestionTemplate?: string; @@ -54136,69 +57279,67 @@ declare namespace __esri { interface LocatorSearchSource extends SearchSource, JSONSupport { /** * A string array which limits the results to one or more categories. For example, `Populated Place` or `airport`. Only applicable when using the World Geocode Service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#categories) */ categories: string[]; /** * Constricts search results to a specified country code. For example, `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#countryCode) */ countryCode: string; /** * Sets the sources for local `distance` and `minScale` for searching. See the object specification table below for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#localSearchOptions) */ localSearchOptions: LocatorSearchSourceLocalSearchOptions; /** * When reverse geocoding a result, use this distance in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#locationToAddressDistance) - * + * * @default 1500 */ locationToAddressDistance: number; /** * The locator task used to search. This is **required** and defaults to the [World Geocoding Service](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#locator) */ locator: Locator; /** * The name of the source for display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#name) */ name: string; /** * A template string used to display multiple fields in a defined order when results are displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#searchTemplate) */ searchTemplate: string; /** * The field name of the Single Line Address Field in the REST services directory for the locator service. Common values are `SingleLine` and `SingleLineFieldName`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#singleLineFieldName) */ singleLineFieldName: string; /** * Creates a deep clone of this object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#clone) - * - * + * + * */ clone(): LocatorSearchSource; } interface LocatorSearchSourceConstructor { - - - new(properties?: LocatorSearchSourceProperties): LocatorSearchSource; + new (properties?: LocatorSearchSourceProperties): LocatorSearchSource; fromJSON(json: any): LocatorSearchSource; } @@ -54208,188 +57349,234 @@ declare namespace __esri { interface LocatorSearchSourceProperties extends SearchSourceProperties { /** * A string array which limits the results to one or more categories. For example, `Populated Place` or `airport`. Only applicable when using the World Geocode Service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#categories) */ categories?: string[]; /** * Constricts search results to a specified country code. For example, `US` for United States or `SE` for Sweden. Only applies to the World Geocode Service. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#countryCode) */ countryCode?: string; /** * Sets the sources for local `distance` and `minScale` for searching. See the object specification table below for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#localSearchOptions) */ localSearchOptions?: LocatorSearchSourceLocalSearchOptions; /** * When reverse geocoding a result, use this distance in meters. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#locationToAddressDistance) - * + * * @default 1500 */ locationToAddressDistance?: number; /** * The locator task used to search. This is **required** and defaults to the [World Geocoding Service](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-category-filtering.htm). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#locator) */ locator?: LocatorProperties; /** * The name of the source for display. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#name) */ name?: string; /** * A template string used to display multiple fields in a defined order when results are displayed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#searchTemplate) */ searchTemplate?: string; /** * The field name of the Single Line Address Field in the REST services directory for the locator service. Common values are `SingleLine` and `SingleLineFieldName`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#singleLineFieldName) */ singleLineFieldName?: string; } - export interface LocatorSearchSourceLocalSearchOptions extends Object { /** * The distance to search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#localSearchOptions) */ distance?: number; /** * The minimum scale used to search locally. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html#localSearchOptions) */ minScale?: number; } + interface SearchResultRenderer extends Widget { + /** + * Indicates whether to display the `Show more results` link within the search result's popup. A value of `true` will not display the link in the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchResultRenderer.html#showMoreResultsOpen) + * + * @default false + */ + showMoreResultsOpen: boolean; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchResultRenderer.html#viewModel) + */ + viewModel: SearchViewModel; + + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchResultRenderer.html#render) + * + * + */ + render(): any; + } + + interface SearchResultRendererConstructor { + new (properties?: SearchResultRendererProperties): SearchResultRenderer; + } + + export const SearchResultRenderer: SearchResultRendererConstructor; + + interface SearchResultRendererProperties extends WidgetProperties { + /** + * Indicates whether to display the `Show more results` link within the search result's popup. A value of `true` will not display the link in the popup. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchResultRenderer.html#showMoreResultsOpen) + * + * @default false + */ + showMoreResultsOpen?: boolean; + /** + * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html) class to access all properties and methods on the widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchResultRenderer.html#viewModel) + */ + viewModel?: SearchViewModelProperties; + } + interface SearchSource extends JSONSupport { /** * Indicates whether to automatically navigate to the selected result once selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#autoNavigate) - * + * * @default true */ autoNavigate: boolean; /** * This property replaces the now deprecated `searchQueryParams`, `suggestQueryParams`, and `searchExtent` properties. Please see the object specification table below for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#filter) */ filter: SearchSourceFilter; /** * Indicates the maximum number of search results to return. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#maxResults) - * + * * @default 6 */ maxResults: number; /** * Indicates the maximum number of suggestions to return for the widget's input. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#maxSuggestions) - * + * * @default 6 */ maxSuggestions: number; /** * Indicates the minimum number of characters required before querying for a suggestion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#minSuggestCharacters) - * + * * @default 1 */ minSuggestCharacters: number; /** * Specifies the fields returned with the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#outFields) */ outFields: string[]; /** * Used as a hint for the source input text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#placeholder) */ placeholder: string; /** * Indicates whether to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a selected result is clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#popupEnabled) */ popupEnabled: boolean; /** - * The popup template used to display search results. If no popup is needed, set the source's popupTemplate to `null`. + * The popup template used to display search results. If no popup is needed, set the source's popupTemplate to `null`. * > This property should be set in instances where there is no existing [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) configured. For example, [feature sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) will default to any existing [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) configured on the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#popupTemplate) */ popupTemplate: PopupTemplate; /** * Specify this to prefix the user's input of the search text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#prefix) */ prefix: string; /** * Indicates whether to show a graphic on the map for the selected source using the [resultSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#resultSymbol). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#resultGraphicEnabled) */ resultGraphicEnabled: boolean; /** * The symbol used to display the result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#resultSymbol) */ resultSymbol: Symbol; /** * Specify this to add a suffix to the user's input for the search value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#suffix) */ suffix: string; /** * Indicates whether to display suggestions as the user enters input text in the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#suggestionsEnabled) - * + * * @default true */ suggestionsEnabled: boolean; /** * Indicates whether to constrain the search results to the view's extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#withinViewEnabled) - * + * * @default false */ withinViewEnabled: boolean; /** * The set zoom scale for the resulting search result. This scale is automatically honored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#zoomScale) */ zoomScale: number; } interface SearchSourceConstructor { - - - new(properties?: SearchSourceProperties): SearchSource; + new (properties?: SearchSourceProperties): SearchSource; fromJSON(json: any): SearchSource; } @@ -54399,126 +57586,125 @@ declare namespace __esri { interface SearchSourceProperties { /** * Indicates whether to automatically navigate to the selected result once selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#autoNavigate) - * + * * @default true */ autoNavigate?: boolean; /** * This property replaces the now deprecated `searchQueryParams`, `suggestQueryParams`, and `searchExtent` properties. Please see the object specification table below for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#filter) */ filter?: SearchSourceFilter; /** * Indicates the maximum number of search results to return. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#maxResults) - * + * * @default 6 */ maxResults?: number; /** * Indicates the maximum number of suggestions to return for the widget's input. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#maxSuggestions) - * + * * @default 6 */ maxSuggestions?: number; /** * Indicates the minimum number of characters required before querying for a suggestion. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#minSuggestCharacters) - * + * * @default 1 */ minSuggestCharacters?: number; /** * Specifies the fields returned with the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#outFields) */ outFields?: string[]; /** * Used as a hint for the source input text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#placeholder) */ placeholder?: string; /** * Indicates whether to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) when a selected result is clicked. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#popupEnabled) */ popupEnabled?: boolean; /** - * The popup template used to display search results. If no popup is needed, set the source's popupTemplate to `null`. + * The popup template used to display search results. If no popup is needed, set the source's popupTemplate to `null`. * > This property should be set in instances where there is no existing [PopupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html) configured. For example, [feature sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) will default to any existing [popupTemplate](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#popupTemplate) configured on the layer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#popupTemplate) */ popupTemplate?: PopupTemplateProperties; /** * Specify this to prefix the user's input of the search text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#prefix) */ prefix?: string; /** * Indicates whether to show a graphic on the map for the selected source using the [resultSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#resultSymbol). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#resultGraphicEnabled) */ resultGraphicEnabled?: boolean; /** * The symbol used to display the result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#resultSymbol) */ resultSymbol?: SymbolProperties; /** * Specify this to add a suffix to the user's input for the search value. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#suffix) */ suffix?: string; /** * Indicates whether to display suggestions as the user enters input text in the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#suggestionsEnabled) - * + * * @default true */ suggestionsEnabled?: boolean; /** * Indicates whether to constrain the search results to the view's extent. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#withinViewEnabled) - * + * * @default false */ withinViewEnabled?: boolean; /** * The set zoom scale for the resulting search result. This scale is automatically honored. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#zoomScale) */ zoomScale?: number; } - export interface SearchSourceFilter extends Object { /** * The where clause specified for filtering suggests or search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#filter) */ where?: string; /** * The filter geometry for suggests or search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html#filter) */ geometry?: Geometry; @@ -54527,272 +57713,273 @@ declare namespace __esri { interface SearchViewModel extends Accessor, Evented, GoTo { /** * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) object currently selected. Can be either a [feature layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or a [locator task](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#activeSource) */ readonly activeSource: FeatureLayerSearchSource | LocatorSearchSource; /** * The selected source's index. This value is `-1` when all sources are selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#activeSourceIndex) - * + * * @default 0 */ activeSourceIndex: number; /** * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-allplaceholder.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#allPlaceholder) - * + * * @default "Find address or place" */ allPlaceholder: string; /** * The combined collection of [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) and [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). The [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) displays first in the Search UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#allSources) */ readonly allSources: Collection; /** * Indicates whether to automatically select and zoom to the first geocoded result. If `false`, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation will still geocode the input string, but the top result will not be selected. To work with the geocoded results, you can set up a [search-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#event:search-complete) event handler and get the results through the event object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#autoSelect) - * + * * @default true */ autoSelect: boolean; /** * A read-only property that is a [Collection](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html) of module:esri/widgets/Search/FeaturelayerSource and/or [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html). This property may contain [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) [locators](http://enterprise.arcgis.com/en/server/latest/publish-services/windows/geocode-services.htm) and any web map or web scene [configurable search sources](http://doc.arcgis.com/en/arcgis-online/create-maps/configure-feature-search.htm). This property is used to populate the Search UI if the [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) property is not set. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) */ readonly defaultSources: Collection; /** * The default [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the search result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSymbol) - * + * * @default PictureMarkerSymbol */ defaultSymbol: Symbol; /** * Indicates whether or not to include [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) in the Search UI. This can be a boolean value or a function that returns an array of Search [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#includeDefaultSources) - * + * * @default true */ includeDefaultSources: boolean | Function; /** - * Indicates whether location services are enabled within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-locationEnabled.png) + * Indicates whether location services are enabled within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-locationEnabled.png) * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#locationEnabled) */ locationEnabled: boolean; /** * The maximum character length of the search text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxInputLength) - * + * * @default 128 */ maxInputLength: number; /** * The maximum number of results returned by the widget if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxResults) - * + * * @default 6 */ maxResults: number; /** * The maximum number of suggestions returned by the widget if not specified by the source. If working with the default [ArcGIS Online Geocoding service](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm), the default remains at `5`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxSuggestions) - * + * * @default 6 */ maxSuggestions: number; /** * The minimum number of characters needed for the search if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#minSuggestCharacters) - * + * * @default 1 */ minSuggestCharacters: number; /** * The placeholder used by the [activeSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#activeSource). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#placeholder) */ readonly placeholder: string; /** * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupEnabled) - * + * * @default true */ popupEnabled: boolean; /** * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupTemplate) - * + * * @default null */ popupTemplate: PopupTemplate; /** * It is possible to search a specified portal instance's [locator services](http://enterprise.arcgis.com/en/portal/latest/administer/windows/configure-portal-to-geocode-addresses.htm) Use this property to set this [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) instance to search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#portal) */ portal: Portal; /** * The graphic used to highlight the resulting feature or location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) - * + * * @default null */ readonly resultGraphic: Graphic; /** - * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) will display at the location of the selected feature. + * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) will display at the location of the selected feature. * A graphic will be placed in the View's [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics) for [layer views](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) that do not support the `highlight` method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphicEnabled) - * + * * @default true */ resultGraphicEnabled: boolean; /** * An array of current results from the search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#results) - * + * * @default null */ readonly results: any[]; /** * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-true-false](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-false.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchAllEnabled) - * + * * @default true */ searchAllEnabled: boolean; /** * The value of the search box input text string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchTerm) */ searchTerm: string; /** * The result selected from a search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#selectedResult) - * + * * @default null */ readonly selectedResult: any; /** * The selected SuggestResult. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#selectedSuggestion) - * + * * @default null */ readonly selectedSuggestion: Geometry | SearchViewModelSuggestResult; /** - * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) specified by the Search widget instance. There are two types of sources: + * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) specified by the Search widget instance. There are two types of sources: * * [FeatureLayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) * * [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html) - * - * + * + * * Any combination of these sources may be used together in the same instance of the Search widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) */ sources: Collection; /** - * The current state of the widget. This property was removed from [Search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html) and should now be accessed within the [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html). **Possible Values:** ready | disabled | searching - * + * The current state of the widget. This property was removed from [Search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html) and should now be accessed within the [SearchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html). **Possible Values:** ready | disabled | searching | loading + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#state) - * + * * @default ready */ readonly state: string; /** * The millisecond delay after keyup and before making a [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest) network request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionDelay) - * + * * @default 150 */ suggestionDelay: number; /** * An array of results from the [suggest method](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest). This is available if working with a 10.3 or greater geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e. `supportsPagination = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestions) - * + * * @default null */ readonly suggestions: SearchViewModelSuggestResult[]; /** * Enable suggestions for the widget. This is only available if working with a 10.3 or greater geocoding service that has [suggest capability loaded] (https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e. `supportsPagination = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionsEnabled) - * + * * @default true */ suggestionsEnabled: boolean; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) - * + * * @default null */ view: MapView | SceneView; /** * Clears the current value, search results, suggest results, graphic, and graphics layer. It also hides any open menus. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#clear) - * - * + * + * */ clear(): void; /** * Depending on the sources specified, `search()` queries the feature layer(s) and/or performs address matching using any specified [Locator(s)](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html) and returns the applicable results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#search) - * + * * @param searchTerm This searchTerm can be a string, geometry, suggest candidate object, or an array of [latitude,longitude]. If a geometry is supplied, then it will reverse geocode (locator) or findAddressCandidates with geometry instead of text (featurelayer). - * + * */ - search(searchTerm?: string | Geometry | SearchViewModelSuggestResult | number[][]): IPromise; + search( + searchTerm?: string | Geometry | SearchViewModelSuggestResult | number[][] + ): IPromise; /** * Returns search results near your current location. It checks whether [locationEnabled](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#locationEnabled) is `true`. If so, and your browser supports [geolocation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation), it will return search results nearby your current location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchNearby) - * - * + * + * */ searchNearby(): IPromise; /** * Performs a suggest() request on the active Locator. It also uses the current value of the widget or one that is passed in. Suggestions are available if working with a 10.3 or greater geocoding service that has [suggest capability loaded](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e.`supportsPagination = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest) - * + * * @param value The string value used to suggest() on an active Locator or feature layer. If nothing is passed in, takes the current value of the widget. - * + * */ suggest(value?: string): IPromise; - on(name: "search-clear", eventHandler: SearchViewModelSearchClearEventHandler): IHandle; on(name: "search-start", eventHandler: SearchViewModelSearchStartEventHandler): IHandle; @@ -54807,9 +57994,7 @@ declare namespace __esri { } interface SearchViewModelConstructor { - - - new(properties?: SearchViewModelProperties): SearchViewModel; + new (properties?: SearchViewModelProperties): SearchViewModel; } export const SearchViewModel: SearchViewModelConstructor; @@ -54817,170 +58002,168 @@ declare namespace __esri { interface SearchViewModelProperties extends GoToProperties { /** * The selected source's index. This value is `-1` when all sources are selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#activeSourceIndex) - * + * * @default 0 */ activeSourceIndex?: number; /** * String value used as a hint for input text when searching on multiple sources. See the image below to view the location and style of this text in the context of the widget. ![search-allPlaceholder](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-allplaceholder.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#allPlaceholder) - * + * * @default "Find address or place" */ allPlaceholder?: string; /** * Indicates whether to automatically select and zoom to the first geocoded result. If `false`, the [findAddressCandidates](https://developers.arcgis.com/rest/geocode/api-reference/geocoding-find-address-candidates.htm) operation will still geocode the input string, but the top result will not be selected. To work with the geocoded results, you can set up a [search-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#event:search-complete) event handler and get the results through the event object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#autoSelect) - * + * * @default true */ autoSelect?: boolean; /** * The default [symbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-Symbol.html) for the search result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSymbol) - * + * * @default PictureMarkerSymbol */ defaultSymbol?: SymbolProperties; /** * Indicates whether or not to include [defaultSources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#defaultSources) in the Search UI. This can be a boolean value or a function that returns an array of Search [sources](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#includeDefaultSources) - * + * * @default true */ includeDefaultSources?: boolean | Function; /** - * Indicates whether location services are enabled within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-locationEnabled.png) + * Indicates whether location services are enabled within the widget. ![locationEnabled](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-locationEnabled.png) * > The use of this property is only supported on secure origins. To use it, switch your application to a secure origin, such as HTTPS. Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that supports [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext#Browser_compatibility) (currently Chrome and Firefox). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#locationEnabled) */ locationEnabled?: boolean; /** * The maximum character length of the search text. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxInputLength) - * + * * @default 128 */ maxInputLength?: number; /** * The maximum number of results returned by the widget if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxResults) - * + * * @default 6 */ maxResults?: number; /** * The maximum number of suggestions returned by the widget if not specified by the source. If working with the default [ArcGIS Online Geocoding service](https://developers.arcgis.com/rest/geocode/api-reference/overview-world-geocoding-service.htm), the default remains at `5`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#maxSuggestions) - * + * * @default 6 */ maxSuggestions?: number; /** * The minimum number of characters needed for the search if not specified by the source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#minSuggestCharacters) - * + * * @default 1 */ minSuggestCharacters?: number; /** * Indicates whether to display the [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html) on feature click. The graphic can be clicked to display a [Popup](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupEnabled) - * + * * @default true */ popupEnabled?: boolean; /** * A customized PopupTemplate for the selected feature. Note that specifying a wildcard {*} for the popupTemplate will return all fields in addition to search-specific fields. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#popupTemplate) - * + * * @default null */ popupTemplate?: PopupTemplateProperties; /** * It is possible to search a specified portal instance's [locator services](http://enterprise.arcgis.com/en/portal/latest/administer/windows/configure-portal-to-geocode-addresses.htm) Use this property to set this [ArcGIS Portal](https://enterprise.arcgis.com/en/portal/) instance to search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#portal) */ portal?: PortalProperties; /** - * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) will display at the location of the selected feature. + * Indicates if the [resultGraphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphic) will display at the location of the selected feature. * A graphic will be placed in the View's [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#graphics) for [layer views](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LayerView.html) that do not support the `highlight` method. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#resultGraphicEnabled) - * + * * @default true */ resultGraphicEnabled?: boolean; /** * Indicates whether to display the option to search all sources. When `true`, the "All" option is displayed by default: ![search-searchAllEnabled-true](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-true.png) When `false`, no option to search all sources at once is available: ![search-searchAllEnabled-true-false](https://developers.arcgis.com/javascript/assets/img/apiref/widgets/search-enablesearchingall-false.png) - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchAllEnabled) - * + * * @default true */ searchAllEnabled?: boolean; /** * The value of the search box input text string. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#searchTerm) */ searchTerm?: string; /** - * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) specified by the Search widget instance. There are two types of sources: + * The Search widget may be used to search features in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or geocode locations with a [Locator](https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Locator.html). The `sources` property defines the sources from which to search for the [view](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) specified by the Search widget instance. There are two types of sources: * * [FeatureLayerSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-FeatureLayerSearchSource.html) * * [LocatorSearchSource](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LocatorSearchSource.html) - * - * + * + * * Any combination of these sources may be used together in the same instance of the Search widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) */ sources?: CollectionProperties; /** * The millisecond delay after keyup and before making a [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest) network request. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionDelay) - * + * * @default 150 */ suggestionDelay?: number; /** * Enable suggestions for the widget. This is only available if working with a 10.3 or greater geocoding service that has [suggest capability loaded] (https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm) or a 10.3 or greater feature layer that supports pagination, i.e. `supportsPagination = true`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggestionsEnabled) - * + * * @default true */ suggestionsEnabled?: boolean; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#view) - * + * * @default null */ view?: MapViewProperties | SceneViewProperties; } - export interface SearchViewModelSearchClearEvent { - } + export interface SearchViewModelSearchClearEvent {} export interface SearchViewModelSearchCompleteEvent { - activeSourceIndex: number; errors: Error[]; @@ -54994,37 +58177,37 @@ declare namespace __esri { /** * When resolved, returns this response after calling [search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#search). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ export interface SearchViewModelSearchResponse extends Object { /** * The index of the source from which the search result was obtained. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ activeSourceIndex: number; /** * An array of error objects returned from the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ errors: Error[]; /** * The number of search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ numResults: number; /** * The searched expression - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ searchTerm: string; /** * An array of objects representing the results of search. See object specification table below for more information about the result object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ results: SearchViewModelSearchResponseResults[]; @@ -55032,35 +58215,33 @@ declare namespace __esri { /** * The result object returned from the [search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#search). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResult) */ export interface SearchViewModelSearchResult extends Object { /** * The extent, or bounding box, of the returned feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResult) */ extent: Extent; /** * The resulting feature or location obtained from the search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResult) */ feature: Graphic; /** * The name of the result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResult) */ name: string; } - export interface SearchViewModelSearchStartEvent { - } + export interface SearchViewModelSearchStartEvent {} export interface SearchViewModelSelectResultEvent { - result: SearchViewModelSelectResultEventResult; source: any; @@ -55069,7 +58250,6 @@ declare namespace __esri { } export interface SearchViewModelSuggestCompleteEvent { - activeSourceIndex: number; errors: Error[]; @@ -55082,38 +58262,38 @@ declare namespace __esri { } /** - * When resolved, returns this reponse after calling [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest). - * + * When resolved, returns this response after calling [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest). + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ export interface SearchViewModelSuggestResponse extends Object { /** * The index of the source from which suggestions are obtained. This value is `-1` when all sources are selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ activeSourceIndex: number; /** * An array of error objects returned from the suggest results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ errors: Error[]; /** * The number of suggest results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ numResults: number; /** * The search expression used for the suggest. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ searchTerm: string; /** * An array of objects representing the results of suggest. See object specification table below for more information about the result object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ results: SearchViewModelSuggestResponseResults[]; @@ -55121,36 +58301,33 @@ declare namespace __esri { /** * The result object returned from a [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#suggest). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResult) */ export interface SearchViewModelSuggestResult extends Object { /** * The key related to the suggest result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResult) */ key: string; /** * The string name of the suggested location to geocode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResult) */ text: string; /** * The index of the currently selected result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResult) */ sourceIndex: number; } - export interface SearchViewModelSuggestStartEvent { - } - + export interface SearchViewModelSuggestStartEvent {} export interface SearchViewModelSearchCompleteEventResults extends Object { - results: SearchResult[]; sourceIndex: number; @@ -55158,31 +58335,28 @@ declare namespace __esri { source: any[]; } - export interface SearchViewModelSearchResponseResults extends Object { /** * An array of search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ results: SearchViewModelSearchResult[]; /** * The index of the currently selected source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ sourceIndex: number; /** * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) of the selected result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SearchResponse) */ source: any; } - export interface SearchViewModelSelectResultEventResult extends Object { - extent: Extent; feature: Graphic; @@ -55190,9 +58364,7 @@ declare namespace __esri { name: string; } - export interface SearchViewModelSuggestCompleteEventResults extends Object { - results: SearchViewModelSuggestResult[]; sourceIndex: number; @@ -55200,23 +58372,22 @@ declare namespace __esri { source: any; } - export interface SearchViewModelSuggestResponseResults extends Object { /** * An array of suggest results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ results: SearchViewModelSuggestResult[]; /** * The index of the currently selected source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ sourceIndex: number; /** * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#sources) of the selected result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchViewModel.html#SuggestResponse) */ source: any; @@ -55224,37 +58395,37 @@ declare namespace __esri { /** * When resolved, returns this response after calling [search](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#search). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ export interface SearchResponse extends Object { /** * The index of the source from which the search result was obtained. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ activeSourceIndex: number; /** * An array of error objects returned from the search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ errors: Error[]; /** * The number of search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ numResults: number; /** * The searched expression - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ searchTerm: string; /** * An array of objects representing the results of search. See object specification table below for more information about the result object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ results: SearchResponseResults[]; @@ -55262,25 +58433,25 @@ declare namespace __esri { /** * The result object returned from a [search()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#search). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) */ export interface SearchResult extends Object { /** * The extent, or bounding box, of the returned feature. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) */ extent: Extent; /** * The resulting feature or location obtained from the search. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) */ feature: Graphic; /** * The name of the result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResult) */ name: string; @@ -55288,37 +58459,37 @@ declare namespace __esri { /** * When resolved, returns this response after calling [suggest](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ export interface SuggestResponse extends Object { /** * The index of the source from which suggestions are obtained. This value is `-1` when all sources are selected. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ activeSourceIndex: number; /** * An array of error objects returned from the suggest results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ errors: Error[]; /** * The number of suggest results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ numResults: number; /** * The search expression used for the suggest. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ searchTerm: string; /** * An array of objects representing the results of suggest. See object specification table below for more information about the result object. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ results: SuggestResponseResults[]; @@ -55326,69 +58497,67 @@ declare namespace __esri { /** * The result object returned from a [suggest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#suggest). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResult) */ export interface SuggestResult extends Object { /** * The key related to the suggest result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResult) */ key: string; /** * The string name of the suggested location to geocode. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResult) */ text: string; /** * The index of the currently selected result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResult) */ sourceIndex: number; } - export interface SearchResponseResults extends Object { /** * An array of search results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ results: SearchResult[]; /** * The index of the currently selected source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ sourceIndex: number; /** * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) of the selected result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SearchResponse) */ source: any; } - export interface SuggestResponseResults extends Object { /** * An array of suggest results. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ results: SuggestResult[]; /** * The index of the currently selected source. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ sourceIndex: number; /** * The [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources) of the selected result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#SuggestResponse) */ source: any; @@ -55397,116 +58566,116 @@ declare namespace __esri { interface SizeSlider extends Accessor, Widgette { /** * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#handlesVisible) - * + * * @default true */ handlesVisible: boolean; /** * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram) */ histogram: HistogramResult; /** * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogramVisible) - * + * * @default true */ histogramVisible: boolean; /** * The width of the histogram in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogramWidth) - * + * * @default 100 */ histogramWidth: number; /** * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#labelsVisible) - * + * * @default true */ labelsVisible: boolean; /** * The size in points or pixels with which features will be represented at or above the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxSize) */ readonly maxSize: number; /** * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics), but may not be smaller than the upper value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue) */ maxValue: number; /** * The size in points or pixels with which features will be represented at or below the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minSize) */ readonly minSize: number; /** * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics), but may not be greater than the lower value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) */ minValue: number; /** * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue) of the slider if values for those properties are not already provided. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) */ statistics: SizeSliderStatistics; /** * Indicates whether to show the average value of features in the dataset in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statisticsVisible) - * + * * @default true */ statisticsVisible: boolean; /** * The symbol on the slider representing the features in the view. This symbol type should match the symbol type of the appropriate features. This can be an instance of [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), which is the default value, or [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#symbol) */ symbol: SimpleMarkerSymbol | SimpleLineSymbol; /** * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#ticksVisible) - * + * * @default true */ ticksVisible: boolean; /** - * Represents the data values corresponding to the handles on the slider. It is an array of numbers indicating the `minDataValue` and the `maxDataValue` of the [visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html#SizeVisualVariable) represented by the slider. - * + * Represents the data values corresponding to the handles on the slider. It is an array of numbers indicating the `minDataValue` and the `maxDataValue` of the [visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-visualVariables-SizeVariable.html) represented by the slider. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) */ readonly values: number[]; /** * The size visual variable represented by the slider. This must be set initially on the slider for it to render in the view. This may be created manually (see snippet below) or generated from the sizeRendererCreator helper methods. A new size visual variable is created each time the user slides handles or changes the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) or the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#visualVariable) */ - visualVariable: SizeVisualVariable; + visualVariable: SizeVariable; } interface SizeSliderConstructor { /** * The SizeSlider is a widget intended for authoring and exploring data-driven visualizations in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) using the size of marker symbols or 3D object symbol layers. To display properly, this slider requires a [size visual variable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#visualVariable) and [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) object. Other optional properties may be used including adding a [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram). Most of the various options that affect the UI of the slider are labeled in the image below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html) */ - new(properties?: SizeSliderProperties): SizeSlider; + new (properties?: SizeSliderProperties): SizeSlider; } export const SizeSlider: SizeSliderConstructor; @@ -55514,122 +58683,328 @@ declare namespace __esri { interface SizeSliderProperties extends WidgetteProperties { /** * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#handlesVisible) - * + * * @default true */ handlesVisible?: boolean; /** * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram) */ histogram?: HistogramResult; /** * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogramVisible) - * + * * @default true */ histogramVisible?: boolean; /** * The width of the histogram in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#histogramWidth) - * + * * @default 100 */ histogramWidth?: number; /** * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#labelsVisible) - * + * * @default true */ labelsVisible?: boolean; /** * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics), but may not be smaller than the upper value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue) */ maxValue?: number; /** * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics), but may not be greater than the lower value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) */ minValue?: number; /** * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue) of the slider if values for those properties are not already provided. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) */ statistics?: SizeSliderStatistics; /** * Indicates whether to show the average value of features in the dataset in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statisticsVisible) - * + * * @default true */ statisticsVisible?: boolean; /** * The symbol on the slider representing the features in the view. This symbol type should match the symbol type of the appropriate features. This can be an instance of [SimpleMarkerSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html), which is the default value, or [SimpleLineSymbol](https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleLineSymbol.html). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#symbol) */ symbol?: SimpleMarkerSymbolProperties | SimpleLineSymbolProperties; /** * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#ticksVisible) - * + * * @default true */ ticksVisible?: boolean; /** * The size visual variable represented by the slider. This must be set initially on the slider for it to render in the view. This may be created manually (see snippet below) or generated from the sizeRendererCreator helper methods. A new size visual variable is created each time the user slides handles or changes the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#minValue) or the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#maxValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#visualVariable) */ - visualVariable?: SizeVisualVariable; + visualVariable?: SizeVariableProperties; } - export interface SizeSliderStatistics extends Object { /** * The average of all data values represented in the size visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) */ avg?: number; /** * The maximum of all data values represented in the size visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) */ max: number; /** * The minimum of all data values represented in the size visual variable. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-SizeSlider.html#statistics) */ min: number; } + interface Sketch extends Widget { + /** + * Returns the name of the active tool associated with the Sketch widget instance. **Possible Values:** point | polyline | polygon | circle | rectangle | move | transform | reshape + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#activeTool) + */ + readonly activeTool: string; + /** + * The graphic that is being created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#createGraphic) + */ + readonly createGraphic: Graphic; + /** + * The Sketch widget's default CSS icon class. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#iconClass) + */ + readonly iconClass: string; + /** + * The [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) associated with the Sketch widget. The Sketch widget adds new [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) to this layer or can only update graphics stored in this layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#layer) + */ + layer: GraphicsLayer; + /** + * Determines the layout/orientation of the Sketch widget. **Possible Values:** vertical | horizontal + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#layout) + * + * @default horizontal + */ + layout: string; + /** + * The Sketch widget's state. **Possible Values:** ready | disabled | active + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#state) + */ + readonly state: string; + /** + * An array of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) that are being updated by the Sketch widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#updateGraphics) + */ + readonly updateGraphics: Collection; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the Sketch widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#view) + */ + view: MapView; + /** + * The view model for the Sketch widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [SketchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html) class to access all properties and methods on the Sketch widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#viewModel) + */ + viewModel: SketchViewModel; + /** + * The Sketch widget's default label. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#widgetLabel) + */ + readonly widgetLabel: string; + + /** + * Cancels the active operation and fires the [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:create) or [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event and changes the event's state to `cancel`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#cancel) + * + * + */ + cancel(): void; + /** + * Completes the active operation and fires the [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:create) or [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event and changes the event's state to `complete`. If called in midst of create operation, `complete()` finishes the active create operation and keeps the valid geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#complete) + * + * + */ + complete(): void; + /** + * Create a graphic with a geometry specified in `tool`. When first vertex of the graphic is added, [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:create) event will start firing. **Note:** Creating a circle geometry does not work in all spatial references. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#create) + * + * @param tool Name of the create tool. Specifies the geometry type for the graphic to be created. **Possible Values:** point | polyline | polygon | rectangle | circle + * @param createOptions Options for the graphic to be created. + * @param createOptions.mode + * Specifies how the graphic can be created. The create mode applies only when creating `polygon`, `polyline`, `rectangle` and `circle` geometries. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline`. + * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` `rectangle` and `circle`. Default for `rectangle` and `circle`. + * click | Vertices are added when the pointer is clicked. + * + */ + create(tool: string, createOptions?: SketchCreateCreateOptions): void; + /** + * Incrementally redo actions recorded in the stack. Calling this method will fire the [redo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:redo) event. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#redo) + * + * + */ + redo(): void; + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#render) + * + * + */ + render(): any; + /** + * Resets the Sketch widget to prepare for another create operation. Reset discards the current sketch, if called in middle of create operation. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#reset) + * + * + */ + reset(): void; + /** + * Incrementally undo actions recorded in the stack. Calling this method will fire the [undo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:undo) event. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#undo) + * + * + */ + undo(): void; + /** + * Initializes an update operation for the specified graphic(s) and fires [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) + * + * @param graphics An array of graphics to be updated. Only graphics added to the Sketch widget's [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#layer) property can be updated. + * @param updateOptions Update options for the graphics to be updated. + * @param updateOptions.tool + * Name of the update tool. Specifies the update operation for the selected graphics. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * transform | The *default* tool for graphics with [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometries. It allows one or multiple graphics to be scaled, rotated and moved by default. Its default behavior can be changed by setting `enableRotation`, `enableScaling` or `preserveAspectRatio` properties when calling `update` method or setting them on [defaultUpdateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#defaultUpdateOptions) property when the Sketch widget initializes. This tool does not apply if selected graphics have only [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. + * reshape | It allows the entire graphic or individual vertices of the graphic to be moved. Vertices can be added or removed. This tool can only be used with one graphic and the graphic's geometry has to be [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) or [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html). + * move | The *default* tool for graphics with [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. It should be used for specific cases where you just want to move selected `polygon` and `polyline` graphics without additional options. Additionally, the `move` tool does not support toggling to different modes, since `move` operation is already built into both `transform` and `reshape` tools by default. + * @param updateOptions.enableRotation Indicates if the `rotation` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * @param updateOptions.enableScaling Indicates if the `scale` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * @param updateOptions.preserveAspectRatio Indicates if the uniform scale operation will be enabled when updating graphics. `enableScaling` must be set `true` when setting this property to `true`. Only applies if `tool` is `transform`. + * @param updateOptions.toggleToolOnClick Indicates if the graphic being updated can be toggled between `transform` and `reshape` update options. + * + */ + update(graphics: Graphic[], updateOptions?: SketchUpdateUpdateOptions): void; + } + + interface SketchConstructor { + /** + * Sketch widget provides a simple UI for creating and updating graphics on the 2D [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). This significantly minimizes the code required for working with graphics in the view. It is intended to be used with [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) stored in its [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#layer) property. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html) + */ + + new (properties?: SketchProperties): Sketch; + } + + export const Sketch: SketchConstructor; + + interface SketchProperties extends WidgetProperties { + /** + * The [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) associated with the Sketch widget. The Sketch widget adds new [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) to this layer or can only update graphics stored in this layer. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#layer) + */ + layer?: GraphicsLayerProperties; + /** + * Determines the layout/orientation of the Sketch widget. **Possible Values:** vertical | horizontal + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#layout) + * + * @default horizontal + */ + layout?: string; + /** + * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). Set this to link the Sketch widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#view) + */ + view?: MapViewProperties; + /** + * The view model for the Sketch widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [SketchViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html) class to access all properties and methods on the Sketch widget. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#viewModel) + */ + viewModel?: SketchViewModelProperties; + } + interface SketchViewModel extends Accessor, Evented { /** - * Graphic representing the sketch that is being drawn or updated on the view. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#graphic) + * Returns the name of the active tool associated with the SketchViewModel instance. **Possible Values:** point | multipoint | polyline | polygon | circle | rectangle | move | transform | reshape + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#activeTool) */ - readonly graphic: Graphic; + readonly activeTool: string; /** - * GraphicsLayer associated with the SketchViewModel. It allows you to organize where temporary graphics are placed when the drawing is completed. - * + * The graphic that is being created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#createGraphic) + */ + readonly createGraphic: Graphic; + /** + * Default update options set for the SketchViewModel. Update options set on this property will be overwritten if the update options are changed when [update()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) method is called. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) + */ + readonly defaultUpdateOptions: SketchViewModelDefaultUpdateOptions; + /** + * The [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) associated with the SketchViewModel. The SketchViewModel adds new [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) to this layer or can only update graphics stored in this layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#layer) */ layer: GraphicsLayer; @@ -55647,7 +59022,7 @@ declare namespace __esri { * } * } * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#pointSymbol) */ pointSymbol: SimpleMarkerSymbol; @@ -55663,7 +59038,7 @@ declare namespace __esri { * } * } * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polygonSymbol) */ polygonSymbol: SimpleFillSymbol; @@ -55676,100 +59051,133 @@ declare namespace __esri { * width: 2 * } * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polylineSymbol) */ polylineSymbol: SimpleLineSymbol; /** - * The sketch view model's state. **Possible Values:** ready | disabled | creating | updating - * + * The sketch view model's state. **Possible Values:** ready | disabled | active + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#state) */ readonly state: string; + /** + * An array of graphics that are being updated by the SketchViewModel. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#updateGraphics) + */ + readonly updateGraphics: Collection; + /** + * Indicates if a graphic can be selected to be updated. If `false`, graphics cannot selected to be updated. Set this property to `false` to add a custom [hitTest](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) logic for [updating](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#updateOnGraphicClick) + */ + updateOnGraphicClick: boolean; /** * The view in which geometries will be sketched by the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#view) */ view: MapView; /** - * Completes the active drawing and fires the [create-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:create-complete) or [update-complete](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:update-complete) event depending on the draw operation. If called mid-drawing, `complete()` finishes the active drawing and keeps the valid geometry. - * + * Cancels the active operation and fires the [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:create) or [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:update) event and changes the event's state to `cancel`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#cancel) + * + * + */ + cancel(): void; + /** + * Completes the active operation and fires the [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:create) or [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:update) event and changes the event's state to `complete`. If called in midst of create operation, `complete()` finishes the active create operation and keeps the valid geometry. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#complete) - * - * + * + * */ complete(): void; /** - * Creates the requested draw action. **Note:** Creating a circle geometry does not work in all spatial references. - * + * Create a graphic with a geometry specified in `tool` parameter. When first vertex of the graphic is added, [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:create) event will start firing. **Note:** Creating a circle geometry does not work in all spatial references. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#create) - * - * @param drawAction Name of the draw action tool. **Possible Values:** point | multipoint | polyline | polygon | rectangle | circle - * @param drawOptions Object of the drawing options for the geometry to be created. - * @param drawOptions.mode - * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `rectangle` and `circle` geometries. **Possible Values:** - * + * + * @param tool Name of the create tool. Specifies the geometry type for the graphic to be created. **Possible Values:** point | multipoint | polyline | polygon | rectangle | circle + * @param createOptions Options for the graphic to be created. + * @param createOptions.mode + * Specifies how the graphic can be created. The create mode applies only when creating `polygon`, `polyline`, `rectangle` and `circle` geometries. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline`. * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` `rectangle` and `circle`. Default for `rectangle` and `circle`. * click | Vertices are added when the pointer is clicked. - * + * */ - create(drawAction: string, drawOptions?: SketchViewModelCreateDrawOptions): void; + create(tool: string, createOptions?: SketchViewModelCreateCreateOptions): void; /** * Incrementally redo actions recorded in the stack. Calling this method will fire the [redo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:redo) event. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#redo) - * - * + * + * */ redo(): void; /** - * Resets SketchViewModel to prepare for another create operation. Reset discards the current drawing, if called mid drawing. - * + * Resets SketchViewModel to prepare for another create operation. Reset discards the current sketch, if called in middle of create operation. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#reset) - * - * + * + * */ reset(): void; /** * Incrementally undo actions recorded in the stack. Calling this method will fire the [undo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:undo) event. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#undo) - * - * + * + * */ undo(): void; /** - * Initializes an update operation for the selected geometry and fires [update-init](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:update-init) event. - * + * Initializes an update operation for the specified graphic(s) and fires [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event:update) event. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) - * - * @param graphic The graphic to be updated. - * + * + * @param graphics An array of graphics to be updated. Only graphics added to SketchViewModel's [layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#layer) property can be updated. + * @param updateOptions Update options for the graphics to be updated. + * @param updateOptions.tool + * Name of the update tool. Specifies the update operation for the selected graphics. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * transform | The *default* tool for graphics with [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometries. It allows one or multiple graphics to be scaled, rotated and moved by default. Its default behavior can be changed by setting `enableRotation`, `enableScaling` or `preserveAspectRatio` properties when calling `update` method or setting them on [defaultUpdateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) property when the widget initializes. This tool does not apply if selected graphics have only [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or [multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html) geometries. + * reshape | It allows the entire graphic or individual vertices of the graphic to be moved. Vertices can be added or removed. This tool can only be used with one graphic and the graphic's geometry has to be [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) or [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html). + * move | The *default* tool for graphics with [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and [multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html) geometries. It should be used for specific cases where you just want to move selected `polygon` and `polyline` graphics without additional options. Additionally, the `move` tool does not support toggling to different modes, since `move` operation is already built into both `transform` and `reshape` tools by default. + * @param updateOptions.enableRotation Indicates if the `rotation` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * @param updateOptions.enableScaling Indicates if the `scale` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * @param updateOptions.preserveAspectRatio Indicates if the uniform scale operation will be enabled when updating graphics. `enableScaling` must be set `true` when setting this property to `true`. Only applies if `tool` is `transform`. + * @param updateOptions.toggleToolOnClick Indicates if the graphic being updated can be toggled between `transform` and `reshape` update options. + * */ - update(graphic: Graphic): void; + update(graphics: Graphic[], updateOptions?: SketchViewModelUpdateUpdateOptions): void; } interface SketchViewModelConstructor { /** - * SketchViewModel simplifies the process of adding and updating graphics on the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). SketchViewModel is intended to be used with [Graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html). Its [events](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#events-summary) allow control of a graphic's geometry. Use the [DrawAction](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-2d-draw-DrawAction.html) class if more fine-grained control is needed with vertices when creating graphics. - * + * Provides the logic for the [Sketch](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html) widget. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html) */ - new(properties?: SketchViewModelProperties): SketchViewModel; + new (properties?: SketchViewModelProperties): SketchViewModel; } export const SketchViewModel: SketchViewModelConstructor; interface SketchViewModelProperties { /** - * GraphicsLayer associated with the SketchViewModel. It allows you to organize where temporary graphics are placed when the drawing is completed. - * + * The [GraphicsLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html) associated with the SketchViewModel. The SketchViewModel adds new [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) to this layer or can only update graphics stored in this layer. + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#layer) */ layer?: GraphicsLayerProperties; @@ -55787,7 +59195,7 @@ declare namespace __esri { * } * } * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#pointSymbol) */ pointSymbol?: SimpleMarkerSymbolProperties; @@ -55803,7 +59211,7 @@ declare namespace __esri { * } * } * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polygonSymbol) */ polygonSymbol?: SimpleFillSymbolProperties; @@ -55816,78 +59224,553 @@ declare namespace __esri { * width: 2 * } * ``` - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#polylineSymbol) */ polylineSymbol?: SimpleLineSymbolProperties; + /** + * Indicates if a graphic can be selected to be updated. If `false`, graphics cannot selected to be updated. Set this property to `false` to add a custom [hitTest](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) logic for [updating](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#updateOnGraphicClick) + */ + updateOnGraphicClick?: boolean; /** * The view in which geometries will be sketched by the user. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#view) */ view?: MapViewProperties; } - - export interface SketchViewModelCreateDrawOptions extends Object { + export interface SketchViewModelCreateCreateOptions extends Object { /** - * The drawing mode. The drawing mode applies only when creating `polygon`, `polyline`, `rectangle` and `circle` geometries. **Possible Values:** - * + * Specifies how the graphic can be created. The create mode applies only when creating `polygon`, `polyline`, `rectangle` and `circle` geometries. **Possible Values:** + * * Value | Description | * ----- | ----------- | * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline`. * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` `rectangle` and `circle`. Default for `rectangle` and `circle`. * click | Vertices are added when the pointer is clicked. - * - * + * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#create) */ mode?: string; } + export interface SketchViewModelDefaultUpdateOptions extends Object { + /** + * Name of the update tool. The default tool is `move` for graphics with `point` and `multipoint` geometries and `transform` for graphics with `polygon` and `polyline` geometries. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) + */ + tool?: string; + /** + * Indicates if the `rotation` operation will be enabled when updating graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) + * + * @default true + */ + enableRotation?: boolean; + /** + * Indicates if the `scale` operation will be enabled when updating graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) + * + * @default true + */ + enableScaling?: boolean; + /** + * Indicates if the uniform scale operation will be enabled when updating graphics. `enableScaling` must be set `true` when setting this property to `true`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) + * + * @default false + */ + preserveAspectRatio?: boolean; + /** + * Indicates if the graphic being updated can be toggled between `transform` and `reshape` update options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) + * + * @default true + */ + toggleToolOnClick?: boolean; + } + + export interface SketchViewModelUpdateUpdateOptions extends Object { + /** + * Name of the update tool. Specifies the update operation for the selected graphics. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * transform | The *default* tool for graphics with [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometries. It allows one or multiple graphics to be scaled, rotated and moved by default. Its default behavior can be changed by setting `enableRotation`, `enableScaling` or `preserveAspectRatio` properties when calling `update` method or setting them on [defaultUpdateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#defaultUpdateOptions) property when the widget initializes. This tool does not apply if selected graphics have only [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) or [multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html) geometries. + * reshape | It allows the entire graphic or individual vertices of the graphic to be moved. Vertices can be added or removed. This tool can only be used with one graphic and the graphic's geometry has to be [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) or [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html). + * move | The *default* tool for graphics with [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) and [multipoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Multipoint.html) geometries. It should be used for specific cases where you just want to move selected `polygon` and `polyline` graphics without additional options. Additionally, the `move` tool does not support toggling to different modes, since `move` operation is already built into both `transform` and `reshape` tools by default. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) + */ + tool?: string; + /** + * Indicates if the `rotation` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) + * + * @default true + */ + enableRotation?: boolean; + /** + * Indicates if the `scale` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) + * + * @default true + */ + enableScaling?: boolean; + /** + * Indicates if the uniform scale operation will be enabled when updating graphics. `enableScaling` must be set `true` when setting this property to `true`. Only applies if `tool` is `transform`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) + * + * @default false + */ + preserveAspectRatio?: boolean; + /** + * Indicates if the graphic being updated can be toggled between `transform` and `reshape` update options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#update) + * + * @default true + */ + toggleToolOnClick?: boolean; + } + + /** + * This information is returned as `toolEventInfo` parameter for the [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:create) event when the graphic is being created. It returns [VertexAddEventInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#VertexAddEventInfo) when the user clicks the view or [CursorUpdateEventInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#CursorUpdateEventInfo) or when the user moves the cursor. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#CreateToolEventInfo) + */ + export type CreateToolEventInfo = VertexAddEventInfo | CursorUpdateEventInfo; + + /** + * This information is returned as `toolEventInfo` parameter for the [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:create) event when the user moves the cursor on the view while the graphic is being created. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#CursorUpdateEventInfo) + */ + export interface CursorUpdateEventInfo extends Object { + /** + * Type is always `cursor-update`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#CursorUpdateEventInfo) + */ + type: string; + /** + * An array of numbers representing the coordinates of the cursor location. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#CursorUpdateEventInfo) + */ + coordinates: number[]; + } + + /** + * This information is returned as `toolEventInfo` parameter for the [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event while the user is moving the graphics. It returns additional information associated with the move operation and what stage it is at. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#MoveEventInfo) + */ + export interface MoveEventInfo extends Object { + /** + * Returns information indicating the stage of the move operation. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * move-start | The type changes to `move-start` at the start of `move` operation. + * move | The type changes to `move` while graphics are being moved. + * move-stop | The type changes to `move-stop` once graphics are moved. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#MoveEventInfo) + */ + type: string; + /** + * Number of pixels moved on the x-axis from the last known position. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#MoveEventInfo) + */ + dx: number; + /** + * Number of pixels moved on the y-axis from the last known position. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#MoveEventInfo) + */ + dy: number; + /** + * The instance of the graphic that is being moved. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#MoveEventInfo) + */ + mover: Graphic; + } + + /** + * This information is returned as `toolEventInfo` parameter for the [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event while the user is reshaping the graphics. It returns additional information associated with the reshape operation and what stage it is at. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#ReshapeEventInfo) + */ + export interface ReshapeEventInfo extends Object { + /** + * Returns information indicating the stage of the reshape operation. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * reshape-start | The type changes to `reshape-start` at the start of `reshape` operation. + * reshape | The type changes to `reshape` while graphics are being reshaped. + * reshape-stop | The type changes to `reshape-stop` once graphics are reshaped. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#ReshapeEventInfo) + */ + type: string; + } + + /** + * This information is returned as `toolEventInfo` parameter for the [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event while the user is rotating the graphics. It returns additional information associated with the rotate operation and what stage it is at. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#RotateEventInfo) + */ + export interface RotateEventInfo extends Object { + /** + * Returns information indicating the stage of the rotate operation. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * rotate-start | The type changes to `rotate-start` at the start of `rotate` operation. + * rotate | The type changes to `rotate` while graphics are being rotated. + * rotate-stop | The type changes to `rotate-stop` once graphics are rotated. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#RotateEventInfo) + */ + type: string; + /** + * Angle of rotation in degrees. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#RotateEventInfo) + */ + angle: number; + } + + /** + * This information is returned as `toolEventInfo` parameter for the [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event while the user is scaling or resizing the graphics. It returns additional information associated with the scale operation and what stage it is at. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#ScaleEventInfo) + */ + export interface ScaleEventInfo extends Object { + /** + * Returns information indicating the stage of the scale operation. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * scale-start | The type changes to `scale-start` at the start of scale or resize operation. + * scale | The type changes to `scale` while graphics are being scaled or resized. + * scale-stop | The type changes to `scale-stop` once graphics are scaled or resized. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#ScaleEventInfo) + */ + type: string; + /** + * The x scale factor used to enlarge or shrink the geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#ScaleEventInfo) + */ + xScale: number; + /** + * The y scale factor used to enlarge or shrink the geometry. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#ScaleEventInfo) + */ + yScale: number; + } + + export interface SketchCreateCreateOptions extends Object { + /** + * Specifies how the graphic can be created. The create mode applies only when creating `polygon`, `polyline`, `rectangle` and `circle` geometries. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * hybrid | Vertices are added while the pointer is clicked or dragged. Applies to and is the default for `polygon` and `polyline`. + * freehand | Vertices are added while the pointer is dragged. Applies to `polygon`, `polyline` `rectangle` and `circle`. Default for `rectangle` and `circle`. + * click | Vertices are added when the pointer is clicked. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#create) + */ + mode?: string; + } + + export interface SketchUpdateUpdateOptions extends Object { + /** + * Name of the update tool. Specifies the update operation for the selected graphics. **Possible Values:** + * + * Value | Description | + * ----- | ----------- | + * transform | The *default* tool for graphics with [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) and [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html) geometries. It allows one or multiple graphics to be scaled, rotated and moved by default. Its default behavior can be changed by setting `enableRotation`, `enableScaling` or `preserveAspectRatio` properties when calling `update` method or setting them on [defaultUpdateOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#defaultUpdateOptions) property when the Sketch widget initializes. This tool does not apply if selected graphics have only [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. + * reshape | It allows the entire graphic or individual vertices of the graphic to be moved. Vertices can be added or removed. This tool can only be used with one graphic and the graphic's geometry has to be [polygon](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html) or [polyline](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polyline.html). + * move | The *default* tool for graphics with [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries. It should be used for specific cases where you just want to move selected `polygon` and `polyline` graphics without additional options. Additionally, the `move` tool does not support toggling to different modes, since `move` operation is already built into both `transform` and `reshape` tools by default. + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) + */ + tool?: string; + /** + * Indicates if the `rotation` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) + * + * @default true + */ + enableRotation?: boolean; + /** + * Indicates if the `scale` operation will be enabled when updating graphics. Only applies if `tool` is `transform`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) + * + * @default true + */ + enableScaling?: boolean; + /** + * Indicates if the uniform scale operation will be enabled when updating graphics. `enableScaling` must be set `true` when setting this property to `true`. Only applies if `tool` is `transform`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) + * + * @default false + */ + preserveAspectRatio?: boolean; + /** + * Indicates if the graphic being updated can be toggled between `transform` and `reshape` update options. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#update) + * + * @default true + */ + toggleToolOnClick?: boolean; + } + + /** + * This information is returned as `toolEventInfo` parameter for the [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event when the user is updating graphics. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#UpdateToolEventInfo) + */ + export type UpdateToolEventInfo = + | MoveEventInfo + | ReshapeEventInfo + | RotateEventInfo + | ScaleEventInfo + | VertexAddEventInfo + | VertexRemoveEventInfo; + + /** + * This information is returned as `toolEventInfo` parameter for the [create](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:create) or [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event when the user adds vertices to the graphic being created or updated. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#VertexAddEventInfo) + */ + export interface VertexAddEventInfo extends Object { + /** + * Type is always `vertex-add`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#VertexAddEventInfo) + */ + type: string; + /** + * An array of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) with [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries representing the vertices that were added. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#VertexAddEventInfo) + */ + added: Graphic[]; + } + + /** + * This information is returned as `toolEventInfo` parameter for the [update](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event:update) event when the user is removing vertices from the graphic. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#VertexRemoveEventInfo) + */ + export interface VertexRemoveEventInfo extends Object { + /** + * Type is always `vertex-remove`. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#VertexRemoveEventInfo) + */ + type: string; + /** + * An array of [graphics](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html) with [point](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Point.html) geometries representing the vertices that were removed. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#VertexRemoveEventInfo) + */ + removed: Graphic[]; + } + + interface Slice extends Widget { + /** + * A reference to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice.html#view) + */ + view: SceneView; + /** + * The view model for this widget. This is a class that contains the properties and methods that control this widget's behavior. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice.html#viewModel) + */ + viewModel: SliceViewModel; + + /** + * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice.html#render) + * + * + */ + render(): any; + } + + interface SliceConstructor { + /** + * The slice widget is a 3D analysis tool that can be used to reveal occluded content in a {@link module:esri/views/SceneView}. The slice widget can be applied to any layer type, making it possible to see inside buildings or to explore geological surfaces. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice.html) + */ + + new (properties?: SliceProperties): Slice; + } + + export const Slice: SliceConstructor; + + interface SliceProperties extends WidgetProperties { + /** + * A reference to the [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice.html#view) + */ + view?: SceneViewProperties; + /** + * The view model for this widget. This is a class that contains the properties and methods that control this widget's behavior. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice.html#viewModel) + */ + viewModel?: SliceViewModelProperties; + } + + interface SliceViewModel extends Accessor { + /** + * Add layers to this collection to exclude them from the slice. Layers that are draped on the ground surface are not affected by this property and can be excluded from the slice using [excludeGroundSurface](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#excludeGroundSurface). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#excludedLayers) + */ + excludedLayers: Collection; + /** + * Indicates whether the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) and layers that are draped on the ground surface are excluded from the slice. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#excludeGroundSurface) + */ + excludeGroundSurface: boolean; + /** + * The view model's state. + * + * Value | Description + * ------------|------------- + * disabled | not ready yet + * ready | ready for slicing + * slicing | currently slicing + * + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#state) + * + * @default disabled + */ + readonly state: string; + + /** + * Clears the current slice. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#clearSlice) + * + * + */ + clearSlice(): void; + /** + * Starts a new slice. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#newSlice) + * + * + */ + newSlice(): void; + } + + interface SliceViewModelConstructor { + new (properties?: SliceViewModelProperties): SliceViewModel; + } + + export const SliceViewModel: SliceViewModelConstructor; + + interface SliceViewModelProperties { + /** + * Add layers to this collection to exclude them from the slice. Layers that are draped on the ground surface are not affected by this property and can be excluded from the slice using [excludeGroundSurface](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#excludeGroundSurface). + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#excludedLayers) + */ + excludedLayers?: CollectionProperties; + /** + * Indicates whether the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) and layers that are draped on the ground surface are excluded from the slice. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Slice-SliceViewModel.html#excludeGroundSurface) + */ + excludeGroundSurface?: boolean; + } + interface GeolocationPositioning { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#geolocationOptions) - * + * * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } */ geolocationOptions: any; /** * Indicates whether to navigate the view to the position and scale of the geolocated result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#goToLocationEnabled) - * + * * @default true */ goToLocationEnabled: boolean; /** * The graphic used to show the user's location on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#graphic) */ graphic: Graphic; /** * The scale to set on the view when navigating to the position of the geolocated result. If a scale value is not explicitly set, then the view will navigate to a default scale of `2500`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#scale) - * + * * @default null */ scale: number; /** * The view associated with the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#view) */ view: MapView | SceneView; } interface GeolocationPositioningConstructor { - - - new(): GeolocationPositioning; + new (): GeolocationPositioning; } export const GeolocationPositioning: GeolocationPositioningConstructor; @@ -55895,37 +59778,37 @@ declare namespace __esri { interface GeolocationPositioningProperties { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#geolocationOptions) - * + * * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } */ geolocationOptions?: any; /** * Indicates whether to navigate the view to the position and scale of the geolocated result. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#goToLocationEnabled) - * + * * @default true */ goToLocationEnabled?: boolean; /** * The graphic used to show the user's location on the map. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#graphic) */ graphic?: GraphicProperties; /** * The scale to set on the view when navigating to the position of the geolocated result. If a scale value is not explicitly set, then the view will navigate to a default scale of `2500`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#scale) - * + * * @default null */ scale?: number; /** * The view associated with the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GeolocationPositioning.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -55934,16 +59817,14 @@ declare namespace __esri { interface GoTo { /** * This function provides the ability to override either the [MapView goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) or [SceneView goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GoTo.html#goToOverride) */ goToOverride: GoToOverride; } interface GoToConstructor { - - - new(): GoTo; + new (): GoTo; } export const GoTo: GoToConstructor; @@ -55951,77 +59832,84 @@ declare namespace __esri { interface GoToProperties { /** * This function provides the ability to override either the [MapView goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) or [SceneView goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) methods. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-GoTo.html#goToOverride) */ goToOverride?: GoToOverride; } - interface widget { /** * This convenience decorator is used to help simplify accessibility within the widget keyboard events. For example, it can be used to execute a method when the `space` or `enter` keys are pressed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#accessibleHandler) - * - * + * + * */ accessibleHandler(): Function; /** * Utility method used for creating CSS animation/transition functions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#cssTransition) - * + * * @param type The animation/transition type. **Possible Values:** enter | exit * @param className The animation/transition class name. - * + * */ cssTransition(type: string, className: string): Function; + /** + * Utility method used to determine if the directionality of the text of the document is right-to-left. + * + * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#isRTL) + * + * + */ + isRTL(): boolean; /** * Utility method used for joining CSS classes. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#join) - * + * * @param classNames The class names to join. - * + * */ join(...classNames: string[]): string; /** * This convenience decorator marks a property for automatic rendering. It is useful when you want rendering to be scheduled whenever the decorated property changes. Many times this decorator is used in conjunction with the [@property](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-accessorSupport-decorators.html) decorator. Rendering on deep properties is also supported by providing a path to a property deeper in the instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#renderable) - * + * * @param propertyName Names of nested renderable properties. - * + * */ renderable(propertyName?: string | string[]): Function; /** * This convenience method is used to assign an [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) DOM node reference to a variable. It does this by taking a [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) passed from either the [afterUpdate](https://developers.arcgis.com/javascript/latest/guide/custom-widget/index.html#widget-rendering) or [afterCreate](https://developers.arcgis.com/javascript/latest/guide/custom-widget/index.html#widget-rendering) callbacks. In order to use this, the element must have a set [data-node-ref](https://developers.arcgis.com/javascript/latest/guide/custom-widget/index.html#widget-rendering) attribute. In addition, it must also be bound to the widget instance, e.g. `bind={this}`. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#storeNode) - * + * * @param node The referenced DOM node. - * + * */ storeNode(node: HTMLElement): void; /** * This convenience method is used to render the JSX in the [widget.render()](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#render) method. It is required to import `tsx` even though it is not explicitly called. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#tsx) - * + * * @param selector The element to create. * @param properties The element's properties. * @param children The element's children. - * + * */ tsx(selector: string, properties?: any, children?: any): any; /** * This convenience decorator helps dispatch view model events on the widget instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#vmEvent) - * + * * @param eventNames The event names to re-dispatch. - * + * */ vmEvent(eventNames: string | string[]): Function; } @@ -56032,19 +59920,19 @@ declare namespace __esri { /** * The following parameters passed to either the [MapView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) or [SceneView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) functions. For additional information on what can be passed to its `target` or `options`, please refer to documentation for either the [MapView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) or [SceneView's goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) functions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#GoToParameters) */ export interface GoToParameters extends Object { /** * The target location/viewpoint to animate to. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#GoToParameters) */ target: any; /** * Animation options. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-support-widget.html#GoToParameters) */ options?: any; @@ -56053,97 +59941,97 @@ declare namespace __esri { interface Track extends Widget, GoTo { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#geolocationOptions) - * + * * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } */ geolocationOptions: any; /** * Indicates whether the widget will automatically navigate the view to the user's position when a geolocation result is found. Set to `false` to disable this behavior, leaving full control to the developer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#goToLocationEnabled) - * + * * @default true */ goToLocationEnabled: boolean; /** * The graphic used to show the user's location in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#graphic) */ graphic: Graphic; /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#label) */ readonly label: string; /** * Indicates the scale to set on the view when navigating to the position of the geolocated result once a location is returned from the [track](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#event:track) event. If a scale value is not explicitly set, then the view will navigate to a default scale of `2500`. For 2D views the value should be within the [effectiveMinScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) and [effectiveMaxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#scale) - * + * * @default null */ scale: number; /** * Indicates whether the widget is watching for new positions. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#tracking) - * + * * @default false */ readonly tracking: boolean; /** * Indicates whether the widget will automatically [rotate to user's direction](https://www.w3.org/TR/geolocation-API/#coordinates_interface). Set to `false` to disable this behavior. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#useHeadingEnabled) - * + * * @default true */ useHeadingEnabled: boolean; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#view) */ view: MapView | SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [TrackViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#viewModel) */ viewModel: TrackViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#render) - * - * + * + * */ render(): any; /** * When executed, the widget will start [tracking](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#tracking) the user's location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#start) - * - * + * + * */ start(): void; /** * Stops tracking the user's location when executed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#stop) - * - * + * + * */ stop(): void; } @@ -56151,11 +60039,11 @@ declare namespace __esri { interface TrackConstructor { /** * Provides a simple button that animates the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to the user's location when clicked. The view rotates according to the direction where the tracked device is heading towards. While tracking, the default button looks like the following: - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html) */ - new(properties?: TrackProperties): Track; + new (properties?: TrackProperties): Track; } export const Track: TrackConstructor; @@ -56163,51 +60051,51 @@ declare namespace __esri { interface TrackProperties extends WidgetProperties, GoToProperties { /** * The HTML5 Geolocation Position options for locating. Refer to [Geolocation API Specification](http://www.w3.org/TR/geolocation-API/#position-options) for details. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#geolocationOptions) - * + * * @default { maximumAge: 0, timeout: 15000, enableHighAccuracy: true } */ geolocationOptions?: any; /** * Indicates whether the widget will automatically navigate the view to the user's position when a geolocation result is found. Set to `false` to disable this behavior, leaving full control to the developer. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#goToLocationEnabled) - * + * * @default true */ goToLocationEnabled?: boolean; /** * The graphic used to show the user's location in the view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#graphic) */ graphic?: GraphicProperties; /** * Indicates the scale to set on the view when navigating to the position of the geolocated result once a location is returned from the [track](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#event:track) event. If a scale value is not explicitly set, then the view will navigate to a default scale of `2500`. For 2D views the value should be within the [effectiveMinScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints) and [effectiveMaxScale](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#constraints). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#scale) - * + * * @default null */ scale?: number; /** * Indicates whether the widget will automatically [rotate to user's direction](https://www.w3.org/TR/geolocation-API/#coordinates_interface). Set to `false` to disable this behavior. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#useHeadingEnabled) - * + * * @default true */ useHeadingEnabled?: boolean; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [TrackViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html#viewModel) */ viewModel?: TrackViewModelProperties; @@ -56216,35 +60104,35 @@ declare namespace __esri { interface TrackViewModel extends Accessor, Evented, GeolocationPositioning, GoTo { /** * The current state of the widget. **Possible Values:** disabled | ready | tracking | waiting - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * Indicates whether new positions are being watched. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#tracking) - * + * * @default false */ readonly tracking: boolean; /** * When executed, [tracking](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#tracking) starts at the user's location. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#start) - * - * + * + * */ start(): void; /** * Stops tracking the user's location when executed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#stop) - * - * + * + * */ stop(): void; } @@ -56252,113 +60140,111 @@ declare namespace __esri { interface TrackViewModelConstructor { /** * Provides the logic for the [Track](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track.html) widget, which animates the [View](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html) to the user's location when clicked and tracks it as the location is updated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html) */ - new(properties?: TrackViewModelProperties): TrackViewModel; + new (properties?: TrackViewModelProperties): TrackViewModel; } export const TrackViewModel: TrackViewModelConstructor; - interface TrackViewModelProperties extends GeolocationPositioningProperties, GoToProperties { - - } + interface TrackViewModelProperties extends GeolocationPositioningProperties, GoToProperties {} interface UnivariateColorSizeSlider extends Accessor, Widgette { /** * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#handlesVisible) - * + * * @default true */ handlesVisible: boolean; /** * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram) */ histogram: HistogramResult; /** * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogramVisible) - * + * * @default true */ histogramVisible: boolean; /** * The width of the histogram in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogramWidth) - * + * * @default 100 */ histogramWidth: number; /** * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#labelsVisible) - * + * * @default true */ labelsVisible: boolean; /** * The size in points or pixels with which features will be represented at or above the [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxSize) */ readonly maxSize: number; /** * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics), but may not be smaller than the upper value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue) */ maxValue: number; /** * The size in points or pixels with which features will be represented at or below the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue). - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minSize) */ readonly minSize: number; /** * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics), but may not be greater than the lower value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue) */ minValue: number; /** * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue) of the slider if values for those properties are not already provided. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) */ statistics: UnivariateColorSizeSliderStatistics; /** * Indicates whether to show the average of the dataset in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statisticsVisible) - * + * * @default true */ statisticsVisible: boolean; /** * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#ticksVisible) - * + * * @default true */ ticksVisible: boolean; /** * Represents the data values corresponding to the handles on the slider. It is an array of numbers indicating the `minDataValue` and the `maxDataValue` of the visual variables represented by the slider. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) */ readonly values: number[]; /** * The size and color visual variables represented by the slider. Since this slider represents univariate visualizations, both color and size visual variables must represent data from the same field or expression and be conicident. In other words, the lower stop or bound of the color visual variable must match the lower bound (or `minDataValue`) of the size visual variable. The same is true of the upper bounds of both visual variables. These must be set initially on the slider for it to render in the view. Both visual variables may be created manually (see snippet below) or generated from the [univariateColorSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html) helper methods. New coincident color and size visual variables are created each time the user slides the handles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#visualVariables) */ visualVariables: any[]; @@ -56367,11 +60253,11 @@ declare namespace __esri { interface UnivariateColorSizeSliderConstructor { /** * The UnivariateColorSizeSlider is a widget intended for authoring and exploring data-driven univariate visualizations in a [FeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or [SceneLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-SceneLayer.html) using color and size. To display properly, this slider requires [color and size visual variables](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#visualVariables) and a [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) object. Other optional properties may be used including adding a [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram). Most of the various options that affect the UI of the slider are labeled in the image below. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html) */ - new(properties?: UnivariateColorSizeSliderProperties): UnivariateColorSizeSlider; + new (properties?: UnivariateColorSizeSliderProperties): UnivariateColorSizeSlider; } export const UnivariateColorSizeSlider: UnivariateColorSizeSliderConstructor; @@ -56379,107 +60265,106 @@ declare namespace __esri { interface UnivariateColorSizeSliderProperties extends WidgetteProperties { /** * Indicates whether to show the handles of the slider that may be dragged by the user. See the image in the [class description](#) to see where handles are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#handlesVisible) - * + * * @default true */ handlesVisible?: boolean; /** * The histogram associated with the data represented on the slider. This may be generated using the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-histogram.html) statistics function. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram) */ histogram?: HistogramResult; /** * Indicates whether to show the [histogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogram) in the slider UI. See the image in the [class description](#) to see where the histogram is typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogramVisible) - * + * * @default true */ histogramVisible?: boolean; /** * The width of the histogram in pixels. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#histogramWidth) - * + * * @default 100 */ histogramWidth?: number; /** * Indicates whether to show labels in the slider UI. See the image in the [class description](#) to see where labels are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#labelsVisible) - * + * * @default true */ labelsVisible?: boolean; /** * The maximum value or upper bound of the slider. This value overrides the `max` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics), but may not be smaller than the upper value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue) */ maxValue?: number; /** * The minimum value or lower bound of the slider. This value overrides the `min` property of the [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics), but may not be greater than the lower value of the [values](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#values) array. This property may be set programmatically or by the user in the widget's UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue) */ minValue?: number; /** * The summary statistics of the data represented in the slider. This is an object that may be generated from the [summaryStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-statistics-summaryStatistics.html) statistics function. The `min` and `max` values in this object determine the [minValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#minValue) and [maxValue](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#maxValue) of the slider if values for those properties are not already provided. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) */ statistics?: UnivariateColorSizeSliderStatistics; /** * Indicates whether to show the average of the dataset in the slider UI. See the image in the [class description](#) to see where this symbol is typically placed. Hover over this symbol to view the average in the tooltip. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statisticsVisible) - * + * * @default true */ statisticsVisible?: boolean; /** * Indicates whether to show tick marks next to the slider handles. See the image in the [class description](#) to see where ticks are typically placed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#ticksVisible) - * + * * @default true */ ticksVisible?: boolean; /** * The size and color visual variables represented by the slider. Since this slider represents univariate visualizations, both color and size visual variables must represent data from the same field or expression and be conicident. In other words, the lower stop or bound of the color visual variable must match the lower bound (or `minDataValue`) of the size visual variable. The same is true of the upper bounds of both visual variables. These must be set initially on the slider for it to render in the view. Both visual variables may be created manually (see snippet below) or generated from the [univariateColorSize](https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-smartMapping-creators-univariateColorSize.html) helper methods. New coincident color and size visual variables are created each time the user slides the handles. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#visualVariables) */ visualVariables?: any[]; } - export interface UnivariateColorSizeSliderStatistics extends Object { /** * The average of all data values represented in the size and color visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) */ avg: number; /** * The maximum of all data values represented in the size and color visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) */ max: number; /** * The minimum of all data values represented in the size and color visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) */ min: number; /** * The standard deviation calculated from all data values represented in the size and color visual variables. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-UnivariateColorSizeSlider.html#statistics) */ stddev: number; @@ -56488,98 +60373,90 @@ declare namespace __esri { interface Widget extends Accessor, Evented { /** * The ID or node representing the DOM element containing the widget. This property can only be set once. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#container) */ container: string | HTMLElement; /** * When `true`, this property indicates whether the widget has been destroyed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#destroyed) */ destroyed: boolean; /** * The unique ID assigned to the widget when the widget is created. If not set by the developer, it will default to the container ID, or if that is not present then it will be automatically generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#id) */ id: string; /** - * A utility method used for building the value for a widget's `class` property. This aids in simplifying CSS class setup. + * A utility method used for building the value for a widget's `class` property. This aids in simplifying CSS class setup. * > Prior to version 4.7, there were various approaches towards setting CSS classes. These were dependent upon variables, such as whether the classes were: * * a single static class, * * multiple static classes, or * * dynamic classes. - * - * + * + * * This helper method takes all of these approaches into account and simplifies it to use one single pattern to accommodate these multiple approaches. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#classes) - * + * * @param classNames The class names. - * + * */ classes(...classNames: (string | string[] | any)[]): string; /** * Destroys the widget instance. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#destroy) - * - * + * + * */ destroy(): void; /** * Widget teardown helper. Any handles added to it will be automatically removed when the widget is destroyed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#own) - * + * * @param handles Handles marked for removal once the widget is destroyed. - * + * */ own(handles: WatchHandle | WatchHandle[]): void; /** * *This method is primarily used by developers when implementing custom widgets.* Executes after widget is ready for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#postInitialize) - * - * + * + * */ postInitialize(): void; /** * Renders widget to the DOM immediately. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#renderNow) - * - * + * + * */ renderNow(): void; /** * *This method is primarily used by developers when implementing custom widgets.* Schedules widget rendering. This method is useful for changes affecting the UI. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#scheduleRender) - * - * + * + * */ scheduleRender(): void; - /** - * **Deprecated.** Finalizes the creation of the widget. - * - * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#startup) - * - * - */ - startup(): void; } interface WidgetConstructor { /** * The base class for widgets. Each widget's presentation is separate from its properties, methods, and data. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html) */ - new(properties?: WidgetProperties): Widget; + new (properties?: WidgetProperties): Widget; } export const Widget: WidgetConstructor; @@ -56587,19 +60464,19 @@ declare namespace __esri { interface WidgetProperties { /** * The ID or node representing the DOM element containing the widget. This property can only be set once. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#container) */ container?: string | HTMLElement; /** * When `true`, this property indicates whether the widget has been destroyed. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#destroyed) */ destroyed?: boolean; /** * The unique ID assigned to the widget when the widget is created. If not set by the developer, it will default to the container ID, or if that is not present then it will be automatically generated. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html#id) */ id?: string; @@ -56608,43 +60485,41 @@ declare namespace __esri { interface Widgette { /** * The ID or node representing the DOM element containing the widget. Note that once set, this property cannot be modified afterwards. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#container) */ container: string | HTMLElement; /** * Indicates whether the widget is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#visible) - * + * * @default true */ visible: boolean; /** * Destroys the widget instance. Call this method when the widget is no longer needed by the application. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#destroy) - * - * + * + * */ destroy(): void; /** * Registers an event handler on the widget instance. Call this method to hook an event with a listener. See the [Events summary table](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#events-summary) for a list of supported events. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#on) - * + * * @param type The name of the event. * @param listener The function to call when the event is fired. - * + * */ on(type: string, listener: Function): any; } interface WidgetteConstructor { - - - new(): Widgette; + new (): Widgette; } export const Widgette: WidgetteConstructor; @@ -56652,15 +60527,15 @@ declare namespace __esri { interface WidgetteProperties { /** * The ID or node representing the DOM element containing the widget. Note that once set, this property cannot be modified afterwards. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#container) */ container?: string | HTMLElement; /** * Indicates whether the widget is visible. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widgette.html#visible) - * + * * @default true */ visible?: boolean; @@ -56669,59 +60544,59 @@ declare namespace __esri { interface Zoom extends Widget { /** * The widget's default CSS icon class. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#iconClass) */ readonly iconClass: string; /** * The widget's default label. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#label) */ readonly label: string; /** * Determines the layout/orientation of the Zoom widget. **Possible Values:** vertical | horizontal - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#layout) - * + * * @default vertical */ layout: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#view) */ view: MapView | SceneView; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [ZoomViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#viewModel) */ viewModel: ZoomViewModel; /** * *This method is primarily used by developers when implementing custom widgets.* It must be implemented by subclasses for rendering. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#render) - * - * + * + * */ render(): any; /** * Zooms the view in by an LOD factor of 0.5. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#zoomIn) - * - * + * + * */ zoomIn(): void; /** * Zooms the view out by an LOD factor of 2. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#zoomOut) - * - * + * + * */ zoomOut(): void; } @@ -56729,11 +60604,11 @@ declare namespace __esri { interface ZoomConstructor { /** * The Zoom widget allows users to zoom in/out within a view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html) */ - new(properties?: ZoomProperties): Zoom; + new (properties?: ZoomProperties): Zoom; } export const Zoom: ZoomConstructor; @@ -56741,21 +60616,21 @@ declare namespace __esri { interface ZoomProperties extends WidgetProperties { /** * Determines the layout/orientation of the Zoom widget. **Possible Values:** vertical | horizontal - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#layout) - * + * * @default vertical */ layout?: string; /** * A reference to the [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html) or [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html). Set this to link the widget to a specific view. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#view) */ view?: MapViewProperties | SceneViewProperties; /** * The view model for this widget. This is a class that contains all the logic (properties and methods) that controls this widget's behavior. See the [ZoomViewModel](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html) class to access all properties and methods on the widget. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom.html#viewModel) */ viewModel?: ZoomViewModelProperties; @@ -56764,53 +60639,51 @@ declare namespace __esri { interface ZoomViewModel extends Accessor { /** * Indicates if the view can zoom in. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#canZoomIn) */ canZoomIn: boolean; /** * Indicates if the view can zoom out. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#canZoomOut) */ canZoomOut: boolean; /** * The current state of the widget. **Possible Values:** disabled | ready - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#state) - * + * * @default disabled */ readonly state: string; /** * The view from which to operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#view) */ view: MapView | SceneView; /** * Zooms the view in by an LOD factor of 0.5. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#zoomIn) - * - * + * + * */ zoomIn(): void; /** * Zooms the view out by an LOD factor of 2. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#zoomOut) - * - * + * + * */ zoomOut(): void; } interface ZoomViewModelConstructor { - - - new(properties?: ZoomViewModelProperties): ZoomViewModel; + new (properties?: ZoomViewModelProperties): ZoomViewModel; } export const ZoomViewModel: ZoomViewModelConstructor; @@ -56818,19 +60691,19 @@ declare namespace __esri { interface ZoomViewModelProperties { /** * Indicates if the view can zoom in. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#canZoomIn) */ canZoomIn?: boolean; /** * Indicates if the view can zoom out. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#canZoomOut) */ canZoomOut?: boolean; /** * The view from which to operate. - * + * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Zoom-ZoomViewModel.html#view) */ view?: MapViewProperties | SceneViewProperties; @@ -57093,11 +60966,6 @@ declare module "esri/identity/Credential" { export = Credential; } -declare module "esri/identity/IdentityManagerBase" { - import IdentityManagerBase = __esri.IdentityManagerBase; - export = IdentityManagerBase; -} - declare module "esri/identity/IdentityManager" { const IdentityManager: __esri.IdentityManager; export = IdentityManager; @@ -57118,6 +60986,11 @@ declare module "esri/layers/BaseElevationLayer" { export = BaseElevationLayer; } +declare module "esri/layers/BuildingSceneLayer" { + import BuildingSceneLayer = __esri.BuildingSceneLayer; + export = BuildingSceneLayer; +} + declare module "esri/layers/BingMapsLayer" { import BingMapsLayer = __esri.BingMapsLayer; export = BingMapsLayer; @@ -57248,6 +61121,41 @@ declare module "esri/layers/BaseTileLayer" { export = BaseTileLayer; } +declare module "esri/layers/buildingSublayers/BuildingComponentSublayer" { + import BuildingComponentSublayer = __esri.BuildingComponentSublayer; + export = BuildingComponentSublayer; +} + +declare module "esri/layers/buildingSublayers/BuildingGroupSublayer" { + import BuildingGroupSublayer = __esri.BuildingGroupSublayer; + export = BuildingGroupSublayer; +} + +declare module "esri/layers/buildingSublayers/BuildingSublayer" { + import BuildingSublayer = __esri.BuildingSublayer; + export = BuildingSublayer; +} + +declare module "esri/layers/pointCloudFilters/PointCloudFilter" { + import PointCloudFilter = __esri.PointCloudFilter; + export = PointCloudFilter; +} + +declare module "esri/layers/pointCloudFilters/PointCloudValueFilter" { + import PointCloudValueFilter = __esri.PointCloudValueFilter; + export = PointCloudValueFilter; +} + +declare module "esri/layers/pointCloudFilters/PointCloudReturnFilter" { + import PointCloudReturnFilter = __esri.PointCloudReturnFilter; + export = PointCloudReturnFilter; +} + +declare module "esri/layers/support/AttachmentInfo" { + import AttachmentInfo = __esri.AttachmentInfo; + export = AttachmentInfo; +} + declare module "esri/layers/support/CodedValueDomain" { import CodedValueDomain = __esri.CodedValueDomain; export = CodedValueDomain; @@ -57473,6 +61381,46 @@ declare module "esri/renderers/support/HeatmapColorStop" { export = HeatmapColorStop; } +declare module "esri/renderers/visualVariables/ColorVariable" { + import ColorVariable = __esri.ColorVariable; + export = ColorVariable; +} + +declare module "esri/renderers/visualVariables/OpacityVariable" { + import OpacityVariable = __esri.OpacityVariable; + export = OpacityVariable; +} + +declare module "esri/renderers/visualVariables/RotationVariable" { + import RotationVariable = __esri.RotationVariable; + export = RotationVariable; +} + +declare module "esri/renderers/visualVariables/SizeVariable" { + import SizeVariable = __esri.SizeVariable; + export = SizeVariable; +} + +declare module "esri/renderers/visualVariables/VisualVariable" { + import VisualVariable = __esri.VisualVariable; + export = VisualVariable; +} + +declare module "esri/renderers/visualVariables/support/ColorStop" { + import ColorStop = __esri.ColorStop; + export = ColorStop; +} + +declare module "esri/renderers/visualVariables/support/OpacityStop" { + import OpacityStop = __esri.OpacityStop; + export = OpacityStop; +} + +declare module "esri/renderers/visualVariables/support/SizeStop" { + import SizeStop = __esri.SizeStop; + export = SizeStop; +} + declare module "esri/support/actions/ActionButton" { import ActionButton = __esri.ActionButton; export = ActionButton; @@ -57483,6 +61431,111 @@ declare module "esri/support/actions/ActionToggle" { export = ActionToggle; } +declare module "esri/support/ExpressionInfo" { + import ExpressionInfo = __esri.ExpressionInfo; + export = ExpressionInfo; +} + +declare module "esri/support/FieldInfo" { + import FieldInfo = __esri.FieldInfo; + export = FieldInfo; +} + +declare module "esri/support/LayerOptions" { + import LayerOptions = __esri.LayerOptions; + export = LayerOptions; +} + +declare module "esri/support/RelatedRecordsInfo" { + import RelatedRecordsInfo = __esri.RelatedRecordsInfo; + export = RelatedRecordsInfo; +} + +declare module "esri/support/ContentElement/Attachments" { + import Attachments = __esri.Attachments; + export = Attachments; +} + +declare module "esri/support/ContentElement/ContentElement" { + import ContentElementContentElement = __esri.ContentElementContentElement; + export = ContentElementContentElement; +} + +declare module "esri/support/ContentElement/Fields" { + import Fields = __esri.Fields; + export = Fields; +} + +declare module "esri/support/ContentElement/Media" { + import Media = __esri.Media; + export = Media; +} + +declare module "esri/support/ContentElement/Text" { + import Text = __esri.Text; + export = Text; +} + +declare module "esri/support/ContentElement/Media/BarChart" { + import BarChart = __esri.BarChart; + export = BarChart; +} + +declare module "esri/support/ContentElement/Media/Chart" { + import Chart = __esri.Chart; + export = Chart; +} + +declare module "esri/support/ContentElement/Media/ColumnChart" { + import ColumnChart = __esri.ColumnChart; + export = ColumnChart; +} + +declare module "esri/support/ContentElement/Media/LineChart" { + import LineChart = __esri.LineChart; + export = LineChart; +} + +declare module "esri/support/ContentElement/Media/Media" { + import MediaMedia = __esri.MediaMedia; + export = MediaMedia; +} + +declare module "esri/support/ContentElement/Media/PieChart" { + import PieChart = __esri.PieChart; + export = PieChart; +} + +declare module "esri/support/ContentElement/Media/Chart/Series" { + import Series = __esri.Series; + export = Series; +} + +declare module "esri/support/ContentElement/Media/Chart/Value" { + import Value = __esri.Value; + export = Value; +} + +declare module "esri/support/ContentElement/Media/Image" { + import Image = __esri.Image; + export = Image; +} + +declare module "esri/support/ContentElement/Media/Image/Value" { + import ImageValue = __esri.ImageValue; + export = ImageValue; +} + +declare module "esri/support/FieldInfo/Format" { + import FieldInfoFormat = __esri.FieldInfoFormat; + export = FieldInfoFormat; +} + +declare module "esri/support/RelatedRecordsInfo/FieldOrder" { + import FieldOrder = __esri.FieldOrder; + export = FieldOrder; +} + declare module "esri/symbols/ExtrudeSymbol3DLayer" { import ExtrudeSymbol3DLayer = __esri.ExtrudeSymbol3DLayer; export = ExtrudeSymbol3DLayer; @@ -58073,11 +62126,6 @@ declare module "esri/views/2d/draw/SegmentDrawAction" { export = SegmentDrawAction; } -declare module "esri/views/2d/layers/BaseLayerView2D" { - import BaseLayerView2D = __esri.BaseLayerView2D; - export = BaseLayerView2D; -} - declare module "esri/webmap/Bookmark" { import Bookmark = __esri.Bookmark; export = Bookmark; @@ -58148,6 +62196,11 @@ declare module "esri/webscene/background/ColorBackground" { export = ColorBackground; } +declare module "esri/widgets/AreaMeasurement2D" { + import AreaMeasurement2D = __esri.AreaMeasurement2D; + export = AreaMeasurement2D; +} + declare module "esri/widgets/AreaMeasurement3D" { import AreaMeasurement3D = __esri.AreaMeasurement3D; export = AreaMeasurement3D; @@ -58198,6 +62251,11 @@ declare module "esri/widgets/DirectLineMeasurement3D" { export = DirectLineMeasurement3D; } +declare module "esri/widgets/DistanceMeasurement2D" { + import DistanceMeasurement2D = __esri.DistanceMeasurement2D; + export = DistanceMeasurement2D; +} + declare module "esri/widgets/Expand" { import Expand = __esri.Expand; export = Expand; @@ -58213,6 +62271,11 @@ declare module "esri/widgets/FeatureForm" { export = FeatureForm; } +declare module "esri/widgets/FeatureTemplates" { + import FeatureTemplates = __esri.FeatureTemplates; + export = FeatureTemplates; +} + declare module "esri/widgets/Fullscreen" { import Fullscreen = __esri.Fullscreen; export = Fullscreen; @@ -58263,11 +62326,21 @@ declare module "esri/widgets/Search" { export = widgetsSearch; } +declare module "esri/widgets/Sketch" { + import Sketch = __esri.Sketch; + export = Sketch; +} + declare module "esri/widgets/SizeSlider" { import SizeSlider = __esri.SizeSlider; export = SizeSlider; } +declare module "esri/widgets/Slice" { + import Slice = __esri.Slice; + export = Slice; +} + declare module "esri/widgets/Track" { import Track = __esri.Track; export = Track; @@ -58288,6 +62361,11 @@ declare module "esri/widgets/Zoom" { export = Zoom; } +declare module "esri/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel" { + import AreaMeasurement2DViewModel = __esri.AreaMeasurement2DViewModel; + export = AreaMeasurement2DViewModel; +} + declare module "esri/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel" { import AreaMeasurement3DViewModel = __esri.AreaMeasurement3DViewModel; export = AreaMeasurement3DViewModel; @@ -58348,6 +62426,11 @@ declare module "esri/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DView export = DirectLineMeasurement3DViewModel; } +declare module "esri/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel" { + import DistanceMeasurement2DViewModel = __esri.DistanceMeasurement2DViewModel; + export = DistanceMeasurement2DViewModel; +} + declare module "esri/widgets/Expand/ExpandViewModel" { import ExpandViewModel = __esri.ExpandViewModel; export = ExpandViewModel; @@ -58368,9 +62451,9 @@ declare module "esri/widgets/FeatureForm/FieldConfig" { export = FieldConfig; } -declare module "esri/widgets/FeatureForm/FieldOptions" { - import FieldOptions = __esri.FieldOptions; - export = FieldOptions; +declare module "esri/widgets/FeatureForm/FieldGroupConfig" { + import FieldGroupConfig = __esri.FieldGroupConfig; + export = FieldGroupConfig; } declare module "esri/widgets/FeatureForm/InputField" { @@ -58378,6 +62461,26 @@ declare module "esri/widgets/FeatureForm/InputField" { export = InputField; } +declare module "esri/widgets/FeatureForm/InputFieldGroup" { + import InputFieldGroup = __esri.InputFieldGroup; + export = InputFieldGroup; +} + +declare module "esri/widgets/FeatureTemplates/FeatureTemplatesViewModel" { + import FeatureTemplatesViewModel = __esri.FeatureTemplatesViewModel; + export = FeatureTemplatesViewModel; +} + +declare module "esri/widgets/FeatureTemplates/TemplateItem" { + import TemplateItem = __esri.TemplateItem; + export = TemplateItem; +} + +declare module "esri/widgets/FeatureTemplates/TemplateItemGroup" { + import TemplateItemGroup = __esri.TemplateItemGroup; + export = TemplateItemGroup; +} + declare module "esri/widgets/Fullscreen/FullscreenViewModel" { import FullscreenViewModel = __esri.FullscreenViewModel; export = FullscreenViewModel; @@ -58443,6 +62546,11 @@ declare module "esri/widgets/Search/LocatorSearchSource" { export = LocatorSearchSource; } +declare module "esri/widgets/Search/SearchResultRenderer" { + import SearchResultRenderer = __esri.SearchResultRenderer; + export = SearchResultRenderer; +} + declare module "esri/widgets/Search/SearchSource" { import SearchSource = __esri.SearchSource; export = SearchSource; @@ -58453,6 +62561,11 @@ declare module "esri/widgets/Search/SearchViewModel" { export = SearchViewModel; } +declare module "esri/widgets/Slice/SliceViewModel" { + import SliceViewModel = __esri.SliceViewModel; + export = SliceViewModel; +} + declare module "esri/widgets/Track/TrackViewModel" { import TrackViewModel = __esri.TrackViewModel; export = TrackViewModel; @@ -58498,11 +62611,6 @@ declare module "esri/layers/mixins/ArcGISCachedService" { export = ArcGISCachedService; } -declare module "esri/layers/mixins/ArcGISDynamicMapService" { - import ArcGISDynamicMapService = __esri.ArcGISDynamicMapService; - export = ArcGISDynamicMapService; -} - declare module "esri/layers/mixins/ArcGISImageService" { import ArcGISImageService = __esri.ArcGISImageService; export = ArcGISImageService; @@ -58538,9 +62646,9 @@ declare module "esri/layers/mixins/SublayersOwner" { export = SublayersOwner; } -declare module "esri/renderers/VisualVariablesMixin" { - import VisualVariablesMixin = __esri.VisualVariablesMixin; - export = VisualVariablesMixin; +declare module "esri/renderers/mixins/VisualVariablesRenderer" { + import VisualVariablesRenderer = __esri.VisualVariablesRenderer; + export = VisualVariablesRenderer; } declare module "esri/support/actions/ActionBase" { @@ -58583,16 +62691,36 @@ declare module "esri/config" { export = config; } +declare module "esri/geometry" { + import geometry = __esri.geometry; + export = geometry; +} + declare module "esri/kernel" { import kernel = __esri.kernel; export = kernel; } +declare module "esri/pointCloudRenderers" { + import pointCloudRenderers = __esri.pointCloudRenderers; + export = pointCloudRenderers; +} + +declare module "esri/renderers" { + import renderers = __esri.renderers; + export = renderers; +} + declare module "esri/request" { import request = __esri.request; export = request; } +declare module "esri/symbols" { + import symbols = __esri.symbols; + export = symbols; +} + declare module "esri/core/Error" { import Error = __esri.Error; export = Error; @@ -58773,6 +62901,11 @@ declare module "esri/renderers/support/jsonUtils" { export = supportJsonUtils; } +declare module "esri/support/ContentElement" { + import ContentElement = __esri.ContentElement; + export = ContentElement; +} + declare module "esri/symbols/support/jsonUtils" { import symbolsSupportJsonUtils = __esri.symbolsSupportJsonUtils; export = symbolsSupportJsonUtils; @@ -58783,6 +62916,11 @@ declare module "esri/symbols/support/symbolPreview" { export = symbolPreview; } +declare module "esri/views/2d/layers/BaseLayerView2D" { + import BaseLayerView2D = __esri.BaseLayerView2D; + export = BaseLayerView2D; +} + declare module "esri/views/3d/externalRenderers" { import externalRenderers = __esri.externalRenderers; export = externalRenderers; @@ -58802,98 +62940,3 @@ declare module "esri/widgets/CoordinateConversion/support/Conversion" { import Conversion = __esri.Conversion; export = Conversion; } - - -declare module "esri/geometry" { - export import Extent = __esri.Extent; - export import Multipoint = __esri.Multipoint; - export import Point = __esri.Point; - export import Polygon = __esri.Polygon; - export import Polyline = __esri.Polyline; - export import SpatialReference = __esri.SpatialReference; - export import ScreenPoint = __esri.ScreenPoint; - export import Mesh = __esri.Mesh; - - export type Geometry = Extent | Multipoint | Point | Polygon | Polyline | Mesh; -} - - - -declare module "esri/pointCloudRenderers" { - export import PointCloudClassBreaksRenderer = __esri.PointCloudClassBreaksRenderer; - export import PointCloudRGBRenderer = __esri.PointCloudRGBRenderer; - export import PointCloudStretchRenderer = __esri.PointCloudStretchRenderer; - export import PointCloudUniqueValueRenderer = __esri.PointCloudUniqueValueRenderer; - - export type PointCloudRenderer = PointCloudClassBreaksRenderer | PointCloudRGBRenderer | PointCloudStretchRenderer | PointCloudUniqueValueRenderer; -} - - - - - -declare module "esri/renderers" { - export import ClassBreaksRenderer = __esri.ClassBreaksRenderer; - export import HeatmapRenderer = __esri.HeatmapRenderer; - export import SimpleRenderer = __esri.SimpleRenderer; - export import UniqueValueRenderer = __esri.UniqueValueRenderer; - - export type Renderer = ClassBreaksRenderer | HeatmapRenderer | SimpleRenderer | UniqueValueRenderer; -} - - - -declare module "esri/symbols" { - export import ExtrudeSymbol3DLayer = __esri.ExtrudeSymbol3DLayer; - export import FillSymbol3DLayer = __esri.FillSymbol3DLayer; - export import Font = __esri.Font; - export import IconSymbol3DLayer = __esri.IconSymbol3DLayer; - export import LabelSymbol3D = __esri.LabelSymbol3D; - export import LineSymbol3D = __esri.LineSymbol3D; - export import LineSymbol3DLayer = __esri.LineSymbol3DLayer; - export import MeshSymbol3D = __esri.MeshSymbol3D; - export import ObjectSymbol3DLayer = __esri.ObjectSymbol3DLayer; - export import PathSymbol3DLayer = __esri.PathSymbol3DLayer; - export import PictureFillSymbol = __esri.PictureFillSymbol; - export import PictureMarkerSymbol = __esri.PictureMarkerSymbol; - export import PointSymbol3D = __esri.PointSymbol3D; - export import PolygonSymbol3D = __esri.PolygonSymbol3D; - export import SimpleFillSymbol = __esri.SimpleFillSymbol; - export import SimpleLineSymbol = __esri.SimpleLineSymbol; - export import SimpleMarkerSymbol = __esri.SimpleMarkerSymbol; - export import TextSymbol = __esri.TextSymbol; - export import TextSymbol3DLayer = __esri.TextSymbol3DLayer; - export import WebStyleSymbol = __esri.WebStyleSymbol; - - export type FillSymbol = PictureFillSymbol | SimpleFillSymbol; - export type MarkerSymbol = PictureMarkerSymbol | SimpleMarkerSymbol; - - export type Symbol2D = ( - PictureFillSymbol | - PictureMarkerSymbol | - SimpleFillSymbol | - SimpleLineSymbol | - SimpleMarkerSymbol | - TextSymbol - ); - - export type Symbol3D = ( - LabelSymbol3D | - LineSymbol3D | - MeshSymbol3D | - PointSymbol3D | - PolygonSymbol3D - ); - - export type Symbol3DLayer = ( - ExtrudeSymbol3DLayer | - FillSymbol3DLayer | - IconSymbol3DLayer | - LineSymbol3DLayer | - ObjectSymbol3DLayer | - PathSymbol3DLayer | - TextSymbol3DLayer - ); - - export type Symbol = Symbol2D | Symbol3D | WebStyleSymbol; -} diff --git a/types/arcgis-js-api/v3/index.d.ts b/types/arcgis-js-api/v3/index.d.ts index a42c651068..e38c5c0356 100644 --- a/types/arcgis-js-api/v3/index.d.ts +++ b/types/arcgis-js-api/v3/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript 3.26 +// Type definitions for ArcGIS API for JavaScript 3.27 // Project: https://developers.arcgis.com/javascript/3/ // Definitions by: Esri // Bjorn Svensson @@ -560,7 +560,7 @@ declare module "esri" { /** An array of driving time break values. */ breakValues?: number[]; /** The point feature layer around which drive-time areas will be drawn. */ - inputLayer: FeatureLayer; + inputLayers: FeatureLayer[]; /** The geometry type of the input layer. */ inputType?: string; /** Reference to the map object. */ @@ -1351,6 +1351,8 @@ declare module "esri" { clip?: number; /** If the widget is enabled and layers can be swiped. */ enabled?: boolean; + /** Indicates whether layer placement should be inverted (switched). */ + invertPlacement?: boolean; /** The layers to be swiped. */ layers: Layer[]; /** The number of pixels to place the tool from the left of the map. */ @@ -2532,7 +2534,7 @@ declare module "esri/Credential" { class Credential { /** Token expiration time specified as number of milliseconds since 1 January 1970 00:00:00 UTC. */ expires: number; - /** Indicates whether this credential belongs to a user with admin privileges. */ + /** Indicates that this credential was created to access the ArcGIS REST Admin service */ isAdmin: boolean; /** The Identity Manager's setOAuthRedirectionHandler returns an object that contains a "state" parameter. */ oAuthState: any; @@ -2600,6 +2602,12 @@ declare module "esri/IdentityManagerBase" { tokenValidity: number; /** If your application is on the same domain as *.arcgis.com or ArcGIS Enterprise Server, the IdentityManager will redirect the user to its sign-in page. */ useSignInPage: boolean; + /** + * Returns a Credential object if the user has already signed in to access the given resource and is allowed to do so when using the given application id. + * @param resUrl The resource URL. + * @param appId The registered OAuth application id. + */ + checkAppAccess(resUrl: string, appId: string): any; /** * Returns the credential (via Deferred) if the user has already signed in to access the given resource. * @param resUrl The resource URL. @@ -2891,7 +2899,7 @@ declare module "esri/SnappingManager" { } declare module "esri/SpatialReference" { - /** The spatial reference of a map, layer, or inputs to and outputs from a task. */ + /** Defines the spatial reference of a map, layer, or task parameters. */ class SpatialReference { /** The well-known ID of a spatial reference. */ wkid: number; @@ -2953,6 +2961,54 @@ declare module "esri/TimeExtent" { export = TimeExtent; } +declare module "esri/arcadeProfiles/fieldCalculateProfile" { + /** Module that implements the Arcade field calculate profile in web apps that calculate field values using Arcade expressions. */ + var fieldCalculateProfile: { + /** + * Initializes the field calculate profile for the given Arcade expressions. + * @param expressions An array of Arcade expressions intended for use in the calculate profile. + */ + initialize(expressions: string[]): any; + }; + export = fieldCalculateProfile; +} + +declare module "esri/arcadeProfiles/labelingProfile" { + /** Module that implements the Arcade labeling profile in web apps that label features using Arcade expressions. */ + var labelingProfile: { + /** + * Initializes the labeling profile for the given Arcade expressions. + * @param expressions An array of Arcade expressions intended for use in a label class. + */ + initialize(expressions: string[]): any; + }; + export = labelingProfile; +} + +declare module "esri/arcadeProfiles/popupProfile" { + /** Module that implements the Arcade popup profile for web apps that contain popups that reference Arcade expressions. */ + var popupProfile: { + /** + * Initializes the popup profile for the given Arcade expressions. + * @param expressions An array of Arcade expressions intended for use in a popup template. + */ + initialize(expressions: string[]): any; + }; + export = popupProfile; +} + +declare module "esri/arcadeProfiles/visualizationProfile" { + /** Module that implements the Arcade visualization profile in web apps that render features using Arcade expressions. */ + var visualizationProfile: { + /** + * Initializes the visualization profile for the given Arcade expressions. + * @param expressions An array of Arcade expressions intended for use in a renderer. + */ + initialize(expressions: string[]): any; + }; + export = visualizationProfile; +} + declare module "esri/arcgis/OAuthInfo" { import esri = require("esri"); @@ -4827,6 +4883,8 @@ declare module "esri/dijit/LayerSwipe" { clip: number; /** If the widget is enabled and layers can be swiped. */ enabled: boolean; + /** Indicates whether layer placement should be inverted (switched). */ + invertPlacement: boolean; /** The layers to be swiped. */ layers: Layer[]; /** The number of pixels to place the tool from the left of the map. */ @@ -6285,7 +6343,7 @@ declare module "esri/dijit/analysis/CreateDriveTimeAreas" { /** An array of driving time break values. */ breakValues: number[]; /** The point feature layer around which drive-time areas will be drawn. */ - inputLayer: FeatureLayer; + inputLayers: FeatureLayer[]; /** The geometry type of the input layer. */ inputType: string; /** Reference to the map object. */ @@ -9073,6 +9131,8 @@ declare module "esri/graphic" { getNode(): any; /** Returns one or more DOM nodes used to draw the graphic. */ getNodes(): any; + /** Applicable to label graphics. */ + getParentGraphic(): Graphic; /** Returns the dojox/gfx/shape.Shape of the Esri graphic. */ getShape(): any; /** Returns one or more dojox/gfx/shape.Shape used to draw the graphic. */ @@ -10314,6 +10374,8 @@ declare module "esri/layers/FeatureLayer" { on(type: "query-limit-exceeded", listener: (event: { target: FeatureLayer }) => void): esri.Handle; /** Fires when queryRelatedFeatures() is complete. */ on(type: "query-related-features-complete", listener: (event: { relatedFeatures: any; target: FeatureLayer }) => void): esri.Handle; + /** Fires right before the actual refresh kicks in for the layer, and only fires when the refresh is triggered by the refreshInterval. */ + on(type: "refresh-tick", listener: (event: { target: FeatureLayer }) => void): esri.Handle; /** Fires when a layer resumes drawing. */ on(type: "resume", listener: (event: { target: FeatureLayer }) => void): esri.Handle; /** Fires when a layer's minScale and/or maxScale is changed. */ @@ -12419,7 +12481,7 @@ declare module "esri/map" { getMinScale(): number; /** Returns the minimum zoom level of the map. */ getMinZoom(): number; - /** Returns the current map scale. */ + /** Returns the map scale at the center of the view. */ getScale(): number; /** Returns the current zoom level of the map. */ getZoom(): number; diff --git a/types/arr-diff/arr-diff-tests.ts b/types/arr-diff/arr-diff-tests.ts new file mode 100644 index 0000000000..509b2f43cc --- /dev/null +++ b/types/arr-diff/arr-diff-tests.ts @@ -0,0 +1,8 @@ +import diff = require('arr-diff'); + +const a = ['a', 'b', 'c', 'd']; +const b = [1, 2]; + +diff(['a']); // $ExpectType string[] +diff(['a'], [1]); // $ExpectType string[] +diff([1], ['a']); // $ExpectType number[] diff --git a/types/arr-diff/index.d.ts b/types/arr-diff/index.d.ts new file mode 100644 index 0000000000..3c9c5037cc --- /dev/null +++ b/types/arr-diff/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for arr-diff 4.0 +// Project: https://github.com/jonschlinkert/arr-diff +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = arrDiff; + +declare function arrDiff(first: T[], ...args: any[][]): T[]; diff --git a/types/arr-diff/tsconfig.json b/types/arr-diff/tsconfig.json new file mode 100644 index 0000000000..6ea302e0ba --- /dev/null +++ b/types/arr-diff/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "arr-diff-tests.ts" + ] +} diff --git a/types/arr-diff/tslint.json b/types/arr-diff/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/arr-diff/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/array-move/array-move-tests.ts b/types/array-move/array-move-tests.ts new file mode 100644 index 0000000000..0bf720b751 --- /dev/null +++ b/types/array-move/array-move-tests.ts @@ -0,0 +1,8 @@ +import arrayMove = require('array-move'); + +const input = ['a', 'b', 'c']; +const input2 = [1, 2, 3]; + +arrayMove(input, 1, 2); // $ExpectType string[] +arrayMove(input2, 1, 2); // $ExpectType number[] +arrayMove.mut(input, 1, 2); // $ExpectType void diff --git a/types/array-move/index.d.ts b/types/array-move/index.d.ts new file mode 100644 index 0000000000..9b9aae938a --- /dev/null +++ b/types/array-move/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for array-move 1.0 +// Project: https://github.com/sindresorhus/array-move +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = arrayMove; + +/** + * Move an array item to a different position. + * + * @param from Index of item to move. If negative, it will begin that many elements from the end. + * @param to Index of where to move the item. If negative, it will begin that many elements from the end. + * @returns A new array with the item moved to the new position. + */ +declare function arrayMove(input: T, from: number, to: number): T; + +declare namespace arrayMove { + /** + * Moves the item to the new position in the input array. + * + * Useful for huge arrays where absolute performance is needed. + * + * @param from Index of item to move. If negative, it will begin that many elements from the end. + * @param to Index of where to move the item. If negative, it will begin that many elements from the end. + */ + function mut(input: any[], from: number, to: number): void; +} diff --git a/types/array-move/tsconfig.json b/types/array-move/tsconfig.json new file mode 100644 index 0000000000..6b4a5d5bb0 --- /dev/null +++ b/types/array-move/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "array-move-tests.ts" + ] +} diff --git a/types/array-move/tslint.json b/types/array-move/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/array-move/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/asn1/asn1-tests.ts b/types/asn1/asn1-tests.ts new file mode 100644 index 0000000000..f37541b03e --- /dev/null +++ b/types/asn1/asn1-tests.ts @@ -0,0 +1,88 @@ +import { Ber, BerReader, BerWriter } from 'asn1'; + +let buf: Buffer = Buffer.alloc(0); +let bool = false; +let str = ''; +let num = 0; +let numOrNull: number | null = 0; +const roStrArray: ReadonlyArray = [str]; + +const reader = new BerReader(buf); +numOrNull = reader.peek(); +bool = reader.readBoolean(); +numOrNull = reader.readByte(bool); +num = reader.readEnumeration(); +num = reader.readInt(); +num = reader.readLength(); +num = reader.readLength(num); +str = reader.readOID(); +str = reader.readOID(num); +numOrNull = reader.readSequence(); +numOrNull = reader.readSequence(num); +str = reader.readString(); +str = reader.readString(num); +buf = reader.readString(num, bool); +num = reader._readTag(); +num = reader._readTag(num); + +let writer = new BerWriter(); +writer = new BerWriter({ + size: num, + growthFactor: num, +}); + +buf = writer.buffer; +buf = writer._buf; +num = writer._size; +num = writer._offset; + +writer.endSequence(); +writer.startSequence(); +writer.startSequence(num); +writer.writeBoolean(bool); +writer.writeBoolean(bool, num); +writer.writeBuffer(buf, num); +writer.writeByte(num); +writer.writeEnumeration(num); +writer.writeEnumeration(num, num); +writer.writeInt(num); +writer.writeInt(num, num); +writer.writeLength(num); +writer.writeNull(); +writer.writeOID(str, num); +writer.writeString(str); +writer.writeString(str, num); +writer.writeStringArray(roStrArray); +writer._ensure(num); + +num = Ber.BMPString; +num = Ber.BitString; +num = Ber.Boolean; +num = Ber.CharacterString; +num = Ber.Constructor; +num = Ber.Context; +num = Ber.EOC; +num = Ber.Enumeration; +num = Ber.External; +num = Ber.GeneralString; +num = Ber.GeneralizedTime; +num = Ber.GraphicString; +num = Ber.IA5String; +num = Ber.Integer; +num = Ber.Null; +num = Ber.NumericString; +num = Ber.OID; +num = Ber.ObjectDescriptor; +num = Ber.OctetString; +num = Ber.PDV; +num = Ber.PrintableString; +num = Ber.Real; +num = Ber.RelativeOID; +num = Ber.Sequence; +num = Ber.Set; +num = Ber.T61String; +num = Ber.UTCTime; +num = Ber.UniversalString; +num = Ber.Utf8String; +num = Ber.VideotexString; +num = Ber.VisibleString; diff --git a/types/asn1/index.d.ts b/types/asn1/index.d.ts new file mode 100644 index 0000000000..3f7de44af8 --- /dev/null +++ b/types/asn1/index.d.ts @@ -0,0 +1,126 @@ +// Type definitions for asn1 0.2 +// Project: https://github.com/joyent/node-asn1 +// Definitions by: Jim Geurts +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 +/// + +export class BerReader { + readonly buffer: Buffer; + readonly offset: number; + readonly length: number; + readonly remain: number; + readonly _buf: Buffer; + _size: number; + _offset: number; + + constructor(data: Buffer); + + peek(): number | null; + readBoolean(): boolean; + readByte(peek: boolean): number | null; + readEnumeration(): number; + readInt(): number; + readLength(offset?: number): number; + readOID(tag?: number): string; + readSequence(tag?: number): number | null; + readString(tag?: number): string; + readString(tag: number, retbuf: boolean): Buffer; + _readTag(tag?: number): number; +} + +export class BerWriter { + readonly buffer: Buffer; + readonly _buf: Buffer; + readonly _size: number; + _offset: number; + + constructor(options?: { + size: number; + growthFactor: number; + }); + + endSequence(): void; + startSequence(tag?: number): void; + writeBoolean(b: boolean, tag?: number): void; + writeBuffer(buf: Buffer, tag: number): void; + writeByte(b: number): void; + writeEnumeration(i: number, tag?: number): void; + writeInt(i: number, tag?: number): void; + writeLength(len: number): void; + writeNull(): void; + writeOID(s: string, tag: number): void; + writeString(s: string, tag?: number): void; + writeStringArray(strings: ReadonlyArray): void; + _ensure(length: number): void; +} + +export namespace Ber { + const BMPString: number; + const BitString: number; + const Boolean: number; + const CharacterString: number; + const Constructor: number; + const Context: number; + const EOC: number; + const Enumeration: number; + const External: number; + const GeneralString: number; + const GeneralizedTime: number; + const GraphicString: number; + const IA5String: number; + const Integer: number; + const Null: number; + const NumericString: number; + const OID: number; + const ObjectDescriptor: number; + const OctetString: number; + const PDV: number; + const PrintableString: number; + const Real: number; + const RelativeOID: number; + const Sequence: number; + const Set: number; + const T61String: number; + const UTCTime: number; + const UniversalString: number; + const Utf8String: number; + const VideotexString: number; + const VisibleString: number; +} +/* +declare enum BerType { + EOC = 0, + Boolean = 1, + Integer = 2, + BitString = 3, + OctetString = 4, + Null = 5, + OID = 6, + ObjectDescriptor = 7, + External = 8, + Real = 9, // float + Enumeration = 10, + PDV = 11, + Utf8String = 12, + RelativeOID = 13, + Sequence = 16, + Set = 17, + NumericString = 18, + PrintableString = 19, + T61String = 20, + VideotexString = 21, + IA5String = 22, + UTCTime = 23, + GeneralizedTime = 24, + GraphicString = 25, + VisibleString = 26, + GeneralString = 28, + UniversalString = 29, + CharacterString = 30, + BMPString = 31, + Constructor = 32, + Context = 128, +} + +*/ diff --git a/types/asn1/tsconfig.json b/types/asn1/tsconfig.json new file mode 100644 index 0000000000..fd1bdc45d9 --- /dev/null +++ b/types/asn1/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "noUnusedParameters": true, + + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "asn1-tests.ts" + ] +} \ No newline at end of file diff --git a/types/asn1/tslint.json b/types/asn1/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/asn1/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file diff --git a/types/async-busboy/async-busboy-tests.ts b/types/async-busboy/async-busboy-tests.ts new file mode 100644 index 0000000000..ee81ca8a8c --- /dev/null +++ b/types/async-busboy/async-busboy-tests.ts @@ -0,0 +1,16 @@ +import Koa = require('koa'); +import asyncBusboy = require('async-busboy'); + +async function middleware(ctx: Koa.Context, next: () => Promise) { + const {files, fields} = await asyncBusboy(ctx.req); +} + +async function middleware2(ctx: Koa.Context, next: () => Promise) { + const {fields} = await asyncBusboy(ctx.req, { + limits: { + fileSize: 2 * 1024 * 1024, + }, + onFile: (fieldname: string, file: NodeJS.ReadableStream, filename: string, encoding: string, mimetype: string) => { + } + }); +} diff --git a/types/async-busboy/index.d.ts b/types/async-busboy/index.d.ts new file mode 100644 index 0000000000..ed92d2717a --- /dev/null +++ b/types/async-busboy/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for async-busboy 0.7 +// Project: https://github.com/m4nuC/async-busboy#readme +// Definitions by: Hiroshi Ioka +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as fs from 'fs'; +import * as http from 'http'; + +import busboy = require('busboy'); + +interface Options extends busboy.BusboyConfig { + onFile: ( + fieldname: string, + file: NodeJS.ReadableStream, + filename: string, + encoding: string, + mimetype: string) => void; +} + +type AsyncBusboy = ( + req: http.IncomingMessage, + options?: Options +) => Promise<{fields: {[key: string]: any}; files?: fs.ReadStream[]}>; + +declare const asyncBusboy: AsyncBusboy; + +export = asyncBusboy; diff --git a/types/async-busboy/tsconfig.json b/types/async-busboy/tsconfig.json new file mode 100644 index 0000000000..6dbcd063c5 --- /dev/null +++ b/types/async-busboy/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "async-busboy-tests.ts" + ] +} diff --git a/types/async-busboy/tslint.json b/types/async-busboy/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/async-busboy/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/async/index.d.ts b/types/async/index.d.ts index e6cfd3bcaa..05d99e5968 100644 --- a/types/async/index.d.ts +++ b/types/async/index.d.ts @@ -1,13 +1,18 @@ -// Type definitions for Async 2.0.1 +// Type definitions for Async 2.4 // Project: https://github.com/caolan/async -// Definitions by: Boris Yankov , Arseniy Maximov , Joe Herman , Angus Fenying , Pascal Martin +// Definitions by: Boris Yankov +// Arseniy Maximov +// Joe Herman +// Angus Fenying +// Pascal Martin +// Dmitri Trofimov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 export as namespace async; export interface Dictionary { [key: string]: T; } -export type IterableCollection = T[] | IterableIterator | Dictionary +export type IterableCollection = T[] | IterableIterator | Dictionary; export interface ErrorCallback { (err?: E | null): void; } export interface AsyncBooleanResultCallback { (err?: E | null, truthValue?: boolean): void; } @@ -26,30 +31,40 @@ export interface AsyncBooleanIterator { (item: T, callback: AsyncB export interface AsyncWorker { (task: T, callback: ErrorCallback): void; } export interface AsyncVoidFunction { (callback: ErrorCallback): void; } -export type AsyncAutoTasks, E> = { [K in keyof R]: AsyncAutoTask } -export type AsyncAutoTask, E> = AsyncAutoTaskFunctionWithoutDependencies | (keyof R | AsyncAutoTaskFunction)[]; +export type AsyncAutoTasks, E> = { [K in keyof R]: AsyncAutoTask }; +export type AsyncAutoTask, E> = AsyncAutoTaskFunctionWithoutDependencies | Array>; export interface AsyncAutoTaskFunctionWithoutDependencies { (cb: AsyncResultCallback | ErrorCallback): void; } export interface AsyncAutoTaskFunction, E = Error> { (results: R, cb: AsyncResultCallback | ErrorCallback): void; } +export interface DataContainer { + data: T; +} + +export interface CallbackContainer { + callback: Function; +} + +export interface PriorityContainer { + priority: number; +} + export interface AsyncQueue { length(): number; started: boolean; running(): number; idle(): boolean; concurrency: number; - push(task: T | T[], callback?: AsyncResultCallback): void; + push(task: T | T[], callback?: AsyncResultCallback): void; unshift(task: T | T[], callback?: ErrorCallback): void; + remove(filter: (node: DataContainer) => boolean): void; saturated: () => any; empty: () => any; drain: () => any; paused: boolean; - pause(): void + pause(): void; resume(): void; kill(): void; - workersList(): { - data: T, - callback: Function - }[]; + workersList, CallbackContainer>(): TWorker[]; error(error: Error, data: any): void; unsaturated(): void; buffer: number; @@ -60,7 +75,7 @@ export interface AsyncPriorityQueue { concurrency: number; started: boolean; paused: boolean; - push(task: T | T[], priority: number, callback?: AsyncResultArrayCallback): void; + push(task: T | T[], priority: number, callback?: AsyncResultArrayCallback): void; saturated: () => any; empty: () => any; drain: () => any; @@ -69,11 +84,7 @@ export interface AsyncPriorityQueue { pause(): void; resume(): void; kill(): void; - workersList(): { - data: T, - priority: number, - callback: Function - }[]; + workersList, CallbackContainer, PriorityContainer>(): TWorker[]; error(error: Error, data: any): void; unsaturated(): void; buffer: number; @@ -82,7 +93,7 @@ export interface AsyncPriorityQueue { export interface AsyncCargo { length(): number; payload?: number; - push(task: any, callback? : Function): void; + push(task: any, callback?: Function): void; saturated(): void; empty(): void; drain(): void; @@ -105,11 +116,17 @@ export function forEachOfLimit(obj: IterableCollection, limit: export const eachOf: typeof forEachOf; export const eachOfSeries: typeof forEachOf; export const eachOfLimit: typeof forEachOfLimit; -export function map(arr: T[] | IterableIterator, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; -export function map(arr: Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; +export function map(arr: T[] | IterableIterator | Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; export const mapSeries: typeof map; export function mapLimit(arr: IterableCollection, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; -export function mapValuesLimit(obj: Dictionary, limit: number, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultObjectCallback): void; + +export function mapValuesLimit( + obj: Dictionary, + limit: number, + iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, + callback: AsyncResultObjectCallback + ): void; + export function mapValues(obj: Dictionary, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultObjectCallback): void; export const mapValuesSeries: typeof mapValues; export function filter(arr: IterableCollection, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; @@ -151,7 +168,7 @@ export function concatLimit(arr: IterableCollection, limit: export const concatSeries: typeof concat; // Control Flow -export function series(tasks: AsyncFunction[], callback?: AsyncResultArrayCallback): void; +export function series(tasks: Array>, callback?: AsyncResultArrayCallback): void; export function series(tasks: Dictionary>, callback?: AsyncResultObjectCallback): void; export function parallel(tasks: Array>, callback?: AsyncResultArrayCallback): void; export function parallel(tasks: Dictionary>, callback?: AsyncResultObjectCallback): void; @@ -161,9 +178,9 @@ export function whilst(test: () => boolean, fn: AsyncVoidFunction, export function doWhilst(fn: AsyncFunctionEx, test: (...results: T[]) => boolean, callback: ErrorCallback): void; export function until(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; export function doUntil(fn: AsyncFunctionEx, test: (...results: T[]) => boolean, callback: ErrorCallback): void; -export function during(test: (testCallback : AsyncBooleanResultCallback) => void, fn: AsyncVoidFunction, callback: ErrorCallback): void; +export function during(test: (testCallback: AsyncBooleanResultCallback) => void, fn: AsyncVoidFunction, callback: ErrorCallback): void; export function doDuring(fn: AsyncVoidFunction, test: (testCallback: AsyncBooleanResultCallback) => void, callback: ErrorCallback): void; -export function forever(next: (next : ErrorCallback) => void, errBack: ErrorCallback) : void; +export function forever(next: (next: ErrorCallback) => void, errBack: ErrorCallback): void; export function waterfall(tasks: Function[], callback?: AsyncResultCallback): void; export function compose(...fns: Function[]): Function; export function seq(...fns: Function[]): Function; @@ -172,34 +189,52 @@ export function applyEachSeries(fns: Function[], ...argsAndCallback: any[]): voi export function queue(worker: AsyncWorker, concurrency?: number): AsyncQueue; export function queue(worker: AsyncResultIterator, concurrency?: number): AsyncQueue; export function priorityQueue(worker: AsyncWorker, concurrency: number): AsyncPriorityQueue; -export function cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo; +export function cargo(worker: (tasks: any[], callback: ErrorCallback) => void, payload?: number): AsyncCargo; export function auto, E = Error>(tasks: AsyncAutoTasks, concurrency?: number, callback?: AsyncResultCallback): void; export function auto, E = Error>(tasks: AsyncAutoTasks, callback?: AsyncResultCallback): void; export function autoInject(tasks: any, callback?: AsyncResultCallback): void; -export function retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: AsyncResultCallback): void; -export function retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: AsyncResultCallback): void; + +export function retry( + opts: number | { + times: number, + interval: number | ((retryCount: number) => number) + }, + task: (callback: AsyncResultCallback, results: any) => void, + callback: AsyncResultCallback + ): void; + export function retryable(opts: number | {times: number, interval: number}, task: AsyncFunction): AsyncFunction; -export function apply(fn: Function, ...args: any[]): AsyncFunction; +export function apply(fn: Function, ...args: any[]): AsyncFunction; export function nextTick(callback: Function, ...args: any[]): void; export const setImmediate: typeof nextTick; -export function reflect(fn: AsyncFunction) : (callback: (err: null, result: {error?: E, value?: T}) => void) => void; -export function reflectAll(tasks: AsyncFunction[]): ((callback: (err: null, result: {error?: E, value?: T}) => void) => void)[]; +export function reflect(fn: AsyncFunction): (callback: (err: null, result: {error?: E, value?: T}) => void) => void; +export function reflectAll(tasks: Array>): Array<(callback: (err: null, result: {error?: E, value?: T}) => void) => void>; export function timeout(fn: AsyncFunction, milliseconds: number, info?: any): AsyncFunction; export function timeout(fn: AsyncResultIterator, milliseconds: number, info?: any): AsyncResultIterator; -export function times (n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; +export function times(n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; export function timesSeries(n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; export function timesLimit(n: number, limit: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; export function transform(arr: T[], iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void, callback?: AsyncResultArrayCallback): void; export function transform(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void, callback?: AsyncResultArrayCallback): void; -export function transform(arr: {[key: string] : T}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void, callback?: AsyncResultObjectCallback): void; -export function transform(arr: {[key: string] : T}, acc: {[key: string] : R}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void, callback?: AsyncResultObjectCallback): void; +export function transform( + arr: {[key: string]: T}, + iteratee: (acc: {[key: string]: R}, item: T, key: string, callback: (error?: E) => void) => void, + callback?: AsyncResultObjectCallback + ): void; -export function race(tasks: (AsyncFunction)[], callback: AsyncResultCallback) : void; +export function transform( + arr: {[key: string]: T}, + acc: {[key: string]: R}, + iteratee: (acc: {[key: string]: R}, item: T, key: string, callback: (error?: E) => void) => void, + callback?: AsyncResultObjectCallback + ): void; + +export function race(tasks: Array>, callback: AsyncResultCallback): void; // Utils export function memoize(fn: Function, hasher?: Function): Function; diff --git a/types/async/test/es6-generators.ts b/types/async/test/es6-generators.ts index b67e7daad7..e0008d7d5e 100644 --- a/types/async/test/es6-generators.ts +++ b/types/async/test/es6-generators.ts @@ -10,45 +10,45 @@ function eachOfIterator(item: T, key: K, callback: (err: Error) => void function concatIterator(item: T, callback: (err: E, res: R[]) => void) { } -async.map(collectionGenerator(), funcMapIterator, funcMapComplete) -async.mapSeries(collectionGenerator(), funcMapIterator, funcMapComplete) -async.mapLimit(collectionGenerator(), 2, funcMapIterator, funcMapComplete) +async.map(collectionGenerator(), funcMapIterator, funcMapComplete); +async.mapSeries(collectionGenerator(), funcMapIterator, funcMapComplete); +async.mapLimit(collectionGenerator(), 2, funcMapIterator, funcMapComplete); -async.filter(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) -async.filterSeries(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) -async.filterLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, results: any[]) { }) -async.select(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) -async.selectSeries(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) -async.selectLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, results: any[]) { }) +async.filter(collectionGenerator(), booleanIterator, (err: Error, results: any[]) => { }); +async.filterSeries(collectionGenerator(), booleanIterator, (err: Error, results: any[]) => { }); +async.filterLimit(collectionGenerator(), 2, booleanIterator, (err: Error, results: any[]) => { }); +async.select(collectionGenerator(), booleanIterator, (err: Error, results: any[]) => { }); +async.selectSeries(collectionGenerator(), booleanIterator, (err: Error, results: any[]) => { }); +async.selectLimit(collectionGenerator(), 2, booleanIterator, (err: Error, results: any[]) => { }); -async.reject(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) -async.rejectSeries(collectionGenerator(), booleanIterator, function (err: Error, results: any[]) { }) -async.rejectLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, results: any[]) { }) +async.reject(collectionGenerator(), booleanIterator, (err: Error, results: any[]) => { }); +async.rejectSeries(collectionGenerator(), booleanIterator, (err: Error, results: any[]) => { }); +async.rejectLimit(collectionGenerator(), 2, booleanIterator, (err: Error, results: any[]) => { }); -async.each(collectionGenerator(), eachIterator, function (err: Error) { }) -async.eachLimit(collectionGenerator(), 2, eachIterator, function (err: Error) { }) -async.eachSeries(collectionGenerator(), eachIterator, function (err: Error) { }) -async.eachOf(collectionGenerator(), eachOfIterator, function (err: Error) { }) -async.eachOfLimit(collectionGenerator(), 2, eachOfIterator, function (err: Error) { }) -async.eachOfSeries(collectionGenerator(), eachOfIterator, function (err: Error) { }) -async.forEach(collectionGenerator(), eachIterator, function (err: Error) { }) -async.forEachLimit(collectionGenerator(), 2, eachIterator, function (err: Error) { }) -async.forEachSeries(collectionGenerator(), eachIterator, function (err: Error) { }) -async.forEachOf(collectionGenerator(), eachOfIterator, function (err: Error) { }) -async.forEachOfLimit(collectionGenerator(), 2, eachOfIterator, function (err: Error) { }) -async.forEachOfSeries(collectionGenerator(), eachOfIterator, function (err: Error) { }) +async.each(collectionGenerator(), eachIterator, (err: Error) => { }); +async.eachLimit(collectionGenerator(), 2, eachIterator, (err: Error) => { }); +async.eachSeries(collectionGenerator(), eachIterator, (err: Error) => { }); +async.eachOf(collectionGenerator(), eachOfIterator, (err: Error) => { }); +async.eachOfLimit(collectionGenerator(), 2, eachOfIterator, (err: Error) => { }); +async.eachOfSeries(collectionGenerator(), eachOfIterator, (err: Error) => { }); +async.forEach(collectionGenerator(), eachIterator, (err: Error) => { }); +async.forEachLimit(collectionGenerator(), 2, eachIterator, (err: Error) => { }); +async.forEachSeries(collectionGenerator(), eachIterator, (err: Error) => { }); +async.forEachOf(collectionGenerator(), eachOfIterator, (err: Error) => { }); +async.forEachOfLimit(collectionGenerator(), 2, eachOfIterator, (err: Error) => { }); +async.forEachOfSeries(collectionGenerator(), eachOfIterator, (err: Error) => { }); -async.every(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) -async.everyLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, res: boolean) { }) -async.everySeries(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) +async.every(collectionGenerator(), booleanIterator, (err: Error, res: boolean) => { }); +async.everyLimit(collectionGenerator(), 2, booleanIterator, (err: Error, res: boolean) => { }); +async.everySeries(collectionGenerator(), booleanIterator, (err: Error, res: boolean) => { }); -async.some(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) -async.someLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, res: boolean) { }) -async.someSeries(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) +async.some(collectionGenerator(), booleanIterator, (err: Error, res: boolean) => { }); +async.someLimit(collectionGenerator(), 2, booleanIterator, (err: Error, res: boolean) => { }); +async.someSeries(collectionGenerator(), booleanIterator, (err: Error, res: boolean) => { }); -async.detect(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) -async.detectLimit(collectionGenerator(), 2, booleanIterator, function (err: Error, res: boolean) { }) -async.detectSeries(collectionGenerator(), booleanIterator, function (err: Error, res: boolean) { }) +async.detect(collectionGenerator(), booleanIterator, (err: Error, res: boolean) => { }); +async.detectLimit(collectionGenerator(), 2, booleanIterator, (err: Error, res: boolean) => { }); +async.detectSeries(collectionGenerator(), booleanIterator, (err: Error, res: boolean) => { }); -async.concat(collectionGenerator(), concatIterator, (err: Error, res: any[]) => { }) -async.concatSeries(collectionGenerator(), concatIterator, (err: Error, res: any[]) => { }) +async.concat(collectionGenerator(), concatIterator, (err: Error, res: any[]) => { }); +async.concatSeries(collectionGenerator(), concatIterator, (err: Error, res: any[]) => { }); diff --git a/types/async/test/explicit.ts b/types/async/test/explicit.ts index 0c0e1a44ee..ae97888531 100644 --- a/types/async/test/explicit.ts +++ b/types/async/test/explicit.ts @@ -1,74 +1,58 @@ - - interface StringCallback { (err?: Error, result?: string): void; } interface AsyncStringGetter { (callback: StringCallback): void; } -var taskArray: AsyncStringGetter[] = [ - function (callback) { - setTimeout(function () { - callback(undefined, 'one'); - }, 200); - }, - function (callback) { - setTimeout(function () { - callback(undefined, 'two'); - }, 100); - }, +const taskArray: AsyncStringGetter[] = [ + callback => { setTimeout(() => { callback(undefined, 'one'); }, 200); }, + callback => { setTimeout(() => { callback(undefined, 'two'); }, 100); } ]; -async.series(taskArray, function (err, results) { +async.series(taskArray, (err, results) => { if (results) { - let first = results[0]; + const first = results[0]; if (first) { - console.log(first.match(/o/)) - } - } -}); -async.parallel(taskArray, function (err, results) { - if (results) { - let first = results[0]; - if (first) { - console.log(first.match(/o/)) - } - } -}); -async.parallelLimit(taskArray, 3, function (err, results) { - if (results) { - let first = results[0]; - if (first) { - console.log(first.match(/o/)) + console.log(first.match(/o/)); } } }); +async.parallel(taskArray, (err, results) => { + if (results) { + const first = results[0]; + if (first) { + console.log(first.match(/o/)); + } + } +}); + +async.parallelLimit(taskArray, 3, (err, results) => { + if (results) { + const first = results[0]; + if (first) { + console.log(first.match(/o/)); + } + } +}); interface Lookup { [key: string]: T; } interface NumberCallback { (err?: Error, result?: number): void; } interface AsyncNumberGetter { (callback: NumberCallback): void; } -var taskDict: Lookup = { - one: function(callback) { - setTimeout(function() { - callback(undefined, 1); - }, 200); - }, - two: function(callback) { - setTimeout(function() { - callback(undefined, 2); - }, 100); - } -} +const taskDict: Lookup = { + one: callback => { setTimeout(() => { callback(undefined, 1); }, 200); }, + two: callback => { setTimeout(() => { callback(undefined, 2); }, 100); } +}; -async.series(taskDict, function(err, results) { - let one = results['one']; - console.log(one && one.toFixed(1)) -}); -async.parallel(taskDict, function(err, results) { - let one = results['one']; - console.log(one && one.toFixed(1)) -}); -async.parallelLimit(taskDict, 3, function(err, results) { - let one = results['one']; - console.log(one && one.toFixed(1)) +async.series(taskDict, (err, results) => { + const one = results['one']; + console.log(one && one.toFixed(1)); }); +async.parallel(taskDict, (err, results) => { + const one = results['one']; + console.log(one && one.toFixed(1)); +}); + +async.parallelLimit(taskDict, 3, (err, results) => { + const one = results['one']; + console.log(one && one.toFixed(1)); +}); diff --git a/types/async/test/index.ts b/types/async/test/index.ts index 574a5ed8b9..97e888870b 100644 --- a/types/async/test/index.ts +++ b/types/async/test/index.ts @@ -9,406 +9,272 @@ declare var path: { exists: (path: string, callback?: (err: Error, exists: boolean) => any) => void; }; -function funcStringCbErrBoolean(v:string, cb:(err:Error,res:boolean) => void) {} +function funcStringCbErrBoolean(v: string, cb: (err: Error, res: boolean) => void) {} function callback() { } -async.map(['file1', 'file2', 'file3'], fs.stat, function (err:Error, results:Array) { }); -async.mapSeries(['file1', 'file2', 'file3'], fs.stat, function (err:Error, results:Array) { }); -async.mapLimit(['file1', 'file2', 'file3'], 2, fs.stat, function (err:Error, results:Array) { }); +async.map(['file1', 'file2', 'file3'], fs.stat, (err: Error, results: fs.Stats[]) => { }); +async.mapSeries(['file1', 'file2', 'file3'], fs.stat, (err: Error, results: fs.Stats[]) => { }); +async.mapLimit(['file1', 'file2', 'file3'], 2, fs.stat, (err: Error, results: fs.Stats[]) => { }); -async.filter(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.filterSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.filterLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.select(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.selectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.selectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array) { }); +async.filter(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, results: string[]) => { }); +async.filterSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, results: string[]) => { }); +async.filterLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, (err: Error, results: string[]) => { }); +async.select(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, results: string[]) => { }); +async.selectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, results: string[]) => { }); +async.selectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, (err: Error, results: string[]) => { }); -async.reject(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.rejectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,results:Array) { }); -async.rejectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,results:Array) { }); +async.reject(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, results: string[]) => { }); +async.rejectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, results: string[]) => { }); +async.rejectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, (err: Error, results: string[]) => { }); async.parallel([ - function () { }, - function () { } + () => { }, + () => { } ], callback); async.series([ - function () { }, - function () { } + () => { }, + () => { } ]); -var data: any[] = []; +const data: any[] = []; function asyncProcess(item: any, callback: (err: Error, result: any) => void) { } -async.map(data, asyncProcess, function (err, results) { - console.log(results); -}); +async.map(data, asyncProcess, (err, results) => { console.log(results); }); -var openFiles = ['file1', 'file2']; -var openFilesObj = { +const openFiles = ['file1', 'file2']; +const openFilesObj = { file1: "fileOne", file2: "fileTwo" -} +}; -var saveFile = function (file:string,cb:(err:Error)=>void) { } -async.each(openFiles, saveFile, function (err:Error) { }); -async.eachSeries(openFiles, saveFile, function (err:Error) { }); +const saveFile = (file: string, cb: (err: Error) => void) => { }; +async.each(openFiles, saveFile, (err: Error) => { }); +async.eachSeries(openFiles, saveFile, (err: Error) => { }); -var documents: any, requestApi: any; -async.eachLimit(documents, 20, requestApi, function (err) { }); +const documents: any[] = []; +const requestApi: async.AsyncIterator = () => { }; +async.eachLimit(documents, 20, requestApi, err => { }); // forEachOf* functions. May accept array or object. function forEachOfIterator(item: string, key: string, forEachOfIteratorCallback: any) { - console.log("ForEach: item=" + item + ", key=" + key); + console.log(`ForEach: item=${item}, key=${key}`); forEachOfIteratorCallback(); } -async.forEachOf(openFiles, forEachOfIterator, function (err) { }); -async.forEachOf(openFilesObj, forEachOfIterator, function (err) { }); -async.forEachOfSeries(openFiles, forEachOfIterator, function (err) { }); -async.forEachOfSeries(openFilesObj, forEachOfIterator, function (err) { }); -async.forEachOfLimit(openFiles, 2, forEachOfIterator, function (err) { }); -async.forEachOfLimit(openFilesObj, 2, forEachOfIterator, function (err) { }); +async.forEachOf(openFiles, forEachOfIterator, err => { }); +async.forEachOf(openFilesObj, forEachOfIterator, err => { }); +async.forEachOfSeries(openFiles, forEachOfIterator, err => { }); +async.forEachOfSeries(openFilesObj, forEachOfIterator, err => { }); +async.forEachOfLimit(openFiles, 2, forEachOfIterator, err => { }); +async.forEachOfLimit(openFilesObj, 2, forEachOfIterator, err => { }); -var numArray = [1, 2, 3]; +const numArray = [1, 2, 3]; function reducer(memo: any, item: any, callback: any) { - process.nextTick(function () { - callback(null, memo + item) - }); + process.nextTick(() => { callback(null, memo + item); }); } -async.reduce(numArray, 0, reducer, function (err, result) { }); -async.inject(numArray, 0, reducer, function (err, result) { }); -async.foldl(numArray, 0, reducer, function (err, result) { }); -async.reduceRight(numArray, 0, reducer, function (err, result) { }); -async.foldr(numArray, 0, reducer, function (err, result) { }); -async.detect(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err: Error,result:string) { }); -async.detectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err,result) { }); -async.detectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err,result) { }); +async.reduce(numArray, 0, reducer, (err, result) => { }); +async.inject(numArray, 0, reducer, (err, result) => { }); +async.foldl(numArray, 0, reducer, (err, result) => { }); +async.reduceRight(numArray, 0, reducer, (err, result) => { }); +async.foldr(numArray, 0, reducer, (err, result) => { }); -async.sortBy(['file1', 'file2', 'file3'], function (file, callback) { - fs.stat(file, function (err, stats) { - callback(err, stats.mtime); - }); -}, function (err, results) { }); +async.detect(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, result: string) => { }); +async.detectSeries(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err, result) => { }); +async.detectLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, (err, result) => { }); -async.some(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); -async.someLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,result:boolean) { }); -async.any(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); +async.sortBy(['file1', 'file2', 'file3'], (file, callback) => { + fs.stat(file, (err, stats) => { callback(err, stats.mtime); }); +}, (err, results) => { }); -async.every(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); -async.everyLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, function (err:Error,result:boolean) { }); -async.all(['file1', 'file2', 'file3'], funcStringCbErrBoolean, function (err:Error,result:boolean) { }); +async.some(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, result: boolean) => { }); +async.someLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, (err: Error, result: boolean) => { }); +async.any(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, result: boolean) => { }); -async.concat(['dir1', 'dir2', 'dir3'], fs.readdir, function (err, files) { }); -async.concatSeries(['dir1', 'dir2', 'dir3'], fs.readdir, function (err, files) { }); +async.every(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, result: boolean) => { }); +async.everyLimit(['file1', 'file2', 'file3'], 2, funcStringCbErrBoolean, (err: Error, result: boolean) => { }); +async.all(['file1', 'file2', 'file3'], funcStringCbErrBoolean, (err: Error, result: boolean) => { }); +async.concat(['dir1', 'dir2', 'dir3'], fs.readdir, (err, files) => { }); +async.concatSeries(['dir1', 'dir2', 'dir3'], fs.readdir, (err, files) => { }); // Control Flow // -async.series([ - function (callback) { - callback(undefined, 'one'); - }, - function (callback) { - callback(undefined, 'two'); - }, -], -function (err, results) { }); - -async.series([ - function (callback) { - callback(undefined, 'one'); - }, - function (callback) { - callback(undefined, 'two'); - }, -], -function (err, results) { }); +async.series([callback => { callback(undefined, 'one'); }, callback => { callback(undefined, 'two'); }], (err, results) => { }); +async.series([callback => { callback(undefined, 'one'); }, callback => { callback(undefined, 'two'); }], (err, results) => { }); async.series({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); + one: callback => { setTimeout(() => { callback(undefined, 1); }, 200); }, + two: callback => { setTimeout(() => { callback(undefined, 2); }, 100); } }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, -function (err, results) { }); + (err, results) => { }); async.series({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); + one: callback => { setTimeout(() => { callback(undefined, 1); }, 200); }, + two: callback => { setTimeout(() => { callback(undefined, 2); }, 100); } }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, -function (err, results) { }); + (err, results) => { }); -async.times(5, function(n, next) { - next(undefined as any, n) -}, function(err, results) { - console.log(results) -}) +async.times(5, (n, next) => { next(undefined as any, n); }, (err, results) => { console.log(results); }); -async.timesSeries(5, function(n, next) { - next(undefined as any, n) -}, function(err, results) { - console.log(results) -}) +async.timesSeries(5, (n, next) => { next(undefined as any, n); }, (err, results) => { console.log(results); }); async.parallel([ - function (callback) { - setTimeout(function () { - callback(undefined, 'one'); - }, 200); - }, - function (callback) { - setTimeout(function () { - callback(undefined, 'two'); - }, 100); - }, -], -function (err, results) { }); + callback => { setTimeout(() => { callback(undefined, 'one'); }, 200); }, + callback => { setTimeout(() => { callback(undefined, 'two'); }, 100); } + ], + (err, results) => { }); async.parallel([ - function (callback) { - setTimeout(function () { - callback(undefined, 'one'); - }, 200); - }, - function (callback) { - setTimeout(function () { - callback(undefined, 'two'); - }, 100); - }, -], -function (err, results) { }); - + callback => { setTimeout(() => { callback(undefined, 'one'); }, 200); }, + callback => { setTimeout(() => { callback(undefined, 'two'); }, 100); } + ], + (err, results) => { }); async.parallel({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); + one: callback => { setTimeout(() => { callback(undefined, 1); }, 200); }, + two: callback => { setTimeout(() => { callback(undefined, 2); }, 100); } }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, -function (err, results) { }); + (err, results) => { }); async.parallel({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); + one: callback => { setTimeout(() => { callback(undefined, 1); }, 200); }, + two: callback => { setTimeout(() => { callback(undefined, 2); }, 100); } }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, - function (err, results) { }); + (err, results) => { }); async.parallelLimit({ - one: function (callback) { - setTimeout(function () { - callback(undefined, 1); - }, 200); + one: callback => { setTimeout(() => { callback(undefined, 1); }, 200); }, + two: callback => { setTimeout(() => { callback(undefined, 2); }, 100); } }, - two: function (callback) { - setTimeout(function () { - callback(undefined, 2); - }, 100); - }, -}, 2, - function (err, results) { } + (err, results) => { } ); - function whileFn(callback: any) { setTimeout(() => callback(null, ++count), 1000); } function whileTest() { return count < 5; } function doWhileTest(count: number) { return count < 5; } -var count = 0; -async.whilst(whileTest, whileFn, function (err) { }); -async.until(whileTest, whileFn, function (err) { }); -async.doWhilst(whileFn, doWhileTest, function (err) { }); -async.doUntil(whileFn, doWhileTest, function (err) { }); -async.during(function (testCallback) { testCallback(new Error(), false); }, function (callback) { callback() }, function (error) { console.log(error) }); -async.doDuring(function (callback) { callback() }, function (testCallback) { testCallback(new Error(), false); }, function (error) { console.log(error) }); -async.forever(function (errBack) { - errBack(new Error("Not going on forever.")); -}, - function (error) { - console.log(error); - } -); +let count = 0; +async.whilst(whileTest, whileFn, err => { }); +async.until(whileTest, whileFn, err => { }); +async.doWhilst(whileFn, doWhileTest, err => { }); +async.doUntil(whileFn, doWhileTest, err => { }); + +async.during(testCallback => { testCallback(new Error(), false); }, callback => { callback(); }, error => { console.log(error); }); +async.doDuring(callback => { callback(); }, testCallback => { testCallback(new Error(), false); }, error => { console.log(error); }); +async.forever(errBack => { errBack(new Error("Not going on forever.")); }, error => { console.log(error); }); async.waterfall([ - function (callback: any) { - callback(null, 'one', 'two'); - }, - function (arg1: any, arg2: any, callback: any) { - callback(null, 'three'); - }, - function (arg1: any, callback: any) { - callback(null, 'done'); - } -], function (err, result) { }); + (callback: any) => { callback(null, 'one', 'two'); }, + (arg1: any, arg2: any, callback: any) => { callback(null, 'three'); }, + (arg1: any, callback: any) => { callback(null, 'done'); } + ], + (err, result) => { }); - -var q = async.queue(function (task: any, callback: (err?:Error,msg?:string) => void) { +const q = async.queue((task: any, callback: (err?: Error, msg?: string) => void) => { console.log('hello ' + task.name); - callback(undefined,'a message.'); + callback(undefined, 'a message.'); }, 2); - -q.drain = function () { - console.log('all items have been processed'); -} +q.drain = () => { console.log('all items have been processed'); }; q.push({ name: 'foo' }); - -q.push({ name: 'bar' }, function (err) { - console.log('finished processing bar'); -}); - -q.push([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (err) { - console.log('finished processing bar'); -}); - -q.push({name: 'foo'}, function (err, msg) { - console.log('foo finished with a message "'+ msg! + '"'); -}); +q.push({ name: 'bar' }, err => { console.log('finished processing bar'); }); +q.push([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], err => { console.log('finished processing bar'); }); +q.push({name: 'foo'}, (err, msg) => { console.log(`foo finished with a message "${msg!}"`); }); q.unshift({ name: 'foo' }); +q.unshift({ name: 'bar' }, err => { console.log('finished processing bar'); }); +q.unshift([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], err => { console.log('finished processing bar'); }); -q.unshift({ name: 'bar' }, function (err) { - console.log('finished processing bar'); -}); +const qLength: number = q.length(); +const qStarted: boolean = q.started; +const qPaused: boolean = q.paused; +const qProcessingCount: number = q.running(); +const qIsIdle: boolean = q.idle(); -q.unshift([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (err) { - console.log('finished processing bar'); -}); +q.saturated = () => { console.log('queue is saturated.'); }; -var qLength : number = q.length(); -var qStarted : boolean = q.started; -var qPaused : boolean = q.paused; -var qProcessingCount : number = q.running(); -var qIsIdle : boolean = q.idle(); +q.empty = () => { console.log('queue is empty.'); }; -q.saturated = function() { - console.log('queue is saturated.'); -} - -q.empty = function() { - console.log('queue is empty.'); -} - -q.drain = function() { - console.log('queue was drained.'); -} +q.drain = () => { console.log('queue was drained.'); }; q.pause(); q.resume(); q.kill(); // tests for strongly typed tasks -var q2 = async.queue(function (task: string, callback: () => void) { +const q2 = async.queue((task: string, callback: () => void) => { console.log('Task: ' + task); callback(); }, 1); q2.push('task1'); - -q2.push('task2', function (error) { - console.log('Finished tasks'); -}); - -q2.push(['task3', 'task4', 'task5'], function (error) { - console.log('Finished tasks'); -}); +q2.push('task2', error => { console.log('Finished tasks'); }); +q2.push(['task3', 'task4', 'task5'], error => { console.log('Finished tasks'); }); q2.unshift('task1'); +q2.unshift('task2', error => { console.log('Finished tasks'); }); +q2.unshift(['task3', 'task4', 'task5'], error => { console.log('Finished tasks'); }); -q2.unshift('task2', function (error) { - console.log('Finished tasks'); -}); +const q2Length = q2.length(); +q2.push('testRemovalTask'); +q2.remove(x => x.data === 'testTaskRemoval'); +if (q2Length !== q2.length()) { + throw new Error('Failed to remove a task from queue.'); +} -q2.unshift(['task3', 'task4', 'task5'], function (error) { - console.log('Finished tasks'); -}); - - -var aq = async.queue(function (level: number, callback: (error?: Error, newLevel?: number) => void) { +const aq = async.queue((level: number, callback: (error?: Error, newLevel?: number) => void) => { console.log('hello ' + level); - callback(undefined, level+1); + callback(undefined, level + 1); }); -aq.push(1, function (err : Error, newLevel : number) { +aq.push(1, (err: Error, newLevel: number) => { console.log('finished processing bar' + newLevel); }); // create a cargo object with payload 2 -var cargo = async.cargo(function (tasks, callback) { - for (var i = 0; i < tasks.length; i++) { - console.log('hello ' + tasks[i].name); +const cargo = async.cargo((tasks, callback) => { + for (const task of tasks) { + console.log('hello ' + task.name); } callback(); }, 2); - // add some items -cargo.push({ name: 'foo' }, function (err: Error) { - console.log('finished processing foo'); -}); -cargo.push({ name: 'bar' }, function (err: Error) { - console.log('finished processing bar'); -}); -cargo.push({ name: 'baz' }, function (err: Error) { - console.log('finished processing baz'); -}); +cargo.push({ name: 'foo' }, (err: Error) => { console.log('finished processing foo'); }); +cargo.push({ name: 'bar' }, (err: Error) => { console.log('finished processing bar'); }); +cargo.push({ name: 'baz' }, (err: Error) => { console.log('finished processing baz'); }); -var filename = ''; +const filename = ''; async.auto({ - get_data: function (callback: AsyncResultCallback) { }, - make_folder: function (callback: AsyncResultCallback) { }, - //arrays with different types are not accepted by TypeScript. - write_file: ['get_data', 'make_folder', function (callback: AsyncResultCallback) { + get_data: (callback: AsyncResultCallback) => { }, + make_folder: (callback: AsyncResultCallback) => { }, + + // arrays with different types are not accepted by TypeScript. + write_file: ['get_data', 'make_folder', ((callback: AsyncResultCallback) => { callback(null, filename); - } as any], - //arrays with different types are not accepted by TypeScript. - email_link: ['write_file', function (callback: AsyncResultCallback, results: any) { } as any] + }) as any], + + // arrays with different types are not accepted by TypeScript. + email_link: ['write_file', ((callback: AsyncResultCallback, results: any) => { }) as any] }); async.auto({ - get_data: function (callback: AsyncResultCallback) { }, - make_folder: function (callback: AsyncResultCallback) { }, - //arrays with different types are not accepted by TypeScript. - write_file: ['get_data', 'make_folder', function (callback: AsyncResultCallback) { - callback(null, filename); - } as any], - //arrays with different types are not accepted by TypeScript. - email_link: ['write_file', function (callback: AsyncResultCallback, results: any) { } as any] -}, function (err, results) { - console.log('finished auto'); -}); + get_data: (callback: AsyncResultCallback) => { }, + make_folder: (callback: AsyncResultCallback) => { }, + + // arrays with different types are not accepted by TypeScript. + write_file: ['get_data', 'make_folder', ((callback: AsyncResultCallback) => { callback(null, filename); }) as any], + + // arrays with different types are not accepted by TypeScript. + email_link: ['write_file', ((callback: AsyncResultCallback, results: any) => { }) as any] + }, + (err, results) => { console.log('finished auto'); } +); interface A { get_data: any; @@ -418,32 +284,28 @@ interface A { } async.auto
({ - get_data: function (callback: AsyncResultCallback) { }, - make_folder: function (callback: AsyncResultCallback) { }, - //arrays with different types are not accepted by TypeScript. - write_file: ['get_data', 'make_folder', function (callback: AsyncResultCallback) { - callback(null, filename); - } as any], - //arrays with different types are not accepted by TypeScript. - email_link: ['write_file', function (callback: AsyncResultCallback, results: any) { } as any] -}, 1, function (err, results) { - console.log('finished auto'); -}); + get_data: (callback: AsyncResultCallback) => { }, + make_folder: (callback: AsyncResultCallback) => { }, -async.retry(3, function (callback, results) { }, function (err, result) { }); -async.retry({ times: 3, interval: 200 }, function (callback, results) { }, function (err, result) { }); -async.retry({ times: 3, interval: (retryCount) => { return 200 * retryCount; } }, function (callback, results) { }, function (err, result) { }); + // arrays with different types are not accepted by TypeScript. + write_file: ['get_data', 'make_folder', ((callback: AsyncResultCallback) => { callback(null, filename); }) as any], + // arrays with different types are not accepted by TypeScript. + email_link: ['write_file', ((callback: AsyncResultCallback, results: any) => { }) as any] + }, + 1, + (err, results) => { console.log('finished auto'); } +); + +async.retry(3, (callback, results) => { }, (err, result) => { }); +async.retry({ times: 3, interval: 200 }, (callback, results) => { }, (err, result) => { }); +async.retry({ times: 3, interval: (retryCount) => 200 * retryCount }, (callback, results) => { }, (err, result) => { }); async.parallel([ - function (callback: ( err:Error, val:string ) => void ) { }, - function (callback) { } -], -function (err:Error,results:Array) { - async.series([ - function (callback) { }, - function email_link(callback) { } - ]); + (callback: (err: Error, val: string) => void) => { }, + callback => { } + ], + (err: Error, results: string[]) => { async.series([callback => { }, function email_link(callback) { }]); }); async.parallel([ @@ -451,428 +313,281 @@ async.parallel([ async.apply(fs.writeFile, 'testfile2', 'test2'), ]); - async.parallel([ - function (callback) { - fs.writeFile('testfile1', 'test1', callback); - }, - function (callback) { - fs.writeFile('testfile2', 'test2', callback); - }, + callback => { fs.writeFile('testfile1', 'test1', callback); }, + callback => { fs.writeFile('testfile2', 'test2', callback); } ]); -var call_order: string[] = []; -async.nextTick(function () { - call_order.push('two'); -}); +const call_order: string[] = []; +async.nextTick(() => { call_order.push('two'); }); call_order.push('one'); -var slow_fn = function (name: string, callback: any) { - callback(null, 123); -}; -var fn = async.memoize(slow_fn); -fn('some name', function () {}); +const slow_fn = (name: string, callback: any) => { callback(null, 123); }; +const fn = async.memoize(slow_fn); + +fn('some name', () => { }); async.unmemoize(fn); -async.ensureAsync(function () { }); +async.ensureAsync(() => { }); async.constant(42); -async.asyncify(function () { }); +async.asyncify(() => { }); -async.log(function (name: any, callback: any) { - setTimeout(function () { - callback(null, 'hello ' + name); - }, 0); -}, "world" - ); +async.log( + (name: any, callback: any) => { setTimeout(() => { callback(null, 'hello ' + name); }, 0); }, + "world"); -async.dir(function (name: string, callback: any) { - setTimeout(function () { - callback(null, { hello: name }); - }, 1000); -}, "world"); +async.dir((name: string, callback: any) => { setTimeout(() => { callback(null, { hello: name }); }, 1000); }, "world"); // each -async.each({ - "a": 1, - "b": 2 -}, function(val: number, next: ErrorCallback): void { +async.each( + { a: 1, b: 2 }, + (val: number, next: ErrorCallback) => { + setTimeout(() => { + console.log(`async.each: ${val}`); + next(); + }, + 500); + }, + (err?: Error) => { console.log("async.each: done."); } +); - setTimeout(function(): void { +async.eachSeries( + { a: 1, b: 2 }, + (val: number, next: ErrorCallback) => { + setTimeout( + () => { + console.log(`async.eachSeries: ${val}`); + next(); + }, + 500); + }, + (err?: Error) => { console.log("async.eachSeries: done."); } +); - console.log(`async.each: ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.each: done."); - -}); - -async.eachSeries({ - "a": 1, - "b": 2 -}, function(val: number, next: ErrorCallback): void { - - setTimeout(function(): void { - - console.log(`async.eachSeries: ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.eachSeries: done."); - -}); - -async.eachLimit({ - "a": 1, - "b": 2, - "c": 3, - "d": 4, - "e": 5, - "f": 6 -}, 2, function(val: number, next: ErrorCallback): void { - - setTimeout(function(): void { - - console.log(`async.eachLimit: ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.eachLimit: done."); - -}); +async.eachLimit( + { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }, + 2, + (val: number, next: ErrorCallback) => { + setTimeout(() => { + console.log(`async.eachLimit: ${val}`); + next(); + }, + 500); + }, + (err?: Error) => { console.log("async.eachLimit: done."); } +); // forEachOf/eachOf -async.eachOf({ - "a": 1, - "b": 2 -}, function(val: number, key: string, next: ErrorCallback): void { +async.eachOf( + { a: 1, b: 2 }, + (val: number, key: string, next: ErrorCallback) => { + setTimeout( + () => { + console.log(`async.forEachOf/eachOf: ${key} = ${val}`); + next(); + }, + 500); + }, + (err?: Error) => { console.log("async.forEachOf/eachOf: done."); } +); - setTimeout(function(): void { +async.forEachOfSeries( + { a: 1, b: 2 }, + (val: number, key: string, next: ErrorCallback) => { + setTimeout( + () => { + console.log(`async.forEachOfSeries: ${key} = ${val}`); + next(); + }, + 500); + }, + (err?: Error) => { console.log("async.forEachOfSeries: done."); } +); - console.log(`async.forEachOf/eachOf: ${key} = ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.forEachOf/eachOf: done."); - -}); - -async.forEachOfSeries({ - "a": 1, - "b": 2 -}, function(val: number, key: string, next: ErrorCallback): void { - - setTimeout(function(): void { - - console.log(`async.forEachOfSeries: ${key} = ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.forEachOfSeries: done."); - -}); - -async.forEachOfLimit({ - "a": 1, - "b": 2, - "c": 3, - "d": 4, - "e": 5, - "f": 6 -}, 2, function(val: number, key: string, next: ErrorCallback): void { - - setTimeout(function(): void { - - console.log(`async.forEachOfLimit: ${key} = ${val}`); - - next(); - - }, 500); - -}, function(err?: Error): void { - - console.log("async.forEachOfLimit: done."); - -}); +async.forEachOfLimit( + { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }, + 2, + (val: number, key: string, next: ErrorCallback) => { + setTimeout( + () => { + console.log(`async.forEachOfLimit: ${key} = ${val}`); + next(); + }, + 500); + }, + (err?: Error) => { console.log("async.forEachOfLimit: done."); } +); // map -async.map({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, next: AsyncResultCallback): void { +async.map( + { a: 1, b: 2, c: 3 }, + (val: number, next: AsyncResultCallback) => { + setTimeout( + () => { + console.log(`async.map: ${val}`); + next(undefined as any, val.toString()); + }, + 500); + }, + (err: Error, results: string[]) => { console.log("async.map: done with results", results); } +); - setTimeout(function(): void { +async.mapSeries( + { a: 1, b: 2, c: 3 }, + (val: number, next: AsyncResultCallback) => { + setTimeout( + () => { + console.log(`async.mapSeries: ${val}`); + next(undefined as any, val.toString()); + }, + 500); + }, + (err: Error, results: string[]) => { console.log("async.mapSeries: done with results", results); } +); - console.log(`async.map: ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: string[]): void { - - console.log("async.map: done with results", results); - -}); - -async.mapSeries({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, next: AsyncResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.mapSeries: ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: string[]): void { - - console.log("async.mapSeries: done with results", results); - -}); - -async.mapLimit({ - "a": 1, - "b": 2, - "c": 3, - "d": 4, - "e": 5, - "f": 6 -}, 2, function(val: number, next: AsyncResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.mapLimit: ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: string[]): void { - - console.log("async.mapLimit: done with results", results); - -}); +async.mapLimit( + { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }, + 2, + (val: number, next: AsyncResultCallback) => { + setTimeout( + () => { + console.log(`async.mapLimit: ${val}`); + next(undefined as any, val.toString()); + }, + 500); + }, + (err: Error, results: string[]) => { console.log("async.mapLimit: done with results", results); } +); // mapValues -async.mapValues({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, key: string, next: AsyncResultCallback): void { +async.mapValues( + { a: 1, b: 2, c: 3 }, + (val: number, key: string, next: AsyncResultCallback) => { + setTimeout( + () => { + console.log(`async.mapValues: ${key} = ${val}`); + next(undefined as any, val.toString()); + }, + 500); + }, + (err: Error, results: Dictionary) => { console.log("async.mapValues: done with results", results); } +); - setTimeout(function(): void { - - console.log(`async.mapValues: ${key} = ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: Dictionary): void { - - console.log("async.mapValues: done with results", results); - -}); - -async.mapValuesSeries({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, key: string, next: AsyncResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.mapValuesSeries: ${key} = ${val}`); - - next(undefined as any, val.toString()); - - }, 500); - -}, function(err: Error, results: Dictionary): void { - - console.log("async.mapValuesSeries: done with results", results); - -}); +async.mapValuesSeries( + { a: 1, b: 2, c: 3 }, + (val: number, key: string, next: AsyncResultCallback) => { + setTimeout( + () => { + console.log(`async.mapValuesSeries: ${key} = ${val}`); + next(undefined as any, val.toString()); + }, + 500); + }, + (err: Error, results: Dictionary) => { console.log("async.mapValuesSeries: done with results", results); } +); // filter/select/reject -async.filter({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, next: AsyncBooleanResultCallback): void { +async.filter( + { a: 1, b: 2, c: 3 }, + (val: number, next: AsyncBooleanResultCallback) => { + setTimeout( + () => { + console.log(`async.filter/select: ${val}`); + next(undefined as any, val % 2 === 0); + }, + 500); + }, + (err: Error, results: number[]) => { console.log("async.filter/select: done with results", results); } +); - setTimeout(function(): void { - - console.log(`async.filter/select: ${val}`); - - next(undefined as any, val % 2 === 0); - - }, 500); - -}, function(err: Error, results: number[]): void { - - console.log("async.filter/select: done with results", results); - -}); - -async.reject({ - "a": 1, - "b": 2, - "c": 3 -}, function(val: number, next: AsyncBooleanResultCallback): void { - - setTimeout(function(): void { - - console.log(`async.reject: ${val}`); - - next(undefined as any, val % 2 === 0); - - }, 500); - -}, function(err: Error, results: number[]): void { - - console.log("async.reject: done with results", results); - -}); +async.reject( + { a: 1, b: 2, c: 3 }, + (val: number, next: AsyncBooleanResultCallback) => { + setTimeout( + () => { + console.log(`async.reject: ${val}`); + next(undefined as any, val % 2 === 0); + }, + 500); + }, + (err: Error, results: number[]) => { console.log("async.reject: done with results", results); } +); // concat -async.concat({ - "a": "1", - "b": "2", - "c": "3" -}, function(item: string, next: AsyncResultCallback): void { - - console.log(`async.concat: ${item}`); - - next(undefined as any, [item, item, item]); - -}, function(err: Error, results: string[]) { - - console.log("async.concat: done with results", results); - -}); +async.concat( + { a: "1", b: "2", c: "3" }, + (item: string, next: AsyncResultCallback) => { + console.log(`async.concat: ${item}`); + next(undefined as any, [item, item, item]); + }, + (err: Error, results: string[]) => { console.log("async.concat: done with results", results); } +); // detect/find -async.detect({ - "a": 1, - "b": 2, - "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { - - console.log(`async.detect/find: ${item}`); - - next(undefined as any, item > 1); - -}, function(err: Error, result: number) { - - if (err) { - - console.log(err); - - } else { - - console.log("async.detect/find: done with result", result); +async.detect( + { a: 1, b: 2, c: 3 }, + (item: number, next: AsyncBooleanResultCallback) => { + console.log(`async.detect/find: ${item}`); + next(undefined as any, item > 1); + }, + (err: Error, result: number) => { + if (err) { + console.log(err); + } else { + console.log("async.detect/find: done with result", result); + } } - -}); +); // every/all -async.every({ - "a": 1, - "b": 2, - "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { - - console.log(`async.every/all: ${item}`); - - next(undefined as any, item > 0); - -}, function(err: Error, result: boolean) { - - console.log("async.every/all: done with result", result); - -}); +async.every( + { a: 1, b: 2, c: 3 }, + (item: number, next: AsyncBooleanResultCallback) => { + console.log(`async.every/all: ${item}`); + next(undefined as any, item > 0); + }, + (err: Error, result: boolean) => { console.log("async.every/all: done with result", result); } +); // some/any -async.some({ - "a": 1, - "b": 2, - "c": 3 -}, function(item: number, next: AsyncBooleanResultCallback): void { - - console.log(`async.some/any: ${item}`); - - next(undefined as any, item > 2); - -}, function(err: Error, result: boolean) { - - console.log("async.some/any: done with result", result); - -}); +async.some( + { a: 1, b: 2, c: 3 }, + (item: number, next: AsyncBooleanResultCallback) => { + console.log(`async.some/any: ${item}`); + next(undefined as any, item > 2); + }, + (err: Error, result: boolean) => { console.log("async.some/any: done with result", result); } +); // timeout -function myFunction1(foo : any, callback: (err?: Error, result?: any) => void ) : void { +function myFunction1(foo: any, callback: (err?: Error, result?: any) => void): void { console.log(`async.timeout 1 ${foo}`); - return callback(undefined, foo); + callback(undefined, foo); } -var wrapped1 = async.timeout(myFunction1, 1000); -wrapped1({ bar: 'bar' }, function(err : Error, data : any) { - console.log(`async.timeout 1 end ${data}`); -}); +const wrapped1 = async.timeout(myFunction1, 1000); +wrapped1({ bar: 'bar' }, (err: Error, data: any) => { console.log(`async.timeout 1 end ${data}`); }); - -function myFunction2(callback: (err?: Error, result?: any) => void ) : void { +function myFunction2(callback: (err?: Error, result?: any) => void): void { console.log(`async.timeout 2`); - return callback(undefined, { bar: 'bar' }); + callback(undefined, { bar: 'bar' }); } -var wrapped2 = async.timeout(myFunction2, 1000); -wrapped2( function(err : Error, data : any) { - console.log(`async.timeout 2 end ${data}`); -}); +const wrapped2 = async.timeout(myFunction2, 1000); +wrapped2((err: Error, data: any) => { console.log(`async.timeout 2 end ${data}`); }); -function myFunction3(callback: (err?: Error, result?: any) => void ) : void { +function myFunction3(callback: (err?: Error, result?: any) => void): void { console.log(`async.timeout 3`); - return callback(undefined, { bar: 'bar' }); + callback(undefined, { bar: 'bar' }); } -var wrapped3 = async.timeout(myFunction3, 1000, { bar: 'bar' }); -wrapped3( function(err : Error, data : any) { - console.log(`async.timeout 3 end ${data}`); -}); - +const wrapped3 = async.timeout(myFunction3, 1000, { bar: 'bar' }); +wrapped3((err: Error, data: any) => { console.log(`async.timeout 3 end ${data}`); }); diff --git a/types/async/tslint.json b/types/async/tslint.json index 9380375afa..5612ed6657 100644 --- a/types/async/tslint.json +++ b/types/async/tslint.json @@ -1,34 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - // TODOs - "arrow-return-shorthand": false, - "array-type": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "max-line-length": false, - "no-consecutive-blank-lines": false, - "no-padding": false, - "no-unnecessary-generics": false, - "no-var-keyword": false, - "no-void-expression": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-const": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "trim-file": false, - "typedef-whitespace": false, - "unified-signatures": false, - "whitespace": false + "ban-types": true, // PRODUCES ERRORS WHEN REMOVED + "callable-types": false, // HAS ISSUES + "no-unnecessary-generics": false // HAS ISSUES } } diff --git a/types/auth0-js/auth0-js-tests.ts b/types/auth0-js/auth0-js-tests.ts index 6d21de4ed3..6353cc1e40 100644 --- a/types/auth0-js/auth0-js-tests.ts +++ b/types/auth0-js/auth0-js-tests.ts @@ -136,6 +136,12 @@ webAuth.passwordlessStart({ send: 'code' }, (err, data) => {}); +webAuth.passwordlessLogin({ + connection: 'the_connection', + phoneNumber: '123', + verificationCode: '456' +}, (err, data) => {}); + webAuth.signupAndAuthorize({ connection: 'the_connection', email: 'me@example.com', diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index 7ca266e6ce..4fcbb5df33 100644 --- a/types/auth0-js/index.d.ts +++ b/types/auth0-js/index.d.ts @@ -270,6 +270,13 @@ export class WebAuth { */ passwordlessVerify(options: PasswordlessVerifyOptions, callback: Auth0Callback): void; + /** + * Logs in a user with the verification code sent to the user + * @param options + * @param callback + */ + passwordlessLogin(options: PasswordlessLoginOptions, callback: Auth0Callback): void; + /** * Renews an existing session on Auth0's servers using `response_mode=web_message` (i.e. Auth0's hosted login page) * @@ -615,6 +622,13 @@ export interface PasswordlessVerifyOptions { send?: string; } +export interface PasswordlessLoginOptions { + connection: string; + verificationCode: string; + phoneNumber?: string; + email?: string; +} + export interface Auth0UserProfile { name: string; nickname: string; @@ -798,6 +812,8 @@ export interface AuthorizeOptions { login_hint?: string; prompt?: string; mode?: "login" | "signUp"; + accessType?: string; + approvalPrompt?: string; } export interface CheckSessionOptions extends AuthorizeOptions { diff --git a/types/auth0-lock/auth0-lock-tests.ts b/types/auth0-lock/auth0-lock-tests.ts index 6e23e81d5e..53c50dd98f 100644 --- a/types/auth0-lock/auth0-lock-tests.ts +++ b/types/auth0-lock/auth0-lock-tests.ts @@ -130,7 +130,8 @@ const otherOptions : Auth0LockConstructorOptions = { hashCleanup: false, leeway: 30, _enableImpersonation: true, - _enableIdPInitiatedLogin: false + _enableIdPInitiatedLogin: false, + defaultADUsernameFromEmailPrefix: false }; new Auth0Lock(CLIENT_ID, DOMAIN, otherOptions); diff --git a/types/auth0-lock/index.d.ts b/types/auth0-lock/index.d.ts index 2916ec58c8..32a3228e56 100644 --- a/types/auth0-lock/index.d.ts +++ b/types/auth0-lock/index.d.ts @@ -130,7 +130,7 @@ interface Auth0LockConstructorOptions { closable?: boolean; configurationBaseUrl?: string; container?: string; - defaultADUsernameFromEmailPrefix?: string; + defaultADUsernameFromEmailPrefix?: boolean; defaultDatabaseConnection?: string; defaultEnterpriseConnection?: string; flashMessage?: Auth0LockFlashMessageOptions; diff --git a/types/auth0/auth0-tests.ts b/types/auth0/auth0-tests.ts index 60bbf86823..cca6bf8373 100644 --- a/types/auth0/auth0-tests.ts +++ b/types/auth0/auth0-tests.ts @@ -147,11 +147,21 @@ management management .updateUser({id: "user_id"}, {"email": "hi@me.co"}, (err: Error, users: auth0.User) => {}); - // Update user metadata management .updateUserMetadata({id: "user_id"}, {"key": "value"}); +// Update user metadata with JSON object +management + .updateUserMetadata({id: "user_id"}, { + key: "value", + numKey: 123, + objKey: { + foo: "bar", + another: "value" + } + }); + // Update user metadata using callback management .updateUserMetadata({id: "user_id"}, {"key": "value"}, (err: Error, users: auth0.User) => {}); diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index 39d9d36fd7..c2df7dee7c 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for auth0 2.9.2 +// Type definitions for auth0 2.9.3 // Project: https://github.com/auth0/node-auth0 // Definitions by: Seth Westphal +// Ian Howe +// Alex Bjørlig // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -32,7 +34,7 @@ export interface RetryOptions { } export interface UserMetadata { - [propName: string]: string + [propName: string]: any } export interface AppMetadata { @@ -46,7 +48,10 @@ export interface UserData { verify_email?: boolean; password?: string; phone_number?: string; - phone_verified?: boolean, + phone_verified?: boolean; + given_name?: string; + family_name?: string; + name?: string; user_metadata?: UserMetadata; app_metadata?: AppMetadata; } diff --git a/types/autobahn/autobahn-tests.ts b/types/autobahn/autobahn-tests.ts index d753e960fe..8f05c25141 100644 --- a/types/autobahn/autobahn-tests.ts +++ b/types/autobahn/autobahn-tests.ts @@ -43,5 +43,7 @@ function test_client() { }); }; - connection.open(); + if (!connection.isOpen && !connection.isRetrying && connection.session == null) { + connection.open(); + } } diff --git a/types/autobahn/index.d.ts b/types/autobahn/index.d.ts index c62f6115af..7a518e0fd4 100644 --- a/types/autobahn/index.d.ts +++ b/types/autobahn/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for AutobahnJS v0.9.7 +// Type definitions for AutobahnJS 0.9 // Project: http://autobahn.ws/js/ -// Definitions by: Elad Zelingher , Andy Hawkins , Wladimir Totino , Mathias Teier +// Definitions by: Elad Zelingher , Andy Hawkins , Wladimir Totino , Mathias Teier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -191,7 +191,9 @@ declare namespace autobahn { constructor(options?: IConnectionOptions); isOpen: boolean; - + isRetrying: boolean; + session?: Session; + open(): void; close(reason?: string, message?: string): void; diff --git a/types/autobahn/tslint.json b/types/autobahn/tslint.json index a41bf5d19a..a0357daa61 100644 --- a/types/autobahn/tslint.json +++ b/types/autobahn/tslint.json @@ -7,7 +7,6 @@ "ban-types": false, "callable-types": false, "comment-format": false, - "dt-header": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 00b71132e9..ba6ebdc5ac 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -118,12 +118,18 @@ str = apiGwEvt.resource; str = customAuthorizerEvt.type; str = customAuthorizerEvt.methodArn; strOrUndefined = customAuthorizerEvt.authorizationToken; +strOrUndefined = customAuthorizerEvt.resource; +strOrUndefined = customAuthorizerEvt.path; +strOrUndefined = customAuthorizerEvt.httpMethod; str = customAuthorizerEvt.headers!["example"]; str = customAuthorizerEvt.multiValueHeaders!["example"][0]; str = customAuthorizerEvt.pathParameters!["example"]; str = customAuthorizerEvt.queryStringParameters!["example"]; str = customAuthorizerEvt.multiValueQueryStringParameters!["example"][0]; +str = customAuthorizerEvt.stageVariables!["example"]; apiGwEvtReqCtxOpt = customAuthorizerEvt.requestContext; +strOrUndefined = customAuthorizerEvt.domainName; +strOrUndefined = customAuthorizerEvt.apiId; /* DynamoDB Stream Event */ const dynamoDBStreamEvent: AWSLambda.DynamoDBStreamEvent = { @@ -599,6 +605,27 @@ const CodePipelineEvent: AWSLambda.CodePipelineEvent = { CodePipelineEvent["CodePipeline.job"].data.encryptionKey = { type: 'KMS', id: 'key' }; +/* CodePipeline CloudWatch Events + * see https://docs.aws.amazon.com/codepipeline/latest/userguide/detect-state-changes-cloudwatch-events.html + * Their documentation says that detail.version is a string, but it is actually an integer + */ +const CodePipelineCloudWatchEvent: AWSLambda.CodePipelineCloudWatchEvent = { + version: '0', + id: 'event_Id', + 'detail-type': 'CodePipeline Pipeline Execution State Change', + source: 'aws.codepipeline', + account: 'Pipeline_Account', + time: 'TimeStamp', + region: 'us-east-1', + resources: ['arn:aws:codepipeline:us-east-1:account_ID:myPipeline'], + detail: { + pipeline: 'myPipeline', + version: 1, + state: 'STARTED', + 'execution-id': 'execution_Id', + }, +}; + /* CloudFront events, see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html */ const CloudFrontRequestWithCustomOriginEvent: AWSLambda.CloudFrontRequestEvent = { Records: [ @@ -1029,3 +1056,113 @@ const firehoseEventHandler: AWSLambda.FirehoseTransformationHandler = ( ] }); }; + +declare let lexEvent: AWSLambda.LexEvent; +lexEvent = { + currentIntent: { + name: 'intent-name', + slots: { + slot1: null, + slot2: 'value2', + }, + slotDetails: { + slot1: { + resolutions: [ + { value: 'value1' }, + ], + originalValue: 'originalValue', + } + }, + confirmationStatus: 'None', + }, + bot: { + name: 'bot name', + alias: 'bot alias', + version: 'bot version', + }, + userId: 'User ID specified in the POST request to Amazon Lex.', + inputTranscript: 'Text used to process the request', + invocationSource: 'FulfillmentCodeHook', + outputDialogMode: 'Text', + messageVersion: '1.0', + sessionAttributes: { + key1: 'value1', + key2: 'value2', + }, + requestAttributes: { + key1: 'value1', + key2: 'value2', + } +}; + +declare let lexResult: AWSLambda.LexResult; +declare let lexDialogAction: AWSLambda.LexDialogAction; +declare let lexDialogActionBase: AWSLambda.LexDialogActionBase; +declare let lexDialogActionClose: AWSLambda.LexDialogActionClose; +declare let lexDialogActionConfirmIntent: AWSLambda.LexDialogActionConfirmIntent; +declare let lexDialogActionDelegate: AWSLambda.LexDialogActionDelegate; +declare let lexDialogActionElicitIntent: AWSLambda.LexDialogActionElicitIntent; +declare let lexDialogActionElicitSlot: AWSLambda.LexDialogActionElicitSlot; +declare let lexGenericAttachment: AWSLambda.LexGenericAttachment; + +lexResult = { + sessionAttributes: { + attrib1: 'Value One', + }, + dialogAction: { + type: 'Close', + fulfillmentState: 'Failed', + }, +}; + +str = lexGenericAttachment.title; +str = lexGenericAttachment.subTitle; +str = lexGenericAttachment.imageUrl; +str = lexGenericAttachment.attachmentLinkUrl; +str = lexGenericAttachment.buttons[0].text; +str = lexGenericAttachment.buttons[0].value; + +lexDialogAction.type === 'Close'; +lexDialogAction.type === 'ConfirmIntent'; +lexDialogAction.type === 'Delegate'; +lexDialogAction.type === 'ElicitIntent'; +lexDialogAction.type === 'ElicitSlot'; + +lexDialogActionBase.message!.contentType === 'CustomPayload'; +lexDialogActionBase.message!.contentType === 'PlainText'; +lexDialogActionBase.message!.contentType === 'SSML'; +str = lexDialogActionBase.message!.content; +num = lexDialogActionBase.responseCard!.version; +lexDialogActionBase.responseCard!.contentType === 'application/vnd.amazonaws.card.generic'; +// $ExpectType LexGenericAttachment +lexDialogActionBase.responseCard!.genericAttachments[0]; + +lexDialogActionClose.type === 'Close'; +lexDialogActionClose.fulfillmentState === 'Failed'; +lexDialogActionClose.fulfillmentState === 'Fulfilled'; + +lexDialogActionConfirmIntent.type === 'ConfirmIntent'; +str = lexDialogActionConfirmIntent.intentName; +strOrNull = lexDialogActionConfirmIntent.slots['example']; + +lexDialogActionDelegate.type === 'Delegate'; +strOrNull = lexDialogActionDelegate.slots['example']; + +lexDialogActionElicitIntent.type === 'ElicitIntent'; +lexDialogActionElicitSlot.type === 'ElicitSlot'; +strOrNull = lexDialogActionElicitSlot.slots['example']; +str = lexDialogActionElicitSlot.slotToElicit; +str = lexDialogActionElicitSlot.intentName; + +const lexEventHandler: AWSLambda.LexHandler = async ( + event: AWSLambda.LexEvent, + context: AWSLambda.Context, +) => { + // $ExpectType LexEvent + event; + + // $ExpectType Context + context; + str = context.functionName; + return lexResult; +}; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index d9d22f8c65..52314529bc 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -24,6 +24,7 @@ // Oliver Hookins // Trevor Leach // James Gregory +// Erik Dalén // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -78,12 +79,18 @@ export interface CustomAuthorizerEvent { type: string; methodArn: string; authorizationToken?: string; + resource?: string; + path?: string; + httpMethod?: string; headers?: { [name: string]: string }; multiValueHeaders?: { [name: string]: string[] }; pathParameters?: { [name: string]: string } | null; queryStringParameters?: { [name: string]: string } | null; multiValueQueryStringParameters?: { [name: string]: string[] } | null; + stageVariables?: { [name: string]: string }; requestContext?: APIGatewayEventRequestContext; + domainName?: string; + apiId?: string; } // Context @@ -576,6 +583,109 @@ export interface CodePipelineEvent { }; } +/** + * CodePipeline CloudWatch Events + * https://docs.aws.amazon.com/codepipeline/latest/userguide/detect-state-changes-cloudwatch-events.html + * + * The above CodePipelineEvent is when a lambda is invoked by a CodePipeline. + * These events are when you subsribe to CodePipeline events in CloudWatch. + * + * Their documentation says that detail.version is a string, but it is actually an integer + */ +export type CodePipelineState = + | 'STARTED' + | 'SUCCEEDED' + | 'RESUMED' + | 'FAILED' + | 'CANCELED' + | 'SUPERSEDED'; + +export type CodePipelineStageState = + | 'STARTED' + | 'SUCCEEDED' + | 'RESUMED' + | 'FAILED' + | 'CANCELED'; + +export type CodePipelineActionState = + | 'STARTED' + | 'SUCCEEDED' + | 'FAILED' + | 'CANCELED'; + +export interface CodePipelineCloudWatchPipelineEvent { + version: string; + id: string; + 'detail-type': 'CodePipeline Pipeline Execution State Change'; + source: 'aws.codepipeline'; + account: string; + time: string; + region: string; + resources: string[]; + detail: { + pipeline: string; + version: number; + state: CodePipelineState; + 'execution-id': string; + }; +} + +export interface CodePipelineCloudWatchStageEvent { + version: string; + id: string; + 'detail-type': 'CodePipeline Stage Execution State Change'; + source: 'aws.codepipeline'; + account: string; + time: string; + region: string; + resources: string[]; + detail: { + pipeline: string; + version: number; + 'execution-id': string; + stage: string; + state: CodePipelineStageState; + }; +} + +export type CodePipelineActionCategory = + | 'Approval' + | 'Build' + | 'Deploy' + | 'Invoke' + | 'Source' + | 'Test'; + +export interface CodePipelineCloudWatchActionEvent { + version: string; + id: string; + 'detail-type': 'CodePipeline Action Execution State Change'; + source: 'aws.codepipeline'; + account: string; + time: string; + region: string; + resources: string[]; + detail: { + pipeline: string; + version: number; + 'execution-id': string; + stage: string; + action: string; + state: CodePipelineActionState; + type: { + owner: 'AWS' | 'Custom' | 'ThirdParty'; + category: CodePipelineActionCategory; + provider: string; + version: number; + }; + }; +} + +export type CodePipelineCloudWatchEvent = + | CodePipelineCloudWatchPipelineEvent + | CodePipelineCloudWatchStageEvent + | CodePipelineCloudWatchActionEvent; + /** * CloudFront events * http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html @@ -766,6 +876,100 @@ export interface SQSMessageAttributes { [name: string]: SQSMessageAttribute; } +// Lex +// https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html#supported-event-source-lex +export interface LexEvent { + currentIntent: { + name: string; + slots: { [name: string]: string | null }; + slotDetails: LexSlotDetails; + confirmationStatus: 'None' | 'Confirmed' | 'Denied'; + }; + bot: { + name: string; + alias: string; + version: string; + }; + userId: string; + inputTranscript: string; + invocationSource: 'DialogCodeHook' | 'FulfillmentCodeHook'; + outputDialogMode: 'Text' | 'Voice'; + messageVersion: '1.0'; + sessionAttributes: { [key: string]: string }; + requestAttributes: { [key: string]: string } | null; +} + +export interface LexSlotResolution { + value: string; +} + +export interface LexSlotDetails { + [name: string]: { + // The following line only works in TypeScript Version: 3.0, The array should have at least 1 and no more than 5 items + // resolutions: [LexSlotResolution, LexSlotResolution?, LexSlotResolution?, LexSlotResolution?, LexSlotResolution?]; + resolutions: LexSlotResolution[] + originalValue: string; + }; +} + +export interface LexGenericAttachment { + title: string; + subTitle: string; + imageUrl: string; + attachmentLinkUrl: string; + buttons: Array<{ + text: string; + value: string; + }>; +} + +export interface LexDialogActionBase { + type: 'Close' | 'ElicitIntent' | 'ElicitSlot' | 'ConfirmIntent'; + message?: { + contentType: 'PlainText' | 'SSML' | 'CustomPayload'; + content: string; + }; + responseCard?: { + version: number; + contentType: 'application/vnd.amazonaws.card.generic'; + genericAttachments: LexGenericAttachment[]; + }; +} + +export interface LexDialogActionClose extends LexDialogActionBase { + type: 'Close'; + fulfillmentState: 'Fulfilled' | 'Failed'; +} + +export interface LexDialogActionElicitIntent extends LexDialogActionBase { + type: 'ElicitIntent'; +} + +export interface LexDialogActionElicitSlot extends LexDialogActionBase { + type: 'ElicitSlot'; + intentName: string; + slots: { [name: string]: string | null }; + slotToElicit: string; +} + +export interface LexDialogActionConfirmIntent extends LexDialogActionBase { + type: 'ConfirmIntent'; + intentName: string; + slots: { [name: string]: string | null }; +} + +export interface LexDialogActionDelegate { + type: 'Delegate'; + slots: { [name: string]: string | null }; +} + +export type LexDialogAction = LexDialogActionClose | LexDialogActionElicitIntent | LexDialogActionElicitSlot | LexDialogActionConfirmIntent | LexDialogActionDelegate; + +export interface LexResult { + sessionAttributes?: { [key: string]: string }; + dialogAction: LexDialogAction; +} + /** * AWS Lambda handler function. * http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html @@ -828,6 +1032,9 @@ export type ScheduledHandler = Handler; // TODO: Alexa +export type LexHandler = Handler; +export type LexCallback = Callback; + export type APIGatewayProxyHandler = Handler; export type APIGatewayProxyCallback = Callback; export type ProxyHandler = APIGatewayProxyHandler; // Old name @@ -837,6 +1044,11 @@ export type ProxyCallback = APIGatewayProxyCallback; // Old name export type CodePipelineHandler = Handler; +export type CodePipelineCloudWatchHandler = Handler; +export type CodePipelineCloudWatchPipelineHandler = Handler; +export type CodePipelineCloudWatchStageHandler = Handler; +export type CodePipelineCloudWatchActionHandler = Handler; + export type CloudFrontRequestHandler = Handler; export type CloudFrontRequestCallback = Callback; diff --git a/types/azure-sb/azure-sb-tests.ts b/types/azure-sb/azure-sb-tests.ts index 14d2ba9054..e1703c8086 100644 --- a/types/azure-sb/azure-sb-tests.ts +++ b/types/azure-sb/azure-sb-tests.ts @@ -80,3 +80,14 @@ nh.wns.send('tag', '', 'wns/toast', { headers: {} }, Response nh.wns.sendToastText01('tag', '', ResponseCallback); nh.wns.sendToastText01(['tag'], '', ResponseCallback); nh.wns.sendToastText01('tag', '', { headers: {} }, ResponseCallback); +nh.createOrUpdateInstallation({ + "installationId":"123-123-123-123", + "platform":"gcm", + "pushChannel":"aXhytc4zD=", +}, () => {}); +nh.createOrUpdateInstallation({ + installationId:"123-123-123-123", + platform:"gcm", + pushChannel:"aXhytc4zD=", + tags:["tag1","tag2"] +}, {}, () => {}); \ No newline at end of file diff --git a/types/azure-sb/index.d.ts b/types/azure-sb/index.d.ts index bd62e100ab..acb0bed06a 100644 --- a/types/azure-sb/index.d.ts +++ b/types/azure-sb/index.d.ts @@ -140,6 +140,32 @@ export namespace Azure.ServiceBus { WnsHeaders?: any; } + export interface NotificationHubInstallation { + installationId: string; + readonly lastActiveOn?: string; + readonly expirationTime?: string; + readonly lastUpdate?: string; + platform: "apns" | "wns" | "mpns" | "adm" | "gcm"; + pushChannel: string; + readonly expiredPushChannel?: string; + tags?: Array; + templates?: { + [name: string]: { + body: string; + headers?: any; + expiry?: string; + tags?: Array; + }; + }; + secondaryTile?: { + [titleId: string]: { + pushChannel: string; + tags?: Array; + templates?: any; + }; + }; + } + export interface Response { body: Dictionary; headers: Dictionary; diff --git a/types/azure-sb/lib/notificationhubservice.d.ts b/types/azure-sb/lib/notificationhubservice.d.ts index d56b53d9d5..ab2cf0f3ee 100644 --- a/types/azure-sb/lib/notificationhubservice.d.ts +++ b/types/azure-sb/lib/notificationhubservice.d.ts @@ -2,6 +2,7 @@ import { Azure } from 'azure-sb'; import Callback = Azure.ServiceBus.ResponseCallback; import NotificationHubRegistration = Azure.ServiceBus.NotificationHubRegistration; import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions; +import NotificationHubInstallation = Azure.ServiceBus.NotificationHubInstallation; import ApnsService = require('./apnsservice'); import GcmService = require('./gcmservice'); @@ -29,10 +30,10 @@ declare class NotificationHubService { options: { headers: object }, callback: Callback): void; - public createOrUpdateInstallation(installation: string, + public createOrUpdateInstallation(installation: NotificationHubInstallation, callback: Callback): void; - public createOrUpdateInstallation(installation: string, + public createOrUpdateInstallation(installation: NotificationHubInstallation, options: any, callback: Callback): void; diff --git a/types/babel__traverse/babel__traverse-tests.ts b/types/babel__traverse/babel__traverse-tests.ts index 70f8c5f0b6..98a0338021 100644 --- a/types/babel__traverse/babel__traverse-tests.ts +++ b/types/babel__traverse/babel__traverse-tests.ts @@ -150,3 +150,8 @@ const VisitorStateTest: Visitor = { } } }; + +const VisitorAliasTest: Visitor = { + Function() {}, + Expression() {}, +}; diff --git a/types/babel__traverse/index.d.ts b/types/babel__traverse/index.d.ts index 89e242129b..fe817d5daf 100644 --- a/types/babel__traverse/index.d.ts +++ b/types/babel__traverse/index.d.ts @@ -145,6 +145,8 @@ export class Binding { export type Visitor = VisitNodeObject & { [Type in Node["type"]]?: VisitNode>; +} & { + [K in keyof t.Aliases]?: VisitNode }; export type VisitNode = VisitNodeFunction | VisitNodeObject; diff --git a/types/babel__traverse/package.json b/types/babel__traverse/package.json index 2442a952db..47a2d3dc48 100644 --- a/types/babel__traverse/package.json +++ b/types/babel__traverse/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.3.0" } } diff --git a/types/backbone-relational/backbone-relational-tests.ts b/types/backbone-relational/backbone-relational-tests.ts index 90433cd153..6e0135fcd9 100644 --- a/types/backbone-relational/backbone-relational-tests.ts +++ b/types/backbone-relational/backbone-relational-tests.ts @@ -74,6 +74,7 @@ paul.get('livesIn'); // === ourHouse // You can control which relations get serialized to JSON, using the 'includeInJSON' // property on a Relation. Also, each object will only get serialized once to prevent loops. alert(JSON.stringify(paul.get('user').toJSON(), null, '\t')); +alert(JSON.stringify(paul.get('user').toJSON({ option1: 'value1' }), null, '\t')); // Load occupants 'person-2' and 'person-5', which don't exist yet, from the server ourHouse.fetchRelated('occupants'); diff --git a/types/backbone-relational/index.d.ts b/types/backbone-relational/index.d.ts index 403759ac97..84406fb60a 100644 --- a/types/backbone-relational/index.d.ts +++ b/types/backbone-relational/index.d.ts @@ -34,7 +34,7 @@ declare module 'backbone' { fetchRelated(key:string, options?:any, update?:boolean):any; - toJSON():any; + toJSON(options?: any):any; static setup(); diff --git a/types/badgen/badgen-tests.ts b/types/badgen/badgen-tests.ts new file mode 100644 index 0000000000..1b795b3d72 --- /dev/null +++ b/types/badgen/badgen-tests.ts @@ -0,0 +1,24 @@ +import badgen from 'badgen'; + +// $ExpectType string +badgen({ + subject: 'SUBJECT', + status: 'STATUS' +}); + +// $ExpectType string +badgen({ + subject: 'SUBJECT', + status: 'STATUS', + color: 'green' +}); + +// $ExpectType string +badgen({ + subject: 'SUBJECT', + status: 'STATUS', + color: '#FF0000', + style: 'flat', + icon: 'data:image/svg+xml;base64,...', + iconWidth: 20 +}); diff --git a/types/badgen/index.d.ts b/types/badgen/index.d.ts new file mode 100644 index 0000000000..cc6aa1fe54 --- /dev/null +++ b/types/badgen/index.d.ts @@ -0,0 +1,55 @@ +// Type definitions for badgen 2.6 +// Project: https://github.com/amio/badgen +// Definitions by: m5d215 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +type ColorPresets = + | 'green' + | 'blue' + | 'red' + | 'yellow' + | 'orange' + | 'purple' + | 'pink' + | 'grey' + | 'gray' + | 'cyan' + | 'black'; + +interface BadgeCreationParams { + /** + * Text representing the subject. + */ + subject: string; + + /** + * Text representing the status. + */ + status: string; + + /** + * Color RGB or Color Name, optional. + */ + color?: ColorPresets | string; + + /** + * 'flat' or undefined, optional. + */ + style?: 'flat'; + + /** + * Use icon, optional. + */ + icon?: string; + + /** + * Use this if icon is not square. + * @default 13 + */ + iconWidth?: number; +} + +declare function badgen(params: BadgeCreationParams): string; + +export = badgen; diff --git a/types/badgen/tsconfig.json b/types/badgen/tsconfig.json new file mode 100644 index 0000000000..8e915b8aac --- /dev/null +++ b/types/badgen/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "badgen-tests.ts" + ] +} diff --git a/types/universal-router/tslint.json b/types/badgen/tslint.json similarity index 100% rename from types/universal-router/tslint.json rename to types/badgen/tslint.json diff --git a/types/bandagedbd__bdapi/bandagedbd__bdapi-tests.ts b/types/bandagedbd__bdapi/bandagedbd__bdapi-tests.ts new file mode 100644 index 0000000000..3966aa3d1e --- /dev/null +++ b/types/bandagedbd__bdapi/bandagedbd__bdapi-tests.ts @@ -0,0 +1,6 @@ +import { BdApi } from 'bandagedbd__bdapi'; + +BdApi.React; // $ExpectType typeof React +BdApi.ReactDOM.render; // $ExpectType Renderer +BdApi.alert('foo', 'bar'); // $ExpectType void +BdApi.showToast('hello', { timeout: 2000 }); // $ExpectType void diff --git a/types/bandagedbd__bdapi/index.d.ts b/types/bandagedbd__bdapi/index.d.ts new file mode 100644 index 0000000000..4792992374 --- /dev/null +++ b/types/bandagedbd__bdapi/index.d.ts @@ -0,0 +1,176 @@ +// Type definitions for bdapi 0.2 +// Project: https://github.com/rauenzi/BetterDiscordApp +// Definitions by: Ari Seyhun +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 +// Documentation: https://github.com/rauenzi/BetterDiscordApp/wiki/Creating-Plugins#bdapi + +import * as ReactInstance from 'react'; +import * as ReactDOMInstance from 'react-dom'; + +export const BdApi: typeof BdApiModule; + +/** + * Function with no arguments and no return value that may be called to revert changes made by monkeyPatch method, + * restoring (unpatching) original method. + */ +export type CancelPatch = () => void; + +/** + * A callback that modifies method logic. + * This callback is called on each call of the original method and is provided all data about original call. + * Any of the data can be modified if necessary, but do so wisely. + */ +export type PatchFunction = (data: PatchData) => any; + +/** + * A callback that modifies method logic. + * This callback is called on each call of the original method and is provided all data about original call. + * Any of the data can be modified if necessary, but do so wisely. + */ +export interface PatchData { + thisObject: object; + methodArguments: any[]; + CancelPatch: CancelPatch; + originalMethod: () => void; + callOriginalMethod: () => void; + returnValue: any; +} + +export interface MonkeyPatchOptions { + once?: boolean; + silent?: boolean; + displayName?: string; + before?: PatchFunction; + after?: PatchFunction; + instead?: PatchFunction; +} + +export interface ToastOptions { + type?: string; + icon?: boolean; + timeout?: number; +} + +export namespace BdApiModule { + /** + * The React module being used inside Discord. + */ + const React: typeof ReactInstance; + + /** + * The ReactDOM module being used inside Discord. + */ + const ReactDOM: typeof ReactDOMInstance; + + /** + * Creates an shows an alert modal to the user. A preview of how it may look can be found [here](https://i.zackrauen.com/7qnnNC.png). + */ + function alert(title: string, content: string): void; + + /** + * Removes a style added with [`injectCSS`](#injectcssid-css) below. + */ + function clearCSS(id: string): void; + + /** + * Deletes some saved data for plugin `pluginName` with key `key`. + */ + function deleteData(pluginName: string, key: string): void; + + /** + * Searches for an internal Discord webpack module based on `filter`. + */ + function findModule(filter: () => void): any; + + /** + * Searches for multiple internal Discord webpack module based on `filter`. It's the same as [`findModule`](#findmodulefilter) but will return all matches + */ + function findAllModules(filter: () => void): any[]; + + /** + * Searches for an internal Discord webpack module that has every property passed. + */ + function findModuleByProps(...props: string[]): any; + + /** + * Returns BandagedBD's instance of the core module. Only use this if you know what you are doing. + */ + function getCore(): any; // TODO: This should not return 'any' but instead 'Core' + + /** + * Alias for [loadData(pluginName, key)](#loaddatapluginname-key) + */ + function getData(pluginName: string, key: string): any; + + /** + * Gets the internal react instance for a particular node. + */ + function getInternalInstance(node: HTMLElement): object|undefined; + + /** + * Gets the instance of another plugin with the name `name`. + */ + function getPlugin(name: string): object|null; + + /** + * Adds a block of css to the current document's `head`. + */ + function injectCSS(id: string, css: string): object|null; + + /** + * Links some remote JavaScript to be added to the page. Useful for libraries like `Sortable.js`. + */ + function linkJS(id: string, url: string): void; + + /** + * Gets some saved data for plugin `pluginName` with key `key`. Data can be saved with [`saveData`](#savedatapluginname-key-data). + */ + function loadData(pluginName: string, key: string): any; + + /** + * This function monkey-patches a method on an object. The patching callback may be run before, after or instead of target method. + * - Be careful when monkey-patching. Think not only about original functionality of target method and your changes, + * but also about developers of other plugins, who may also patch this method before or after you. + * Try to change target method behaviour as little as possible, and avoid changing method signatures. + * - Display name of patched method is changed, so you can see if a function has been patched (and how many times) while debugging or in the stack trace. + * Also, patched methods have property `__monkeyPatched` set to `true`, in case you want to check something programmatically. + */ + function monkeyPatch(module: object, methodName: string, options: MonkeyPatchOptions): CancelPatch; + + /** + * Adds a listener for when the node is removed from the document body. + */ + function onRemoved(node: HTMLElement, callback: () => void): void; + + /** + * Saved some `data` for plugin `pluginName` under `key` key. Gets saved in the plugins folder under `pluginName.config.json`. Data can be saved with [`loadData`](#loaddatapluginname-key). + */ + function saveData(pluginName: string, key: string, data: any): void; + + /** + * Alias for [saveData(pluginName, key, data)](#savedatapluginname-key-data) + * + */ + function setData(pluginName: string, key: string, data: any): void; + + /** + * Shows a simple toast message similar to on Android. An example of the `success` toast can be seen [here](https://i.zackrauen.com/zIagVa.png). + */ + function showToast(content: string, options?: ToastOptions): void; + + /** + * Wraps a function in a try catch block. + */ + function suppressErrors(method: () => void, message?: string): () => void; + + /** + * Determines if the input is valid and parseable JSON. + */ + function testJSON(data: string): boolean; + + /** + * Removes some previously linked JS by [`linkJS`](#linkjsid-url). + */ + function unlinkJS(id: string): void; +} diff --git a/types/nuka-carousel/tsconfig.json b/types/bandagedbd__bdapi/tsconfig.json similarity index 93% rename from types/nuka-carousel/tsconfig.json rename to types/bandagedbd__bdapi/tsconfig.json index 240c9965c5..7e35378a67 100644 --- a/types/nuka-carousel/tsconfig.json +++ b/types/bandagedbd__bdapi/tsconfig.json @@ -20,6 +20,6 @@ }, "files": [ "index.d.ts", - "nuka-carousel-tests.tsx" + "bandagedbd__bdapi-tests.ts" ] } diff --git a/types/bandagedbd__bdapi/tslint.json b/types/bandagedbd__bdapi/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bandagedbd__bdapi/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/base-x/base-x-tests.ts b/types/base-x/base-x-tests.ts index 44e302d2d5..7f50a98e54 100644 --- a/types/base-x/base-x-tests.ts +++ b/types/base-x/base-x-tests.ts @@ -1,13 +1,10 @@ +import * as baseX from 'base-x'; -import * as basex from 'base-x'; +const BASE58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; +const bs58 = baseX(BASE58); -let bs16 = basex('0123456789ABCDEF'); +const decoded = bs58.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr'); +decoded; // $ExpectType Buffer +bs58.decodeUnsafe('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr'); // $ExpectType Buffer | undefined -{ - let encoded: string; - - encoded = bs16.encode([255]); - encoded = bs16.encode({0: 255, length: 1}); -} - -let decoded: number[] = bs16.decode('FF'); +bs58.encode(decoded); // $ExpectType string diff --git a/types/base-x/index.d.ts b/types/base-x/index.d.ts index bbad200ce1..1b8fa16cee 100644 --- a/types/base-x/index.d.ts +++ b/types/base-x/index.d.ts @@ -1,23 +1,21 @@ -// Type definitions for base-x v1.0.1 +// Type definitions for base-x 3.0 // Project: https://github.com/cryptocoinjs/base-x // Definitions by: Ilya Mochalov +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare var BaseX: BaseX.Base; -export = BaseX; +/// -declare namespace BaseX { - interface EncodeBuffer { - [index: number]: number; - length: number; - } +import { Buffer } from 'buffer'; - interface BaseConverter { - encode: (buffer: EncodeBuffer) => string; - decode: (string: string) => number[]; - } +export = baseX; - interface Base { - (ALPHABET: string): BaseX.BaseConverter - } +declare function baseX(ALPHABET: string): baseX.BaseConverter; + +declare namespace baseX { + interface BaseConverter { + encode(buffer: Buffer): string; + decodeUnsafe(string: string): Buffer | undefined; + decode(string: string): Buffer; + } } diff --git a/types/base-x/tsconfig.json b/types/base-x/tsconfig.json index d69790c7d6..6f491037d2 100644 --- a/types/base-x/tsconfig.json +++ b/types/base-x/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "base-x-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/base-x/tslint.json b/types/base-x/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/base-x/tslint.json +++ b/types/base-x/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/base-x/v1/base-x-tests.ts b/types/base-x/v1/base-x-tests.ts new file mode 100644 index 0000000000..3af01f8ca0 --- /dev/null +++ b/types/base-x/v1/base-x-tests.ts @@ -0,0 +1,12 @@ +import * as basex from 'base-x'; + +const bs16 = basex('0123456789ABCDEF'); + +{ + let encoded: string; + + encoded = bs16.encode([255]); + encoded = bs16.encode({0: 255, length: 1}); +} + +const decoded: number[] = bs16.decode('FF'); diff --git a/types/base-x/v1/index.d.ts b/types/base-x/v1/index.d.ts new file mode 100644 index 0000000000..379eeb8182 --- /dev/null +++ b/types/base-x/v1/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for base-x 1.0 +// Project: https://github.com/cryptocoinjs/base-x +// Definitions by: Ilya Mochalov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare var BaseX: BaseX.Base; +export = BaseX; + +declare namespace BaseX { + interface EncodeBuffer { + [index: number]: number; + length: number; + } + + interface BaseConverter { + encode: (buffer: EncodeBuffer) => string; + decode: (string: string) => number[]; + } + + type Base = (ALPHABET: string) => BaseConverter; +} diff --git a/types/dwt/v12/tsconfig.json b/types/base-x/v1/tsconfig.json similarity index 86% rename from types/dwt/v12/tsconfig.json rename to types/base-x/v1/tsconfig.json index f856dd2657..b48e3e2932 100644 --- a/types/dwt/v12/tsconfig.json +++ b/types/base-x/v1/tsconfig.json @@ -13,8 +13,8 @@ "../../" ], "paths": { - "dwt": [ - "dwt/v12" + "base-x": [ + "base-x/v1" ] }, "types": [], @@ -23,6 +23,6 @@ }, "files": [ "index.d.ts", - "dwt-tests.ts" + "base-x-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/base-x/v1/tslint.json b/types/base-x/v1/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/base-x/v1/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/base64-async/base64-async-tests.ts b/types/base64-async/base64-async-tests.ts new file mode 100644 index 0000000000..7efe30b89f --- /dev/null +++ b/types/base64-async/base64-async-tests.ts @@ -0,0 +1,24 @@ +import b64 = require('base64-async'); +import * as fs from 'fs'; + +const buffer: Buffer = fs.readFileSync('somehugefile.jpg'); +const b64String = 'aGkgbXVt...'; + +b64.encode(buffer).then(b64String => { + b64String; // $ExpectType string +}); +b64.encode(buffer, { chunkSize: 10 }).then(b64String => { + b64String; // $ExpectType string +}); + +b64.decode(b64String).then(buffer => { + buffer; // $ExpectType Buffer +}); +b64.decode(b64String, { chunkSize: 10 }).then(buffer => { + buffer; // $ExpectType Buffer +}); + +b64(buffer); // $ExpectType Promise +b64(buffer, { chunkSize: 10 }); // $ExpectType Promise +b64(b64String); // $ExpectType Promise +b64(b64String, { chunkSize: 10 }); // $ExpectType Promise diff --git a/types/base64-async/index.d.ts b/types/base64-async/index.d.ts new file mode 100644 index 0000000000..d14125a3ca --- /dev/null +++ b/types/base64-async/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for base64-async 2.1 +// Project: https://github.com/lukechilds/base64-async +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export = base64Async; + +declare function base64Async(input: Buffer, options?: base64Async.Options): Promise; +declare function base64Async(input: string, options?: base64Async.Options): Promise; + +declare namespace base64Async { + function encode(input: Buffer, options?: Options): Promise; + function decode(input: string, options?: Options): Promise; + + interface Options { + chunkSize?: number; + } +} diff --git a/types/base64-async/tsconfig.json b/types/base64-async/tsconfig.json new file mode 100644 index 0000000000..38a35f20b8 --- /dev/null +++ b/types/base64-async/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", + "base64-async-tests.ts" + ] +} diff --git a/types/base64-async/tslint.json b/types/base64-async/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/base64-async/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/battery-level/battery-level-tests.ts b/types/battery-level/battery-level-tests.ts new file mode 100644 index 0000000000..e9b7bcf679 --- /dev/null +++ b/types/battery-level/battery-level-tests.ts @@ -0,0 +1,4 @@ +import batteryLevel = require('battery-level'); + +// $ExpectType Promise +batteryLevel(); diff --git a/types/battery-level/index.d.ts b/types/battery-level/index.d.ts new file mode 100644 index 0000000000..b5303f2b9f --- /dev/null +++ b/types/battery-level/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for battery-level 3.0 +// Project: https://github.com/gillstrom/battery-level#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = batteryLevel; + +declare function batteryLevel(): Promise; diff --git a/types/battery-level/tsconfig.json b/types/battery-level/tsconfig.json new file mode 100644 index 0000000000..59980404d5 --- /dev/null +++ b/types/battery-level/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", + "battery-level-tests.ts" + ] +} diff --git a/types/battery-level/tslint.json b/types/battery-level/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/battery-level/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/beeper/beeper-tests.ts b/types/beeper/beeper-tests.ts new file mode 100644 index 0000000000..b3f6f8d60b --- /dev/null +++ b/types/beeper/beeper-tests.ts @@ -0,0 +1,7 @@ +import beeper = require('beeper'); + +beeper(); +beeper(3); +beeper(3, () => {}); +beeper('****-*-*'); +beeper('****-*-*', () => {}); diff --git a/types/beeper/index.d.ts b/types/beeper/index.d.ts new file mode 100644 index 0000000000..3e17e4be1c --- /dev/null +++ b/types/beeper/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for beeper 1.1 +// Project: https://github.com/sindresorhus/beeper#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = beeper; + +declare function beeper(count?: number, cb?: () => void): void; +declare function beeper(melody: string, cb?: () => void): void; diff --git a/types/beeper/tsconfig.json b/types/beeper/tsconfig.json new file mode 100644 index 0000000000..54614ad773 --- /dev/null +++ b/types/beeper/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", + "beeper-tests.ts" + ] +} diff --git a/types/beeper/tslint.json b/types/beeper/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/beeper/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bell/bell-tests.ts b/types/bell/bell-tests.ts index 26a29670a0..8a091f005c 100644 --- a/types/bell/bell-tests.ts +++ b/types/bell/bell-tests.ts @@ -16,7 +16,7 @@ async function run() { clientSecret: '', scope(request) { const scopes = ['public_profile', 'email']; - if ((request.query as RequestQuery).wantsSharePermission) { + if (request.query.wantsSharePermission) { scopes.push('publish_actions'); } return scopes; diff --git a/types/better-sqlite3/better-sqlite3-tests.ts b/types/better-sqlite3/better-sqlite3-tests.ts index 7272d88f7e..f5a6c0e070 100644 --- a/types/better-sqlite3/better-sqlite3-tests.ts +++ b/types/better-sqlite3/better-sqlite3-tests.ts @@ -1,40 +1,80 @@ -import Database = require('better-sqlite3'); +import Sqlite = require('better-sqlite3'); -const integer = Database.Integer(1); -const err = new Database.SqliteError('ok', 'ok'); -const result: Database.RunResult = { changes: 1, lastInsertRowid: 1 }; -const options: Database.Options = { fileMustExist: true, memory: true, readonly: true }; -const registrationOptions: Database.RegistrationOptions = { +const integer = Sqlite.Integer(1); +const err = new Sqlite.SqliteError('ok', 'ok'); +const result: Sqlite.RunResult = { changes: 1, lastInsertRowid: 1 }; +const options: Sqlite.Options = { fileMustExist: true, memory: true, readonly: true }; +const registrationOptions: Sqlite.RegistrationOptions = { deterministic: true, - name: '', safeIntegers: true, varargs: true }; -let db = Database('.'); -db = new Database('.', { memory: true }); +let db: Sqlite.Database = Sqlite('.'); +db = new Sqlite('.', { memory: true }); db.exec('CREATE TABLE test (id INTEGER PRIMARY KEY NOT NULL, name TEXT NOT NULL);'); db.exec('INSERT INTO test(name) VALUES("name");'); -db.pragma('data_version', true); +db.pragma('data_version', { simple: true }); db.checkpoint(); db.checkpoint('main'); -db.register(() => { }); -db.register({ name: 'noop', deterministic: true, varargs: true }, () => { }); +db.function('noop', () => { }); +db.function('noop', { deterministic: true, varargs: true }, () => { }); +db.aggregate('add', { + start: 0, + step: (t, n) => t + n, + deterministic: true, + varargs: true +}); +db.aggregate('getAverage', { + start: () => [], + step: (array, nextValue) => { + array.push(nextValue); + }, + result: array => array.reduce((t: any, v: any) => t + v) / array.length, +}); +db.aggregate('addAll', { + start: 0, + step: (total, nextValue) => total + nextValue, + inverse: (total, droppedValue) => total - droppedValue, + result: total => Math.round(total), +}); db.defaultSafeIntegers(); db.defaultSafeIntegers(true); -const stmt = db.prepare('SELECT * FROM test WHERE name == ?;'); +const stmt: Sqlite.Statement = db.prepare('SELECT * FROM test WHERE name == ?;'); stmt.get(['name']); stmt.all({ name: 'name' }); -stmt.each('name', (row: { name: string }) => { }); -stmt.each((row: { name: string }) => { }); +for (const row of stmt.iterate('name')) { +} stmt.pluck(); stmt.pluck(true); +stmt.expand(); +stmt.expand(true); stmt.bind('name'); stmt.safeIntegers(); stmt.safeIntegers(true); +stmt.raw(); +stmt.raw(true); +stmt.raw(false); +let col: Sqlite.ColumnDefinition; +for (col of stmt.columns()) { + col.name; + col.column; + col.type; +} -const trans = db.transaction(['INSERT INTO test(name) VALUES(?);']); -trans.run('name'); -trans.bind('name'); -trans.run(); +const trans: Sqlite.Transaction = db.transaction((param) => stmt.all(param)); +trans('name'); +trans.default('name'); +trans.deferred('name'); +trans.immediate('name'); +trans.exclusive('name'); + +const transTyped = db.transaction((param: number) => stmt.all(param)); +transTyped(1); +trans.default(1); +trans.deferred(1); +trans.immediate(1); +trans.exclusive(1); +// $ExpectError +transTyped('name'); diff --git a/types/better-sqlite3/index.d.ts b/types/better-sqlite3/index.d.ts index 5a4859e21f..32a71d96af 100644 --- a/types/better-sqlite3/index.d.ts +++ b/types/better-sqlite3/index.d.ts @@ -1,58 +1,82 @@ -// Type definitions for better-sqlite3 5.0 +// Type definitions for better-sqlite3 5.2 // Project: http://github.com/JoshuaWise/better-sqlite3 // Definitions by: Ben Davies // Mathew Rumsey // Santiago Aguilar +// Alessandro Vergani +// Andrew Kaiser // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 import Integer = require("integer"); -declare class Statement { - database: Database; - source: string; - returnsData: boolean; - constructor(db: Database, sources: string[]); +type VariableArgFunction = (...params: any[]) => any; +type ArgumentTypes = F extends (...args: infer A) => any + ? A + : never; - run(...params: any[]): Database.RunResult; - get(...params: any[]): any; - all(...params: any[]): any[]; - each(params: any, cb: (row: any) => void): void; - each(cb: (row: any) => void): void; - each(...params: any[]): void; - pluck(toggleState?: boolean): this; - bind(...params: any[]): this; - safeIntegers(toggleState?: boolean): this; -} +declare namespace BetterSqlite3 { + interface Statement { + database: Database; + source: string; + reader: boolean; -declare class Transaction { - database: Database; - source: string; - constructor(db: Database, sources: string[]); + run(...params: any[]): Database.RunResult; + get(...params: any[]): any; + all(...params: any[]): any[]; + iterate(...params: any[]): IterableIterator; + pluck(toggleState?: boolean): this; + expand(toggleState?: boolean): this; + raw(toggleState?: boolean): this; + bind(...params: any[]): this; + columns(): ColumnDefinition[]; + safeIntegers(toggleState?: boolean): this; + } - run(...params: any[]): Database.RunResult; - bind(...params: any[]): this; - safeIntegers(toggleState?: boolean): this; -} + interface ColumnDefinition { + name: string; + column: string | null; + table: string | null; + database: string | null; + type: string | null; + } -interface Database { - memory: boolean; - readonly: boolean; - name: string; - open: boolean; - inTransaction: boolean; + interface Transaction { + (...params: ArgumentTypes): any; + default(...params: ArgumentTypes): any; + deferred(...params: ArgumentTypes): any; + immediate(...params: ArgumentTypes): any; + exclusive(...params: ArgumentTypes): any; + } - prepare(source: string): Statement; - transaction(sources: string[]): Transaction; - exec(source: string): this; - pragma(source: string, simplify?: boolean): any; - checkpoint(databaseName?: string): this; - register(cb: (...params: any[]) => any): this; - register( - options: Database.RegistrationOptions, - cb: (...params: any[]) => any - ): this; - close(): this; - defaultSafeIntegers(toggleState?: boolean): this; + interface Database { + memory: boolean; + readonly: boolean; + name: string; + open: boolean; + inTransaction: boolean; + + prepare(source: string): Statement; + transaction(fn: F): Transaction; + exec(source: string): this; + pragma(source: string, options?: Database.PragmaOptions): any; + checkpoint(databaseName?: string): this; + function(name: string, cb: (...params: any[]) => any): this; + function(name: string, options: Database.RegistrationOptions, cb: (...params: any[]) => any): this; + aggregate(name: string, options: Database.AggregateOptions): this; + loadExtension(path: string): this; + close(): this; + defaultSafeIntegers(toggleState?: boolean): this; + } + + interface DatabaseConstructor { + new(filename: string, options?: Database.Options): Database; + (filename: string, options?: Database.Options): Database; + prototype: Database; + + Integer: typeof Integer; + SqliteError: typeof SqliteError; + } } declare class SqliteError implements Error { @@ -62,15 +86,6 @@ declare class SqliteError implements Error { constructor(message: string, code: string); } -interface DatabaseConstructor { - new (filename: string, options?: Database.Options): Database; - (filename: string, options?: Database.Options): Database; - prototype: Database; - - Integer: typeof Integer; - SqliteError: typeof SqliteError; -} - declare namespace Database { interface RunResult { changes: number; @@ -81,15 +96,33 @@ declare namespace Database { memory?: boolean; readonly?: boolean; fileMustExist?: boolean; + timeout?: number; + } + + interface PragmaOptions { + simple?: boolean; } interface RegistrationOptions { - name?: string; varargs?: boolean; deterministic?: boolean; safeIntegers?: boolean; } + + interface AggregateOptions extends RegistrationOptions { + start?: any; + step: (total: any, next: any) => any; + inverse?: (total: any, dropped: any) => any; + result?: (total: any) => any; + } + + type Integer = typeof Integer; + type SqliteError = typeof SqliteError; + type Statement = BetterSqlite3.Statement; + type ColumnDefinition = BetterSqlite3.ColumnDefinition; + type Transaction = BetterSqlite3.Transaction; + type Database = BetterSqlite3.Database; } -declare const Database: DatabaseConstructor; +declare const Database: BetterSqlite3.DatabaseConstructor; export = Database; diff --git a/types/better-sqlite3/tsconfig.json b/types/better-sqlite3/tsconfig.json index 30a480355b..19cd56ac36 100644 --- a/types/better-sqlite3/tsconfig.json +++ b/types/better-sqlite3/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "module": "commonjs", + "target": "es6", "lib": [ "es6" ], @@ -20,4 +21,4 @@ "index.d.ts", "better-sqlite3-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/bin-version/bin-version-tests.ts b/types/bin-version/bin-version-tests.ts new file mode 100644 index 0000000000..7decda3e66 --- /dev/null +++ b/types/bin-version/bin-version-tests.ts @@ -0,0 +1,6 @@ +import binVersion = require('bin-version'); + +// $ExpectType Promise +binVersion('curl'); +// $ExpectType Promise +binVersion('openssl', { args: ['version'] }); diff --git a/types/bin-version/index.d.ts b/types/bin-version/index.d.ts new file mode 100644 index 0000000000..3db592bec7 --- /dev/null +++ b/types/bin-version/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for bin-version 3.0 +// Project: https://github.com/sindresorhus/bin-version#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = binVersion; + +declare function binVersion(binary: string, options?: binVersion.Options): Promise; + +declare namespace binVersion { + interface Options { + args?: string[]; + } +} diff --git a/types/bin-version/tsconfig.json b/types/bin-version/tsconfig.json new file mode 100644 index 0000000000..e89af3fdb8 --- /dev/null +++ b/types/bin-version/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", + "bin-version-tests.ts" + ] +} diff --git a/types/bin-version/tslint.json b/types/bin-version/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bin-version/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/binaryextensions/binaryextensions-tests.ts b/types/binaryextensions/binaryextensions-tests.ts new file mode 100644 index 0000000000..c07a6b8b8a --- /dev/null +++ b/types/binaryextensions/binaryextensions-tests.ts @@ -0,0 +1,3 @@ +import extensions = require('binaryextensions'); + +extensions; // $ExpectType string[] diff --git a/types/binaryextensions/index.d.ts b/types/binaryextensions/index.d.ts new file mode 100644 index 0000000000..704e577f31 --- /dev/null +++ b/types/binaryextensions/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for binaryextensions 2.1 +// Project: https://github.com/bevry/binaryextensions +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = extensions; + +declare const extensions: string[]; diff --git a/types/binaryextensions/tsconfig.json b/types/binaryextensions/tsconfig.json new file mode 100644 index 0000000000..e666a0507c --- /dev/null +++ b/types/binaryextensions/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", + "binaryextensions-tests.ts" + ] +} diff --git a/types/binaryextensions/tslint.json b/types/binaryextensions/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/binaryextensions/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bip32/index.d.ts b/types/bip32/index.d.ts index 99a1b8dffd..c536f741af 100644 --- a/types/bip32/index.d.ts +++ b/types/bip32/index.d.ts @@ -17,6 +17,7 @@ export class BIP32 { identifier: Buffer; fingerprint: Buffer; + chainCode: Buffer; privateKey: Buffer; publicKey: Buffer; diff --git a/types/blissfuljs/index.d.ts b/types/blissfuljs/index.d.ts index 9174ee4e94..4712e91bad 100644 --- a/types/blissfuljs/index.d.ts +++ b/types/blissfuljs/index.d.ts @@ -285,7 +285,6 @@ declare namespace BlissNS { addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T; addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; - addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): T; addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T; @@ -555,18 +554,15 @@ declare namespace BlissNS { getElementsByTagName(name: "video"): NodeListOf; getElementsByTagName(name: "view"): NodeListOf; getElementsByTagName(name: "wbr"): NodeListOf; - getElementsByTagName(name: "x-ms-webview"): NodeListOf; getElementsByTagName(name: "xmp"): NodeListOf; getElementsByTagName(name: string): NodeListOf; getElementsByTagNameNS(namespaceURI: string, localName: string): NodeListOf; hasAttribute(name: string): boolean; hasAttributeNS(namespaceURI: string, localName: string): boolean; - msGetRegionContent(): MSRangeCollection; msGetUntransformedBounds(): ClientRect; msMatchesSelector(selectors: string): boolean; msReleasePointerCapture(pointerId: number): T; msSetPointerCapture(pointerId: number): T; - msZoomTo(args: MsZoomToOptions): T; releasePointerCapture(pointerId: number): T; removeAttribute(name?: string): T; removeAttributeNS(namespaceURI: string, localName: string): T; diff --git a/types/bluebird/index.d.ts b/types/bluebird/index.d.ts index 091dbe6e7a..24c2b79a32 100644 --- a/types/bluebird/index.d.ts +++ b/types/bluebird/index.d.ts @@ -35,7 +35,8 @@ * THE SOFTWARE. */ -type CatchFilter = (new (...args: any[]) => E) | ((error: E) => boolean) | (object & E); +type Constructor = new (...args: any[]) => E; +type CatchFilter = ((error: E) => boolean) | (object & E); type IterableItem = R extends Iterable ? U : never; type IterableOrNever = Extract>; type Resolvable = R | PromiseLike; @@ -85,69 +86,74 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * Alias `.caught();` for compatibility with earlier ECMAScript version. */ - catch( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, - filter4: CatchFilter, - filter5: CatchFilter, - onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable, - ): Bluebird; catch( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, - filter4: CatchFilter, - filter5: CatchFilter, + filter1: Constructor, + filter2: Constructor, + filter3: Constructor, + filter4: Constructor, + filter5: Constructor, onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable, ): Bluebird; - catch( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, - filter4: CatchFilter, - onReject: (error: E1 | E2 | E3 | E4) => Resolvable, - ): Bluebird; + catch( + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, + filter3: Constructor | CatchFilter, + filter4: Constructor | CatchFilter, + filter5: Constructor | CatchFilter, + onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable, + ): Bluebird; catch( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, - filter4: CatchFilter, + filter1: Constructor, + filter2: Constructor, + filter3: Constructor, + filter4: Constructor, + onReject: (error: E1 | E2 | E3 | E4) => Resolvable, + ): Bluebird; + + catch( + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, + filter3: Constructor | CatchFilter, + filter4: Constructor | CatchFilter, onReject: (error: E1 | E2 | E3 | E4) => Resolvable, ): Bluebird; - catch( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, - onReject: (error: E1 | E2 | E3) => Resolvable, - ): Bluebird; catch( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, + filter1: Constructor, + filter2: Constructor, + filter3: Constructor, + onReject: (error: E1 | E2 | E3) => Resolvable, + ): Bluebird; + + catch( + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, + filter3: Constructor | CatchFilter, onReject: (error: E1 | E2 | E3) => Resolvable, ): Bluebird; - catch( - filter1: CatchFilter, - filter2: CatchFilter, - onReject: (error: E1 | E2) => Resolvable, - ): Bluebird; catch( - filter1: CatchFilter, - filter2: CatchFilter, + filter1: Constructor, + filter2: Constructor, + onReject: (error: E1 | E2) => Resolvable, + ): Bluebird; + + catch( + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, onReject: (error: E1 | E2) => Resolvable, ): Bluebird; - catch( - filter1: CatchFilter, - onReject: (error: E1) => Resolvable, - ): Bluebird; catch( - filter1: CatchFilter, + filter1: Constructor, + onReject: (error: E1) => Resolvable, + ): Bluebird; + + catch( + // tslint:disable-next-line:unified-signatures + filter1: Constructor | CatchFilter, onReject: (error: E1) => Resolvable, ): Bluebird; @@ -201,33 +207,64 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { tapCatch(onReject: (error?: any) => Resolvable): Bluebird; tapCatch( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, - filter4: CatchFilter, - filter5: CatchFilter, + filter1: Constructor, + filter2: Constructor, + filter3: Constructor, + filter4: Constructor, + filter5: Constructor, + onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable, + ): Bluebird; + tapCatch( + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, + filter3: Constructor | CatchFilter, + filter4: Constructor | CatchFilter, + filter5: Constructor | CatchFilter, onReject: (error: E1 | E2 | E3 | E4 | E5) => Resolvable, ): Bluebird; tapCatch( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, - filter4: CatchFilter, + filter1: Constructor, + filter2: Constructor, + filter3: Constructor, + filter4: Constructor, + onReject: (error: E1 | E2 | E3 | E4) => Resolvable, + ): Bluebird; + tapCatch( + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, + filter3: Constructor | CatchFilter, + filter4: Constructor | CatchFilter, onReject: (error: E1 | E2 | E3 | E4) => Resolvable, ): Bluebird; tapCatch( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, + filter1: Constructor, + filter2: Constructor, + filter3: Constructor, + onReject: (error: E1 | E2 | E3) => Resolvable, + ): Bluebird; + tapCatch( + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, + filter3: Constructor | CatchFilter, onReject: (error: E1 | E2 | E3) => Resolvable, ): Bluebird; tapCatch( - filter1: CatchFilter, - filter2: CatchFilter, + filter1: Constructor, + filter2: Constructor, + onReject: (error: E1 | E2) => Resolvable, + ): Bluebird; + tapCatch( + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, onReject: (error: E1 | E2) => Resolvable, ): Bluebird; tapCatch( - filter1: CatchFilter, + filter1: Constructor, + onReject: (error: E1) => Resolvable, + ): Bluebird; + tapCatch( + // tslint:disable-next-line:unified-signatures + filter1: Constructor | CatchFilter, onReject: (error: E1) => Resolvable, ): Bluebird; @@ -376,33 +413,64 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { // No need to be specific about Error types in these overrides, since there's no handler function catchReturn( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, - filter4: CatchFilter, - filter5: CatchFilter, + filter1: Constructor, + filter2: Constructor, + filter3: Constructor, + filter4: Constructor, + filter5: Constructor, value: U, ): Bluebird; catchReturn( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, - filter4: CatchFilter, + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, + filter3: Constructor | CatchFilter, + filter4: Constructor | CatchFilter, + filter5: Constructor | CatchFilter, value: U, ): Bluebird; catchReturn( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, + filter1: Constructor, + filter2: Constructor, + filter3: Constructor, + filter4: Constructor, value: U, ): Bluebird; catchReturn( - filter1: CatchFilter, - filter2: CatchFilter, + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, + filter3: Constructor | CatchFilter, + filter4: Constructor | CatchFilter, value: U, ): Bluebird; catchReturn( - filter1: CatchFilter, + filter1: Constructor, + filter2: Constructor, + filter3: Constructor, + value: U, + ): Bluebird; + catchReturn( + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, + filter3: Constructor | CatchFilter, + value: U, + ): Bluebird; + catchReturn( + filter1: Constructor, + filter2: Constructor, + value: U, + ): Bluebird; + catchReturn( + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, + value: U, + ): Bluebird; + catchReturn( + filter1: Constructor, + value: U, + ): Bluebird; + catchReturn( + // tslint:disable-next-line:unified-signatures + filter1: Constructor | CatchFilter, value: U, ): Bluebird; @@ -420,33 +488,64 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { // No need to be specific about Error types in these overrides, since there's no handler function catchThrow( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, - filter4: CatchFilter, - filter5: CatchFilter, + filter1: Constructor, + filter2: Constructor, + filter3: Constructor, + filter4: Constructor, + filter5: Constructor, reason: Error, ): Bluebird; catchThrow( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, - filter4: CatchFilter, + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, + filter3: Constructor | CatchFilter, + filter4: Constructor | CatchFilter, + filter5: Constructor | CatchFilter, reason: Error, ): Bluebird; catchThrow( - filter1: CatchFilter, - filter2: CatchFilter, - filter3: CatchFilter, + filter1: Constructor, + filter2: Constructor, + filter3: Constructor, + filter4: Constructor, reason: Error, ): Bluebird; catchThrow( - filter1: CatchFilter, - filter2: CatchFilter, + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, + filter3: Constructor | CatchFilter, + filter4: Constructor | CatchFilter, reason: Error, ): Bluebird; catchThrow( - filter1: CatchFilter, + filter1: Constructor, + filter2: Constructor, + filter3: Constructor, + reason: Error, + ): Bluebird; + catchThrow( + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, + filter3: Constructor | CatchFilter, + reason: Error, + ): Bluebird; + catchThrow( + filter1: Constructor, + filter2: Constructor, + reason: Error, + ): Bluebird; + catchThrow( + filter1: Constructor | CatchFilter, + filter2: Constructor | CatchFilter, + reason: Error, + ): Bluebird; + catchThrow( + filter1: Constructor, + reason: Error, + ): Bluebird; + catchThrow( + // tslint:disable-next-line:unified-signatures + filter1: Constructor | CatchFilter, reason: Error, ): Bluebird; diff --git a/types/bn.js/bn.js-tests.ts b/types/bn.js/bn.js-tests.ts index a5d37dfdeb..738d5220d4 100644 --- a/types/bn.js/bn.js-tests.ts +++ b/types/bn.js/bn.js-tests.ts @@ -8,3 +8,11 @@ bn.byteLength; bn.toArrayLike(Buffer, 'le', 2); const test = new BN(1, 'le'); + +const ctx = BN.red('p224'); +ctx.prime.name; + +const red = bn.toRed(ctx); +const newRed = red.redAdd(new BN(1)); +newRed.cmp(bn); +newRed.fromRed(); diff --git a/types/bn.js/index.d.ts b/types/bn.js/index.d.ts index db4c9f8b9e..be04dbcc5f 100644 --- a/types/bn.js/index.d.ts +++ b/types/bn.js/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/indutny/bn.js // Definitions by: Leonid Logvinov // Henry Nguyen +// Gaylor Bosson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -9,36 +10,16 @@ type Endianness = 'le' | 'be'; type IPrimeName = 'k256' | 'p224' | 'p192' | 'p25519'; -declare class RedBN { - redAdd(b: RedBN): RedBN; - redIAdd(b: RedBN): RedBN; - redSub(b: RedBN): RedBN; - redISub(b: RedBN): RedBN; - redShl(num: number): RedBN; - redMul(b: RedBN): RedBN; - redIMul(b: RedBN): RedBN; - redSqr(): RedBN; - redISqr(): RedBN; - /** - * @description square root modulo reduction context's prime - */ - redSqrt(): RedBN; - /** - * @description modular inverse of the number - */ - redInvm(): RedBN; - redNeg(): RedBN; - /** - * @description modular exponentiation - */ - redPow(b: RedBN): RedBN; - fromRed(): BN; +interface MPrime { + name: string; + p: BN; + n: number; + k: BN; } -// FIXME: not sure how to specify the reduction context here interface ReductionContext { m: number; - prime: any; + prime: MPrime; [key: string]: any; } @@ -78,11 +59,6 @@ declare class BN { */ static min(left: BN, right: BN): BN; - /** - * @description Convert number to red - */ - toRed(reductionContext: ReductionContext): RedBN; - /** * @description clone number */ @@ -522,6 +498,87 @@ declare class BN { * @description inverse `a` modulo `b` */ invm(b: BN): BN; + + /** + * @description Convert number to red + */ + toRed(reductionContext: ReductionContext): RedBN; +} + +/** + * Big-Number class with additionnal methods that are using modular + * operation. + */ +declare class RedBN extends BN { + /** + * @description Convert back a number using a reduction context + */ + fromRed(): BN; + + /** + * @description modular addition + */ + redAdd(b: BN): RedBN; + + /** + * @description in-place modular addition + */ + redIAdd(b: BN): RedBN; + + /** + * @description modular subtraction + */ + redSub(b: BN): RedBN; + + /** + * @description in-place modular subtraction + */ + redISub(b: BN): RedBN; + + /** + * @description modular shift left + */ + redShl(num: number): RedBN; + + /** + * @description modular multiplication + */ + redMul(b: BN): RedBN; + + /** + * @description in-place modular multiplication + */ + redIMul(b: BN): RedBN; + + /** + * @description modular square + */ + redSqr(): RedBN; + + /** + * @description in-place modular square + */ + redISqr(): RedBN; + + /** + * @description modular square root + */ + redSqrt(): RedBN; + + /** + * @description modular inverse of the number + */ + redInvm(): RedBN; + + /** + * @description modular negation + */ + redNeg(): RedBN; + + /** + * @description modular exponentiation + */ + redPow(b: BN): RedBN; } export = BN; diff --git a/types/body-scroll-lock/body-scroll-lock-tests.ts b/types/body-scroll-lock/body-scroll-lock-tests.ts new file mode 100644 index 0000000000..4d716e7355 --- /dev/null +++ b/types/body-scroll-lock/body-scroll-lock-tests.ts @@ -0,0 +1,11 @@ +import { enableBodyScroll, disableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock'; + +const dom: HTMLDivElement = new HTMLDivElement(); + +disableBodyScroll(dom, { + reserveScrollBarGap: false, +}); + +enableBodyScroll(dom); + +clearAllBodyScrollLocks(); diff --git a/types/body-scroll-lock/index.d.ts b/types/body-scroll-lock/index.d.ts new file mode 100644 index 0000000000..5af6c3fbdb --- /dev/null +++ b/types/body-scroll-lock/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for body-scroll-lock 2.6 +// Project: https://github.com/willmcpo/body-scroll-lock +// Definitions by: kimcoder +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface BodyScrollOptions { + reserveScrollBarGap?: boolean; + allowTouchMove?: (el: HTMLElement) => void; +} + +export function disableBodyScroll(targetElement: HTMLElement, options?: BodyScrollOptions): void; +export function enableBodyScroll(targetElement: HTMLElement): void; +export function clearAllBodyScrollLocks(): void; + +export as namespace bodyScrollLock; diff --git a/types/body-scroll-lock/tsconfig.json b/types/body-scroll-lock/tsconfig.json new file mode 100644 index 0000000000..d94754517f --- /dev/null +++ b/types/body-scroll-lock/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", + "body-scroll-lock-tests.ts" + ] +} diff --git a/types/body-scroll-lock/tslint.json b/types/body-scroll-lock/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/body-scroll-lock/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bootstrap/bootstrap-tests.ts b/types/bootstrap/bootstrap-tests.ts index 9a80afc654..9344423cfb 100755 --- a/types/bootstrap/bootstrap-tests.ts +++ b/types/bootstrap/bootstrap-tests.ts @@ -34,12 +34,16 @@ $("#carousel").carousel("pause"); $("#carousel").carousel(100); -$("#carousel").on("slide.bs.carousel", function(ev) { +$("#carousel").on("slide.bs.carousel", function(e) { const that: HTMLElement = this; - const from: number = ev.from; - const to: number = ev.to; - const direction: string = ev.direction; - const data: undefined = ev.data; + + const data: undefined = e.data; + const carousel: HTMLElement = e.target; + + const direction: string = e.direction; + const relatedTarget: HTMLElement = e.relatedTarget; + const from: number = e.from; + const to: number = e.to; }); $("#carousel").carousel({ @@ -48,6 +52,7 @@ $("#carousel").carousel({ slide: false, pause: "hover", wrap: true, + touch: false, }); $("#carousel").carousel({ @@ -101,7 +106,11 @@ $("#dropdown").dropdown(); // $ExpectType JQuery $("#dropdown").dropdown("update"); -$("#dropdown").on("hide.bs.dropdown", () => {}); +$("#dropdown").on("hide.bs.dropdown", (e) => { + const data: undefined = e.data; + const container: HTMLElement = e.target; + const togglingAnchorElement: HTMLElement = e.relatedTarget; +}); $("#dropdown").dropdown({ offset: 10, @@ -141,7 +150,13 @@ $("#modal").modal(); // $ExpectType JQuery $("#modal").modal("show"); -$("#modal").on("hide.bs.modal", () => {}); +$("#modal").on("show.bs.modal", (e) => { + const data: undefined = e.data; + const modal: HTMLElement = e.target; + if (e.relatedTarget) { + const clickedElement: HTMLElement = e.relatedTarget; + } +}); $("#modal").modal({ backdrop: false, @@ -226,10 +241,31 @@ $("#scrollspy").scrollspy({ $("#someListItem").tab("show"); $("a[data-toggle=\"list\"]").on("shown.bs.tab", (e) => { - e.target; // newly activated tab - e.relatedTarget; // previous active tab + const data: undefined = e.data; + const newlyActivatedTab: HTMLElement = e.target; + const previousActiveTab: HTMLElement = e.relatedTarget; }); +// -------------------------------------------------------------------------------------- +// Toast +// -------------------------------------------------------------------------------------- + +// $ExpectType JQuery +$("#toast").toast(); + +// $ExpectType JQuery +$("#toast").toast("show"); + +$("#toast").on("shown.bs.toast", () => {}); + +$("#toast").toast({ + animation: false, + autohide: false, + delay: 100, +}); + +$("#toast").toast({}); + // -------------------------------------------------------------------------------------- // Tooltip // -------------------------------------------------------------------------------------- diff --git a/types/bootstrap/index.d.ts b/types/bootstrap/index.d.ts index 9744731237..d42cf5c524 100755 --- a/types/bootstrap/index.d.ts +++ b/types/bootstrap/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Bootstrap 4.1 +// Type definitions for Bootstrap 4.2 // Project: https://github.com/twbs/bootstrap/ // Definitions by: denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -64,9 +64,10 @@ export interface CarouselOption { slide?: "next" | "prev" | false; /** - * If set to "hover", pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave. + * If set to "hover", pauses the cycling of the carousel on `mouseenter` and resumes the cycling of the carousel on `mouseleave`. * If set to false, hovering over the carousel won't pause it. - * On touch-enabled devices, when set to "hover", cycling will pause on touchend (once the user finished interacting with the carousel) + * + * On touch-enabled devices, when set to "hover", cycling will pause on `touchend` (once the user finished interacting with the carousel) * for two intervals, before automatically resuming. Note that this is in addition to the above mouse behavior. * * @default "hover" @@ -79,6 +80,13 @@ export interface CarouselOption { * @default true */ wrap?: boolean; + + /** + * Whether the carousel should support left/right swipe interactions on touchscreen devices. + * + * @default true + */ + touch?: boolean; } export interface CollapseOption { @@ -144,7 +152,7 @@ export interface DropdownOption { export interface ModalOption { /** * Includes a modal-backdrop element. - * Alternatively, specify static for a backdrop which doesn't close the modal on click. + * Alternatively, specify `static` for a backdrop which doesn't close the modal on click. * * @default true */ @@ -174,8 +182,8 @@ export interface ModalOption { export interface PopoverOption extends TooltipOption { /** - * Default content value if data-content attribute isn't present. - * If a function is given, it will be called with its this reference + * Default content value if `data-content` attribute isn't present. + * If a function is given, it will be called with its `this` reference * set to the element that the popover is attached to. * * @default "" @@ -185,7 +193,10 @@ export interface PopoverOption extends TooltipOption { export interface ScrollspyOption { /** - * TODO: https://github.com/twbs/bootstrap/issues/25799 + * Finds which section the spied element is in: + * * `auto` will choose the best method get scroll coordinates. + * * `offset` will use jQuery offset method to get scroll coordinates. + * * `position` will use jQuery position method to get scroll coordinates. * * @default "auto" */ @@ -207,6 +218,29 @@ export interface ScrollspyOption { target?: string | Element; } +export interface ToastOption { + /** + * Apply a CSS fade transition to the toast. + * + * @default true + */ + animation?: boolean; + + /** + * Auto hide the toast. + * + * @default true + */ + autohide?: boolean; + + /** + * Delay hiding the toast in millisecond. + * + * @default 500 + */ + delay?: number; +} + export interface TooltipOption { /** * Apply a CSS fade transition to the tooltip or popover. @@ -246,10 +280,11 @@ export interface TooltipOption { /** * How to position the tooltip or popover - auto | top | bottom | left | right. - * When auto is specified, it will dynamically reorient the tooltip or popover. + * When "auto" is specified, it will dynamically reorient the tooltip or popover. + * * When a function is used to determine the placement, it is called with * the tooltip or popover DOM node as its first argument and the triggering element DOM node as its second. - * The this context is set to the tooltip or popover instance. + * The `this` context is set to the tooltip or popover instance. * * @default tooltip: "top", popover: "right" */ @@ -264,8 +299,9 @@ export interface TooltipOption { selector?: string | false; /** - * Base HTML to use when creating the tooltip or popover. The tooltip's (resp., popover's) title will be injected into - * the `.tooltip-inner` (resp., `.popover-header`). The `.arrow` will become the tooltip's (resp., popover's) arrow. + * Base HTML to use when creating the tooltip or popover. + * The tooltip's (resp., popover's) title will be injected into the `.tooltip-inner` (resp., `.popover-header`). + * The `.arrow` will become the tooltip's (resp., popover's) arrow. * The outermost wrapper element should have the `.tooltip` (resp., .popover) class and `role="tooltip"`. * * @default '' @@ -275,7 +311,7 @@ export interface TooltipOption { /** * Default title value if title attribute isn't present. - * If a function is given, it will be called with its this reference set to the element + * If a function is given, it will be called with its `this` reference set to the element * that the tooltip or popover is attached to. * * @default "" @@ -322,12 +358,22 @@ export interface TooltipOption { // Events // -------------------------------------------------------------------------------------- -export interface CarouselEventHandler extends JQuery.TriggeredEvent { +export interface CarouselEventHandler extends JQuery.TriggeredEvent { + /** + * The carousel dom element. + */ + target: HTMLElement; // overridden only for better JsDoc + /** * The direction in which the carousel is sliding. */ direction: "left" | "right"; + /** + * The DOM element that is being slid into place as the active item. + */ + relatedTarget: HTMLElement; + /** * The index of the current item. */ @@ -339,7 +385,44 @@ export interface CarouselEventHandler extends JQuery.TriggeredEvent extends JQuery.TriggeredEvent { +export interface DropdownsEventHandler extends JQuery.TriggeredEvent { + /** + * The the dropdown's toggle and the dropdown menu container (the `.dropdown` element). + */ + target: HTMLElement; // overridden only for better JsDoc + + /** + * The toggling anchor element. + */ + relatedTarget: HTMLElement; +} + +export interface ModalEventHandler extends JQuery.TriggeredEvent { + /** + * The modal dom element. + */ + target: HTMLElement; // overridden only for better JsDoc + + /** + * For `show.bs.modal` and `shown.bs.modal` is the clicked element, when caused by a _click_. + * Otherwise is undefined. + */ + relatedTarget: HTMLElement | undefined; +} + +export interface TapEventHandler extends JQuery.TriggeredEvent { + /** + * * For `show.bs.tab` and `shown.bs.tab`, is the newly activated tab. + * * For `hide.bs.tab`, is the current active tab. + * * For `hidden.bs.tab`, is the previous active tab. + */ + target: HTMLElement; // overridden only for better JsDoc + + /** + * * For `show.bs.tab` and `shown.bs.tab`, is the previous active tab. + * * For `hide.bs.tab`, is the new soon-to-be-active tab. + * * For `hidden.bs.tab`, is the new active tab. + */ relatedTarget: HTMLElement; } @@ -351,6 +434,7 @@ export type ModalEvent = "show.bs.modal" | "shown.bs.modal" | "hide.bs.modal" | export type PopoverEvent = "show.bs.popover" | "shown.bs.popover" | "hide.bs.popover" | "hidden.bs.popover" | "inserted.bs.popover"; export type ScrollspyEvent = "activate.bs.scrollspy"; export type TapEvent = "show.bs.tab" | "shown.bs.tab" | "hide.bs.tab" | "hidden.bs.tab"; +export type ToastEvent = "show.bs.toast" | "shown.bs.toast" | "hide.bs.toast" | "hidden.bs.toast"; export type TooltipEvent = "show.bs.tooltip" | "shown.bs.tooltip" | "hide.bs.tooltip" | "hidden.bs.tooltip" | "inserted.bs.tooltip"; // -------------------------------------------------------------------------------------- @@ -359,38 +443,177 @@ export type TooltipEvent = "show.bs.tooltip" | "shown.bs.tooltip" | "hide.bs.too declare global { interface JQuery { + /** + * If no _method_ is specified, makes an alert listen for click events on descendant elements which have the `data-dismiss="alert"` attribute. + * (Not necessary when using the data-api's auto-initialization.) + * Otherwise, call the method on the alert element: + * * `close` – Closes an alert by removing it from the DOM. If the `.fade` and `.show` classes are present on the element, the alert will fade out before it is removed. + * * `dispose` – Destroys an element's alert. + */ alert(action?: "close" | "dispose"): this; + /** + * Call a method on the button element: + * * `toggle` – Toggles push state. Gives the button the appearance that it has been activated. + * * `dispose` – Destroys an element's button. + */ button(action: "toggle" | "dispose"): this; + /** + * Call a method on the carousel element: + * * `cycle` – Cycles through the carousel items from left to right. + * * `pause` – Stops the carousel from cycling through items. + * * _number_ – Cycles the carousel to a particular frame (0 based, similar to an array). + * * `prev` – Cycles to the previous item. + * * `next` – Cycles to the next item. + * * `dispose` – Destroys an element's carousel. + * + * Returns to the caller before the target item has been shown (i.e. before the `slid.bs.carousel` event occurs). + */ carousel(action: "cycle" | "pause" | number | "prev" | "next" | "dispose"): this; + /** + * Initializes the carousel and starts cycling through items. + */ carousel(options?: CarouselOption): this; + /** + * Call a method on the collapsible element: + * * `toggle` – Toggles a collapsible element to shown or hidden. + * * `show` – Shows a collapsible element. + * * `hide` – Hides a collapsible element. + * * `dispose` – Destroys an element's collapse. + * + * Returns to the caller before the collapsible element has actually been shown or hidden (i.e. before the `shown.bs.collapse` or `hidden.bs.collapse` event occurs). + */ collapse(action: "toggle" | "show" | "hide" | "dispose"): this; + /** + * Activates a content as a collapsible element. + */ collapse(options?: CollapseOption): this; + /** + * Call a method on the dropdown element: + * * `toggle` – Toggles the dropdown menu of a given navbar or tabbed navigation. + * * `update` – Updates the position of an element's dropdown. + * * `dispose` – Destroys an element's dropdown. + */ dropdown(action: "toggle" | "update" | "dispose"): this; + /** + * Toggle contextual overlays for displaying lists of links. + * + * The data-api, `data-toggle="dropdown"` is always required to be present on the dropdown's trigger element. + */ dropdown(options?: DropdownOption): this; + /** + * Call a method on the modal element: + * * `toggle` – Manually toggles a modal. + * * `show` – Manually opens a modal. + * * `hide` – Manually hides a modal. + * * `handleUpdate` – Manually readjust the modal's position if the height of a modal changes while it is open (i.e. in case a scrollbar appears). + * * `dispose` – Destroys an element's modal. + * + * Returns to the caller before the modal has actually been shown or hidden (i.e. before the `shown.bs.modal` or `hidden.bs.modal` event occurs). + */ modal(action: "toggle" | "show" | "hide" | "handleUpdate" | "dispose"): this; + /** + * Activates a content as a modal. + */ modal(options?: ModalOption): this; + /** + * Call a method on the popover element: + * * `show` – Reveals an element's popover. Popovers whose both title and content are zero-length are never displayed. + * * `hide` – Hides an element's popover. + * * `toggle` – Toggles an element's popover. + * * `dispose` – Hides and destroys an element's popover. + * Popovers that use delegation (which are created using the `selector` option) cannot be individually destroyed on descendant trigger elements. + * * `enable` – Gives an element's popover the ability to be shown. Popovers are enabled by default. + * * `disable` – Removes the ability for an element's popover to be shown. The popover will only be able to be shown if it is re-enabled. + * * `toggleEnabled` – Toggles the ability for an element's popover to be shown or hidden. + * * `update` – Updates the position of an element's popover. + * + * Returns to the caller before the popover has actually been shown or hidden (i.e. before the `shown.bs.popover` or `hidden.bs.popover` event occurs). + * This is considered a "manual" triggering of the popover. + */ popover(action: "show" | "hide" | "toggle" | "dispose" | "enable" | "disable" | "toggleEnabled" | "update"): this; + /** + * Initializes popovers for an element collection. + */ popover(options?: PopoverOption): this; +// tslint:disable:jsdoc-format + /** + * Call a method on the scrollspy element: + * * `refresh` – When using scrollspy in conjunction with adding or removing of elements from the DOM, you'll need to call the refresh, see example. + * * `dispose` – Destroys an element's scrollspy. + * + * @example +```javascript +$('[data-spy="scroll"]').each(function () { + var $spy = $(this).scrollspy('refresh') +}) +``` + */ +// tslint:enable:jsdoc-format scrollspy(action: "refresh" | "dispose"): this; + /** + * Add scrollspy behavior to a topbar navigation. + */ scrollspy(options?: ScrollspyOption): this; + /** + * Call a method on the list item or tab element: + * * `show` – Selects the given list item or tab and shows its associated pane. + * Any other list item or tab that was previously selected becomes unselected and its associated pane is hidden. + * * `dispose` – Destroys an element's tab. + * + * Returns to the caller before the tab pane has actually been shown (i.e. before the `shown.bs.tab` event occurs). + */ tab(action: "show" | "dispose"): this; + /** + * Call a method on the toast element: + * * `show` – Reveals an element's toast. You have to manually call this method, instead your toast won't show. + * * `hide` – Hides an element's toast. You have to manually call this method if you made `autohide` to false. + * * `dispose` – Hides an element's toast. Your toast will remain on the DOM but won't show anymore. + * + * Returns to the caller before the toast has actually been shown or hidden (i.e. before the `shown.bs.toast` or `hidden.bs.toast` event occurs). + */ + toast(action: "show" | "hide" | "dispose"): this; + /** + * Attaches a toast handler to an element collection. + */ + toast(options?: ToastOption): this; + + /** + * Call a method on the tooltip element: + * * `show` – Reveals an element's tooltip. Tooltips with zero-length titles are never displayed. + * * `hide` – Hides an element's tooltip. + * * `toggle` – Toggles an element's tooltip. + * * `dispose` – Hides and destroys an element's tooltip. + * Tooltips that use delegation (which are created using `selector` option) cannot be individually destroyed on descendant trigger elements. + * * `enable` – Gives an element's tooltip the ability to be shown. Tooltips are enabled by default. + * * `disable` – Removes the ability for an element's tooltip to be shown. The tooltip will only be able to be shown if it is re-enabled. + * * `toggleEnabled` – Toggles the ability for an element's tooltip to be shown or hidden. + * * `update` – Updates the position of an element's tooltip. + * + * Returns to the caller before the tooltip has actually been shown or hidden (i.e. before the `shown.bs.tooltip` or `hidden.bs.tooltip` event occurs). + * This is considered a "manual" triggering of the tooltip. + */ tooltip(action: "show" | "hide" | "toggle" | "dispose" | "enable" | "disable" | "toggleEnabled" | "update"): this; + /** + * Attaches a tooltip handler to an element collection. + */ tooltip(options?: TooltipOption): this; on(events: CarouselEvent, handler: JQuery.EventHandlerBase>): this; + on(events: DropdownEvent, handler: JQuery.EventHandlerBase>): this; + on(events: ModalEvent, handler: JQuery.EventHandlerBase>): this; on(events: TapEvent, handler: JQuery.EventHandlerBase>): this; - on(events: - AlertEvent | CollapseEvent | DropdownEvent | ModalEvent | - PopoverEvent | ScrollspyEvent | TooltipEvent, - handler: JQuery.EventHandler): this; + on( + events: AlertEvent | CollapseEvent | PopoverEvent | ScrollspyEvent | ToastEvent | TooltipEvent, + handler: JQuery.EventHandler + ): this; } } diff --git a/types/bootstrap/v3/bootstrap-tests.ts b/types/bootstrap/v3/bootstrap-tests.ts index 00a8fa44fd..7711b5792d 100644 --- a/types/bootstrap/v3/bootstrap-tests.ts +++ b/types/bootstrap/v3/bootstrap-tests.ts @@ -1,3 +1,5 @@ +declare let aHtmlElement: HTMLElement; + // -------------------------------------------------------------------------------------- // Modal // -------------------------------------------------------------------------------------- @@ -29,6 +31,10 @@ $(".dropdown").dropdown(); $(".dropdown").dropdown("toggle"); +$(".dropdown").on("show.bs.dropdown", (e) => { + aHtmlElement = e.relatedTarget; +}); + // -------------------------------------------------------------------------------------- // Scrollspy // -------------------------------------------------------------------------------------- @@ -42,15 +48,32 @@ $(".navbar").scrollspy({ offset: 10, }); +$('.navbar').on("activate.bs.scrollspy", () => { + // do something... +}); + +// -------------------------------------------------------------------------------------- +// Togglable tabs +// -------------------------------------------------------------------------------------- + +$(".tab").tab(); + +$(".tab").tab("show"); + +$(".tab").on("shown.bs.tab", (e) => { + aHtmlElement = e.target; // newly activated tab + aHtmlElement = e.relatedTarget; // previous active tab +}); + // -------------------------------------------------------------------------------------- // Tooltip // -------------------------------------------------------------------------------------- -$("#element").tooltip(); +$(".tooltip").tooltip(); -$("#element").tooltip("show"); +$(".tooltip").tooltip("show"); -$("#element").tooltip({ +$(".tooltip").tooltip({ animation: true, container: false, delay: 0, @@ -63,26 +86,26 @@ $("#element").tooltip({ viewport: { selector: "body", padding: 0 }, }); -$("#element").tooltip({ +$(".tooltip").tooltip({ container: "body", }); -$("#element").tooltip({ +$(".tooltip").tooltip({ delay: { show: 500, hide: 100 }, }); -$("#element").tooltip({ +$(".tooltip").tooltip({ placement() { return "top"; }, }); -$("#element").tooltip({ +$(".tooltip").tooltip({ placement(tooltip: HTMLElement, trigger: Element) { console.log(this.options.delay); return "top"; }, }); -$("#element").tooltip({ +$(".tooltip").tooltip({ placement(tooltip: HTMLElement, trigger: Element) { // $ExpectError console.log(this.options.content); // only for PopoverOption, not TooltipOption @@ -90,23 +113,27 @@ $("#element").tooltip({ }, }); -$("#element").tooltip({ +$(".tooltip").tooltip({ title() { return this.id; }, }); -$("#element").tooltip({ +$(".tooltip").tooltip({ viewport: "body", }); +$(".tooltip").on("hidden.bs.tooltip", () => { + // do something... +}); + // -------------------------------------------------------------------------------------- // Popover // -------------------------------------------------------------------------------------- -$("#element").popover(); +$(".popover").popover(); -$("#element").popover("show"); +$(".popover").popover("show"); -$("#element").popover({ +$(".popover").popover({ animation: true, container: false, content: "content", @@ -120,37 +147,41 @@ $("#element").popover({ viewport: { selector: "body", padding: 0 }, }); -$("#element").popover({ +$(".popover").popover({ container: "body", }); -$("#element").popover({ +$(".popover").popover({ content() { return `Elem id: ${this.id}`; }, }); -$("#element").popover({ +$(".popover").popover({ delay: { show: 500, hide: 100 }, }); -$("#element").popover({ +$(".popover").popover({ placement() { return "top"; }, }); -$("#element").popover({ +$(".popover").popover({ placement(tooltip: HTMLElement, trigger: Element) { console.log(this.options.content); return "top"; }, }); -$("#element").popover({ +$(".popover").popover({ title() { return `Elem id: ${this.id}`; }, }); -$("#element").popover({ +$(".popover").popover({ viewport: "body", }); +$(".popover").on("hidden.bs.popover", () => { + // do something... +}); + // -------------------------------------------------------------------------------------- // Alert // -------------------------------------------------------------------------------------- @@ -159,12 +190,14 @@ $(".alert").alert(); $(".alert").alert("close"); +$(".alert").on("closed.bs.alert", () => { + // do something... +}); + // -------------------------------------------------------------------------------------- // Button // -------------------------------------------------------------------------------------- -$(".btn").button(); - $(".btn").button("toggle"); $(".btn").button("reset"); @@ -184,6 +217,10 @@ $(".collapse").collapse({ toggle: false, }); +$(".collapse").on("hidden.bs.collapse", () => { + // do something... +}); + // -------------------------------------------------------------------------------------- // Carousel // -------------------------------------------------------------------------------------- @@ -209,6 +246,11 @@ $(".carousel").carousel({ pause: null, }); +$('#myCarousel').on('slide.bs.carousel', (e) => { + const dir: "left" | "right" = e.direction; + aHtmlElement = e.relatedTarget; +}); + // -------------------------------------------------------------------------------------- // Affix // -------------------------------------------------------------------------------------- diff --git a/types/bootstrap/v3/index.d.ts b/types/bootstrap/v3/index.d.ts index a6ddbeb1f8..45dee67370 100644 --- a/types/bootstrap/v3/index.d.ts +++ b/types/bootstrap/v3/index.d.ts @@ -43,85 +43,433 @@ interface TooltipInstance { // -------------------------------------------------------------------------------------- interface ModalOptions { + /** + * Includes a modal-backdrop element. + * Alternatively, specify `static` for a backdrop which doesn't close the modal on click. + * + * @default true + */ backdrop?: boolean | "static"; + + /** + * Closes the modal when escape key is pressed. + * + * @default true + */ keyboard?: boolean; + + /** + * Shows the modal when initialized. + * + * @default true + */ show?: boolean; + + /** + * If a remote URL is provided, **content will be loaded one time** via jQuery's `load` method and injected into the `.modal-content` div. + * + * @default false + * @deprecated Use client-side templating or a data binding framework instead, or call `jQuery.load` yourself. + */ remote?: string; } interface ScrollSpyOptions { + /** + * Pixels to offset from top when calculating position of scroll. + * + * @default 10 + */ offset?: number; + + /** + * The ID or class of the parent element of any Bootstrap `.nav` component. + * + * @default "" + */ target?: string; } interface TooltipOptions { + /** + * Apply a CSS fade transition to the tooltip or popover. + * + * @default true + */ animation?: boolean; + + /** + * Appends the tooltip or popover to a specific element. Example: `container: 'body'`. + * This option is particularly useful in that it allows you to position the tooltip or popover + * in the flow of the document near the triggering element - which will prevent + * it from floating away from the triggering element during a window resize. + * + * @default false + */ container?: string | false; + + /** + * Delay showing and hiding the tooltip or popover (ms) - does not apply to manual trigger type. + * If a number is supplied, delay is applied to both hide/show. + * Object structure is: `delay: { "show": 500, "hide": 100 }`. + * + * @default 0 + */ delay?: number | BootstrapDelay; + + /** + * Insert HTML into the tooltip or popover. If false, jQuery's text method will be used to insert content into the DOM. + * Use text if you're worried about XSS attacks. + * + * @default false + */ html?: boolean; + + /** + * How to position the tooltip or popover - top | bottom | left | right | auto. + * When "auto" is specified, it will dynamically reorient the tooltip or popover. + * For example, if placement is "auto left", the tooltip will display to the left when possible, otherwise it will display right. + * + * When a function is used to determine the placement, it is called with + * the tooltip or popover DOM node as its first argument and the triggering element DOM node as its second. + * The `this` context is set to the tooltip or popover instance. + * + * @default tooltip: "top", popover: "right" + */ placement?: BootstrapPlacement | ((this: TooltipInstance, tooltip: HTMLElement, trigger: Element) => BootstrapPlacement); + + /** + * If a selector is provided, tooltip or popover objects will be delegated to the specified targets. + * In practice, this is used to enable dynamic HTML content to have popovers added. + * + * @default false + */ selector?: string; + + /** + * Base HTML to use when creating the tooltip or popover. + * The tooltip's (resp., popover's) title will be injected into the `.tooltip-inner` (resp., `.popover-title`). + * The popover's content will be injected into the `.popover-content`. + * The `.tooltip-arrow` (resp., `.arrow`) will become the tooltip's (resp., popover's) arrow. + * The outermost wrapper element should have the `.tooltip` (resp., `.popover`) class. + * + * @default '' + * @default '' + */ template?: string; + + /** + * Default title value if title attribute isn't present. + * If a function is given, it will be called with its `this` reference set to the element + * that the tooltip or popover is attached to. + * + * @default "" + */ title?: string | ((this: Element) => string); + + /** + * How tooltip or popover is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space. + * "manual" cannot be combined with any other trigger. + * + * @default tooltip: "hover focus", popover: "click" + */ trigger?: BootstrapTrigger; + + /** + * Keeps the tooltip within the bounds of this element. Example: viewport: `#viewport` or `{"selector": "#viewport", "padding": 0}`. + * If a function is given in the object, it is called with the triggering element DOM node as its only argument. + * The `this` context is set to the tooltip instance. + * + * @default {selector: 'body', padding: 0} + */ viewport?: string | BootstrapViewport; } interface PopoverOptions extends TooltipOptions { + /** + * Default content value if `data-content` attribute isn't present. + * If a function is given, it will be called with its `this` reference + * set to the element that the popover is attached to. + * + * @default "" + */ content?: string | ((this: Element) => string); } interface CollapseOptions { + /** + * If a selector is provided, then all collapsible elements under the specified parent will be closed when this collapsible item is shown. + * + * @default false + */ parent?: string | false; + + /** + * Toggles the collapsible element on invocation. + * + * @default true + */ toggle?: boolean; } interface CarouselOptions { + /** + * The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle. + * + * @default 5000 + */ interval?: number | false; + + /** + * If set to "hover", pauses the cycling of the carousel on `mouseenter` and resumes the cycling of the carousel on `mouseleave`. + * If set to null, hovering over the carousel won't pause it. + * + * @default "hover" + */ pause?: "hover" | null; + + /** + * Whether the carousel should cycle continuously or have hard stops. + * + * @default true + */ wrap?: boolean; + + /** + * Whether the carousel should react to keyboard events. + * + * @default true + */ keyboard?: boolean; } interface AffixOptions { + /** + * Pixels to offset from screen when calculating position of scroll. If a single number is provided, the offset will be applied in both top and bottom directions. + * To provide a unique, bottom and top offset just provide an object offset: `{top: 7, bottom: 5}`. + * Use a function in the object when you need to dynamically calculate an offset. + * + * @default 10 + */ offset?: number | BootstrapOffset; + + /** + * Specifies the target element of the affix. + * + * @default window + */ target?: string | Node | JQuery | Window; } +// -------------------------------------------------------------------------------------- +// Events +// -------------------------------------------------------------------------------------- + +interface CarouselEventHandler extends JQuery.TriggeredEvent { + /** + * The direction in which the carousel is sliding. + */ + direction: "left" | "right"; + + /** + * The DOM element that is being slid into place as the active item. + */ + relatedTarget: HTMLElement; +} + +interface DropdownsEventHandler extends JQuery.TriggeredEvent { + /** + * The toggling anchor element. + */ + relatedTarget: HTMLElement; +} + +interface TapEventHandler extends JQuery.TriggeredEvent { + /** + * * For `show.bs.tab` and `shown.bs.tab`, is the new active tab. + * * For `hide.bs.tab`, is the current active tab. + * * For `hidden.bs.tab`, is the previous active tab. + */ + target: HTMLElement; // overridden only for better JsDoc + + /** + * * For `show.bs.tab` and `shown.bs.tab`, is the previous active tab, if available. + * * For `hide.bs.tab`, is the new soon-to-be-active tab. + * * For `hidden.bs.tab`, is the new active tab. + */ + relatedTarget: HTMLElement; +} + +type AffixEvent = "affix.bs.affix" | "affixed.bs.affix" | "affix-top.bs.affix" | "affixed-top.bs.affix" | "affix-bottom.bs.affix" | "affixed-bottom.bs.affix"; +type AlertEvent = "close.bs.alert" | "closed.bs.alert"; +type CarouselEvent = "slide.bs.carousel" | "slid.bs.carousel"; +type CollapseEvent = "show.bs.collapse" | "shown.bs.collapse" | "hide.bs.collapse" | "hidden.bs.collapse"; +type DropdownEvent = "show.bs.dropdown" | "shown.bs.dropdown" | "hide.bs.dropdown" | "hidden.bs.dropdown"; +type PopoverEvent = "show.bs.popover" | "shown.bs.popover" | "hide.bs.popover" | "hidden.bs.popover" | "inserted.bs.popover"; +type ScrollspyEvent = "activate.bs.scrollspy"; +type TapEvent = "show.bs.tab" | "shown.bs.tab" | "hide.bs.tab" | "hidden.bs.tab"; +type TooltipEvent = "show.bs.tooltip" | "shown.bs.tooltip" | "hide.bs.tooltip" | "hidden.bs.tooltip" | "inserted.bs.tooltip"; + // -------------------------------------------------------------------------------------- // jQuery // -------------------------------------------------------------------------------------- interface JQuery { - modal(action?: "toggle" | "show" | "hide" | "handleUpdate"): JQuery; - modal(options: ModalOptions): JQuery; + /** + * Call a method on the modal element: + * * `toggle` – Manually toggles a modal. + * * `show` – Manually opens a modal. + * * `hide` – Manually hides a modal. + * * `handleUpdate` – Readjusts the modal's positioning to counter a scrollbar in case one should appear, which would make the modal jump to the left. + * Only needed when the height of the modal changes while it is open. + * + * Returns to the caller before the modal has actually been shown or hidden (i.e. before the `shown.bs.modal` or `hidden.bs.modal` event occurs). + */ + modal(action: "toggle" | "show" | "hide" | "handleUpdate"): JQuery; + /** + * Activates a content as a modal. + */ + modal(options?: ModalOptions): JQuery; - dropdown(action?: "toggle"): JQuery; + /** + * Toggles the dropdown menu of a given navbar or tabbed navigation. + */ + dropdown(action: "toggle"): JQuery; + /** + * Toggle contextual overlays for displaying lists of links. + * + * The data-api, `data-toggle="dropdown"` is always required to be present on the dropdown's trigger element. + */ + dropdown(): this; - scrollspy(action?: "refresh"): JQuery; - scrollspy(options: ScrollSpyOptions): JQuery; +// tslint:disable:jsdoc-format + /** + * When using scrollspy in conjunction with adding or removing of elements from the DOM, you'll need to call the refresh, see example. + * @example +```javascript +$('[data-spy="scroll"]').each(function () { + var $spy = $(this).scrollspy('refresh') +}) +``` + */ +// tslint:enable:jsdoc-format + scrollspy(action: "refresh"): JQuery; + /** + * Add scrollspy behavior to a topbar navigation. + */ + scrollspy(options?: ScrollSpyOptions): JQuery; + /** + * If no _method_ is specified, activates a tab element and content container. Tab should have either a `data-target` or an `href` targeting a container node in the DOM. + * + * When _method_ `show` is specified, selects the given tab and shows its associated content. + * Any other tab that was previously selected becomes unselected and its associated content is hidden. + * + * Returns to the caller before the tab pane has actually been shown (i.e. before the `shown.bs.tab` event occurs). + */ tab(action?: "show"): JQuery; - tooltip(action?: "show" | "hide" | "toggle" | "destroy"): JQuery; - tooltip(options: TooltipOptions): JQuery; + /** + * Call a method on the tooltip element: + * * `show` – Reveals an element's tooltip. Tooltips with zero-length titles are never displayed. + * * `hide` – Hides an element's tooltip. + * * `toggle` – Toggles an element's tooltip. + * * `destroy` – Hides and destroys an element's tooltip. + * Tooltips that use delegation (which are created using `selector` option) cannot be individually destroyed on descendant trigger elements. + * + * Returns to the caller before the tooltip has actually been shown or hidden (i.e. before the `shown.bs.tooltip` or `hidden.bs.tooltip` event occurs). + * This is considered a "manual" triggering of the tooltip. + */ + tooltip(action: "show" | "hide" | "toggle" | "destroy"): JQuery; + /** + * Attaches a tooltip handler to an element collection. + */ + tooltip(options?: TooltipOptions): JQuery; - popover(action?: "show" | "hide" | "toggle" | "destroy"): JQuery; - popover(options: PopoverOptions): JQuery; + /** + * Call a method on the popover element: + * * `show` – Reveals an element's popover. Popovers whose both title and content are zero-length are never displayed. + * * `hide` – Hides an element's popover. + * * `toggle` – Toggles an element's popover. + * * `destroy` – Hides and destroys an element's popover. + * Popovers that use delegation (which are created using the `selector` option) cannot be individually destroyed on descendant trigger elements. + * + * Returns to the caller before the popover has actually been shown or hidden (i.e. before the `shown.bs.popover` or `hidden.bs.popover` event occurs). + * This is considered a "manual" triggering of the popover. + */ + popover(action: "show" | "hide" | "toggle" | "destroy"): JQuery; + /** + * Initializes popovers for an element collection. + */ + popover(options?: PopoverOptions): JQuery; + /** + * If no _method_ is specified, makes an alert listen for click events on descendant elements which have the `data-dismiss="alert"` attribute. + * (Not necessary when using the data-api's auto-initialization.) + * + * When _method_ `close` is specified, closes an alert by removing it from the DOM. If the `.fade` and `.in` classes are present on the element, + * the alert will fade out before it is removed. + */ alert(action?: "close"): JQuery; - button(action?: "toggle" | "reset" | string): JQuery; + /** + * Call a method on the button element: + * * `toggle` – Toggles push state. Gives the button the appearance that it has been activated. + * * `reset` – Resets button state: swaps text to original text. This method is asynchronous and returns before the resetting has actually completed. + * * _string_ – Swaps text to any data defined text state. + */ + button(action: "toggle" | "reset" | string): JQuery; - collapse(action?: "toggle" | "show" | "hide"): JQuery; - collapse(options: CollapseOptions): JQuery; + /** + * Call a method on the collapsible element: + * * `toggle` – Toggles a collapsible element to shown or hidden. + * * `show` – Shows a collapsible element. + * * `hide` – Hides a collapsible element. + * + * Returns to the caller before the collapsible element has actually been shown or hidden (i.e. before the `shown.bs.collapse` or `hidden.bs.collapse` event occurs). + */ + collapse(action: "toggle" | "show" | "hide"): JQuery; + /** + * Activates a content as a collapsible element. + */ + collapse(options?: CollapseOptions): JQuery; - carousel(action?: "cycle" | "pause" | number | "prev" | "next"): JQuery; - carousel(options: CarouselOptions): JQuery; + /** + * Call a method on the carousel element: + * * `cycle` – Cycles through the carousel items from left to right. + * * `pause` – Stops the carousel from cycling through items. + * * _number_ – Cycles the carousel to a particular frame (0 based, similar to an array). + * * `prev` – Cycles to the previous item. + * * `next` – Cycles to the next item. + * + * Returns to the caller before the target item has been shown (i.e. before the `slid.bs.carousel` event occurs). + */ + carousel(action: "cycle" | "pause" | number | "prev" | "next"): JQuery; + /** + * Initializes the carousel and starts cycling through items. + */ + carousel(options?: CarouselOptions): JQuery; - affix(action?: "checkPosition"): JQuery; - affix(options: AffixOptions): JQuery; + /** + * Recalculates the state of the affix based on the dimensions, position, and scroll position of the relevant elements. + * The `.affix`, `.affix-top`, and `.affix-bottom` classes are added to or removed from the affixed content according to the new state. + * This method needs to be called whenever the dimensions of the affixed content or the target element are changed, to ensure correct positioning of the affixed content. + */ + affix(action: "checkPosition"): JQuery; + /** + * Activates your content as affixed content. + */ + affix(options?: AffixOptions): JQuery; + on(events: CarouselEvent, handler: JQuery.EventHandlerBase>): this; + on(events: DropdownEvent, handler: JQuery.EventHandlerBase>): this; + on(events: TapEvent, handler: JQuery.EventHandlerBase>): this; + on( + events: AffixEvent | AlertEvent | CollapseEvent | PopoverEvent | ScrollspyEvent | TooltipEvent, + handler: JQuery.EventHandler + ): this; + + /** @deprecated */ emulateTransitionEnd(duration: number): JQuery; } diff --git a/types/boxen/boxen-tests.ts b/types/boxen/boxen-tests.ts new file mode 100644 index 0000000000..303e5dd7fa --- /dev/null +++ b/types/boxen/boxen-tests.ts @@ -0,0 +1,37 @@ +import boxen = require('boxen'); + +boxen('unicorn'); // $ExpectType string +boxen('unicorn', { borderColor: 'black' }); // $ExpectType string +boxen('unicorn', { borderStyle: 'double' }); // $ExpectType string +boxen('unicorn', { borderStyle: 'foo' }); // $ExpectError +// $ExpectType string +boxen('unicorn', { + borderStyle: { + topLeft: '+', + topRight: '+', + bottomLeft: '+', + bottomRight: '+', + horizontal: '-', + vertical: '|', + }, +}); +boxen('unicorn', { dimBorder: true }); // $ExpectType string +boxen('unicorn', { padding: 1 }); // $ExpectType string +boxen('unicorn', { padding: { top: 1 } }); // $ExpectType string +boxen('unicorn', { padding: { right: 1 } }); // $ExpectType string +boxen('unicorn', { padding: { bottom: 1 } }); // $ExpectType string +boxen('unicorn', { padding: { left: 1 } }); // $ExpectType string +boxen('unicorn', { margin: 1 }); // $ExpectType string +boxen('unicorn', { margin: { top: 1 } }); // $ExpectType string +boxen('unicorn', { margin: { right: 1 } }); // $ExpectType string +boxen('unicorn', { margin: { bottom: 1 } }); // $ExpectType string +boxen('unicorn', { margin: { left: 1 } }); // $ExpectType string +boxen('unicorn', { float: 'right' }); // $ExpectType string +boxen('unicorn', { float: 'center' }); // $ExpectType string +boxen('unicorn', { float: 'left' }); // $ExpectType string +boxen('unicorn', { float: 'foo' }); // $ExpectError +boxen('unicorn', { backgroundColor: 'white' }); // $ExpectType string +boxen('unicorn', { align: 'left' }); // $ExpectType string +boxen('unicorn', { align: 'center' }); // $ExpectType string +boxen('unicorn', { align: 'right' }); // $ExpectType string +boxen('unicorn', { align: 'foo' }); // $ExpectError diff --git a/types/boxen/index.d.ts b/types/boxen/index.d.ts new file mode 100644 index 0000000000..94b68bb5c7 --- /dev/null +++ b/types/boxen/index.d.ts @@ -0,0 +1,114 @@ +// Type definitions for boxen 2.1 +// Project: https://github.com/sindresorhus/boxen#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import { BoxDefinition, BoxNames } from 'cli-boxes'; + +export = boxen; + +/** + * Create boxes in the terminal + * @param input Text inside the box. + */ +declare function boxen(input: string, options?: boxen.Options): string; + +declare namespace boxen { + interface Options { + /** + * Color of the box border. + * Values: `black` `red` `green` `yellow` `blue` `magenta` `cyan` `white` `gray` or a hex value like `#ff0000` + */ + borderColor?: string; + + /** + * Style of the box border. + * Can be any of the above predefined styles or an object. + * + * Predefined values: + * - `single` + * ``` + * ┌───┐ + * │foo│ + * └───┘ + * ``` + * - `double` + * ``` + * ╔═══╗ + * ║foo║ + * ╚═══╝ + * ``` + * - `round` (`single` sides with round corners) + * ``` + * ╭───╮ + * │foo│ + * ╰───╯ + * ``` + * - `single-double` (`single` on top and bottom, `double` on right and left) + * ``` + * ╓───╖ + * ║foo║ + * ╙───╜ + * ``` + * - `double-single` (`double` on top and bottom, `single` on right and left) + * ``` + * ╒═══╕ + * │foo│ + * ╘═══╛ + * ``` + * - `classic` + * ``` + * +---+ + * |foo| + * +---+ + * ``` + */ + borderStyle?: BoxNames | BoxDefinition; + + /** + * Reduce opacity of the border. + * @default false + */ + dimBorder?: boolean; + + /** + * Space between the text and box border. + * When a number is specified, the left/right padding is 3 times the top/bottom to make it look nice. + * @default 0 + */ + padding?: number | PositionOptions; + + /** + * Space around the box. + * When a number is specified, the left/right margin is 3 times the top/bottom to make it look nice. + * @default 0 + */ + margin?: number | PositionOptions; + + /** + * Float the box on the available terminal screen space. + * @default 'left' + */ + float?: 'right' | 'center' | 'left'; + + /** + * Color of the background. + * Values: `black` `red` `green` `yellow` `blue` `magenta` `cyan` `white` `gray` or a hex value like `#ff0000` + */ + backgroundColor?: string; + + /** + * Align the text in the box based on the widest line. + * @default 'left' + */ + align?: 'left' | 'center' | 'right'; + } + + interface PositionOptions { + top?: number; + right?: number; + bottom?: number; + left?: number; + } +} diff --git a/types/boxen/tsconfig.json b/types/boxen/tsconfig.json new file mode 100644 index 0000000000..6d34147e83 --- /dev/null +++ b/types/boxen/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "boxen-tests.ts" + ] +} diff --git a/types/boxen/tslint.json b/types/boxen/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/boxen/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/browser-bunyan/browser-bunyan-tests.ts b/types/browser-bunyan/browser-bunyan-tests.ts index 6cf1bf926b..9dcb519c27 100644 --- a/types/browser-bunyan/browser-bunyan-tests.ts +++ b/types/browser-bunyan/browser-bunyan-tests.ts @@ -23,3 +23,19 @@ const myObject = { x: 1, y: 2 }; log.info({ obj: myObject }, 'This is my object:'); new bunyan.ConsoleFormattedStream({ logByLevel: true }); + +const style = { + levels: { + trace: 'color: DeepPink', + debug: 'color: GoldenRod', + info: 'color: DarkTurquoise', + warn: 'color: Purple', + error: 'color: Crimson', + fatal: 'color: Black', + }, + def: 'color: DimGray', + msg: 'color: SteelBlue', + src: 'color: DimGray; font-style: italic; font-size: 0.9em', +}; + +new bunyan.ConsoleFormattedStream({ css: style }); diff --git a/types/browser-bunyan/index.d.ts b/types/browser-bunyan/index.d.ts index 4fedbcd780..24d4b3e874 100644 --- a/types/browser-bunyan/index.d.ts +++ b/types/browser-bunyan/index.d.ts @@ -10,17 +10,30 @@ import * as bunyan from 'bunyan'; declare namespace BrowserBunyan { + interface ConsoleFormattedStreamLevelStyle { + trace: string; + debug: string; + info: string; + warn: string; + error: string; + fatal: string; + } + + interface ConsoleFormattedStreamStyle { + levels: Partial; + def: string; + msg: string; + src: string; + } + interface ConsoleFormattedStreamOptions { logByLevel?: boolean; + css?: Partial; } - interface ConsoleFormattedStream { - new(options?: ConsoleFormattedStreamOptions): NodeJS.WritableStream; - } + type ConsoleFormattedStream = new(options?: ConsoleFormattedStreamOptions) => NodeJS.WritableStream; - interface ConsoleRawStream { - new(options?: ConsoleFormattedStreamOptions): NodeJS.WritableStream; - } + type ConsoleRawStream = new(options?: ConsoleFormattedStreamOptions) => NodeJS.WritableStream; } type BrowserBunyan = typeof bunyan & { diff --git a/types/browserslist-useragent/browserslist-useragent-tests.ts b/types/browserslist-useragent/browserslist-useragent-tests.ts new file mode 100644 index 0000000000..83103178e5 --- /dev/null +++ b/types/browserslist-useragent/browserslist-useragent-tests.ts @@ -0,0 +1,30 @@ +import { + matchesUA, + resolveUserAgent, + normalizeQuery +} from 'browserslist-useragent'; + +// $ExpectType boolean +matchesUA( + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36' +); + +// $ExpectType boolean +matchesUA( + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36', + { + browsers: ['defaults'], + env: 'production', + ignorePath: true, + ignoreMinor: false, + allowHigherVersions: false + } +); + +// $ExpectType ResolvedUserAgent +resolveUserAgent( + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36' +); + +// $ExpectType string +normalizeQuery('defaults'); diff --git a/types/browserslist-useragent/index.d.ts b/types/browserslist-useragent/index.d.ts new file mode 100644 index 0000000000..4c7e548a4a --- /dev/null +++ b/types/browserslist-useragent/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for browserslist-useragent 3.0 +// Project: https://github.com/browserslist/browserslist-useragent (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) +// Definitions by: nju33 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface ResolvedUserAgent { + family: string; + version: string; +} + +export interface BrowserslistUseragentOptions { + browsers?: string[]; + env?: string; + ignorePath?: boolean; + ignoreMinor?: boolean; + allowHigherVersions?: boolean; +} + +export function matchesUA( + uaString: string, + opts?: BrowserslistUseragentOptions +): boolean; +export function resolveUserAgent(uaString: string): ResolvedUserAgent; +export function normalizeQuery(query: string): string; diff --git a/types/browserslist-useragent/tsconfig.json b/types/browserslist-useragent/tsconfig.json new file mode 100644 index 0000000000..849531b901 --- /dev/null +++ b/types/browserslist-useragent/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": ["index.d.ts", "browserslist-useragent-tests.ts"] +} diff --git a/types/browserslist-useragent/tslint.json b/types/browserslist-useragent/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/browserslist-useragent/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bs58/bs58-tests.ts b/types/bs58/bs58-tests.ts index 5fe3b73675..f484122683 100644 --- a/types/bs58/bs58-tests.ts +++ b/types/bs58/bs58-tests.ts @@ -1,11 +1,8 @@ +import bs58 = require('bs58'); -import * as bs58 from 'bs58'; +const bytes = Buffer.from('003c176e659bea0f29a3e9bf7880c112b1b31b4dc826268187', 'hex'); +const address = bs58.encode(bytes); +address; // $ExpectType string -{ - let encoded: string; - - encoded = bs58.encode([255]); - encoded = bs58.encode({0: 255, length: 1}); -} - -let decoded: number[] = bs58.decode('5Q'); +bs58.decode(address); // $ExpectType Buffer +bs58.decodeUnsafe(address); // $ExpectType Buffer | undefined diff --git a/types/bs58/index.d.ts b/types/bs58/index.d.ts index 1539910e12..2915e15dfe 100644 --- a/types/bs58/index.d.ts +++ b/types/bs58/index.d.ts @@ -1,14 +1,11 @@ -// Type definitions for bs58 3.0.0 +// Type definitions for bs58 4.0 // Project: https://github.com/cryptocoinjs/bs58 // Definitions by: Ilya Mochalov +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +import { BaseConverter } from 'base-x'; -import * as BaseX from 'base-x'; - -declare namespace base58 { } - -declare let base58: BaseX.BaseConverter; +declare const base58: BaseConverter; export = base58; diff --git a/types/bs58/tsconfig.json b/types/bs58/tsconfig.json index 9e0ed25701..1f9d6fcc87 100644 --- a/types/bs58/tsconfig.json +++ b/types/bs58/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "bs58-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/bs58/tslint.json b/types/bs58/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/bs58/tslint.json +++ b/types/bs58/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/bs58/v3/bs58-tests.ts b/types/bs58/v3/bs58-tests.ts new file mode 100644 index 0000000000..4b2f7891e7 --- /dev/null +++ b/types/bs58/v3/bs58-tests.ts @@ -0,0 +1,10 @@ +import * as bs58 from 'bs58'; + +{ + let encoded: string; + + encoded = bs58.encode([255]); + encoded = bs58.encode({0: 255, length: 1}); +} + +const decoded: number[] = bs58.decode('5Q'); diff --git a/types/bs58/v3/index.d.ts b/types/bs58/v3/index.d.ts new file mode 100644 index 0000000000..c976588bc1 --- /dev/null +++ b/types/bs58/v3/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for bs58 3.0 +// Project: https://github.com/cryptocoinjs/bs58 +// Definitions by: Ilya Mochalov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as BaseX from 'base-x'; + +declare namespace base58 { } + +declare let base58: BaseX.BaseConverter; + +export = base58; diff --git a/types/bs58/v3/tsconfig.json b/types/bs58/v3/tsconfig.json new file mode 100644 index 0000000000..e7f77ce6b4 --- /dev/null +++ b/types/bs58/v3/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "bs58": [ + "bs58/v3" + ], + "base-x": [ + "base-x/v1" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bs58-tests.ts" + ] +} diff --git a/types/bs58/v3/tslint.json b/types/bs58/v3/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/bs58/v3/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/btoa/btoa-tests.ts b/types/btoa/btoa-tests.ts index d09cdad23a..7ce230fcf7 100644 --- a/types/btoa/btoa-tests.ts +++ b/types/btoa/btoa-tests.ts @@ -1,3 +1,3 @@ -import btoa from 'btoa'; +import btoa = require('btoa'); btoa('foo'); diff --git a/types/btoa/index.d.ts b/types/btoa/index.d.ts index cc311ed836..bdb02b5b59 100644 --- a/types/btoa/index.d.ts +++ b/types/btoa/index.d.ts @@ -1,7 +1,10 @@ // Type definitions for btoa 1.2 // Project: https://git.coolaj86.com/coolaj86/btoa.js // Definitions by: John Wright +// Alex Brick // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -export default function(str: string): string; +declare function btoa(str: string): string; + +export = btoa; diff --git a/types/buble/buble-tests.ts b/types/buble/buble-tests.ts new file mode 100644 index 0000000000..cebb373415 --- /dev/null +++ b/types/buble/buble-tests.ts @@ -0,0 +1,77 @@ +import * as buble from 'buble'; + +const input = 'const answer = () => 42;'; + +// Simple transform +(() => { + const output = buble.transform(input); + + console.log(output.code); + console.log(output.map.toString()); + console.log(output.map.toUrl()); +})(); + +// Transform for Chrome & Firefox +(() => { + const output = buble.transform(input, { + target: { + chrome: 71, + firefox: 64, + }, + }); +})(); + +// Transform with sourcemaps support +(() => { + const output = buble.transform(input, { + source: 'input.js', + file: 'output.js', + includeContent: true, + }); +})(); + +// Transform for Preact +(() => { + const output = buble.transform(input, { + jsx: 'h' + }); +})(); + +// Transform with Object assign/spread support +(() => { + let output = buble.transform(input, { + objectAssign: true, + }); + output = buble.transform(input, { + objectAssign: 'MyCustomObjectAssign', + }); +})(); + +// Transform with every transforms +(() => { + const output = buble.transform(input, { + transforms: { + arrow: true, + classes: false, + collections: true, + computedProperty: false, + conciseMethodProperty: true, + constLoop: false, + dangerousForOf: true, + dangerousTaggedTemplateString: false, + defaultParameter: true, + destructuring: false, + forOf: true, + generator: false, + letConst: true, + modules: false, + numericLiteral: true, + parameterDestructuring: false, + reservedProperties: true, + spreadRest: false, + stickyRegExp: true, + templateString: false, + unicodeRegExp: true, + } + }); +})(); diff --git a/types/buble/index.d.ts b/types/buble/index.d.ts new file mode 100644 index 0000000000..db3cb0a7b7 --- /dev/null +++ b/types/buble/index.d.ts @@ -0,0 +1,65 @@ +// Type definitions for buble 0.19 +// Project: https://github.com/Rich-Harris/buble#README +// Definitions by: Hugo Alliaume +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import { SourceMap } from "magic-string"; + +export interface TransformOptions { + // source: https://github.com/Rich-Harris/buble/blob/master/src/support.js + target?: { + chrome?: 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71; + firefox?: 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64; + safari?: 8 | 9 | 10 | 10.1 | 11 | 11.1 | 12; + ie?: 8 | 9 | 10 | 11; + edge?: 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19; + node?: 0.10 | 0.12 | 4 | 5 | 6 | 8 | 8.3 | 8.7 | 8.10; + }; + + // used for sourcemaps + source?: string; // input + file?: string; // output + includeContent?: boolean; + + // custom JSX pragma (https://buble.surge.sh/guide/#jsx) + jsx?: string; // default: 'React.createElement' + + // custom `Object.assign` (https://buble.surge.sh/guide/#object-spread-and-rest) + objectAssign?: string | boolean; + + // transforms + transforms?: { + arrow?: boolean; + classes?: boolean; + collections?: boolean; + computedProperty?: boolean; + conciseMethodProperty?: boolean; + constLoop?: boolean; + dangerousForOf?: boolean; + dangerousTaggedTemplateString?: boolean; + defaultParameter?: boolean; + destructuring?: boolean; + forOf?: boolean; + generator?: boolean; + letConst?: boolean; + modules?: boolean; + numericLiteral?: boolean; + parameterDestructuring?: boolean; + reservedProperties?: boolean; + spreadRest?: boolean; + stickyRegExp?: boolean; + templateString?: boolean; + unicodeRegExp?: boolean; + }; + + // others + namedFunctionExpressions?: boolean; +} + +export interface TransformOutput { + code: string; + map: SourceMap; +} + +export function transform(content: string, options?: TransformOptions): TransformOutput; diff --git a/types/universal-router/package.json b/types/buble/package.json similarity index 60% rename from types/universal-router/package.json rename to types/buble/package.json index 0ab257c45a..d2f8119c0a 100644 --- a/types/universal-router/package.json +++ b/types/buble/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "path-to-regexp": "^2.2.0" + "magic-string": "^0.25.0" } } diff --git a/types/sip.js/tsconfig.json b/types/buble/tsconfig.json similarity index 94% rename from types/sip.js/tsconfig.json rename to types/buble/tsconfig.json index ea3b5a009c..0196ebd845 100644 --- a/types/sip.js/tsconfig.json +++ b/types/buble/tsconfig.json @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "sip.js-tests.ts" + "buble-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/buble/tslint.json b/types/buble/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/buble/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/buffer-crc32/buffer-crc32-tests.ts b/types/buffer-crc32/buffer-crc32-tests.ts new file mode 100644 index 0000000000..979d70215c --- /dev/null +++ b/types/buffer-crc32/buffer-crc32-tests.ts @@ -0,0 +1,11 @@ +import crc32 = require('buffer-crc32'); + +const buf = new Buffer([0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00]); +crc32(buf); // $ExpectType Buffer +crc32('自動販売機'); // $ExpectType Buffer + +crc32.signed(buf); // $ExpectType number +crc32.unsigned(buf); // $ExpectType number + +const partialCrc = crc32('hey'); +crc32(' ', partialCrc); // $ExpectType Buffer diff --git a/types/buffer-crc32/index.d.ts b/types/buffer-crc32/index.d.ts new file mode 100644 index 0000000000..f2857e36a8 --- /dev/null +++ b/types/buffer-crc32/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for buffer-crc32 0.2 +// Project: https://github.com/brianloveswords/buffer-crc32 +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export = crc32; + +declare function crc32(input: string | Buffer, partialCrc?: Buffer): Buffer; + +declare namespace crc32 { + function signed(buffer: Buffer): number; + function unsigned(buffer: Buffer): number; +} diff --git a/types/buffer-crc32/tsconfig.json b/types/buffer-crc32/tsconfig.json new file mode 100644 index 0000000000..cbcb036b91 --- /dev/null +++ b/types/buffer-crc32/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "buffer-crc32-tests.ts" + ] +} diff --git a/types/buffer-crc32/tslint.json b/types/buffer-crc32/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/buffer-crc32/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 2d18e0a800..bbafa0301c 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -36,6 +36,8 @@ declare namespace Bull { max: number; /** Per duration in milliseconds */ duration: number; + /** When jobs get rate limited, they stay in the waiting queue and are not moved to the delayed queue */ + bounceBack?: boolean; } interface QueueOptions { @@ -68,6 +70,11 @@ declare namespace Bull { */ lockDuration?: number; + /** + * Interval in milliseconds on which to acquire the job lock. + */ + lockRenewTime?: number; + /** * How often check for stalled jobs (use 0 for never checking) */ @@ -119,6 +126,35 @@ declare namespace Bull { */ attemptsMade: number; + /** + * When this job was started (unix milliseconds) + */ + processedOn?: number; + + /** + * When this job was completed (unix milliseconds) + */ + finishedOn?: number; + + /** + * Which queue this job was part of + */ + queue: Queue; + + timestamp: number; + + /** + * The named processor name + */ + name: string; + + /** + * The stacktrace for any errors + */ + stacktrace: string[]; + + returnvalue: any; + /** * Report progress on a job */ @@ -330,6 +366,11 @@ declare namespace Bull { } interface Queue { + /** + * The name of the queue + */ + name: string; + /** * Returns a promise that resolves when Redis is connected and the queue is ready to accept jobs. * This replaces the `ready` event emitted on Queue in previous verisons. @@ -544,6 +585,11 @@ declare namespace Bull { */ getJobCounts(): Promise; + /** + * Returns a promise that resolves with the job counts for the given queue of the given types. + */ + getJobCountByTypes(types: string[] | string): Promise; + /** * Returns a promise that resolves with the quantity of completed jobs. */ diff --git a/types/bytebuffer/index.d.ts b/types/bytebuffer/index.d.ts index 285948dc24..eaa1a509d5 100644 --- a/types/bytebuffer/index.d.ts +++ b/types/bytebuffer/index.d.ts @@ -127,7 +127,7 @@ declare class ByteBuffer * Calculates the number of UTF8 characters of a string.JavaScript itself uses UTF- 16, so that a string's length property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF. */ static calculateUTF8Chars( str: string ): number; - + /** * Calculates the number of UTF8 bytes of a string. This is an alias of ByteBuffer#calculateUTF8Bytes. */ @@ -146,7 +146,7 @@ declare class ByteBuffer /** * Concatenates multiple ByteBuffers into one. */ - static concat( buffers: Array, encoding?: string | boolean, litteEndian?: boolean, noAssert?: boolean ): ByteBuffer; + static concat( buffers: Array, encoding?: string | boolean, litteEndian?: boolean, noAssert?: boolean ): ByteBuffer; /** * Decodes a base64 encoded string to a ByteBuffer. @@ -185,7 +185,7 @@ declare class ByteBuffer * @param littleEndian Whether to use little or big endian byte order. Defaults to ByteBuffer.DEFAULT_ENDIAN. * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteBuffer.DEFAULT_NOASSERT. */ - static wrap( buffer: ByteBuffer | ArrayBuffer | Uint8Array | string, enc?: string | boolean, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer; + static wrap( buffer: ByteBuffer | Buffer | ArrayBuffer | Uint8Array | string, enc?: string | boolean, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer; /** * Decodes a zigzag encoded signed 32bit integer. @@ -220,7 +220,7 @@ declare class ByteBuffer /** * Appends some data to this ByteBuffer. This will overwrite any contents behind the specified offset up to the appended data's length. */ - append( source: ByteBuffer | ArrayBuffer | Uint8Array | string, encoding?: string | number, offset?: number ): ByteBuffer; + append( source: ByteBuffer | Buffer | ArrayBuffer | Uint8Array | string, encoding?: string | number, offset?: number ): ByteBuffer; /** * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents behind the specified offset up to the length of this ByteBuffer's data. @@ -291,7 +291,7 @@ declare class ByteBuffer /** * Prepends some data to this ByteBuffer. This will overwrite any contents before the specified offset up to the prepended data's length. If there is not enough space available before the specified offset, the backing buffer will be resized and its contents moved accordingly. */ - prepend( source: ByteBuffer | string | ArrayBuffer, encoding?: string | number, offset?: number ): ByteBuffer; + prepend( source: ByteBuffer | string | ArrayBuffer | Buffer, encoding?: string | number, offset?: number ): ByteBuffer; /** * Prepends this ByteBuffer to another ByteBuffer. This will overwrite any contents before the specified offset up to the prepended data's length. If there is not enough space available before the specified offset, the backing buffer will be resized and its contents moved accordingly. @@ -480,7 +480,7 @@ declare class ByteBuffer /** * Returns a copy of the backing buffer that contains this ByteBuffer's contents. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit. Will transparently ByteBuffer#flip this ByteBuffer if offset > limit but the actual offsets remain untouched. */ - toBuffer( forceCopy?: boolean ): ArrayBuffer; + toBuffer( forceCopy?: boolean ): Buffer; /** *Encodes this ByteBuffer to a hex encoded string with marked offsets. Offset symbols are: @@ -517,7 +517,7 @@ declare class ByteBuffer /** * Writes an array of bytes. This is an alias for append */ - writeBytes( source: ByteBuffer | ArrayBuffer | Uint8Array | string, encoding?: string | number, offset?: number ): ByteBuffer; + writeBytes( source: ByteBuffer | Buffer | ArrayBuffer | Uint8Array | string, encoding?: string | number, offset?: number ): ByteBuffer; /** * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL characters itself. @@ -574,15 +574,20 @@ declare class ByteBuffer */ writeInt8( value: number, offset?: number ): ByteBuffer; + /** + * Write a 64bit signed integer. This is an alias of ByteBuffer#writeInt64. + */ + writeLong( value: number | Long, offset?: number ): ByteBuffer; + /** * Writes a 16bit signed integer. This is an alias of ByteBuffer#writeInt16. */ writeShort( value: number, offset?: number ): ByteBuffer; /** - * Writes an UTF8 encoded string.This is an alias of ByteBuffer#writeUTF8String. + * Writes an UTF8 encoded string. This is an alias of ByteBuffer#writeUTF8String. */ - WriteString( str: string, offset?: number ): ByteBuffer | number; + writeString( str: string, offset?: number ): ByteBuffer | number; /** * Writes an UTF8 encoded string. diff --git a/types/cadesplugin/index.d.ts b/types/cadesplugin/index.d.ts new file mode 100644 index 0000000000..6b93a9514d --- /dev/null +++ b/types/cadesplugin/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for cadesplugin 2.1 +// Project: https://www.npmjs.com/package/cadesplugin +// Definitions by: Delagen , +// kvmi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +declare const cadesplugin: any; diff --git a/types/cadesplugin/package.json b/types/cadesplugin/package.json new file mode 100644 index 0000000000..bb80441dc0 --- /dev/null +++ b/types/cadesplugin/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "types": "index", + "typesVersions": { + ">=3.1.0-0": { "*": ["ts3.1/*"] } + } +} diff --git a/types/cadesplugin/ts3.1/cadescom.d.ts b/types/cadesplugin/ts3.1/cadescom.d.ts new file mode 100644 index 0000000000..a721b54d97 --- /dev/null +++ b/types/cadesplugin/ts3.1/cadescom.d.ts @@ -0,0 +1,97 @@ +declare namespace CAdESCOM { + interface CPSigner { + Certificate: CAPICOM.Certificate; + CheckCertificate: boolean; + + KeyPin: string; + Options: CADES_Common.ValuesOf; + readonly SignatureTimeStampTime: CADES_Common.VarDate; + readonly SigningTime: CADES_Common.VarDate; + TSAAddress: string; + + Display(hwndParent?: number, title?: string): void; + + Load(fileName: string, password?: string): void; + } + + interface CadesSignedData { + readonly Certificates: CAPICOM.Certificates; + Content: string; + ContentEncoding: CADES_Common.ValuesOf; + + DisplayData: CADES_Common.ValuesOf; + + Display(hwndParent?: number, title?: string): void; + + EnhanceCades(cadesType?: CADES_Common.ValuesOf, TSAAddress?: string, encodingType?: CADES_Common.ValuesOf): string; + + SignCades(signer?: CPSigner, CadesType?: CADES_Common.ValuesOf, bDetached?: boolean, EncodingType?: CADES_Common.ValuesOf): string; + + VerifyCades(SignedMessage: string, CadesType?: CADES_Common.ValuesOf, bDetached?: boolean): void; + } + + interface Version { + readonly BuildVersion: number; + readonly MajorVersion: number; + readonly MinorVersion: number; + readonly toStringDefault: string; + + toString(): string; + } + + interface About { + readonly BuildVersion: number; + readonly MajorVersion: number; + readonly MinorVersion: number; + readonly PluginVersion: Version; + readonly Version: string; + + CSPName(ProviderType?: number): string; + + CSPVersion(ProviderName?: string, ProviderType?: number): Version; + + ProviderVersion(ProviderName?: string, ProviderType?: number): string; + + toString(): string; + } + + interface CPSigners { + readonly Count: number; + + Item(index: number): CPSigner; + } + + interface SignedXML { + Content: string; + DigestMethod: string; + SignatureMethod: string; + SignatureType: CADES_Common.ValuesOf; + readonly Signers: CAPICOM.Signers; + + Sign(signer?: CPSigner, XPath?: string): string; + + Verify(SignedMessage: string, XPath?: string): void; + } + + interface CPHashedData { + Algorithm: CADES_Common.ValuesOf; + DataEncoding: CADES_Common.ValuesOf; + Value: string; + + Hash(newVal: string): void; + + SetHashValue(newVal: string): void; + } + + interface CPAttribute { + Name: CADES_Common.ValuesOf; + Value: any; + ValueEncoding: CADES_Common.ValuesOf; + } + + interface RawSignature { + SignHash(hash: CPHashedData, certificate?: string): string; + + VerifyHash(hash: CPHashedData, certificate: CAPICOM.Certificate, signature: string): void; + } +} diff --git a/types/cadesplugin/ts3.1/cadescom_async.d.ts b/types/cadesplugin/ts3.1/cadescom_async.d.ts new file mode 100644 index 0000000000..94e95b2acc --- /dev/null +++ b/types/cadesplugin/ts3.1/cadescom_async.d.ts @@ -0,0 +1,57 @@ +declare namespace CAdESCOM { + interface CPSignerAsync extends CADES_Common.Async { + propset_Certificate(certificate: CAPICOM.CertificateAsync): Promise; + + propset_CheckCertificate(checkCertificate: boolean): Promise; + + propset_KeyPin(keyPin: string): Promise; + + propset_Options(options: CADES_Common.ValuesOf): Promise; + + propset_TSAAddress(TSAAddress: string): Promise; + } + + interface CadesSignedDataAsync extends CADES_Common.Async { + propset_DisplayData(displayData: CADES_Common.ValuesOf): Promise; + + propset_Content(content: string): Promise; + + propset_ContentEncoding(contentEncoding: CADES_Common.ValuesOf): Promise; + } + + interface VersionAsync extends CADES_Common.Async { + } + + interface AboutAsync extends CADES_Common.Async { + } + + interface CPSignersAsync extends CADES_Common.Async { + } + + interface SignedXMLAsync extends CADES_Common.Async { + propset_Content(content: string): Promise; + + propset_DigestMethod(digestMethod: string): Promise; + + propset_SignatureMethod(signatureMethod: string): Promise; + + propset_SignatureType(signatureType: CADES_Common.ValuesOf): Promise; + } + + interface CPHashedDataAsync extends CADES_Common.Async { + propset_Algorithm(algorithm: CADES_Common.ValuesOf): Promise; + + propset_DataEncoding(dataEncoding: CADES_Common.ValuesOf): Promise; + } + + interface CPAttributeAsync extends CADES_Common.Async { + propset_Name(name: CADES_Common.ValuesOf): Promise; + + propset_Value(value: any): Promise; + + propset_ValueEncoding(valueEncoding: CADES_Common.ValuesOf): Promise; + } + + interface RawSignatureAsync extends CADES_Common.Async { + } +} diff --git a/types/cadesplugin/ts3.1/cadescom_enums.d.ts b/types/cadesplugin/ts3.1/cadescom_enums.d.ts new file mode 100644 index 0000000000..918803a47d --- /dev/null +++ b/types/cadesplugin/ts3.1/cadescom_enums.d.ts @@ -0,0 +1,74 @@ +declare namespace CAdESCOM { + interface StoreLocationPlugin { + readonly CADESCOM_LOCAL_MACHINE_STORE: 1; + readonly CADESCOM_CURRENT_USER_STORE: 2; + readonly CADESCOM_CONTAINER_STORE: 100; + } + + interface CADESCOM_STORE_LOCATION extends StoreLocationPlugin { + readonly CADESCOM_MEMORY_STORE: 0; + readonly CADESCOM_ACTIVE_DIRECTORY_USER_STORE: 3; + readonly CADESCOM_SMART_CARD_USER_STORE: 4; + } + + interface CADESCOM_CADES_TYPE { + readonly CADESCOM_CADES_BES: 1; + readonly CADESCOM_CADES_DEFAULT: 0; + readonly CADESCOM_CADES_T: 5; + readonly CADESCOM_CADES_X_LONG_TYPE_1: 93; + } + + interface CADESCOM_CONTENT_ENCODING_TYPE { + readonly CADESCOM_BASE64_TO_BINARY: 1; + readonly CADESCOM_STRING_TO_UCS2LE: 0; + } + + interface CADESCOM_XML_SIGNATURE_TYPE { + readonly CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED: 0; + readonly CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING: 1; + readonly CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE: 2; + } + + interface CADESCOM_ENCRYPTION_ALGORITHM { + readonly CADESCOM_ENCRYPTION_ALGORITHM_RC2: 0; + readonly CADESCOM_ENCRYPTION_ALGORITHM_RC4: 1; + readonly CADESCOM_ENCRYPTION_ALGORITHM_DES: 2; + readonly CADESCOM_ENCRYPTION_ALGORITHM_3DES: 3; + readonly CADESCOM_ENCRYPTION_ALGORITHM_AES: 4; + readonly CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89: 25; + } + + interface CADESCOM_HASH_ALGORITHM { + readonly CADESCOM_HASH_ALGORITHM_SHA1: 0; + readonly CADESCOM_HASH_ALGORITHM_MD2: 1; + readonly CADESCOM_HASH_ALGORITHM_MD4: 2; + readonly CADESCOM_HASH_ALGORITHM_MD5: 3; + readonly CADESCOM_HASH_ALGORITHM_SHA_256: 4; + readonly CADESCOM_HASH_ALGORITHM_SHA_384: 5; + readonly CADESCOM_HASH_ALGORITHM_SHA_512: 6; + readonly CADESCOM_HASH_ALGORITHM_CP_GOST_3411: 100; + readonly CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256: 101; + readonly CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512: 102; + } + + interface CADESCOM_ATTRIBUTE { + readonly CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME: 0; + readonly CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME: 1; + readonly CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION: 2; + readonly CADESCOM_ATTRIBUTE_OTHER: -1; + } + + interface CADESCOM_DISPLAY_DATA { + readonly CADESCOM_DISPLAY_DATA_NONE: 0; + readonly CADESCOM_DISPLAY_DATA_CONTENT: 1; + readonly CADESCOM_DISPLAY_DATA_ATTRIBUTE: 2; + } + + interface CADESCOM_InstallResponseRestrictionFlags { + readonly CADESCOM_AllowNone: 0; + readonly CADESCOM_AllowNoOutstandingRequest: 1; + readonly CADESCOM_AllowUntrustedCertificate: 2; + readonly CADESCOM_AllowUntrustedRoot: 4; + readonly CADESCOM_SkipInstallToStore: 0x10000000; + } +} diff --git a/types/cadesplugin/ts3.1/cadesplugin-tests.ts b/types/cadesplugin/ts3.1/cadesplugin-tests.ts new file mode 100644 index 0000000000..c9784f1671 --- /dev/null +++ b/types/cadesplugin/ts3.1/cadesplugin-tests.ts @@ -0,0 +1,12 @@ +cadesplugin.then(async () => { + if ("CreateObjectAsync" in cadesplugin) { + const pluginAsync: CADESPluginAsync = cadesplugin; + const oAbout = await pluginAsync.CreateObjectAsync("CAdESCOM.About"); + const oVersion = await oAbout.CSPVersion(); + await oVersion.toString(); + } + if ("CreateObject" in cadesplugin) { + const pluginSync: CADESPluginSync = cadesplugin; + pluginSync.CreateObject("CAdESCOM.About").CSPVersion().toString(); + } +}); diff --git a/types/cadesplugin/ts3.1/cadesplugin.d.ts b/types/cadesplugin/ts3.1/cadesplugin.d.ts new file mode 100644 index 0000000000..53bba7e1bd --- /dev/null +++ b/types/cadesplugin/ts3.1/cadesplugin.d.ts @@ -0,0 +1,80 @@ +declare namespace CADES_Plugin { + interface ObjectNames { + "CAPICOM.Store": CAPICOM.Store; + "CAdESCOM.CPSigner": CAdESCOM.CPSigner; + "CAdESCOM.About": CAdESCOM.About; + "CAdESCOM.SignedXML": CAdESCOM.SignedXML; + "CAdESCOM.HashedData": CAdESCOM.CPHashedData; + "CAdESCOM.CadesSignedData": CAdESCOM.CadesSignedData; + "CAdESCOM.CPAttribute": CAdESCOM.CPAttribute; + "CAdESCOM.RawSignature": CAdESCOM.RawSignature; + } + + interface ObjectNamesAsync { + "CAdESCOM.Store": CAPICOM.StoreAsync; + "CAdESCOM.CPSigner": CAdESCOM.CPSignerAsync; + "CAdESCOM.About": CAdESCOM.AboutAsync; + "CAdESCOM.SignedXML": CAdESCOM.SignedXMLAsync; + "CAdESCOM.HashedData": CAdESCOM.CPHashedDataAsync; + "CAdESCOM.CadesSignedData": CAdESCOM.CadesSignedDataAsync; + "CAdESCOM.CPAttribute": CAdESCOM.CPAttributeAsync; + "CAdESCOM.RawSignature": CAdESCOM.RawSignatureAsync; + } + + interface LogLevel { + readonly LOG_LEVEL_DEBUG: 4; + readonly LOG_LEVEL_INFO: 2; + readonly LOG_LEVEL_ERROR: 1; + } + + interface SignedXmlUrls { + readonly XmlDsigGost3410Url: "urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411"; + readonly XmlDsigGost3410UrlObsolete: "http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411"; + readonly XmlDsigGost3411Url: "urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411"; + readonly XmlDsigGost3411UrlObsolete: "http://www.w3.org/2001/04/xmldsig-more#gostr3411"; + } + + interface EncodingType { + readonly CADESCOM_ENCODE_ANY: -1; + readonly CADESCOM_ENCODE_BASE64: 0; + readonly CADESCOM_ENCODE_BINARY: 1; + } +} + +interface CADESPluginBase extends Promise, + CAPICOM.StoreLocationPlugin, CAdESCOM.StoreLocationPlugin, CAPICOM.StoreNamePlugin, + CAPICOM.StoreOpenModePlugin, CAPICOM.CAPICOM_CERTIFICATE_FIND_TYPE, + CADES_Plugin.LogLevel, CAdESCOM.CADESCOM_XML_SIGNATURE_TYPE, + CADES_Plugin.SignedXmlUrls, CAdESCOM.CADESCOM_CADES_TYPE, + CADES_Plugin.EncodingType, CAPICOM.CAPICOM_CERTIFICATE_INCLUDE_OPTION, + CAPICOM.CertIntoTypePlugin, CAPICOM.KeyUsagePlugin, + CAPICOM.PropIDPlugin, CAPICOM.OIDPlugin, CAPICOM.EKUPlugin, + CAPICOM.CAPICOM_ATTRIBUTE, CAdESCOM.CADESCOM_ATTRIBUTE, + CAdESCOM.CADESCOM_CONTENT_ENCODING_TYPE, CAdESCOM.CADESCOM_DISPLAY_DATA, + CAdESCOM.CADESCOM_ENCRYPTION_ALGORITHM, CAdESCOM.CADESCOM_HASH_ALGORITHM, + CAdESCOM.CADESCOM_InstallResponseRestrictionFlags { + readonly JSModuleVersion: string; + readonly current_log_level: number; + + async_spawn(generatorFun: (...args: any[]) => Iterator): T; + + set(obj: CADESPluginBase): void; + + set_log_level(level: CADES_Common.ValuesOf): void; + + getLastError(exception: Error): string; + + is_capilite_enabled(): boolean; +} + +interface CADESPluginAsync extends CADESPluginBase { + CreateObjectAsync(objName: T): Promise; + + ReleasePluginObjects(): Promise; +} + +interface CADESPluginSync extends CADESPluginBase { + CreateObject(objName: T): CADES_Plugin.ObjectNames[T]; +} + +type CADESPlugin = CADESPluginAsync | CADESPluginSync; diff --git a/types/cadesplugin/ts3.1/capicom.d.ts b/types/cadesplugin/ts3.1/capicom.d.ts new file mode 100644 index 0000000000..02bb6f05b5 --- /dev/null +++ b/types/cadesplugin/ts3.1/capicom.d.ts @@ -0,0 +1,83 @@ +declare namespace CAPICOM { + interface EncodedData { + readonly Format: string; + + Value(EncodingType?: CAPICOM_ENCODING_TYPE): string; + } + + interface OID { + FriendlyName: string; + Name: CAPICOM_OID; + Value: string; + } + + interface PublicKey { + readonly Algorithm: OID; + readonly EncodedKey: EncodedData; + readonly EncodedParameters: EncodedData; + readonly Length: number; + } + + interface Certificate { + readonly Version: number; + readonly Thumbprint: string; + readonly SubjectName: string; + readonly SerialNumber: string; + readonly IssuerName: string; + readonly ValidFromDate: CADES_Common.VarDate; + readonly ValidToDate: CADES_Common.VarDate; + + HasPrivateKey(): boolean; + + GetInfo(infoType: CAPICOM_CERT_INFO_TYPE): string; + + IsValid(): CertificateStatus; + + Display(): void; + + PublicKey(): PublicKey; + + Export(EncodingType: CADES_Common.ValuesOf): string; + } + + interface CertificateStatus { + Result: boolean; + } + + interface Certificates { + readonly Count: number; + + Item(index: number): Certificate; + + Find(findType: CADES_Common.ValuesOf, varCriteria?: any, bFindValidOnly?: boolean): Certificates; + + Select(title?: string, displayString?: string, bMultiSelect?: boolean): Certificates; + } + + interface Store { + readonly Certificates: Certificates; + readonly Location: CADES_Common.ValuesOf; + readonly Name: string; + + Open(location?: CADES_Common.ValuesOf, name?: CADES_Common.ValuesOf, openMode?: CADES_Common.ValuesOf): void; + + Close(): void; + + Delete(): boolean; + + Import(encodedStore: string): void; + } + + interface Signers { + readonly Count: number; + + Item(index: number): Signer; + } + + interface Signer { + Certificate: Certificate; + Options: CAPICOM_CERTIFICATE_INCLUDE_OPTION; + + Load(fileName: string, password?: string): void; + } +} diff --git a/types/cadesplugin/ts3.1/capicom_async.d.ts b/types/cadesplugin/ts3.1/capicom_async.d.ts new file mode 100644 index 0000000000..5ab775aba2 --- /dev/null +++ b/types/cadesplugin/ts3.1/capicom_async.d.ts @@ -0,0 +1,19 @@ +declare namespace CAPICOM { + interface CertificateAsync extends CADES_Common.Async { + } + + interface CertificatesAsync extends CADES_Common.Async { + } + + interface StoreAsync extends CADES_Common.Async { + } + + interface EncodedDataAsync extends CADES_Common.Async { + } + + interface OIDAsync extends CADES_Common.Async { + } + + interface PublicKeyAsync extends CADES_Common.Async { + } +} diff --git a/types/cadesplugin/ts3.1/capicom_enums.d.ts b/types/cadesplugin/ts3.1/capicom_enums.d.ts new file mode 100644 index 0000000000..aada08bfe2 --- /dev/null +++ b/types/cadesplugin/ts3.1/capicom_enums.d.ts @@ -0,0 +1,226 @@ +declare namespace CAPICOM { + interface StoreLocationPlugin { + readonly CAPICOM_LOCAL_MACHINE_STORE: 1; + readonly CAPICOM_CURRENT_USER_STORE: 2; + } + + interface CAPICOM_STORE_LOCATION { + readonly CAPICOM_MEMORY_STORE: 0; + readonly CAPICOM_LOCAL_MACHINE_STORE: 1; + readonly CAPICOM_CURRENT_USER_STORE: 2; + readonly CAPICOM_ACTIVE_DIRECTORY_USER_STORE: 3; + readonly CAPICOM_SMART_CARD_USER_STORE: 4; + } + + interface StoreNamePlugin { + readonly CAPICOM_MY_STORE: "My"; + } + + interface CAPICOM_STORE_NAME extends StoreNamePlugin { + readonly CAPICOM_CA_STORE: "Ca"; + readonly CAPICOM_OTHER_STORE: "AddressBook"; + readonly CAPICOM_ROOT_STORE: "Root"; + } + + interface StoreOpenModePlugin { + readonly CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED: 2; + } + + interface CAPICOM_STORE_OPEN_MODE extends StoreOpenModePlugin { + readonly CAPICOM_STORE_OPEN_READ_ONLY: 0; + readonly CAPICOM_STORE_OPEN_READ_WRITE: 1; + readonly CAPICOM_STORE_OPEN_EXISTING_ONLY: 128; + readonly CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED: 256; + } + + interface CAPICOM_CERTIFICATE_FIND_TYPE { + readonly CAPICOM_CERTIFICATE_FIND_SHA1_HASH: 0; + readonly CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME: 1; + readonly CAPICOM_CERTIFICATE_FIND_ISSUER_NAME: 2; + readonly CAPICOM_CERTIFICATE_FIND_ROOT_NAME: 3; + readonly CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME: 4; + readonly CAPICOM_CERTIFICATE_FIND_EXTENSION: 5; + readonly CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY: 6; + readonly CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY: 7; + readonly CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY: 8; + readonly CAPICOM_CERTIFICATE_FIND_TIME_VALID: 9; + readonly CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID: 10; + readonly CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED: 11; + readonly CAPICOM_CERTIFICATE_FIND_KEY_USAGE: 12; + } + + interface CAPICOM_CERTIFICATE_INCLUDE_OPTION { + readonly CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT: 0; + readonly CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY: 2; + readonly CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN: 1; + } + + interface CertIntoTypePlugin { + readonly CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME: 0; + readonly CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME: 1; + } + + interface CAPICOM_CERT_INFO_TYPE extends CertIntoTypePlugin { + readonly CAPICOM_CERT_INFO_SUBJECT_EMAIL_NAME: 2; + readonly CAPICOM_CERT_INFO_ISSUER_EMAIL_NAME: 3; + readonly CAPICOM_CERT_INFO_SUBJECT_UPN: 4; + readonly CAPICOM_CERT_INFO_ISSUER_UPN: 5; + readonly CAPICOM_CERT_INFO_SUBJECT_DNS_NAME: 6; + readonly CAPICOM_CERT_INFO_ISSUER_DNS_NAME: 7; + } + + interface KeyUsagePlugin { + readonly CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE: 128; + } + + interface CAPICOM_KEY_USAGE extends KeyUsagePlugin { + readonly CAPICOM_NON_REPUDIATION_KEY_USAGE: 64; + readonly CAPICOM_KEY_ENCIPHERMENT_KEY_USAGE: 32; + readonly CAPICOM_DATA_ENCIPHERMENT_KEY_USAGE: 16; + readonly CAPICOM_KEY_AGREEMENT_KEY_USAGE: 8; + readonly CAPICOM_KEY_CERT_SIGN_KEY_USAGE: 4; + readonly CAPICOM_OFFLINE_CRL_SIGN_KEY_USAGE: 2; + readonly CAPICOM_CRL_SIGN_KEY_USAGE: 2; + readonly CAPICOM_ENCIPHER_ONLY_KEY_USAGE: 1; + readonly CAPICOM_DECIPHER_ONLY_KEY_USAGE: 32768; + } + + interface PropIDPlugin { + readonly CAPICOM_PROPID_ENHKEY_USAGE: 9; + } + + interface CAPICOM_PROPID extends PropIDPlugin { + readonly CAPICOM_PROPID_UNKNOWN: 0; + readonly CAPICOM_PROPID_KEY_PROV_HANDLE: 1; + readonly CAPICOM_PROPID_KEY_PROV_INFO: 2; + readonly CAPICOM_PROPID_SHA1_HASH: 3; + readonly CAPICOM_PROPID_HASH_PROP: 3; + readonly CAPICOM_PROPID_MD5_HASH: 4; + readonly CAPICOM_PROPID_KEY_CONTEXT: 5; + readonly CAPICOM_PROPID_KEY_SPEC: 6; + readonly CAPICOM_PROPID_IE30_RESERVED: 7; + readonly CAPICOM_PROPID_PUBKEY_HASH_RESERVED: 8; + readonly CAPICOM_PROPID_CTL_USAGE: 9; + readonly CAPICOM_PROPID_NEXT_UPDATE_LOCATION: 10; + readonly CAPICOM_PROPID_FRIENDLY_NAME: 11; + readonly CAPICOM_PROPID_PVK_FILE: 12; + readonly CAPICOM_PROPID_DESCRIPTION: 13; + readonly CAPICOM_PROPID_ACCESS_STATE: 14; + readonly CAPICOM_PROPID_SIGNATURE_HASH: 15; + readonly CAPICOM_PROPID_SMART_CARD_DATA: 16; + readonly CAPICOM_PROPID_EFS: 17; + readonly CAPICOM_PROPID_FORTEZZA_DATA: 18; + readonly CAPICOM_PROPID_ARCHIVED: 19; + readonly CAPICOM_PROPID_KEY_IDENTIFIER: 20; + readonly CAPICOM_PROPID_AUTO_ENROLL: 21; + readonly CAPICOM_PROPID_PUBKEY_ALG_PARA: 22; + readonly CAPICOM_PROPID_CROSS_CERT_DIST_POINTS: 23; + readonly CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH: 24; + readonly CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH: 25; + readonly CAPICOM_PROPID_ENROLLMENT: 26; + readonly CAPICOM_PROPID_DATE_STAMP: 27; + readonly CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH: 28; + readonly CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH: 29; + readonly CAPICOM_PROPID_EXTENDED_ERROR_INFO: 30; + readonly CAPICOM_PROPID_RENEWAL: 64; + readonly CAPICOM_PROPID_ARCHIVED_KEY_HASH: 65; + readonly CAPICOM_PROPID_FIRST_RESERVED: 66; + readonly CAPICOM_PROPID_LAST_RESERVED: 32767; + readonly CAPICOM_PROPID_FIRST_USER: 32768; + readonly CAPICOM_PROPID_LAST_USER: 65535; + } + + interface OIDPlugin { + readonly CAPICOM_OID_OTHER: 0; + readonly CAPICOM_OID_KEY_USAGE_EXTENSION: 10; + } + + interface CAPICOM_OID extends OIDPlugin { + readonly CAPICOM_OID_AUTHORITY_KEY_IDENTIFIER_EXTENSION: 1; + readonly CAPICOM_OID_KEY_ATTRIBUTES_EXTENSION: 2; + readonly CAPICOM_OID_CERT_POLICIES_95_EXTENSION: 3; + readonly CAPICOM_OID_KEY_USAGE_RESTRICTION_EXTENSION: 4; + readonly CAPICOM_OID_LEGACY_POLICY_MAPPINGS_EXTENSION: 5; + readonly CAPICOM_OID_SUBJECT_ALT_NAME_EXTENSION: 6; + readonly CAPICOM_OID_ISSUER_ALT_NAME_EXTENSION: 7; + readonly CAPICOM_OID_BASIC_CONSTRAINTS_EXTENSION: 8; + readonly CAPICOM_OID_SUBJECT_KEY_IDENTIFIER_EXTENSION: 9; + readonly CAPICOM_OID_PRIVATEKEY_USAGE_PERIOD_EXTENSION: 11; + readonly CAPICOM_OID_SUBJECT_ALT_NAME2_EXTENSION: 12; + readonly CAPICOM_OID_ISSUER_ALT_NAME2_EXTENSION: 13; + readonly CAPICOM_OID_BASIC_CONSTRAINTS2_EXTENSION: 14; + readonly CAPICOM_OID_NAME_CONSTRAINTS_EXTENSION: 15; + readonly CAPICOM_OID_CRL_DIST_POINTS_EXTENSION: 16; + readonly CAPICOM_OID_CERT_POLICIES_EXTENSION: 17; + readonly CAPICOM_OID_POLICY_MAPPINGS_EXTENSION: 18; + readonly CAPICOM_OID_AUTHORITY_KEY_IDENTIFIER2_EXTENSION: 19; + readonly CAPICOM_OID_POLICY_CONSTRAINTS_EXTENSION: 20; + readonly CAPICOM_OID_ENHANCED_KEY_USAGE_EXTENSION: 21; + readonly CAPICOM_OID_CERTIFICATE_TEMPLATE_EXTENSION: 22; + readonly CAPICOM_OID_APPLICATION_CERT_POLICIES_EXTENSION: 23; + readonly CAPICOM_OID_APPLICATION_POLICY_MAPPINGS_EXTENSION: 24; + readonly CAPICOM_OID_APPLICATION_POLICY_CONSTRAINTS_EXTENSION: 25; + readonly CAPICOM_OID_AUTHORITY_INFO_ACCESS_EXTENSION: 26; + readonly CAPICOM_OID_SERVER_AUTH_EKU: 100; + readonly CAPICOM_OID_CLIENT_AUTH_EKU: 101; + readonly CAPICOM_OID_CODE_SIGNING_EKU: 102; + readonly CAPICOM_OID_EMAIL_PROTECTION_EKU: 103; + readonly CAPICOM_OID_IPSEC_END_SYSTEM_EKU: 104; + readonly CAPICOM_OID_IPSEC_TUNNEL_EKU: 105; + readonly CAPICOM_OID_IPSEC_USER_EKU: 106; + readonly CAPICOM_OID_TIME_STAMPING_EKU: 107; + readonly CAPICOM_OID_CTL_USAGE_SIGNING_EKU: 108; + readonly CAPICOM_OID_TIME_STAMP_SIGNING_EKU: 109; + readonly CAPICOM_OID_SERVER_GATED_CRYPTO_EKU: 110; + readonly CAPICOM_OID_ENCRYPTING_FILE_SYSTEM_EKU: 111; + readonly CAPICOM_OID_EFS_RECOVERY_EKU: 112; + readonly CAPICOM_OID_WHQL_CRYPTO_EKU: 113; + readonly CAPICOM_OID_NT5_CRYPTO_EKU: 114; + readonly CAPICOM_OID_OEM_WHQL_CRYPTO_EKU: 115; + readonly CAPICOM_OID_EMBEDED_NT_CRYPTO_EKU: 116; + readonly CAPICOM_OID_ROOT_LIST_SIGNER_EKU: 117; + readonly CAPICOM_OID_QUALIFIED_SUBORDINATION_EKU: 118; + readonly CAPICOM_OID_KEY_RECOVERY_EKU: 119; + readonly CAPICOM_OID_DIGITAL_RIGHTS_EKU: 120; + readonly CAPICOM_OID_LICENSES_EKU: 121; + readonly CAPICOM_OID_LICENSE_SERVER_EKU: 122; + readonly CAPICOM_OID_SMART_CARD_LOGON_EKU: 123; + readonly CAPICOM_OID_PKIX_POLICY_QUALIFIER_CPS: 124; + readonly CAPICOM_OID_PKIX_POLICY_QUALIFIER_USERNOTICE: 125; + } + + interface EKUPlugin { + readonly CAPICOM_EKU_OTHER: 0; + readonly CAPICOM_EKU_CLIENT_AUTH: 2; + readonly CAPICOM_EKU_SMARTCARD_LOGON: 5; + } + + interface CAPICOM_EKU { + readonly CAPICOM_EKU_SERVER_AUTH: 1; + readonly CAPICOM_EKU_CODE_SIGNING: 3; + readonly CAPICOM_EKU_EMAIL_PROTECTION: 4; + readonly CAPICOM_EKU_ENCRYPTING_FILE_SYSTEM: 6; + } + + interface CAPICOM_ATTRIBUTE { + readonly CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME: 0; + readonly CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME: 1; + readonly CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION: 2; + } + + interface CAPICOM_HASH_ALGORITHM { + readonly CAPICOM_HASH_ALGORITHM_SHA1: 0; + readonly CAPICOM_HASH_ALGORITHM_MD2: 1; + readonly CAPICOM_HASH_ALGORITHM_MD4: 2; + readonly CAPICOM_HASH_ALGORITHM_MD5: 3; + readonly CAPICOM_HASH_ALGORITHM_SHA_256: 4; + readonly CAPICOM_HASH_ALGORITHM_SHA_384: 5; + readonly CAPICOM_HASH_ALGORITHM_SHA_512: 6; + } + + interface CAPICOM_ENCODING_TYPE { + readonly CAPICOM_ENCODE_ANY: -1; + readonly CAPICOM_ENCODE_BASE64: 0; + readonly CAPICOM_ENCODE_BINARY: 1; + } +} diff --git a/types/cadesplugin/ts3.1/common.d.ts b/types/cadesplugin/ts3.1/common.d.ts new file mode 100644 index 0000000000..315b0490a3 --- /dev/null +++ b/types/cadesplugin/ts3.1/common.d.ts @@ -0,0 +1,25 @@ +declare namespace CADES_Common { + type ValuesOf = T[keyof T]; + type VarDate = object; + + // Extracts the type if wrapped by a Promise + type Unpacked = T extends Promise ? U : + T extends CAPICOM.Certificate ? CAPICOM.CertificateAsync : + T extends CAPICOM.Certificates ? CAPICOM.CertificatesAsync : + T extends CAdESCOM.CPSigner ? CAdESCOM.CPSignerAsync : + T extends CAdESCOM.CPHashedData ? CAdESCOM.CPHashedDataAsync : + T extends CAdESCOM.Version ? CAdESCOM.VersionAsync : + T extends CAPICOM.OID ? CAPICOM.OIDAsync : + T extends CAPICOM.EncodedData ? CAPICOM.EncodedDataAsync : + T extends CAPICOM.PublicKey ? CAPICOM.PublicKeyAsync : + T; + + type PromisifiedFunction = // tslint:disable-line ban-types + T extends (...args: infer A) => infer U ? (...args: { [K in keyof A]: Unpacked }) => Promise> : + T; + + type Async = { + readonly [K in keyof T]: T[K] extends Function ? PromisifiedFunction : // tslint:disable-line ban-types + Promise>; + }; +} diff --git a/types/cadesplugin/ts3.1/index.d.ts b/types/cadesplugin/ts3.1/index.d.ts new file mode 100644 index 0000000000..13fdba4187 --- /dev/null +++ b/types/cadesplugin/ts3.1/index.d.ts @@ -0,0 +1,13 @@ +/// + +/// +/// +/// + +/// +/// +/// + +/// + +declare const cadesplugin: CADESPlugin; diff --git a/types/cadesplugin/ts3.1/tsconfig.json b/types/cadesplugin/ts3.1/tsconfig.json new file mode 100644 index 0000000000..dbc37d117b --- /dev/null +++ b/types/cadesplugin/ts3.1/tsconfig.json @@ -0,0 +1,25 @@ +{ + "extends": "../tsconfig", + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cadesplugin-tests.ts" + ] +} diff --git a/types/cadesplugin/ts3.1/tslint.json b/types/cadesplugin/ts3.1/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/cadesplugin/ts3.1/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/cadesplugin/tsconfig.json b/types/cadesplugin/tsconfig.json new file mode 100644 index 0000000000..71e6b79545 --- /dev/null +++ b/types/cadesplugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} diff --git a/types/cadesplugin/tslint.json b/types/cadesplugin/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/cadesplugin/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/cassandra-driver/cassandra-driver-tests.ts b/types/cassandra-driver/cassandra-driver-tests.ts index 891c5a0167..ad8a7426fe 100644 --- a/types/cassandra-driver/cassandra-driver-tests.ts +++ b/types/cassandra-driver/cassandra-driver-tests.ts @@ -7,11 +7,15 @@ const client = new cassandra.Client({ keyspace: 'ks1', sslOptions: { cert: fs.readFileSync('certFilePath') + }, + encoding: { + map: Map, + set: Set } }); const query = 'SELECT email, last_name FROM user_profiles WHERE key=?'; -client.execute(query, ['guy'], function(err, result) { +client.execute(query, ['guy'], (err, result) => { console.log('got user profile with email ' + result.rows[0].email); }); diff --git a/types/cassandra-driver/index.d.ts b/types/cassandra-driver/index.d.ts index f57f203a03..df95e386b6 100644 --- a/types/cassandra-driver/index.d.ts +++ b/types/cassandra-driver/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for cassandra-driver v3.5.0 +// Type definitions for cassandra-driver 3.6 // Project: https://github.com/datastax/nodejs-driver // Definitions by: Marc Fisher // Christian D @@ -6,7 +6,6 @@ // TypeScript Version: 2.2 /// -/// export type Callback = Function; export type ResultCallback = (err: Error, result: types.ResultSet) => void; @@ -50,8 +49,8 @@ export namespace policies { } interface DCAwareRoundRobinPolicy extends LoadBalancingPolicy { - localHostsArray: Array; - remoteHostsArray: Array; + localHostsArray: Host[]; + remoteHostsArray: Host[]; } interface RoundRobinPolicyStatic { @@ -67,7 +66,7 @@ export namespace policies { interface TokenAwarePolicy extends LoadBalancingPolicy { } interface WhiteListPolicyStatic { - new (childPolicy: LoadBalancingPolicy, whiteList: Array): WhiteListPolicy; + new (childPolicy: LoadBalancingPolicy, whiteList: string[]): WhiteListPolicy; } interface WhiteListPolicy extends LoadBalancingPolicy { } @@ -78,7 +77,9 @@ export namespace policies { let ExponentialReconnectionPolicy: ExponentialReconnectionPolicyStatic; interface ReconnectionPolicy { - newSchedule(): { next: Function }; + newSchedule(): { + next(): { delay: number; done: boolean; } + }; } interface ConstantReconnectionPolicyStatic { @@ -103,8 +104,8 @@ export namespace policies { } interface RequestInfo { - request: any, - nbRetry: number + request: any; + nbRetry: number; } enum retryDecision { @@ -133,41 +134,41 @@ export namespace policies { } namespace speculativeExecution { - let NoSpeculativeExecutionPolicy: NoSpeculativeExecutionPolicyStatic + let NoSpeculativeExecutionPolicy: NoSpeculativeExecutionPolicyStatic; interface SpeculativeExecutionPolicy { init(client: Client): void; - newPlan(keyspace: string, queryInfo: string | Array): { - nextExecution: Function - } + newPlan(keyspace: string, queryInfo: string | string[]): { + nextExecution: () => number; + }; } interface NoSpeculativeExecutionPolicyStatic { - new (): NoSpeculativeExecutionPolicy + new (): NoSpeculativeExecutionPolicy; } interface NoSpeculativeExecutionPolicy extends SpeculativeExecutionPolicy { } - + interface ConstantSpeculativeExecutionPolicyStatic { - new (delay: number, maxSpeculativeExecutions: number): ConstantSpeculativeExecutionPolicy + new (delay: number, maxSpeculativeExecutions: number): ConstantSpeculativeExecutionPolicy; } interface ConstantSpeculativeExecutionPolicy extends SpeculativeExecutionPolicy { } } namespace timestampGeneration { - let MonotonicTimestampGenerator: MonotonicTimestampGeneratorStatic + let MonotonicTimestampGenerator: MonotonicTimestampGeneratorStatic; interface TimestampGenerator { - next(client: Client): null | number | _Long + next(client: Client): null | number | _Long; } interface MonotonicTimestampGeneratorStatic { - new (warningThreshold?: number, minLogInterval?: number): MonotonicTimestampGeneratorStatic + new (warningThreshold?: number, minLogInterval?: number): MonotonicTimestampGeneratorStatic; } interface MonotonicTimestampGenerator extends TimestampGenerator { - getDate(): number + getDate(): number; } } } @@ -297,11 +298,11 @@ export namespace types { } interface IntegerStatic { - new (bits: Array, sign: number): Integer; + new (bits: number[], sign: number): Integer; fromInt(value: number): Integer; fromNumber(value: number): Integer; - fromBits(bits: Array): Integer; + fromBits(bits: number[]): Integer; fromString(str: string, opt_radix?: number): Integer; fromBuffer(bits: Buffer): Integer; toBuffer(value: Integer): Buffer; @@ -404,14 +405,14 @@ export namespace types { speculativeExecutions: number, achievedConsistency: consistencies, traceId: Uuid, - warnings: Array, + warnings: string[], customPayload: any }; - rows: Array; + rows: Row[]; rowLength: number; columns: Array<{ [key: string]: string; }>; pageState: string; - nextPage: Function; + nextPage: () => void; first(): Row | null; getPageState(): string; @@ -428,7 +429,7 @@ export namespace types { buffer: Buffer; paused: boolean; - _valve(readNext: Function): void; + _valve(readNext: () => void): void; add(chunk: Buffer): void; } @@ -439,7 +440,7 @@ export namespace types { interface Row { get(columnName: string | number): { [key: string]: any; }; values(): Array<{ [key: string]: any; }>; - keys(): Array; + keys(): string[]; forEach(callback: Callback): void; [key: string]: any; } @@ -462,19 +463,19 @@ export namespace types { } interface TupleStatic { - new (...args: Array): Tuple; + new (...args: any[]): Tuple; - fromArray(elements: Array): Tuple; + fromArray(elements: any[]): Tuple; } interface Tuple { - elements: Array; + elements: any[]; length: number; get(index: number): any; toString(): string; toJSON(): string; - values(): Array; + values(): any[]; } interface UuidStatic { @@ -488,6 +489,7 @@ export namespace types { buffer: Buffer; getBuffer(): Buffer; + // tslint:disable-next-line:no-unnecessary-qualifier equals(other: types.Uuid): boolean; toString(): string; inspect(): string; @@ -501,53 +503,53 @@ export let HostMap: HostMapStatic; export let Encoder: EncoderStatic; export interface ClientOptions { - contactPoints: Array, - keyspace?: string, - refreshSchemaDelay?: number, - isMetadataSyncEnabled?: boolean, - prepareOnAllHosts?: boolean, - rePrepareOnUp?: boolean, - maxPrepared?: number, + contactPoints: string[]; + keyspace?: string; + refreshSchemaDelay?: number; + isMetadataSyncEnabled?: boolean; + prepareOnAllHosts?: boolean; + rePrepareOnUp?: boolean; + maxPrepared?: number; policies?: { - loadBalancing?: policies.loadBalancing.LoadBalancingPolicy, - retry?: policies.retry.RetryPolicy, - reconnection?: policies.reconnection.ReconnectionPolicy, - addressResolution?: policies.addressResolution.AddressTranslator, - speculativeExecution?: policies.speculativeExecution.SpeculativeExecutionPolicy, - timestampGeneration?: policies.timestampGeneration.TimestampGenerator, - }, - queryOptions?: QueryOptions, + loadBalancing?: policies.loadBalancing.LoadBalancingPolicy; + retry?: policies.retry.RetryPolicy; + reconnection?: policies.reconnection.ReconnectionPolicy; + addressResolution?: policies.addressResolution.AddressTranslator; + speculativeExecution?: policies.speculativeExecution.SpeculativeExecutionPolicy; + timestampGeneration?: policies.timestampGeneration.TimestampGenerator; + }; + queryOptions?: QueryOptions; pooling?: { - heartBeatInterval?: number, - coreConnectionsPerHost?: { [key: number]: number; }, - maxRequestsPerConnection?: number, + heartBeatInterval?: number; + coreConnectionsPerHost?: { [key: number]: number; }; + maxRequestsPerConnection?: number; warmup?: boolean; - }, + }; protocolOptions?: { - port?: number, - maxSchemaAgreementWaitSeconds?: number, - maxVersion?: number, - noCompact?: boolean - }, + port?: number; + maxSchemaAgreementWaitSeconds?: number; + maxVersion?: number; + noCompact?: boolean; + }; socketOptions?: { - connectTimeout?: number, - defunctReadTimeoutThreshold?: number, - keepAlive?: boolean, - keepAliveDelay?: number, - readTimeout?: number, - tcpNoDelay?: boolean, - coalescingThreshold?: number - }, - authProvider?: auth.AuthProvider, - sslOptions?: tls.ConnectionOptions, + connectTimeout?: number; + defunctReadTimeoutThreshold?: number; + keepAlive?: boolean; + keepAliveDelay?: number; + readTimeout?: number; + tcpNoDelay?: boolean; + coalescingThreshold?: number; + }; + authProvider?: auth.AuthProvider; + sslOptions?: tls.ConnectionOptions; encoding?: { - map?: Function, - set?: Function, - copyBuffer?: boolean, - useUndefinedAsUnset?: boolean - }, - profiles?: Array, - promiseFactory?: Function, + map?: typeof Map | ((...args: any[]) => any); + set?: typeof Set | ((...args: any[]) => any); + copyBuffer?: boolean; + useUndefinedAsUnset?: boolean; + }; + profiles?: ExecutionProfile[]; + promiseFactory?: (handler: (callback: (err?: any, result?: any) => void) => void) => Promise; } export interface QueryOptions { @@ -557,7 +559,7 @@ export interface QueryOptions { customPayload?: any; executionProfile?: string | ExecutionProfile; fetchSize?: number; - hints?: Array | Array>; + hints?: string[] | string[][]; isIdempotent?: boolean; keyspace?: string; logged?: boolean; @@ -566,12 +568,13 @@ export interface QueryOptions { readTimeout?: number; retry?: policies.retry.RetryPolicy; retryOnTimeout?: boolean; - routingIndexes?: Array; - routingKey?: Buffer | Array; - routingNames?: Array; + routingIndexes?: number[]; + routingKey?: Buffer | Buffer[]; + routingNames?: string[]; serialConsistency?: number; timestamp?: number | _Long; traceQuery?: boolean; + host?: Host; } export interface ClientStatic { @@ -583,9 +586,9 @@ export interface Client extends events.EventEmitter { keyspace: string; metadata: metadata.Metadata; - batch(queries: Array | Array<{ query: string, params?: any }>, options: QueryOptions, callback: ResultCallback): void; - batch(queries: Array | Array<{ query: string, params?: any }>, callback: ResultCallback): void; - batch(queries: Array | Array<{ query: string, params?: any }>, options?: QueryOptions): Promise; + batch(queries: string[] | Array<{ query: string, params?: any }>, options: QueryOptions, callback: ResultCallback): void; + batch(queries: string[] | Array<{ query: string, params?: any }>, callback: ResultCallback): void; + batch(queries: string[] | Array<{ query: string, params?: any }>, options?: QueryOptions): Promise; connect(callback: Callback): void; connect(): Promise; @@ -594,7 +597,7 @@ export interface Client extends events.EventEmitter { execute(query: string, params: any, callback: ResultCallback): void; execute(query: string, callback: ResultCallback): void; execute(query: string, params?: any, options?: QueryOptions): Promise; - getReplicas(keyspace: string, token: Buffer): Array; // TODO: Should this be a more explicit return? + getReplicas(keyspace: string, token: Buffer): any[]; // TODO: Should this be a more explicit return? getState(): metadata.ClientState; shutdown(callback?: Callback): void; shutdown(): Promise; @@ -610,10 +613,10 @@ export interface Host extends events.EventEmitter { cassandraVersion: string; dataCenter: string; rack: string; - tokens: Array; + tokens: string[]; canBeConsideredAsUp(): boolean; - getCassandraVersion(): Array; + getCassandraVersion(): number[]; isUp(): boolean; } @@ -624,14 +627,14 @@ export interface HostMapStatic { export interface HostMap extends events.EventEmitter { length: number; - clear(): Array; + clear(): Host[]; forEach(callback: Callback): void; get(key: string): Host; - keys(): Array; + keys(): string[]; remove(key: string): void; - removeMultiple(keys: Array): void; + removeMultiple(keys: string[]): void; set(key: string, value: Host): void; - values(): Array; + values(): Host[]; } export interface EncoderStatic { @@ -643,21 +646,20 @@ export interface Encoder { encode(value: any, typeInfo?: string | number | { code: number, info?: any }): Buffer; } -interface ExecutionProfileOptions { - consistency: number, - loadBalancing: policies.loadBalancing.LoadBalancingPolicy, - name: string, - readTimeout: number, - retry: policies.retry.RetryPolicy, - serialConsistency: number +export interface ExecutionProfileOptions { + consistency: number; + loadBalancing: policies.loadBalancing.LoadBalancingPolicy; + name: string; + readTimeout: number; + retry: policies.retry.RetryPolicy; + serialConsistency: number; } export interface ExecutionProfileStatic { - new (name: string, options: ExecutionProfileOptions): ExecutionProfile + new (name: string, options: ExecutionProfileOptions): ExecutionProfile; } -export interface ExecutionProfile extends ExecutionProfileOptions { -} +export interface ExecutionProfile extends ExecutionProfileOptions {} export namespace auth { let Authenticator: AuthenticatorStatic; @@ -687,8 +689,10 @@ export namespace auth { } export namespace errors { - abstract class DriverError { + abstract class DriverError extends Error { constructor(message: string, constructor?: any); + + info: string; } class ArgumentError extends DriverError { @@ -705,16 +709,28 @@ export namespace errors { class NoHostAvailableError extends DriverError { constructor(innerErrors: any, message?: string); + + innerErrors: any; } class NotSupportedError extends DriverError { constructor(message: string); } - class OperationTimedOutError extends DriverError { } + class OperationTimedOutError extends DriverError { + constructor(message: string, host?: string); + + host?: string; + } class ResponseError extends DriverError { constructor(code: number, message: string); + + code: number; + } + + class BusyConnectionError extends DriverError { + constructor(address: string, maxRequestsPerConnection: number, connectionLength: number); } } @@ -736,44 +752,44 @@ export namespace metadata { argumentTypes: Array<{ code: number, info: any }>; finalFunction: string; initCondition: string; - keyspaceName: string, + keyspaceName: string; returnType: string; - signature: Array; + signature: string[]; stateFunction: string; stateType: string; } - + interface ClientStateStatic { new (): ClientState; } - + interface ClientState { - getConnectedHosts(): Array; + getConnectedHosts(): Host[]; getInFlightQueries(host: Host): number; getOpenConnections(host: Host): number; toString(): string; } interface DataTypeInfo { - code: number, - info: string | DataTypeInfo | Array, + code: number; + info: string | DataTypeInfo | DataTypeInfo[]; options: { - frozen: boolean, - reversed: boolean - } + frozen: boolean; + reversed: boolean; + }; } interface ColumnInfo { - name: string, - type: DataTypeInfo + name: string; + type: DataTypeInfo; } interface DataCollection { bloomFilterFalsePositiveChance: number; caching: caching; clusterKeys: Array<{ c: ColumnInfo, index: number, order: string }>; - clusteringOrder: Array; - columns: Array; + clusteringOrder: string[]; + columns: ColumnInfo[]; columnsByName: { [key: string]: ColumnInfo }; comment: string; compactionClass: string; @@ -787,7 +803,7 @@ export namespace metadata { maxIndexInterval?: number; minIndexInterval?: number; name: string; - partitionKeys: Array<{ c: ColumnInfo, index: number }> + partitionKeys: Array<{ c: ColumnInfo, index: number }>; populateCacheOnFlush: boolean; readRepairChance: number; speculateRetry: string; @@ -800,16 +816,16 @@ export namespace metadata { } interface IndexStatic { - new (name: string, target: string, kind: IndexType, options: Object): Index; + new (name: string, target: string, kind: string | IndexType, options: object): Index; - fromRows(indexRows: Array): Array; - fromColumnRows(columnRows: Array, columnsByName: { [key: string]: ColumnInfo }): Array; + fromRows(indexRows: types.Row[]): Index[]; + fromColumnRows(columnRows: types.Row[], columnsByName: { [key: string]: ColumnInfo }): Index[]; } interface Index { kind: IndexType; name: string; - options: Object; + options: object; target: string; isCompositesKind(): boolean; @@ -830,12 +846,12 @@ export namespace metadata { interface Metadata { clearPrepared(): void; - getAggregate(keyspaceName: string, name: string, signature: Array | Array<{ code: number, info: any }>, callback: Callback): void; + getAggregate(keyspaceName: string, name: string, signature: string[] | Array<{ code: number, info: any }>, callback: Callback): void; getAggregates(keyspaceName: string, name: string, callback: Callback): void; - getFunction(keyspaceName: string, name: string, signature: Array | Array<{ code: number, info: any }>, callback: Callback): void; + getFunction(keyspaceName: string, name: string, signature: string[] | Array<{ code: number, info: any }>, callback: Callback): void; getFunctions(keyspaceName: string, name: string, callback: Callback): void; getMaterializedView(keyspaceName: string, name: string, callback: Callback): void; - getReplicas(keyspaceName: string, tokenBuffer: Buffer): Array; + getReplicas(keyspaceName: string, tokenBuffer: Buffer): any[]; getTable(keyspaceName: string, name: string, callback: Callback): void; getTrace(traceId: types.Uuid, callback: Callback): void; getUdt(keyspaceName: string, name: string, callback: Callback): void; @@ -848,15 +864,15 @@ export namespace metadata { } interface SchemaFunction { - argumentNames: Array; + argumentNames: string[]; argumentTypes: Array<{ code: number, info: any }>; body: string; calledOnNullInput: boolean; - keyspaceName: string, + keyspaceName: string; language: string; name: string; returnType: string; - signature: Array; + signature: string[]; } interface TableMetadataStatic { @@ -864,10 +880,12 @@ export namespace metadata { } interface TableMetadata extends DataCollection { - indexes: Array; + indexes: Index[]; indexInterval?: number; isCompact: boolean; memtableFlushPeriod: number; replicateOnWrite: boolean; + cdc?: boolean; + virtual: boolean; } } diff --git a/types/cassandra-driver/tsconfig.json b/types/cassandra-driver/tsconfig.json index e47bfd4444..59e0316c6a 100644 --- a/types/cassandra-driver/tsconfig.json +++ b/types/cassandra-driver/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "cassandra-driver-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/cassandra-driver/tslint.json b/types/cassandra-driver/tslint.json index a41bf5d19a..ec0272c64c 100644 --- a/types/cassandra-driver/tslint.json +++ b/types/cassandra-driver/tslint.json @@ -1,79 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "no-misused-new": false } } diff --git a/types/catbox/index.d.ts b/types/catbox/index.d.ts index 62b99ac5b3..bd41889e07 100644 --- a/types/catbox/index.d.ts +++ b/types/catbox/index.d.ts @@ -231,7 +231,7 @@ export interface DecoratedPolicyOptions extends PolicyOptions { /** * @default false */ - getDecoratedValue?: boolean; + getDecoratedValue: boolean | undefined; } export interface GenerateFuncFlags { @@ -249,7 +249,7 @@ export interface GenerateFuncFlags { * * ttl - the cache ttl value in milliseconds. Set to 0 to skip storing in the cache. Defaults to the cache global policy. * @see {@link https://github.com/hapijs/catbox#policy} */ -export type GenerateFunc = (id: string, flags: GenerateFuncFlags) => Promise; +export type GenerateFunc = (id: Id, flags: GenerateFuncFlags) => Promise; /** * An object with logging information about the generation operation containing the following keys (as relevant): diff --git a/types/chai-almost/chai-almost-tests.ts b/types/chai-almost/chai-almost-tests.ts new file mode 100644 index 0000000000..07e84f7a62 --- /dev/null +++ b/types/chai-almost/chai-almost-tests.ts @@ -0,0 +1,32 @@ +import { expect, use } from 'chai'; +import chaiAlmost = require('chai-almost'); + +// Normally, call use(chaiAlmost(...)) only once, this is just to check that TypeScript correctly handles both. +use(chaiAlmost(0.01)); // custom tolerance 0.01 +use(chaiAlmost()); // default tolerance 1e-6 (= 0.000001) + +expect(1.0000001).to.almost.equal(1); +expect(1.0000001).to.be.almost(1); +expect(1.0000001).almost.equals(1); + +expect(1.0001).to.not.almost.equal(1); +expect(1.0001).to.not.be.almost(1); +expect(1.0001).not.almost.equals(1); + +// Note the "not" in the following. +// Use deep equality checks to compare values inside of arrays and objects. +expect([1]).to.not.be.almost([1]); + +const arrA = [1, [{ num: 2, name: "Douglas" }, 3]]; +const arrB = [1.0000001, [{ num: 1.9999999, name: "Douglas" }, 2.9999996]]; + +expect(arrA).to.deep.almost.equal(arrB); +expect(arrA).to.be.deep.almost(arrB); +expect(arrA).deep.almost.equals(arrB); +expect(arrA).to.almost.eql(arrB); +expect(arrA).to.be.almost.eql(arrB); +expect(arrA).almost.eqls(arrB); + +expect(1.001).to.be.almost(1, 0.01); +expect(1.001).to.not.be.almost(1, 0.0001); +expect([42]).to.be.deep.almost([42.3145], 0.5); diff --git a/types/chai-almost/index.d.ts b/types/chai-almost/index.d.ts new file mode 100644 index 0000000000..2f7a3ffdc7 --- /dev/null +++ b/types/chai-almost/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for chai-almost 1.0 +// Project: https://github.com/nmuldavin/chai-almost#readme +// Definitions by: Lennard Schulz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare global { + namespace Chai { + interface Assertion { + almost: ChaiAlmost.Almost; + } + interface Deep { + almost: ChaiAlmost.DeepAlmost; + } + + namespace ChaiAlmost { + interface DeepAlmost { + (value: any, toleranceOverride?: number): Assertion; + equal: Equal; + equals: Equal; + eq: Equal; + } + interface Almost extends DeepAlmost { + eql: Equal; + eqls: Equal; + } + } + } +} + +declare function chaiAlmost(tolerance?: number): ((chai: any, utils: any) => void); +export = chaiAlmost; diff --git a/types/chai-almost/tsconfig.json b/types/chai-almost/tsconfig.json new file mode 100644 index 0000000000..e97d3ea722 --- /dev/null +++ b/types/chai-almost/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "chai-almost-tests.ts" + ] +} diff --git a/types/chai-almost/tslint.json b/types/chai-almost/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chai-almost/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/chai-webdriverio/package.json b/types/chai-webdriverio/package.json new file mode 100644 index 0000000000..cd495fe983 --- /dev/null +++ b/types/chai-webdriverio/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "@types/webdriverio": "^4.0.0" + } +} diff --git a/types/chalk-animation/chalk-animation-tests.ts b/types/chalk-animation/chalk-animation-tests.ts new file mode 100644 index 0000000000..e2f12e58b3 --- /dev/null +++ b/types/chalk-animation/chalk-animation-tests.ts @@ -0,0 +1,21 @@ +import * as chalkAnimation from 'chalk-animation'; + +const rainbow: chalkAnimation.Animation = chalkAnimation.rainbow('Lorem ipsum dolor sit amet'); +chalkAnimation.rainbow('Lorem ipsum dolor sit amet', 2); +chalkAnimation.pulse('Lorem ipsum dolor sit amet'); +chalkAnimation.pulse('Lorem ipsum dolor sit amet', 2); +chalkAnimation.glitch('Lorem ipsum dolor sit amet'); +chalkAnimation.glitch('Lorem ipsum dolor sit amet', 2); +chalkAnimation.radar('Lorem ipsum dolor sit amet'); +chalkAnimation.radar('Lorem ipsum dolor sit amet', 2); +chalkAnimation.neon('Lorem ipsum dolor sit amet'); +chalkAnimation.neon('Lorem ipsum dolor sit amet', 2); +chalkAnimation.karaoke('Lorem ipsum dolor sit amet'); +chalkAnimation.karaoke('Lorem ipsum dolor sit amet', 2); + +rainbow.stop(); +rainbow.start(); +rainbow.replace('.'); +rainbow.render(); +// $ExpectType string +rainbow.frame(); diff --git a/types/chalk-animation/index.d.ts b/types/chalk-animation/index.d.ts new file mode 100644 index 0000000000..9f08617bb3 --- /dev/null +++ b/types/chalk-animation/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for chalk-animation 1.6 +// Project: https://github.com/bokub/chalk-animation +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export const rainbow: AnimationFn; +export const pulse: AnimationFn; +export const glitch: AnimationFn; +export const radar: AnimationFn; +export const neon: AnimationFn; +export const karaoke: AnimationFn; + +export type AnimationFn = (text: string, speed?: number) => Animation; + +export interface Animation { + start(): void; + stop(): void; + replace(text: string): void; + render(): void; + frame(): string; +} diff --git a/types/chalk-animation/tsconfig.json b/types/chalk-animation/tsconfig.json new file mode 100644 index 0000000000..bf580a6e70 --- /dev/null +++ b/types/chalk-animation/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "chalk-animation-tests.ts" + ] +} diff --git a/types/chalk-animation/tslint.json b/types/chalk-animation/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chalk-animation/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index fd5ed53e80..e35c556b56 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -71,7 +71,11 @@ const chart: Chart = new Chart(ctx, { padding: 40 } }, - devicePixelRatio: 2 + devicePixelRatio: 2, + plugins: { + bar: false, + foo: {} + } } }); chart.update(); diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 2803def896..8e795ed77c 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -284,8 +284,7 @@ declare namespace Chart { circumference?: number; rotation?: number; devicePixelRatio?: number; - // Plugins can require any options - plugins?: { [pluginId: string]: any }; + plugins?: ChartPluginsOptions; } interface ChartFontOptions { @@ -367,6 +366,12 @@ declare namespace Chart { borderWidth?: number; } + // NOTE: declare plugin options as interface instead of inline '{ [plugin: string]: any }' + // to allow module augmentation in case some plugins want to strictly type their options. + interface ChartPluginsOptions { + [pluginId: string]: any; + } + interface ChartTooltipsStaticConfiguration { positioners: { [mode: string]: ChartTooltipPositioner }; } @@ -532,6 +537,7 @@ declare namespace Chart { interface LinearTickOptions extends TickOptions { maxTicksLimit?: number; stepSize?: number; + precision?: number; suggestedMin?: number; suggestedMax?: number; } diff --git a/types/chroma-js/chroma-js-tests.ts b/types/chroma-js/chroma-js-tests.ts index f1709dd31a..d9027a8801 100644 --- a/types/chroma-js/chroma-js-tests.ts +++ b/types/chroma-js/chroma-js-tests.ts @@ -110,6 +110,9 @@ function test_color() { chroma('teal').alpha(0.5).css(); chroma('teal').css('hsl'); chroma('orange').rgb(); + chroma('orange').rgb(true); + chroma('orange').rgba(); + chroma('orange').rgba(true); chroma('#000000').num(); chroma('#0000ff').num(); diff --git a/types/chroma-js/index.d.ts b/types/chroma-js/index.d.ts index 162a318dc8..b73f572371 100644 --- a/types/chroma-js/index.d.ts +++ b/types/chroma-js/index.d.ts @@ -21,6 +21,8 @@ declare namespace chroma { gl: [number, number, number, number]; } + type InterpolationMode = "rgb" | "hsl" | "hsv" | "hsi" | "lab" | "lch" | "hcl"; + interface ChromaStatic { /** * Creates a color from a string representation (as supported in CSS). @@ -209,7 +211,7 @@ declare namespace chroma { css(col: string): Color; } - type Color = { + interface Color { /** * Get and set the color opacity. */ @@ -300,9 +302,109 @@ declare namespace chroma { * chroma('#ff0000').num() === 16711680 */ num(): number; - } & { - [K in keyof ColorSpaces]: () => ColorSpaces[K]; - }; + + /** + * Returns an array with the red, green, and blue component, each as + * number within the range 0..255. Chroma internally stores RGB + * channels as floats but rounds the numbers before returning them. + * You can pass false to prevent the rounding. + * + * @example + * chroma('orange').rgb() === [255,165,0] + * chroma('orange').darken().rgb() === [198,118,0] + * chroma('orange').darken().rgb(false) === [198.05,118.11,0] + */ + rgb: (round?: boolean) => ColorSpaces['rgb']; + + /** + * Just like color.rgb but adds the alpha channel to the returned array. + * + * @example + * chroma('orange').rgba() === [255,165,0,1] + * chroma('hsla(20, 100%, 40%, 0.5)').rgba() === [204,68,0,0.5] + */ + rgba: (round?: boolean) => ColorSpaces['rgba']; + + /** + * Returns an array with the `hue`, `saturation`, and `lightness` + * component. Hue is the color angle in degree (`0..360`), saturation + * and lightness are within `0..1`. Note that for hue-less colors + * (black, white, and grays), the hue component will be NaN. + * + * @example + * chroma('orange').hsl() === [38.82,1,0.5,1] + * chroma('white').hsl() === [NaN,0,1,1] + */ + hsl: () => ColorSpaces['hsl']; + + /** + * Returns an array with the `hue`, `saturation`, and `value` + * components. Hue is the color angle in degree (`0..360`), + * saturation and value are within `0..1`. Note that for hue-less + * colors (black, white, and grays), the hue component will be NaN. + * + * @example + * chroma('orange').hsv() === [38.82,1,1] + * chroma('white').hsv() === [NaN,0,1] + */ + hsv: () => ColorSpaces['hsv']; + + /** + * Returns an array with the `hue`, `saturation`, and `intensity` + * components, each as number between 0 and 255. Note that for hue-less + * colors (black, white, and grays), the hue component will be NaN. + * + * @example + * chroma('orange').hsi() === [39.64,1,0.55] + * chroma('white').hsi() === [NaN,0,1] + */ + hsi: () => ColorSpaces['hsi']; + + /** + * Returns an array with the **L**, **a**, and **b** components. + * + * @example + * chroma('orange').lab() === [74.94,23.93,78.95] + */ + lab: () => ColorSpaces['lab']; + + /** + * Returns an array with the **Lightness**, **chroma**, and **hue** + * components. + * + * @example + * chroma('skyblue').lch() === [79.21,25.94,235.11] + */ + lch: () => ColorSpaces['lch']; + + /** + * Alias of [lch](#color-lch), but with the components in reverse + * order. + * + * @example + * chroma('skyblue').hcl() === [235.11,25.94,79.21] + */ + hcl: () => ColorSpaces['hcl']; + + /** + * Just like color.rgb but adds the alpha channel to the returned + * array. + * + * @example + * chroma('orange').rgba() === [255,165,0,1] + * chroma('hsla(20, 100%, 40%, 0.5)').rgba() === [204,68,0,0.5] + */ + cmyk: () => ColorSpaces['cmyk']; + + /** + * Returns an array with the cyan, magenta, yellow, and key (black) + * components, each as a normalized value between 0 and 1. + * + * @example + * chroma('33cc00').gl() === [0.2,0.8,0,1] + */ + gl: () => ColorSpaces['gl']; + } interface Scale { (c: string[]): Scale; @@ -311,7 +413,7 @@ declare namespace chroma { domain(d?: number[], n?: number, mode?: string): this; - mode(mode: keyof ColorSpaces): this; + mode(mode: InterpolationMode): this; gamma(g: number): this; diff --git a/types/chrome-apps/index.d.ts b/types/chrome-apps/index.d.ts index 8873e80da2..c947a8d12c 100644 --- a/types/chrome-apps/index.d.ts +++ b/types/chrome-apps/index.d.ts @@ -13274,7 +13274,7 @@ interface HTMLElement { /** * ❗ Unprefixed version are not available as of Chrome 68, in Chrome apps ❗ */ - requestFullscreen(): void; + requestFullscreen(): Promise; /** * ❗ Unprefixed version are not available as of Chrome 68, in Chrome apps ❗ */ diff --git a/types/chrome-apps/test/index.ts b/types/chrome-apps/test/index.ts index 499a34bab1..6dbbabc263 100644 --- a/types/chrome-apps/test/index.ts +++ b/types/chrome-apps/test/index.ts @@ -917,7 +917,7 @@ chrome.app.runtime.onLaunched.addListener(() => { // #region chrome.gcm -const gcmMessage = {}; +const gcmMessage = {} as chrome.gcm.OutgoingMessage; gcmMessage.data = { /*goog: 'any', should not be allowed, and it is not :) */ test: true @@ -1078,8 +1078,7 @@ chrome.networking.config.finishAuthentication(filter.HexSSID || '', 'rejected'); // #region chrome.networking.onc const TLSFormatExample = { - NetworkConfigurations: - { + NetworkConfigurations: { GUID: '{00f79111-51e0-e6e0-76b3b55450d80a1b}', Name: 'MyTTLSNetwork', Type: 'WiFi', @@ -1103,7 +1102,7 @@ const TLSFormatExample = { 'SSID': 'MyTTLSNetwork', 'Security': 'WPA-EAP' } - } + } as chrome.networking.onc.NetworkConfigProperties } chrome.networking.onc.getNetworks({ 'networkType': 'All' }, (networkList) => { @@ -2012,5 +2011,8 @@ appview.connect('id of app'); document.appendChild(appview); //#endregion +// #region HTMLElement correctly subtypes Element in TS3.1. +const htmlElement = document.querySelector('zzzzzz') as HTMLElement; +//#endregion diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index ba074550f8..528ab91be7 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Chrome extension development // Project: http://developer.chrome.com/extensions/ -// Definitions by: Matthew Kimber , otiai10 , couven92 , RReverser , sreimer15 +// Definitions by: Matthew Kimber , otiai10 , couven92 , RReverser , sreimer15 , MatCarlson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -762,6 +762,9 @@ declare namespace chrome.commands { * Permissions: "contentSettings" */ declare namespace chrome.contentSettings { + + type ScopeEnum = 'regular' | 'incognito_session_only'; + export interface ClearDetails { /** * Optional. @@ -770,7 +773,7 @@ declare namespace chrome.contentSettings { * * regular: setting for regular profile (which is inherited by the incognito profile if not overridden elsewhere), * * incognito_session_only: setting for incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular settings). */ - scope?: string; + scope?: ScopeEnum; } export interface SetDetails { @@ -781,11 +784,63 @@ declare namespace chrome.contentSettings { /** Optional. The pattern for the secondary URL. Defaults to matching all URLs. For details on the format of a pattern, see Content Setting Patterns. */ secondaryPattern?: string; /** Optional. Where to set the setting (default: regular). */ - scope?: string; + scope?: ScopeEnum; /** The pattern for the primary URL. For details on the format of a pattern, see Content Setting Patterns. */ primaryPattern: string; } + export interface CookieSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'session_only'; + } + + export interface ImagesSetDetails extends SetDetails { + setting: 'allow' | 'block'; + } + + export interface JavascriptSetDetails extends SetDetails { + setting: 'allow' | 'block'; + } + + export interface LocationSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'ask'; + } + + export interface PluginsSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'detect_important_content'; + } + + export interface PopupsSetDetails extends SetDetails { + setting: 'allow' | 'block'; + } + + export interface NotificationsSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'ask'; + } + + export interface FullscreenSetDetails extends SetDetails { + setting: 'allow'; + } + + export interface MouselockSetDetails extends SetDetails { + setting: 'allow'; + } + + export interface MicrophoneSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'ask'; + } + + export interface CameraSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'ask'; + } + + export interface PpapiBrokerSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'ask'; + } + + export interface MultipleAutomaticDownloadsSetDetails extends SetDetails { + setting: 'allow' | 'block' | 'ask'; + } + export interface GetDetails { /** Optional. The secondary URL for which the content setting should be retrieved. Defaults to the primary URL. Note that the meaning of a secondary URL depends on the content type, and not all content types use secondary URLs. */ secondaryUrl?: string; @@ -829,6 +884,58 @@ declare namespace chrome.contentSettings { get(details: GetDetails, callback: (details: ReturnedDetails) => void): void; } + export interface CookieContentSetting extends ContentSetting{ + set(details: CookieSetDetails, callback?: () => void): void; + } + + export interface PopupsContentSetting extends ContentSetting{ + set(details: PopupsSetDetails, callback?: () => void): void; + } + + export interface JavascriptContentSetting extends ContentSetting{ + set(details: JavascriptSetDetails, callback?: () => void): void; + } + + export interface NotificationsContentSetting extends ContentSetting{ + set(details: NotificationsSetDetails, callback?: () => void): void; + } + + export interface PluginsContentSetting extends ContentSetting{ + set(details: PluginsSetDetails, callback?: () => void): void; + } + + export interface ImagesContentSetting extends ContentSetting{ + set(details: ImagesSetDetails, callback?: () => void): void; + } + + export interface LocationContentSetting extends ContentSetting{ + set(details: LocationSetDetails, callback?: () => void): void; + } + + export interface FullscreenContentSetting extends ContentSetting{ + set(details: FullscreenSetDetails, callback?: () => void): void; + } + + export interface MouselockContentSetting extends ContentSetting{ + set(details: MouselockSetDetails, callback?: () => void): void; + } + + export interface MicrophoneContentSetting extends ContentSetting{ + set(details: MicrophoneSetDetails, callback?: () => void): void; + } + + export interface CameraContentSetting extends ContentSetting{ + set(details: CameraSetDetails, callback?: () => void): void; + } + + export interface PpapiBrokerContentSetting extends ContentSetting{ + set(details: PpapiBrokerSetDetails, callback?: () => void): void; + } + + export interface MultipleAutomaticDownloadsContentSetting extends ContentSetting{ + set(details: MultipleAutomaticDownloadsSetDetails, callback?: () => void): void; + } + /** The only content type using resource identifiers is contentSettings.plugins. For more information, see Resource Identifiers. */ export interface ResourceIdentifier { /** The resource identifier for the given content type. */ @@ -845,7 +952,7 @@ declare namespace chrome.contentSettings { * Default is allow. * The primary URL is the URL representing the cookie origin. The secondary URL is the URL of the top-level frame. */ - export var cookies: ContentSetting; + export var cookies: CookieContentSetting; /** * Whether to allow sites to show pop-ups. One of * allow: Allow sites to show pop-ups, @@ -853,7 +960,7 @@ declare namespace chrome.contentSettings { * Default is block. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - export var popups: ContentSetting; + export var popups: PopupsContentSetting; /** * Whether to run JavaScript. One of * allow: Run JavaScript, @@ -861,7 +968,7 @@ declare namespace chrome.contentSettings { * Default is allow. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - export var javascript: ContentSetting; + export var javascript: JavascriptContentSetting; /** * Whether to allow sites to show desktop notifications. One of * allow: Allow sites to show desktop notifications, @@ -870,7 +977,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the document which wants to show the notification. The secondary URL is not used. */ - export var notifications: ContentSetting; + export var notifications: NotificationsContentSetting; /** * Whether to run plugins. One of * allow: Run plugins automatically, @@ -879,7 +986,7 @@ declare namespace chrome.contentSettings { * Default is allow. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - export var plugins: ContentSetting; + export var plugins: PluginsContentSetting; /** * Whether to show images. One of * allow: Show images, @@ -887,7 +994,7 @@ declare namespace chrome.contentSettings { * Default is allow. * The primary URL is the URL of the top-level frame. The secondary URL is the URL of the image. */ - export var images: ContentSetting; + export var images: ImagesContentSetting; /** * Since Chrome 42. * Whether to allow Geolocation. One of @@ -897,7 +1004,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the document which requested location data. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL). */ - export var location: ContentSetting; + export var location: LocationContentSetting; /** * Since Chrome 42. * Whether to allow sites to toggle the fullscreen mode. One of @@ -906,7 +1013,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the document which requested to toggle the fullscreen mode. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL). */ - export var fullscreen: ContentSetting; + export var fullscreen: FullscreenContentSetting; /** * Since Chrome 42. * Whether to allow sites to disable the mouse cursor. One of @@ -916,7 +1023,29 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - export var mouselock: ContentSetting; + export var mouselock: MouselockContentSetting; + /** + * Since Chrome 46. + * Whether to allow sites to access the microphone. One of + * allow: Allow sites to access the microphone, + * block: Don't allow sites to access the microphone, + * ask: Ask when a site wants to access the microphone. + * Default is ask. + * The primary URL is the URL of the document which requested microphone access. The secondary URL is not used. + * NOTE: The 'allow' setting is not valid if both patterns are ''. + */ + export var microphone: MicrophoneContentSetting; + /** + * Since Chrome 46. + * Whether to allow sites to access the camera. One of + * allow: Allow sites to access the camera, + * block: Don't allow sites to access the camera, + * ask: Ask when a site wants to access the camera. + * Default is ask. + * The primary URL is the URL of the document which requested camera access. The secondary URL is not used. + * NOTE: The 'allow' setting is not valid if both patterns are ''. + */ + export var camera: CameraContentSetting; /** * Since Chrome 42. * Whether to allow sites to run plugins unsandboxed. One of @@ -926,7 +1055,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - export var unsandboxedPlugins: ContentSetting; + export var unsandboxedPlugins: PpapiBrokerContentSetting; /** * Since Chrome 42. * Whether to allow sites to download multiple files automatically. One of @@ -936,7 +1065,7 @@ declare namespace chrome.contentSettings { * Default is ask. * The primary URL is the URL of the top-level frame. The secondary URL is not used. */ - export var automaticDownloads: ContentSetting; + export var automaticDownloads: MultipleAutomaticDownloadsContentSetting; } //////////////////// @@ -966,6 +1095,13 @@ declare namespace chrome.contextMenus { * The ID of the menu item that was clicked. */ menuItemId: any; + /** + * Optional. + * Since Chrome 35. + * The ID of the frame of the element where the context menu was + * clicked, if it was in a frame. + */ + frameId?: number; /** * Optional. * Since Chrome 35. @@ -1048,6 +1184,12 @@ declare namespace chrome.contextMenus { * The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension. */ id?: string; + /** + * Optional. + * Since Chrome 62. + * Whether the item is visible in the menu. + */ + visible?: boolean; } export interface UpdateProperties { @@ -4447,7 +4589,10 @@ declare namespace chrome.omnibox { description: string; } - export interface OmniboxInputEnteredEvent extends chrome.events.Event<(text: string) => void> { } + /** The window disposition for the omnibox query. This is the recommended context to display results. */ + export type OnInputEnteredDisposition = 'currentTab' | 'newForegroundTab' | 'newBackgroundTab'; + + export interface OmniboxInputEnteredEvent extends chrome.events.Event<(text: string, disposition: OnInputEnteredDisposition) => void> { } export interface OmniboxInputChangedEvent extends chrome.events.Event<(text: string, suggest: (suggestResults: SuggestResult[]) => void) => void> { } @@ -4455,6 +4600,8 @@ declare namespace chrome.omnibox { export interface OmniboxInputCancelledEvent extends chrome.events.Event<() => void> { } + export interface OmniboxSuggestionDeletedEvent extends chrome.events.Event<(text: string) => void> { } + /** * Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar. * @param suggestion A partial SuggestResult object, without the 'content' parameter. @@ -4469,6 +4616,11 @@ declare namespace chrome.omnibox { export var onInputStarted: OmniboxInputStartedEvent; /** User has ended the keyword input session without accepting the input. */ export var onInputCancelled: OmniboxInputCancelledEvent; + /** + * User has deleted a suggested result + * @since Chrome 63. + */ + export var onDeleteSuggestion: OmniboxSuggestionDeletedEvent; } //////////////////// diff --git a/types/chromecast-caf-receiver/cast.framework.messages.d.ts b/types/chromecast-caf-receiver/cast.framework.messages.d.ts index c3dc4a405f..1846fd4840 100644 --- a/types/chromecast-caf-receiver/cast.framework.messages.d.ts +++ b/types/chromecast-caf-receiver/cast.framework.messages.d.ts @@ -1372,12 +1372,12 @@ export interface MediaInformation { * is playing or ones that receiver will play shortly after; instead of sending * whole list of clips. This is to avoid overflow of MediaStatus message. */ - breakClips: BreakClip[]; + breakClips?: BreakClip[]; /** * List of breaks. */ - breaks: Break[]; + breaks?: Break[]; /** * Typically the url of the media. @@ -1414,12 +1414,18 @@ export interface MediaInformation { /** * The format of the HLS media segment. */ - hlsSegmentFormat: HlsSegmentFormat; + hlsSegmentFormat?: HlsSegmentFormat; /** * The media metadata. */ - metadata: MediaMetadata; + metadata?: + | MediaMetadata + | GenericMediaMetadata + | MovieMediaMetadata + | MusicTrackMediaMetadata + | PhotoMediaMetadata + | TvShowMediaMetadata; /** * The stream type. @@ -1429,12 +1435,12 @@ export interface MediaInformation { /** * The style of text track. */ - textTrackStyle: TextTrackStyle; + textTrackStyle?: TextTrackStyle; /** * The media tracks. */ - tracks: Track[]; + tracks?: Track[]; } /** diff --git a/types/ckeditor/ckeditor-tests.ts b/types/ckeditor/ckeditor-tests.ts index 6a0b50a4d8..7e224ab683 100644 --- a/types/ckeditor/ckeditor-tests.ts +++ b/types/ckeditor/ckeditor-tests.ts @@ -369,6 +369,7 @@ function test_dom_walker() { node = walker.lastForward(); node = walker.next(); node = walker.previous(); + isSomething = walker.guard(node, true); walker.reset(); isSomething = CKEDITOR.dom.walker.blockBoundary({ div: 1 })(node); @@ -485,7 +486,7 @@ function test_dialog() { { id: 'tab-basic', label: 'Basic Settings', - elements: [] + elements: [] as any [] }, { id: 'tab-adv', diff --git a/types/ckeditor/index.d.ts b/types/ckeditor/index.d.ts index 69c23d6a99..88646f67d1 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -498,7 +498,7 @@ declare namespace CKEDITOR { class walker { evaluator: (node: node) => boolean; - guard: (node: node) => boolean; + guard: (node: node, movingOut?: boolean) => boolean; static validEmptyBlockContainers: { [key: string]: any }; @@ -761,7 +761,7 @@ declare namespace CKEDITOR { pasteFromWordNumberedHeadingToList?: boolean; pasteFromWordPromptCleanup?: boolean; pasteFromWordRemoveFontStyles?: boolean; - pasteFromWorkRemoveStyles?: boolean; + pasteFromWordRemoveStyles?: boolean; pasteFromWord_heuristicsEdgeList?: boolean; pasteFromWord_inlineImages?: boolean; plugins?: string; diff --git a/types/ckeditor/v2/ckeditor-tests.ts b/types/ckeditor/v2/ckeditor-tests.ts index ce93c75eba..3407a07501 100644 --- a/types/ckeditor/v2/ckeditor-tests.ts +++ b/types/ckeditor/v2/ckeditor-tests.ts @@ -337,7 +337,7 @@ function test_adding_dialog_by_definition() { { id: 'tab-basic', label: 'Basic Settings', - elements: [] + elements: [] as any[] }, { id: 'tab-adv', diff --git a/types/ckeditor/v2/index.d.ts b/types/ckeditor/v2/index.d.ts index ab7b88bbdd..93e7902090 100644 --- a/types/ckeditor/v2/index.d.ts +++ b/types/ckeditor/v2/index.d.ts @@ -718,7 +718,7 @@ declare namespace CKEDITOR { pasteFromWordNumberedHeadingToList?: boolean; pasteFromWordPromptCleanup?: boolean; pasteFromWordRemoveFontStyles?: boolean; - pasteFromWorkRemoveStyles?: boolean; + pasteFromWordRemoveStyles?: boolean; plugins?: string; protectedSource?: RegExp[]; diff --git a/types/ckeditor__ckeditor5-core/ckeditor__ckeditor5-core-tests.ts b/types/ckeditor__ckeditor5-core/ckeditor__ckeditor5-core-tests.ts new file mode 100644 index 0000000000..68a20aff51 --- /dev/null +++ b/types/ckeditor__ckeditor5-core/ckeditor__ckeditor5-core-tests.ts @@ -0,0 +1,328 @@ +import * as utils from "ckeditor__ckeditor5-utils"; +import * as core from "ckeditor__ckeditor5-core"; +import * as engine from "ckeditor__ckeditor5-engine"; + +declare let bool: boolean; +declare let command: core.Command; +declare let commandCollection: core.CommandCollection; +declare let commands: core.Command[]; +declare let componentFactory: core.ComponentFactory; +declare let config: utils.Config; +declare let conversion: engine.conversion.Conversion; +declare let dataController: engine.controller.DataController; +declare let editingController: engine.controller.EditingController; +declare let editingKeystrokeHandler: core.EditingKeystrokeHandler; +declare let editor: core.editor.Editor; +declare let focusTracker: utils.FocusTracker; +declare let htmlElement: HTMLElement; +declare let keystrokes: core.EditingKeystrokeHandler; +declare let locale: utils.Locale; +declare let model: engine.model.Model; +declare let num: number; +declare let pendingActions: core.PendingActions; +declare let plugin: core.Plugin; +declare let pluginCollection: core.PluginCollection; +declare let pluginCollectionStr: core.PluginCollection>; +declare let pluginStr: core.Plugin; +declare let myPlugin: MyPlugin; +declare let myPluginMaybe: MyPlugin | undefined; +declare let myPlugins: MyPlugin[]; +declare let str: string; +declare let strOrUndef: string | undefined; +declare let strs: string[]; +declare let ui: core.editor.EditorUI; +declare let undef: undefined; +declare let view: core.EditorUIView; + +class MyPlugin extends core.Plugin { + constructor(editor: core.editor.Editor) { + super(editor); + } + + static get pluginName() { + return "A"; + } + + myMethod() { + return "this is MyPlugin method"; + } +} + +class SomeCommand extends core.Command { + execute() {} +} + +// core/editor/utils/dataapimixin ============================================= + +class DataApiEditor extends core.editor.Editor implements core.editor.utils.DataApi { + // mixin by DataApiMixin + getData: () => string; + setData: (data: string) => void; +} +utils.mix(DataApiEditor, core.editor.utils.DataApiMixin); +const dataApiEditor = new DataApiEditor(); + +dataApiEditor.setData("foo"); +str = dataApiEditor.getData(); + +// core/editor/utils/elementapimixin ========================================== + +class ElementApiEditor extends core.editor.Editor implements core.editor.utils.ElementApi { + // mixin by ElementApiMixin + readonly sourceElement: HTMLElement; + updateSourceElement: () => void; +} +utils.mix(ElementApiEditor, core.editor.utils.ElementApiMixin); +const elementApiEditor = new ElementApiEditor(); + +htmlElement = elementApiEditor.sourceElement; +elementApiEditor.updateSourceElement(); + +// core/editor/utils/attachtoform ============================================= + +// $ExpectError +core.editor.utils.attachToForm(editor); +core.editor.utils.attachToForm(elementApiEditor); + +// core/editor/editor ========================================================= + +commandCollection = editor.commands; +config = editor.config; +editingController = editor.editing; +conversion = editor.conversion; +dataController = editor.data; +editor.isReadOnly = bool; +editingKeystrokeHandler = editor.keystrokes; +locale = editor.locale; +model = editor.model; +pluginCollection = editor.plugins; + +if (editor.state === "initializing") { + console.log("new Editor()"); +} else if (editor.state === "ready") { + console.log("Editor.create()"); +} else if (editor.state === "destroyed") { + console.log("editor.destroy"); +} else { + const n: never = editor.state; +} + +editor.state = "ready"; + +core.editor.Editor.builtinPlugins = [plugin, pluginStr, plugin]; +const plugins: Array> = core.editor.Editor.builtinPlugins; + +core.editor.Editor.defaultConfig = { + foo: { + a: 1, + b: 2 + } +}; + +editor = new core.editor.Editor(); +editor = new core.editor.Editor({language: "pl"}); + +editor.destroy(); +editor.destroy().then(() => { + console.log(`${editor.state} == destroyed`); +}); + +editor.execute("someCommand"); +editor.execute("someCommand2", "arg1", 2); + +editor.initPlugins(); +editor.initPlugins().then(() => { + console.log(`init ${Array.from(editor.plugins).length} plugins`); +}); + +locale.t = editor.t; +str = editor.t("Label"); +str = editor.t('Created file "%0" in %1ms.', ["fileName", "100"]); + +// core/editor/editorui ======================================================= + +componentFactory = ui.componentFactory; +editor = ui.editor; +focusTracker = ui.focusTracker; +view = ui.view; + +ui = new core.editor.EditorUI(editor, view); +ui.destroy(); +ui.update(); + +// core/editor/editorwithui =================================================== + +declare let ewui: core.editor.EditorWithUI; +htmlElement = ewui.element!; +ui = ewui.ui; + +// core/command =============================================================== + +editor = command.editor; + +bool = command.isEnabled; + +undef = command.value; +strOrUndef = new core.Command(editor).value; + +command = new core.Command(editor); + +command.destroy(); + +command.execute(); + +command.refresh(); + +// core/commandcollection ===================================================== + +commandCollection = new core.CommandCollection(); + +const collectionsPairs = Array.from(commandCollection); +const collectionsPair = collectionsPairs[0]; +str = collectionsPair[0]; +command = collectionsPair[1]; + +commandCollection.add("foo", new SomeCommand(editor)); + +command = commandCollection.commands().next().value; +commands = Array.from(commandCollection.commands()); + +commandCollection.destroy(); + +commandCollection.execute("foo"); +commandCollection.execute("bar", 1, "param"); + +command = commandCollection.get("foo"); + +str = commandCollection.names().next().value; +strs = Array.from(commandCollection.names()); + +// core/editingkeystrokehandler =============================================== + +keystrokes = new core.EditingKeystrokeHandler(editor); + +editor = keystrokes.editor; + +keystrokes.press({keyCode: 123}); + +keystrokes.set("Ctrl+A", "foo"); +keystrokes.set(["shift", "33"], "foo"); +keystrokes.set(["ctrl", "A"], "foo", {priority: 10}); +keystrokes.set(["ctrl", "A"], "foo", {priority: "high"}); +keystrokes.set(["ctrl", "A"], () => console.log("key")); +keystrokes.set(["ctrl", "A"], (keyEvtData, cancel) => { + console.log(keyEvtData.keyCode); + cancel(); +}); + +// core/pendingactions ======================================================== + +pendingActions = new core.PendingActions(editor); + +str = core.PendingActions.pluginName; + +const firstAction = pendingActions.first; + +bool = pendingActions.hasAny; + +strs = Array.from(pendingActions, action => action.message); + +const action1 = pendingActions.add("Action 1"); + +pendingActions.remove(action1); + +firstAction!.fire("I'm an Observable with a message"); +str = firstAction!.message; +str = action1.message; + +// core/plugin ================================================================ + +class MyPluginMini extends core.Plugin { + constructor(editor: core.editor.Editor) { + super(editor); + } +} + +class MyPluginAll extends core.Plugin { + constructor(editor: core.editor.Editor) { + super(editor); + } + + static get pluginName() { + return "All"; + } + + static get requires() { + return [MyPlugin, MyPluginMini]; + } + + afterInit() {return Math.random() ? null : Promise.resolve("resolved"); } + destroy() {return Math.random() ? null : Promise.resolve("destroy"); } + init() {return Math.random() ? null : Promise.resolve("init"); } +} + +plugin = new MyPlugin(editor); +plugin = new MyPluginMini(editor); +pluginStr = new MyPluginAll(editor); + +const Plugin: MyPlugin = new MyPlugin(editor); +const pluginMini: MyPluginMini = new MyPluginMini(editor); +const pluginAll: MyPluginAll = new MyPluginAll(editor); + +editor = myPlugin.editor; + +str = MyPluginAll.pluginName; +strOrUndef = MyPluginMini.pluginName; // Todo: should be undefined. + +plugin = new MyPluginAll.requires[0](editor); + +const fs: Function[] = MyPluginAll.requires; +const fsOrUndef = MyPluginMini.requires; // Todo: should be undefined. + +// $ExpectError +pluginMini.afterInit(); +pluginAll.afterInit(); + +// $ExpectError +pluginMini.destroy(); +pluginAll.destroy(); + +// $ExpectError +pluginMini.init(); +pluginAll.init(); + +// core/plugincollection ====================================================== + +pluginCollectionStr = new core.PluginCollection(editor, [MyPluginAll]); +// $ExpectError +pluginCollectionStr = new core.PluginCollection(editor, [MyPlugin]); + +const aColl = new core.PluginCollection(editor, [MyPluginAll, MyPluginMini]); + +const myColl = new core.PluginCollection(editor, [MyPlugin]); + +const myCollArray = Array.from(myColl); +myPlugins = myCollArray.map(entry => entry[1]); +myPlugin = new (myCollArray[0][0])(editor); + +myColl.destroy() + .then(destroyedPlugins => { + num = destroyedPlugins.length; + const plugin = destroyedPlugins[0]; + editor = plugin.editor; + plugin.init!(); + plugin.destroy(); + str = plugin.myMethod(); + }); + +myPluginMaybe = myColl.get("A"); +myPluginMaybe = myColl.get(MyPlugin); + +myColl.load([MyPlugin, "A"]) + .then((loadedPlugins) => { + const plugin = loadedPlugins[0]; + editor = plugin.editor; + str = plugin.myMethod(); + }); + +myColl.load([MyPlugin, "A"], [MyPlugin, "A"]); diff --git a/types/ckeditor__ckeditor5-core/index.d.ts b/types/ckeditor__ckeditor5-core/index.d.ts new file mode 100644 index 0000000000..63ae237739 --- /dev/null +++ b/types/ckeditor__ckeditor5-core/index.d.ts @@ -0,0 +1,269 @@ +// Type definitions for @ckeditor/ckeditor5-core 11.0 +// Project: https://github.com/ckeditor/ckeditor5-core +// Definitions by: denisname +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as engine from "ckeditor__ckeditor5-engine"; +import * as ckutils from "ckeditor__ckeditor5-utils"; + +// TODO: depends on other libraries +export interface AlignmentConfig {} +export interface AutosaveConfig {} +export interface CKFinderAdapterConfig {} +export interface CloudServicesConfig {} +export interface FontFamilyConfig {} +export interface FontSizeConfig {} +export interface HeadingConfig {} +export interface HighlightConfig {} +export interface ImageConfig {} +export interface MediaEmbedConfig {} +export interface TypingConfig {} +export interface ComponentFactory {} // CKEditor 5 UI +export interface EditorUIView {} // CKEditor 5 UI + +export namespace editor { + namespace utils { + // core/editor/utils/attachtoform + + function attachToForm(editor: Editor & ElementApi): void; + + // core/editor/utils/dataapimixin + + const DataApiMixin: DataApi; + + interface DataApi { + getData(): string; + setData(data: string): void; + } + + // core/editor/utils/elementapimixin + + const ElementApiMixin: ElementApi; + + interface ElementApi { + readonly sourceElement: HTMLElement; + updateSourceElement(): void; + } + } + + // core/editor/editor + + class Editor implements ckutils.Emitter, ckutils.Observable { + readonly commands: CommandCollection; + readonly config: ckutils.Config; + readonly conversion: engine.conversion.Conversion; + readonly data: engine.controller.DataController; + readonly editing: engine.controller.EditingController; + isReadOnly: boolean; + readonly keystrokes: EditingKeystrokeHandler; + readonly locale: ckutils.Locale; + readonly model: engine.model.Model; + readonly plugins: PluginCollection>; + state: "initializing" | "ready" | "destroyed"; + + static builtinPlugins: Array>; + static defaultConfig: object; + + constructor(config?: object); + destroy(): Promise; + execute(commandName: string, ...commandParams: any[]): void; + initPlugins(): Promise; + t(str: string, values?: string[]): string; + + static create(config: object): Promise; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + } + + // core/editor/editorconfig + + interface EditorConfig { + alignment: AlignmentConfig; + autosave: AutosaveConfig; + balloonToolbar: string[]; + blockToolbar: string[]; + ckfinder: CKFinderAdapterConfig; + cloudServices: CloudServicesConfig; + fontFamily: FontFamilyConfig; + fontSize: FontSizeConfig; + heading: HeadingConfig; + highlight: HighlightConfig; + image: ImageConfig; + language: string; + mediaEmbed: MediaEmbedConfig; + plugins: Array; + removePlugins: string[]; + toolbar: string[] | {items: string[]; viewportTopOffset: number; }; + typing: TypingConfig; + } + + // core/editor/editorui + + class EditorUI implements ckutils.Emitter { + readonly componentFactory: ComponentFactory; + readonly editor: Editor; + readonly focusTracker: ckutils.FocusTracker; + readonly view: EditorUIView; + + constructor(editor: Editor, view: EditorUIView); + destroy(): void; + update(): void; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + } + + // core/editor/editorwithui + + interface EditorWithUI { + readonly element: HTMLElement | null; + readonly ui: EditorUI; + } +} + +// core/command + +export class Command implements ckutils.Emitter, ckutils.Observable { + readonly editor: editor.Editor; + readonly isEnabled: boolean; + readonly value: T | undefined; + + constructor(editor: editor.Editor); + destroy(): void; + execute(): void; + refresh(): void; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; +} + +// core/commandcollection + +export class CommandCollection { + constructor(); + [Symbol.iterator](): Iterator<[string, Command]>; + add(commandName: string, command: Command): void; + commands(): IterableIterator; + destroy(): void; + execute(commandName: string, ...commandParams: any[]): void; + get(commandName: string): Command; + names(): IterableIterator; +} + +// core/editingkeystrokehandler + +export class EditingKeystrokeHandler extends ckutils.KeystrokeHandler { + readonly editor: editor.Editor; + + constructor(editor: editor.Editor); + set( + keystroke: string | Array, + callback: string | ((keyEvtData: engine.view.observer.KeyEventData, cancel: () => void) => void), + options?: {priority: ckutils.PriorityString | number} + ): void; +} + +// core/pendingactions + +export class PendingActions extends Plugin { + static readonly pluginName: "PendingActions"; + + first: null | ckutils.Observable & {message: string}; + readonly hasAny: boolean; + + [Symbol.iterator](): Iterator; + add(message: string): ckutils.Observable & {message: string}; + remove(action: ckutils.Observable & {message: string}): void; +} + +// core/plugin + +export abstract class Plugin implements ckutils.Emitter, ckutils.Observable { + readonly editor: editor.Editor; + + static readonly pluginName?: string; + static readonly requires?: Array Plugin>; + + constructor(editor: editor.Editor); + afterInit?(): null | Promise; + destroy?(): null | Promise; + init?(): null | Promise; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; +} + +// PluginInterface, see Plugin + +// core/plugincollection + +export class PluginCollection

> { + constructor( + editor: editor.Editor, + availablePlugins?: Array P> + ); + + [Symbol.iterator](): Iterator<[new(editor: editor.Editor) => P, P]>; + + destroy(): Promise}>>; + + get( + key: string | (new(editor: editor.Editor) => P) + ): P | undefined; + + load( + plugins: Array P)>, + removePlugins?: Array P)> + ): Promise; +} diff --git a/types/ckeditor__ckeditor5-core/tsconfig.json b/types/ckeditor__ckeditor5-core/tsconfig.json new file mode 100644 index 0000000000..5f53bb9035 --- /dev/null +++ b/types/ckeditor__ckeditor5-core/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6", + "dom", + "es2015.promise" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ckeditor__ckeditor5-core-tests.ts" + ] +} diff --git a/types/ckeditor__ckeditor5-core/tslint.json b/types/ckeditor__ckeditor5-core/tslint.json new file mode 100644 index 0000000000..b4dd998211 --- /dev/null +++ b/types/ckeditor__ckeditor5-core/tslint.json @@ -0,0 +1,22 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": { + "options": [ + ["Object", "Avoid using the `Object` type. Did you mean `object`?"], + ["Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?"], + ["Number", "Avoid using the `Number` type. Did you mean `number`?"], + ["String", "Avoid using the `String` type. Did you mean `string`?"], + ["Symbol", "Avoid using the `Symbol` type. Did you mean `symbol`?"] + ] + }, + "no-empty-interface": false, + "prefer-switch": false, + "quotemark": [ + true, + "double", + "avoid-escape", + "avoid-template" + ] + } +} diff --git a/types/ckeditor__ckeditor5-engine/ckeditor__ckeditor5-engine-tests.ts b/types/ckeditor__ckeditor5-engine/ckeditor__ckeditor5-engine-tests.ts new file mode 100644 index 0000000000..676f30ac3b --- /dev/null +++ b/types/ckeditor__ckeditor5-engine/ckeditor__ckeditor5-engine-tests.ts @@ -0,0 +1,81 @@ +import * as engine from "ckeditor__ckeditor5-engine"; + +declare let pattern: engine.view.MatcherPattern; + +pattern = {name: /^p/}; + +pattern = { + attributes: { + title: "foobar", + foo: /^\w+/, + bar: true, + } +}; + +pattern = { + classes: "foobar" +}; + +pattern = { + classes: /foo.../ +}; + +pattern = { + classes: ["baz", "bar", /foo.../] +}; + +pattern = { + styles: { + position: "absolute", + color: /^\w*blue$/ + } +}; + +pattern = { + name: "span", + styles: { + "font-weight": "bold" + }, + classes: "highlighted" +}; + +pattern = (element: engine.view.Element) => { + if (element.name === "div" && element.childCount > 0) { + return {name: true}; + } + + return null; +}; + +pattern = (element: engine.view.Element) => { + if (element.name === "p") { + const fontSize = element.getStyle("font-size")!; + const size = fontSize.match(/(\d+)/px); + + if (size && Number(size[1]) > 26) { + return {name: true, attribute: ["font-size"]}; + } + } + + return null; +}; + +declare let viewDefinition: engine.view.ElementDefinition; + +viewDefinition = "p"; + +viewDefinition = { + name: "h1", + classes: ["foo", "bar"], +}; + +viewDefinition = { + name: "span", + styles: { + "font-size": "12px", + "font-weight": "bold", + }, + attributes: { + "data-id": "123", + } +}; diff --git a/types/ckeditor__ckeditor5-engine/index.d.ts b/types/ckeditor__ckeditor5-engine/index.d.ts new file mode 100644 index 0000000000..280b6ea213 --- /dev/null +++ b/types/ckeditor__ckeditor5-engine/index.d.ts @@ -0,0 +1,1368 @@ +// Type definitions for @ckeditor/ckeditor5-engine 11.0 +// Project: https://github.com/ckeditor/ckeditor5-engine +// Definitions by: denisname +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as ckutils from "ckeditor__ckeditor5-utils"; + +export namespace controller { + // engine/controller/datacontroller + + class DataController implements ckutils.Emitter, ckutils.Observable { + readonly downcastDispatcher: conversion.DowncastDispatcher; + readonly mapper: conversion.Mapper; + readonly model: model.Model; + readonly processor: dataprocessor.DataProcessor; + readonly upcastDispatcher: conversion.UpcastDispatcher; + + constructor(model: model.Model, dataProcessor?: dataprocessor.DataProcessor); + destroy(): void; + get(rootName?: string): string; + init(data: string, rootName?: string): Promise; + parse(data: string, context?: model.SchemaContextDefinition): model.DocumentFragment; + stringify(modelElementOrFragment: Element | model.DocumentFragment): string; + toModel(viewElementOrFragment: Element | model.DocumentFragment, context?: model.SchemaContextDefinition): model.DocumentFragment; + toView(modelElementOrFragment: Element | model.DocumentFragment): model.DocumentFragment; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + } + + // engine/controller/editingcontroller + + class EditingController implements ckutils.Emitter, ckutils.Observable { + readonly downcastDispatcher: conversion.DowncastDispatcher; + readonly mapper: conversion.Mapper; + readonly model: model.Model; + readonly view: view.View; + + constructor(model: model.Model); + destroy(): void; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + } +} + +export namespace conversion { + // engine/conversion/conversion + + class Conversion { + constructor(); + attributeToAttribute(definition?: {model: string | Object, view?: string | Object, upcastAlso?: view.MatcherPattern | view.MatcherPattern[]}): void; + attributeToElement(definition: ConverterDefinition): void; + elementToElement(definition: ConverterDefinition): void; + for(groupName: string): {add: () => void}; + register(groupName: string, dispatchers: Array): void; + } + + interface ConverterDefinition { + converterPriority: ckutils.PriorityString; + model: any; + upcastAlso: view.MatcherPattern | view.MatcherPattern[]; + view: view.ElementDefinition | Object; + } + + // engine/conversion/downcast-converters + + interface HighlightDescriptor { + attributes: Object; + classes: string | string[]; + id: string; + priority: number; + } + + // engine/conversion/downcast-selection-converters + + function clearAttributes(): Function; + + function convertCollapsedSelection(): Function; + + function convertRangeSelection(): Function; + + // engine/conversion/downcastdispatcher + + class DowncastDispatcher { + // TODO + } + + // engine/conversion/mapper + + class Mapper { + constructor(); + bindElementToMarker(element: view.Element, name: string): void; + bindElements(modelElement: model.Element, viewElement: view.Element): void; + clearBindings(): void; + getModelLength(viewNode: view.Element): number; + markerNameToElements(name: string): Set | null; + registerViewToModelLength(viewElementName: string, lengthCallback: Function): void; + toModelElement(viewElement: view.Element): model.Element | undefined; + toModelPosition(viewPosition: view.Position): model.Position; + toModelRange(viewRange: view.Range): model.Range; + toViewElement(modelElement: model.Element): view.Element | undefined; + toViewPosition(modelPosition: model.Position, options?: {isPhantom: boolean}): view.Position; + toViewRange(modelRange: model.Range): view.Range; + unbindElementsFromMarkerName(name: string): void; + unbindModelElement(modelElement: model.Element): void; + unbindViewElement(viewElement: view.Element): void; + } + + // engine/conversion/modelconsumable + + class ModelConsumable { + constructor(); + add(item: model.Item | model.Selection | model.Range, type: string): void; + consume(item: model.Item | model.Selection | model.Range, type: string): boolean; + revert(item: model.Item | model.Selection | model.Range, type: string): null | boolean; + test(item: model.Item | model.Selection | model.Range, type: string): null | boolean; + } + + // engine/conversion/upcast-converters + + function convertText(): Function; + + function convertToModelFragment(): Function; + + function upcastAttributeToAttribute( + config: {view: string | {key: string, name: string, value: string | RegExp | Function}, + model: string | {key: string, value: string | Function}, + converterPriority?: ckutils.PriorityString} + ): Function; + + function upcastElementToAttribute( + config: {view: view.MatcherPattern, model: string | {key: string, value: string | Function}, converterPriority?: ckutils.PriorityString} + ): Function; + + function upcastElementToElement( + config: {view: view.MatcherPattern, model: string | Element | Function, converterPriority?: ckutils.PriorityString} + ): Function; + + function upcastElementToMarker( + config: {view: view.MatcherPattern, model: string | Function, converterPriority?: ckutils.PriorityString} + ): Function; + + // engine/conversion/upcast-selection-converters + + function convertSelectionChange(model: model.Model, mapper: Mapper): Function; + + // engine/conversion/upcastdispatcher + + class UpcastDispatcher { + // TODO + } + + interface ViewConversionApi { + // TODO + } + + // engine/conversion/viewconsumable + + class ViewConsumable { + // TODO + } +} + +export namespace dataprocessor { + // engine/dataprocessor/basichtmlwriter + + class BasicHtmlWriter implements HtmlWriter { + getHtml(fragment: model.DocumentFragment): string; + } + + // engine/dataprocessor/dataprocessor + + interface DataProcessor { + // TODO + } + + // engine/dataprocessor/htmldataprocessor + + class HtmlDataProcessor implements DataProcessor { + // TODO + } + + // engine/dataprocessor/htmlwriter + + interface HtmlWriter { + getHtml(fragment: model.DocumentFragment): string; + } + + // engine/dataprocessor/xmldataprocessor + + class XmlDataProcessor implements DataProcessor { + // TODO + } +} + +export namespace devUtils { + // engine/dev-utils/enableenginedebug + + class DebugPlugin {} + + function disableEngineDebug(): void; + + function enableEngineDebug(_logger: {log: (...arg: any[]) => string, error: (...arg: any[]) => string}): DebugPlugin; + + // engine/dev-utils/model + + namespace devmodel { + function getData( + model: model.Model, + options?: { + withoutSelection?: boolean, + rootName?: string, + convertMarkers?: boolean + } + ): string; + + function parse( + data: string, + schema: model.Schema, + batch: model.Batch, + options?: { + selectionAttributes?: Object[], + lastRangeBackward?: boolean, + context?: model.SchemaContextDefinition + } + ): model.Element | model.Text | model.DocumentFragment | Object; + + function setData(model: string, data: Object, options: {rootName?: string, selectionAttributes?: Object[], lastRangeBackward?: boolean, batchType?: string}): void; + + function stringify( + node: model.RootElement | model.Element | model.Text | model.DocumentFragment, + selectionOrPositionOrRange: model.Selection | model.Position | model.Range, // TODO optional + markers: Iterable | null + ): string; + } + + // engine/dev-utils/operationreplayer + + class OperationReplayer { + // TODO + } + + // engine/dev-utils/view + + function getData( + view: view.View, + options?: { + withoutSelection?: boolean, + rootName?: boolean, + showType?: boolean, + showPriority?: boolean, + showAttributeElementId?: boolean, + renderUIElements?: boolean, + } + ): string; + + function parse( + data: string, + options: { + order?: number[], + lastRangeBackward?: boolean, + rootElement?: view.Element | view.DocumentFragment, + sameSelectionCharacters?: boolean + } + ): view.Text | view.Element | view.DocumentFragment | Object; + + function setData( + view: view.View, + data: string, + options: {rootName?: string} + ): void; + + function stringify( + node: view.Text | view.Element | view.DocumentFragment, + selectionOrPositionOrRange?: view.DocumentSelection | view.Position | view.Range, + options?: { + showType?: boolean, + showPriority?: boolean, + showAttributeElementId?: boolean, + ignoreRoot?: boolean, + sameSelectionCharacters?: boolean, + renderUIElements?: boolean, + } + ): string; +} + +export namespace model { + namespace operation { + // engine/model/operation/attributeoperation + + class AttributeOperation { + // TODO + } + + // engine/model/operation/detachoperation + + class DetachOperation { + // TODO + } + + // engine/model/operation/insertoperation + + class InsertOperation { + // TODO + } + + // engine/model/operation/markeroperation + + class MarkerOperation { + // TODO + } + + // engine/model/operation/mergeoperation + + class MergeOperation { + // TODO + } + + // engine/model/operation/moveoperation + + class MoveOperation { + // TODO + } + + // engine/model/operation/nooperation + + class NoOperation { + // TODO + } + + // engine/model/operation/operation + + class Operation { + // TODO + } + + // engine/model/operation/operationfactory + + class OperationFactory { + // TODO + } + + // engine/model/operation/renameoperation + + class RenameOperation { + // TODO + } + + // engine/model/operation/rootattributeoperation + + class RootAttributeOperation { + // TODO + } + + // engine/model/operation/splitoperation + + class SplitOperation { + // TODO + } + + // engine/model/operation/transform + + class TransformationContext { + // TODO + } + + function transform(a: Operation, b: Operation, context: TransformationContext): Operation[]; + + function transformSets(operationsA: Operation[], operationsB: Operation[], options: {document: Document | null, useRelations: boolean, padWithNoOps: boolean}): object; + } + + namespace utils { + function deleteContent( + model: Model, + selection: Selection | DocumentSelection, + batch: Batch, + options?: {leaveUnmerged: boolean, doNotResetEntireContent: boolean} + ): void; + + function getSelectedContent( + model: Model, + selection: Selection | DocumentSelection + ): DocumentFragment; + + function insertContent( + model: Model, + content: DocumentFragment | Item, + selectable?: Selection | DocumentSelection | Position | Element | Iterable | Range | null + ): void; + + function modifySelection( + model: Model, + selection: Selection | DocumentSelection, + options?: {direction?: "forward" | "backward", unit?: "character" | "codePoint" | "word"} + ): void; + + function injectSelectionPostFixer( + model: Model + ): void; + } + + // engine/model/batch + + class Batch { + // TODO + } + + // engine/model/differ + + class Differ { + // TODO + } + + // engine/model/document + + class Document { + // TODO + } + + // engine/model/documentfragment + + class DocumentFragment { + readonly childCount: number; + readonly isEmpty: boolean; + readonly markers: Map; + readonly maxOffset: number; + readonly parent: null; + readonly root: DocumentFragment; + + protected constructor(children?: Node | Iterable); + [Symbol.iterator](): Iterator; + getChild(index: number): Node | null; + getChildIndex(node: Node): number | null; + getChildStartOffset(node: Node): number | null; + getChildren(): Iterable; + getNodeByPath(relativePath: number[]): Node | DocumentFragment; + getPath(): number[]; /*TS3.0: []*/ + is(type: string): boolean; + offsetToIndex(offset: number): number; + toJSON(): Object; + protected _appendChild(items: Item | Iterable): void; + protected _insertChild(index: number, items: Item | Iterable): void; + protected _removeChildren(index: number, howMany?: number): Node[]; + + static fromJSON(json: object): DocumentFragment; + } + + // engine/model/documentselection + + class DocumentSelection { + // TODO + } + + // engine/model/element + + class Element extends Node { + readonly childCount: number; + readonly isEmpty: boolean; + readonly maxOffset: number; + readonly name: string; + + protected constructor( + name: string, + attrs?: Map | ReadonlyArray<[string, any]>, + children?: Node | Iterable + ); + getChild(index: number): Node; + getChildIndex(node: Node): number; + getChildStartOffset(node: Node): number; + getChildren(): Iterable; + getNodeByPath(relativePath: number[]): Node; + is(type: string, name?: string): boolean; + offsetToIndex(offset: number): number; + toJSON(): object; + protected _appendChild(nodes: Item | Iterable): void; + protected _clone(deep?: boolean): Element; + protected _insertChild(index: number, items: Item | Iterable): void; + protected _removeChildren(index: number, howMany?: number): Node[]; + + static fromJSON(json: object): Element; + } + + // engine/model/history + + class History { + // TODO + } + + // engine/model/item + + type Item = Node | TextProxy; + + // engine/model/liveposition + + class LivePosition { + // TODO + } + + // engine/model/liverange + + class LiveRange { + // TODO + } + + // engine/model/markercollection + + class Marker { + // TODO + } + + class MarkerCollection { + // TODO + } + + // engine/model/model + + class Model implements ckutils.Emitter, ckutils.Observable { + readonly document: Document; + readonly markers: MarkerCollection; + readonly schema: Schema; + + applyOperation(operation: operation.Operation): void; + change(callback: Function): any; + deleteContent(selection: Selection | DocumentSelection, batch: Batch, options: {leaveUnmerged?: boolean, doNotResetEntireContent?: boolean}): void; + destroy(): void; + enqueueChange(batchOrType: Batch | "transparent" | "default", callback: Function): void; + getSelectedContent(selection: Selection | DocumentSelection): DocumentFragment; + hasContent(rangeOrElement: Range | Element): boolean; + insertContent(content: DocumentFragment | Item, selectable?: Selection | DocumentSelection | Position | Element | Iterable | Range | null): void; + modifySelection(selection: Selection | DocumentSelection, options?: {direction?: "forward" | "backward", unit?: "character" | "codePoint" | "word"}): void; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + } + + // engine/model/node + + class Node { + readonly document: Document | null; + readonly endOffset: number | null; + readonly index: number | null; + readonly nextSibling: Node | null; + readonly offsetSize: number; + readonly parent: Element | DocumentFragment | null; + readonly previousSibling: Node | null; + readonly root: Node | DocumentFragment; + readonly startOffset: number | null; + + constructor(attrs?: Map | ReadonlyArray<[string, any]>); + getAncestors(options: {includeSelf: boolean, parentFirst: boolean}): Node[]; + getAttribute(key: string): any /*| undefined*/; + getAttributeKeys(): Iterable; + getAttributes(): Iterable; + getCommonAncestor(node: Node, options?: {includeSelf: boolean}): Element | DocumentFragment | null; + getPath(): number[]; + hasAttribute(key: string): boolean; + + is(type: "element"): this is Element; + is(type: "rootElement"): this is RootElement; + is(type: "text"): this is Text; + is(type: "textProxy"): this is TextProxy; + is(type: "documentFragment"): this is DocumentFragment; + is(type: string, name: string): boolean; + + isAfter(node: Node): boolean; + isBefore(node: Node): boolean; + toJSON(): object; + } + + type NodeSet = Node | TextProxy | string | NodeList | DocumentFragment | Iterable; + + // engine/model/nodelist + + class NodeList implements Iterable { + readonly length: number; + readonly maxOffset: number; + + [Symbol.iterator](): Iterator; + getNode(index: number): Node | null; + getNodeIndex(node: Node): number | null; + getNodeStartOffset(node: Node): number | null; + indexToOffset(index: number): number; + offsetToIndex(offset: number): number; + toJSON(): Node[]; + } + + // engine/model/position + + class Position { + readonly index: number; + readonly isAtEnd: boolean; + readonly isAtStart: boolean; + readonly nodeAfter: Node | null; + readonly nodeBefore: Node; + offset: number; + readonly parent: Element; + readonly path: number[]; + readonly root: Element | DocumentFragment; + stickiness: PositionStickiness; + readonly textNode: Text | null; + + constructor(root: Element | DocumentFragment, path: number[], stickiness?: PositionStickiness); + compareWith(otherPosition: Position): PositionRelation; + getAncestors(): Item[]; + getCommonAncestor(position: Position): Element | DocumentFragment | null; + getCommonPath(position: Position): number[]; + getLastMatchingPosition(skip: (t: TreeWalkerValue) => boolean, options: object): Position; + getParentPath(): number[]; + getShiftedBy(shift: number): Position; + getTransformedByOperation(operation: operation.Operation): Position; + hasSameParentAs(position: Position): boolean; + isAfter(otherPosition: Position): boolean; + isBefore(otherPosition: Position): boolean; + isEqual(otherPosition: Position): boolean; + isTouching(otherPosition: Position): boolean; + toJSON(): object; + + static createAfter(item: Item): Position; + static createAt(itemOrPosition: Item | Position, offset?: number | "end" | "before" | "after"): void; + static createBefore(item: Item): Position; + static createFromParentAndOffset(parent: Element | DocumentFragment, offset: number): Position; + static createFromPosition(position: Position): Position; + static fromJSON(json: object, doc: Document): Position; + } + + type PositionRelation = "before" | "after" | "same"; + + type PositionStickiness = "toNone" | "toNext" | "toPrevious"; + + // engine/model/range + + class Range implements Iterable { + readonly end: Position; + isCollapsed: boolean; + isFlat: boolean; + root: Element | DocumentFragment; + readonly start: Position; + + constructor(start: Position, end?: Position); + [Symbol.iterator](): Iterator; + containsItem(item: Item): void; + containsPosition(position: Position): boolean; + containsRange(otherRange: Range, loose?: boolean): boolean; + getCommonAncestor(): Element | DocumentFragment | null; + getDifference(otherRange: Range): Range[]; + getIntersection(otherRange: Range): Range | null; + getMinimalFlatRanges(): Range[]; + getPositions(options: object): Iterable; + getTransformedByOperation(operation: operation.Operation): Range[]; + getTransformedByOperations(operations: Iterable): Range[]; + getWalker(options: { + startPosition: Position, + singleCharacters: boolean, + shallow: boolean, + ignoreElementEnd: boolean, + }): void; + isEqual(otherRange: Range): boolean; + isIntersecting(otherRange: Range): boolean; + toJSON(): object; + } + + function getItems(options: object): Iterable; + + // engine/model/rootelement + + class RootElement extends Element { + readonly document: Document | null; + readonly rootName: string; + + constructor(doc: Document, name: string, rootName: string); + // TODO: toJSON(): string; + } + + // engine/model/schema + + class Schema { + // TODO + } + + class SchemaContext { + // TODO + } + + interface SchemaCompiledItemDefinition { + name: string; + allowIn: string | string[]; + allowAttributes: string | string[]; + isBlock: boolean; + isLimit: boolean; + isObject: boolean; + } + + type SchemaContextDefinition = Node | Position | SchemaContext | string | Array; + + interface SchemaContextItem { + name: string; + getAttributeKeys: Iterable; + getAttribute: (key: string) => string; + } + + interface SchemaItemDefinition { + allowIn: string | string[]; + allowAttributes: string | string[]; + allowContentOf: string | string[]; + allowWhere: string | string[]; + allowAttributesOf: string | string[]; + inheritTypesFrom: string | string[]; + inheritAllFrom: string | string[]; + isBlock: boolean; + isLimit: boolean; + isObject: boolean; + } + + // engine/model/selection + + class Selection implements ckutils.Emitter { + // TODO + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + } + + // engine/model/text + + class Text extends Node { + readonly data: string; + protected _data: string; + + protected constructor(data: string, attrs?: Map | ReadonlyArray<[string, any]>); + toJSON(): object; + protected _clone(): Text; + + static fromJSON(json: object): Text; + } + + // engine/model/textproxy + + class TextProxy { + readonly data: string; + readonly document: Document | null; + readonly endOffset: number; + readonly isPartial: boolean; + readonly offsetInText: number; + readonly offsetSize: number; + readonly parent: Element | DocumentFragment | null; + readonly root: Node | DocumentFragment; + readonly startOffset: number; + readonly textNode: Text; + + protected constructor(textNode: Text, offsetInText: number, length: number); + getAncestors(options: {includeSelf?: boolean, parentFirst?: boolean}): Array; + getAttribute(key: string): any; + getAttributeKeys(): Iterable; + getAttributes(): Iterable; + getPath(): number[]; + hasAttribute(key: string): boolean; + is(type: "textProxy"): this is TextProxy; + is(type: string): boolean; + } + + // engine/model/treewalker + + class TreeWalker implements Iterable { + readonly boundaries: Range; + readonly direction: "backward" | "forward"; + readonly ignoreElementEnd: boolean; + readonly position: Position; + readonly shallow: boolean; + readonly singleCharacters: boolean; + + constructor(options?: { + direction?: "forward" | "backward", + boundaries?: Range, + startPosition: Position, + singleCharacters?: boolean, + shallow?: boolean, + ignoreElementEnd?: boolean + }); + [Symbol.iterator](): Iterator; + next(): TreeWalkerValue; + skip(skip: (t: TreeWalkerValue) => boolean): void; + } + + interface TreeWalkerValue { + item: Item; + length: number; + nextPosition: Position; + previousPosition: Position; + type: TreeWalkerValueType; + } + + type TreeWalkerValueType = "elementStart" | "elementEnd" | "character" | "text"; + + // engine/model/writer + + class Writer { + // TODO + } +} + +export namespace utils { + // engine/utils/bindtwostepcarettoattribute + + function bindTwoStepCaretToAttribute(view: view.View, model: model.Model, emitter: ckutils.Emitter, attribute: string): void; +} + +export namespace view { + namespace observer { + // engine/view/observer/clickobserver + + class ClickObserver extends DomEventObserver { + // TODO + } + + // engine/view/observer/compositionobserver + + class CompositionObserver extends DomEventObserver { + // TODO + } + + // engine/view/observer/domeventdata + + class DomEventData { + // TODO + } + + // engine/view/observer/domeventobserver + + class DomEventObserver extends Observer { + readonly domEventType: string | string[]; + useCapture: boolean; + + fire(eventType: string, domEvent: Event, additionalData?: Object): void; + onDomEvent(): void; + } + + // engine/view/observer/fakeselectionobserver + + class FakeSelectionObserver extends Observer { + constructor(view: View); + destroy(): void; + observe(): void; + } + + // engine/view/observer/focusobserver + + class FocusObserver extends DomEventObserver { + // TODO + } + + // engine/view/observer/keyobserver + + class KeyEventData extends DomEventData implements ckutils.KeystrokeInfo { + // KeystrokeInfo + altKey?: boolean; + ctrlKey?: boolean; + keyCode: number; + keystroke: number; + shiftKey?: boolean; + } + + class KeyObserver extends DomEventObserver { + // TODO + } + + // engine/view/observer/mouseobserver + + class MouseObserver extends DomEventObserver { + // TODO + } + + // engine/view/observer/mutationobserver + + class MutationObserver extends Observer { + domConverter: DomConverter; + renderer: Renderer; + } + + interface MutatedChildren { + newChildren: Node[]; + node: Element; + oldChildren: Node[]; + type: string; + } + + interface MutatedText { + newText: string; + node: Text; + oldText: string; + type: string; + } + + // engine/view/observer/observer + + class Observer { + readonly document: Document; + readonly isEnabled: boolean; + readonly view: View; + + constructor(view: View); + destroy(): void; + disable(): void; + enable(): void; + observe(domElement: HTMLElement, name: string): void; + } + + // engine/view/observer/selectionobserver + + class SelectionObserver extends Observer { + readonly domConverter: DomConverter; + readonly mutationObserver: MutationObserver; + readonly selection: DocumentSelection; + } + } + + // engine/view/attributeelement + + class AttributeElement extends Element { + readonly id: string | number; + readonly priority: number; + protected _clonesGroup: Set | null; + protected _id: string | number; + protected _priority: number; + + static DEFAULT_PRIORITY: number; + + protected constructor( + name: string, + attrs?: object | Iterable<[string, string]> | Map, + children?: Node | Iterable + ); + getElementsWithSameId(): Set; + getFillerOffset(): number | null; + isSimilar(otherElement: Element): boolean; + protected _clone(deep: boolean): AttributeElement; + } + + // engine/view/containerelement + + class ContainerElement extends Element { + protected constructor( + name: string, + attrs?: object | Iterable<[string, string]> | Map, + children?: Node | Iterable + ); + getFillerOffset(): number | null; + } + + // engine/view/document + + class Document implements ckutils.Emitter, ckutils.Observable { + readonly isComposing: boolean; + readonly isFocused: boolean; + isReadOnly: boolean; + readonly roots: ckutils.Collection; + readonly selection: DocumentSelection; + + constructor(); + getRoot(name?: string): RootEditableElement | null; + registerPostFixer(postFixer: (downcastWriter: DowncastWriter) => boolean): void; + protected _callPostFixers(writer: DowncastWriter): void; + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + } + + type ChangeType = "children" | "attributes" | "text"; + + // engine/view/documentfragment + + class DocumentFragment { + readonly childCount: number; + readonly isEmpty: boolean; + readonly parent: null; + readonly root: DocumentFragment; + protected _children: Element[]; + + protected constructor(children?: Node | Iterable); + [Symbol.iterator](): Iterator; + _appendChild(items: Item | Iterable): number; + _insertChild(index: number, items: Item | Iterable): number; + _removeChildren(index: number, howMany?: number): Node[]; + getChild(index: number): Node; + getChildIndex(node: Node): number; + getChildren(): Iterable; + is(type: string): boolean; + } + + // engine/view/documentselection + + class DocumentSelection { + // TODO + } + + // engine/view/domconverter + + class DomConverter { + // TODO + } + + // engine/view/downcastwriter + + class DowncastWriter { + // TODO + } + + // engine/view/editableelement + + class EditableElement extends ContainerElement { + // TODO + } + + // engine/view/element + + class Element extends Node { + readonly childCount: number; + readonly isEmpty: boolean; + readonly name: string; + protected _attrs: Map; + protected _children: Node[]; + protected _classes: Set; + protected _customProperties: Map; + protected _styles: Map; + + protected constructor( + name: string, + attrs?: object | Iterable<[string, string]> | Map, + children?: Node | Iterable + ); + _removeChildren(index: number, howMany?: number): Node[]; + _removeClass(className: string[] | string): void; + findAncestor(patterns: Object | string | RegExp | Function): Element | null; + getAttribute(key: string): string | undefined; + getAttributeKeys(): Iterable; + getAttributes(): Iterable; + getChild(index: number): Node; + getChildIndex(node: Node): number; + getChildren(): Iterable; + getClassNames(): Iterable; + getCustomProperties(): Iterable; + getCustomProperty(key: string | symbol): any; + getFillerOffset(): void; + getIdentity(): string; + getStyle(property: string): string | undefined; + getStyleNames(): Iterable; + hasAttribute(key: string): boolean; + hasClass(className: string): void; + hasStyle(property: string): void; + is(type: string, name?: string): boolean; + isSimilar(otherElement: Element): boolean; + protected _addClass(className: string[] | string): void; + protected _appendChild(items: Item | Iterable): number; + protected _clone(deep?: boolean): Element; + protected _insertChild(index: number, items: Item | Iterable): number; + protected _removeAttribute(key: string): boolean; + protected _removeCustomProperty(key: string | symbol): boolean; + protected _removeStyle(property: string[] | string): void; + protected _setAttribute(key: string, value: string): void; + protected _setCustomProperty(key: string | symbol, value: any): void; + protected _setStyle(property: string | {[key: string]: string}, value?: string): void; + } + + // engine/view/elementdefinition + + type ElementDefinition = string | { + attributes?: {[key: string]: string}; + classes?: string | string[]; + name: string; + priority?: number; + styles?: {[key: string]: string}; + }; + + // engine/view/emptyelement + + class EmptyElement extends Element { + protected constructor( + name: string, + attrs?: object | Iterable<[string, string]> | Map, + children?: Node | Iterable + ); + getFillerOffset(): null; + } + + // engine/view/filler + + const INLINE_FILLER_LENGTH: number; + + const INLINE_FILLER: string; + + function BR_FILLER(): void; + + function NBSP_FILLER(): void; + + function getDataWithoutFiller(domText: Text): string; + + function injectQuirksHandling(view: View): void; + + function isBlockFiller(domNode: /*TODO globals.*/Node, blockFiller: Function): boolean; + + function isInlineFiller(domText: /*TODO globals.*/Text): boolean; + + function startsWithFiller(domNode: /*TODO globals.*/Text): boolean; + + // engine/view/item + + type Item = Node | TextProxy; + + // engine/view/matcher + + class Matcher { + // TODO + } + + type MatcherPattern = + ((element: Element) => null | {name: boolean; attribute?: string[]; }) | + string | + RegExp | + { + attributes?: {[key: string]: string | RegExp | boolean}; + classes?: string | RegExp | Array; + name?: string | RegExp; + styles?: {[key: string]: string | RegExp}; + }; + + // engine/view/node + + class Node { + readonly document: Document | null; + readonly index: number | null; + readonly nextSibling: Node | null; + readonly parent: Element | DocumentFragment | null; + readonly previousSibling: Node | null; + readonly root: Node | DocumentFragment; + + constructor(); + _fireChange(type: ChangeType, node: Node): void; + getAncestors(options: {includeSelf: boolean, parentFirst?: boolean}): Array; + getCommonAncestor(node: Node, options: {includeSelf?: boolean}): Element | DocumentFragment | null; + getPath(): number[]; + + is(type: "element"): this is Element; + is(type: "containerElement"): this is ContainerElement; + is(type: "attributeElement"): this is AttributeElement; + is(type: "emptyElement"): this is EmptyElement; + is(type: "uiElement"): this is UIElement; + is(type: "documentFragment"): this is DocumentFragment; + is(type: "text"): this is Text; + is(type: "textProxy"): this is TextProxy; + is(type: string, name: string): boolean; + + isAfter(node: Node): boolean; + isBefore(node: Node): boolean; + isSimilar(otherElement: Node): boolean; + toJSON(): object; + protected _clone(): Node; + protected _remove(): void; + } + + // engine/view/placeholder + + function attachPlaceholder(view: View, element: Element, placeholderText: string, checkFunction?: Function): void; + + function detachPlaceholder(view: View, element: Element): void; + + // engine/view/position + + class Position { + // TODO + } + + type PositionRelation = "before" | "after" | "same" | "different"; + + // engine/view/range + + class Range { + // TODO + } + + // engine/view/renderer + + class Renderer { + // TODO + } + + // engine/view/rooteditableelement + + class RootEditableElement extends EditableElement { + // TODO + } + + // engine/view/selection + + class Selection { + // TODO + } + + // engine/view/text + + class Text extends Node { + readonly data: string; + protected _data: string; + protected _textData: string; + + protected constructor(data: string); + isSimilar(otherNode: Text): boolean; + protected _clone(): Text; + } + + // engine/view/textproxy + + class TextProxy { + readonly data: string; + readonly document: Document | null; + readonly isPartial: boolean; + readonly offsetInText: number; + readonly offsetSize: number; + readonly parent: Element | DocumentFragment | null; + readonly root: Node | DocumentFragment; + readonly textNode: Text; + + protected constructor(textNode: Text, offsetInText: number, length: number); + getAncestors(options: {includeSelf?: boolean, parentFirst?: boolean}): Array; + is(type: "textProxy"): this is TextProxy; + is(type: string): boolean; + } + + // engine/view/treewalker + + class TreeWalker { + readonly boundaries: Range; + readonly direction: TreeWalkerDirection; + readonly ignoreElementEnd: boolean; + readonly position: Position; + readonly shallow: boolean; + readonly singleCharacters: boolean; + + constructor(options: { + boundaries?: Range, + startPosition?: Position, + direction?: TreeWalkerDirection, + singleCharacters?: boolean, + shallow?: boolean, + ignoreElementEnd?: boolean; + }); + [Symbol.iterator](): Iterator; + next(): TreeWalkerValue; + skip(skip: (treeWalkerValue: TreeWalkerValue) => boolean): void; + } + + type TreeWalkerDirection = "forward" | "backward"; + + interface TreeWalkerValue { + item: Item; + length: number; + nextPosition: Position; + previousPosition: Position; + type: TreeWalkerValueType; + } + + type TreeWalkerValueType = "elementStart" | "elementEnd" | "text"; + + // engine/view/uielement + + class UIElement extends Element { + protected constructor( + name: string, + attrs?: object | Iterable<[string, string]> | Map, + children?: Node | Iterable + ); + getFillerOffset(): null; + render(domDocument: /*TODO: globals.*/Document): HTMLElement; + toDomElement(domDocument: /*TODO: globals.*/Document): HTMLElement; + } + + // engine/view/upcastwriter + + class UpcastWriter { + // TODO + } + + // engine/view/view + + class View implements ckutils.Emitter, ckutils.Observable { + // TODO + + // Emitter + delegate(...events: string[]): ckutils.EmitterMixinDelegateChain; + fire(eventOrInfo: string | ckutils.EventInfo, ...args: any[]): any; + listenTo(emitter: ckutils.Emitter, event: string, callback: Function, options?: {priority?: ckutils.PriorityString | number }): void; + off(event: string, callback?: Function): void; + on(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + once(event: string, callback: Function, options?: {priority: ckutils.PriorityString | number}): void; + stopDelegating(event?: string, emitter?: ckutils.Emitter): void; + stopListening(emitter?: ckutils.Emitter, event?: string, callback?: Function): void; + + // Observable + bind(...bindProperties: string[]): ckutils.BindChain; + decorate(methodName: string): void; + set(name: object): void; + set(name: string, value: any): void; + unbind(...unbindProperties: string[]): void; + } +} diff --git a/types/ckeditor__ckeditor5-engine/tsconfig.json b/types/ckeditor__ckeditor5-engine/tsconfig.json new file mode 100644 index 0000000000..36da122d77 --- /dev/null +++ b/types/ckeditor__ckeditor5-engine/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ckeditor__ckeditor5-engine-tests.ts" + ] +} diff --git a/types/ckeditor__ckeditor5-engine/tslint.json b/types/ckeditor__ckeditor5-engine/tslint.json new file mode 100644 index 0000000000..6a214f0cfd --- /dev/null +++ b/types/ckeditor__ckeditor5-engine/tslint.json @@ -0,0 +1,20 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": { + "options": [ + ["Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?"], + ["Number", "Avoid using the `Number` type. Did you mean `number`?"], + ["String", "Avoid using the `String` type. Did you mean `string`?"], + ["Symbol", "Avoid using the `Symbol` type. Did you mean `symbol`?"] + ] + }, + "no-empty-interface": false, + "quotemark": [ + true, + "double", + "avoid-escape", + "avoid-template" + ] + } +} diff --git a/types/ckeditor__ckeditor5-utils/ckeditor__ckeditor5-utils-tests.ts b/types/ckeditor__ckeditor5-utils/ckeditor__ckeditor5-utils-tests.ts index 82c272a6ec..19f21f667a 100644 --- a/types/ckeditor__ckeditor5-utils/ckeditor__ckeditor5-utils-tests.ts +++ b/types/ckeditor__ckeditor5-utils/ckeditor__ckeditor5-utils-tests.ts @@ -489,24 +489,30 @@ utils.mapsEqual(map, map); // utils/mix ================================================================== -class Editor { - b: () => number; -} - interface SomeMixin { a: () => string; } +class Editor implements SomeMixin { + a: () => string; + b() { return 3; } +} + const SomeMixin = { - a() { - return "a"; - } + a() { return "a"; } +}; + +const SomeMixinNum = { + a() { return 3; } }; utils.mix(Editor, SomeMixin); -const mixEditor = new Editor() as Editor & SomeMixin; -mixEditor.a(); -mixEditor.b(); +// $ExpectError +utils.mix(Editor, SomeMixinNum); + +const editor = new Editor(); +str = editor.a(); +num = editor.b(); // utils/nth ================================================================== diff --git a/types/ckeditor__ckeditor5-utils/index.d.ts b/types/ckeditor__ckeditor5-utils/index.d.ts index 8d9d50e889..50571483f8 100644 --- a/types/ckeditor__ckeditor5-utils/index.d.ts +++ b/types/ckeditor__ckeditor5-utils/index.d.ts @@ -367,7 +367,11 @@ export class KeystrokeHandler { destroy(): void; listenTo(emitter: Emitter): void; press(keyEvtData: KeystrokeInfo): boolean; - set(keystroke: string | Array, callback: Function, options?: {priority?: PriorityString | number}): void; + set( + keystroke: string | Array, + callback: (keyEvtData: KeystrokeInfo, cancel: () => void) => void, + options?: {priority?: PriorityString | number} + ): void; } // utils/locale @@ -392,7 +396,7 @@ export function mapsEqual(mapsA: Map, mapsB: Map): boolean; // utils/mix -export function mix(baseClass: {new(): any}, ...mixins: any[]): void; +export function mix(baseClass: {new(...p: any[]): T}, ...mixins: Array>): void; // utils/nth diff --git a/types/classnames/bind.d.ts b/types/classnames/bind.d.ts index 4af94d1835..9befbabd4c 100644 --- a/types/classnames/bind.d.ts +++ b/types/classnames/bind.d.ts @@ -1,3 +1,3 @@ -import * as cn from "./index"; +import classNames = require('./index'); -export function bind(styles: Record): typeof cn; +export function bind(styles: Record): typeof classNames; diff --git a/types/classnames/tsconfig.json b/types/classnames/tsconfig.json index f9b03432fc..0e8475e613 100644 --- a/types/classnames/tsconfig.json +++ b/types/classnames/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/clean-css/clean-css-tests.ts b/types/clean-css/clean-css-tests.ts index 1ba3953cfd..98049b3ef6 100644 --- a/types/clean-css/clean-css-tests.ts +++ b/types/clean-css/clean-css-tests.ts @@ -1,18 +1,20 @@ +// Original by Tanguy Krotoff +// Updated by Andrew Potter import * as CleanCSS from 'clean-css'; -var source = 'a{font-weight:bold;}'; -var minified = new CleanCSS().minify(source).styles; +let source = 'a{font-weight:bold;}'; +console.log(new CleanCSS().minify(source).styles); -var source = '@import url(http://path/to/remote/styles);'; -new CleanCSS().minify(source, function (error, minified) { +source = '@import url(http://path/to/remote/styles);'; +new CleanCSS().minify(source, (error: any, minified: CleanCSS.Output): void => { console.log(minified.styles); }); const pathToOutputDirectory = 'path'; -new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }) - .minify(source, function (error, minified) { +new CleanCSS({ sourceMap: true, rebaseTo: pathToOutputDirectory }) + .minify(source, (error: any, minified: CleanCSS.Output): void => { // access minified.sourceMap for SourceMapGenerator object // see https://github.com/mozilla/source-map/#sourcemapgenerator for more details // see https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L114 on how it's used in clean-css' CLI @@ -20,15 +22,15 @@ new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }) }); const inputSourceMapAsString = 'input'; -new CleanCSS({ sourceMap: inputSourceMapAsString, target: pathToOutputDirectory }) - .minify(source, function (error, minified) { +new CleanCSS({ sourceMap: true, rebaseTo: pathToOutputDirectory }) + .minify(source, inputSourceMapAsString, (error: any, minified: CleanCSS.Output): void => { // access minified.sourceMap to access SourceMapGenerator object // see https://github.com/mozilla/source-map/#sourcemapgenerator for more details // see https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L114 on how it's used in clean-css' CLI console.log(minified.sourceMap); }); -new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }).minify({ +new CleanCSS({ sourceMap: true, rebaseTo: pathToOutputDirectory }).minify({ 'path/to/source/1': { styles: '...styles...', sourceMap: '...source-map...' @@ -37,7 +39,7 @@ new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }).minify({ styles: '...styles...', sourceMap: '...source-map...' } -}, function (error, minified) { +}, (error: any, minified: CleanCSS.Output): void => { // access minified.sourceMap as above console.log(minified.sourceMap); }); @@ -52,3 +54,45 @@ new CleanCSS().minify({ styles: 'contents of file two' } }); + +// new tests - promise resolution +new CleanCSS({ returnPromise: true, rebaseTo: pathToOutputDirectory }).minify(source) + .then((minified: CleanCSS.Output): void => { + console.log(minified.styles); + }).catch((error: any): void => { + console.log(error); + } +); + +new CleanCSS({ returnPromise: true, sourceMap: true }).minify(source) + .then((minified: CleanCSS.Output): void => { + // access minified.sourceMap as above + console.log(minified.sourceMap); + }).catch((error: any): void => { + console.log(error); + } +); + +new CleanCSS({ returnPromise: true, sourceMap: true }).minify(source, inputSourceMapAsString) + .then((minified: CleanCSS.Output): void => { + // access minified.sourceMap as above + console.log(minified.sourceMap); + }).catch((error: any): void => { + console.log(error); + } +); + +// test object return when passing options as object +let CleanCssOptions: CleanCSS.Options = { returnPromise: true }; +new CleanCSS(CleanCssOptions).minify(source) + .then((minified: CleanCSS.Output): void => { + console.log(minified.styles); + }).catch((error: any): void => { + console.log(error); + } +); + +CleanCssOptions = { returnPromise: false }; +new CleanCSS(CleanCssOptions).minify(source, (error: any, minified: CleanCSS.Output): void => { + console.log(minified.styles); +}); diff --git a/types/clean-css/index.d.ts b/types/clean-css/index.d.ts index 012977f035..9f2dfe9358 100644 --- a/types/clean-css/index.d.ts +++ b/types/clean-css/index.d.ts @@ -1,108 +1,690 @@ -// Type definitions for clean-css v3.4.9 +// Type definitions for clean-css 4.2 // Project: https://github.com/jakubpawlowicz/clean-css // Definitions by: Tanguy Krotoff +// Andrew Potter // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// +import { RequestOptions as HttpsRequestOptions } from "https"; +import { RequestOptions as HttpRequestOptions } from "http"; + +/** + * Shared options passed when initializing a new instance of CleanCSS that returns either a promise or output + */ +interface OptionsBase { + /** + * Controls compatibility mode used; defaults to ie10+ using `'*'`. + * Compatibility hash exposes the following properties: `colors`, `properties`, `selectors`, and `units` + */ + compatibility?: "*" | "ie9" | "ie8" | "ie7" | CleanCSS.CompatibilityOptions; + + /** + * Controls a function for handling remote requests; Defaults to the build in `loadRemoteResource` function + */ + fetch?: (uri: string, inlineRequest: HttpRequestOptions | HttpsRequestOptions, inlineTimeout: number, done: (message: string | number, body: string) => void) => void; + + /** + * Controls output CSS formatting; defaults to `false`. + * Format hash exposes the following properties: `breaks`, `breakWith`, `indentBy`, `indentWith`, `spaces`, and `wrapAt`. + */ + format?: "beautify" | "keep-breaks" | CleanCSS.FormatOptions | false; + + /** + * inline option whitelists which @import rules will be processed. Defaults to `'local'` + * Accepts the following values: + * 'local': enables local inlining; + * 'remote': enables remote inlining; + * 'none': disables all inlining; + * 'all': enables all inlining, same as ['local', 'remote']; + * '[uri]': enables remote inlining from the specified uri; + * '![url]': disables remote inlining from the specified uri; + */ + inline?: ReadonlyArray | false; + + /** + * Controls extra options for inlining remote @import rules + */ + inlineRequest?: HttpRequestOptions | HttpsRequestOptions; + + /** + * Controls number of milliseconds after which inlining a remote @import fails; defaults to `5000`; + */ + inlineTimeout?: number; + + /** + * Controls optimization level used; defaults to `1`. + * Level hash exposes `1`, and `2`. + */ + level?: 0 | 1 | 2 | CleanCSS.OptimizationsOptions; + + /** + * Controls URL rebasing; defaults to `true`; + */ + rebase?: boolean; + + /** + * controls a directory to which all URLs are rebased, most likely the directory under which the output file + * will live; defaults to the current directory; + */ + rebaseTo?: string; + + /** + * Controls whether an output source map is built; defaults to `false` + */ + sourceMap?: boolean; + + /** + * Controls embedding sources inside a source map's `sourcesContent` field; defaults to `false` + */ + sourceMapInlineSources?: boolean; +} declare namespace CleanCSS { - interface Options { - // Set to false to disable advanced optimizations - selector & property merging, reduction, etc. - advanced?: boolean; - - // Set to false to disable aggressive merging of properties. - aggressiveMerging?: boolean; - - // Turns on benchmarking mode measuring time spent on cleaning up (run npm run bench to see example) - benchmark?: boolean; - - // Enables compatibility mode - compatibility?: Object; - - // Set to true to get minification statistics under stats property (see test/custom-test.js for examples) - debug?: boolean; - - // A hash of options for @import inliner, see test/protocol-imports-test.js for examples, or this comment for a proxy use case. - inliner?: Object; - - // Whether to keep line breaks (default is false) - keepBreaks?: boolean; - - // * for keeping all (default), 1 for keeping first one only, 0 for removing all - keepSpecialComments?: string | number; - - // Whether to merge @media at-rules (default is true) - mediaMerging?: boolean; - - // Whether to process @import rules - processImport?: boolean; - - // A list of @import rules, can be ['all'] (default), ['local'], ['remote'], or a blacklisted path e.g. ['!fonts.googleapis.com'] - processImportFrom?: Array; - - // Set to false to skip URL rebasing - rebase?: boolean; - - // Path to resolve relative @import rules and URLs - relativeTo?: string; - - // Set to false to disable restructuring in advanced optimizations - restructuring?: boolean; - - // Path to resolve absolute @import rules and rebase relative URLs - root?: string; - - // Rounding precision; defaults to 2; -1 disables rounding - roundingPrecision?: number; - - // Set to true to enable semantic merging mode which assumes BEM-like content (default is false as it's highly likely this will break your stylesheets - use with caution!) - semanticMerging?: boolean; - - // Set to false to skip shorthand compacting (default is true unless sourceMap is set when it's false) - shorthandCompacting?: boolean; - - // Exposes source map under sourceMap property, e.g. new CleanCSS().minify(source).sourceMap (default is false) If input styles are a product of CSS preprocessor (Less, Sass) an input source map can be passed as a string. - sourceMap?: boolean | string; - - // Set to true to inline sources inside a source map's sourcesContent field (defaults to false) It is also required to process inlined sources from input source maps. - sourceMapInlineSources?: boolean; - - // Path to a folder or an output file to which rebase all URLs - target?: string; - } - + /** + * Output returned when calling minify functions + */ interface Output { - // Optimized output CSS as a string + /** + * Optimized output CSS as a string + */ styles: string; - // Output source map (if requested with sourceMap option) + /** + * Output source map if requested with `sourceMap` option + */ sourceMap: string; - // A list of errors raised - errors: Array; + /** + * A list of errors raised + */ + errors: string[]; - // A list of warnings raised - warnings: Array; + /** + * A list of warnings raised + */ + warnings: string[]; - // A hash of statistic information (if requested with debug option) + /** + * Contains statistics on the minify process + */ stats: { - // Original content size (after import inlining) + /** + * Original content size after import inlining + */ originalSize: number; - // Optimized content size + /** + * Optimized content size + */ minifiedSize: number; - // Time spent on optimizations + /** + * Time spent on optimizations in milliseconds + */ timeSpent: number; - // A ratio of output size to input size (e.g. 25% if content was reduced from 100 bytes to 75 bytes) + /** + * `(originalSize - minifiedSize) / originalSize`, e.g. 0.25 if size is reduced from 100 bytes to 75 bytes + */ efficiency: number; }; } + + /** + * Fine grained configuration for compatibility option + */ + interface CompatibilityOptions { + /** + * A hash of compatibility options related to color + */ + colors?: { + /** + * Controls `rgba()` / `hsla()` color support; defaults to `true` + */ + opacity?: boolean; + }; + /** + * A hash of properties that can be set with compatibility + */ + properties?: { + /** + * Controls background-clip merging into shorthand; defaults to `true` + */ + backgroundClipMerging?: boolean; + + /** + * Controls background-origin merging into shorthand; defaults to `true` + */ + backgroundOriginMerging?: boolean; + + /** + * Controls background-size merging into shorthand; defaults to `true` + */ + backgroundSizeMerging?: boolean; + + /** + * controls color optimizations; defaults to `true` + */ + colors?: boolean, + + /** + * Controls keeping IE bang hack; defaults to `false` + */ + ieBangHack?: boolean; + + /** + * Controls keeping IE `filter` / `-ms-filter`; defaults to `false` + */ + ieFilters?: boolean; + + /** + * Controls keeping IE prefix hack; defaults to `false` + */ + iePrefixHack?: boolean; + + /** + * Controls keeping IE suffix hack; defaults to `false` + */ + ieSuffixHack?: boolean; + + /** + * Controls property merging based on understandably; defaults to `true` + */ + merging?: boolean; + + /** + * Controls shortening pixel units into `pc`, `pt`, or `in` units; defaults to `false` + */ + shorterLengthUnits?: false; + + /** + * Controls keeping space after closing brace - `url() no-repeat` into `url()no-repeat`; defaults to `true` + */ + spaceAfterClosingBrace?: true; + + /** + * Controls keeping quoting inside `url()`; defaults to `false` + */ + urlQuotes?: boolean; + + /** + * Controls removal of units `0` value; defaults to `true` + */ + zeroUnits?: boolean; + }; + /** + * A hash of options related to compatibility of selectors + */ + selectors?: { + /** + * Controls extra space before `nav` element; defaults to `false` + */ + adjacentSpace?: boolean; + + /** + * Controls removal of IE7 selector hacks, e.g. `*+html...`; defaults to `true` + */ + ie7Hack?: boolean; + + /** + * Controls a whitelist of mergeable pseudo classes; defaults to `[':active', ...]` + */ + mergeablePseudoClasses?: ReadonlyArray; + + /** + * Controls a whitelist of mergeable pseudo elements; defaults to `['::after', ...]` + */ + mergeablePseudoElements: ReadonlyArray; + + /** + * Controls maximum number of selectors in a single rule (since 4.1.0); defaults to `8191` + */ + mergeLimit: number; + + /** + * Controls merging of rules with multiple pseudo classes / elements (since 4.1.0); defaults to `true` + */ + multiplePseudoMerging: boolean; + }; + /** + * A hash of options related to comparability of supported units + */ + units?: { + /** + * Controls treating `ch` as a supported unit; defaults to `true` + */ + ch?: boolean; + + /** + * Controls treating `in` as a supported unit; defaults to `true` + */ + in?: boolean; + + /** + * Controls treating `pc` as a supported unit; defaults to `true` + */ + pc?: boolean; + + /** + * Controls treating `pt` as a supported unit; defaults to `true` + */ + pt?: boolean; + + /** + * Controls treating `rem` as a supported unit; defaults to `true` + */ + rem?: boolean; + + /** + * Controls treating `vh` as a supported unit; defaults to `true` + */ + vh?: boolean; + + /** + * Controls treating `vm` as a supported unit; defaults to `true` + */ + vm?: boolean; + + /** + * Controls treating `vmax` as a supported unit; defaults to `true` + */ + vmax?: boolean; + + /** + * Controls treating `vmin` as a supported unit; defaults to `true` + */ + vmin?: boolean; + }; + } + + /** + * Fine grained options for configuring the CSS formatting + */ + interface FormatOptions { + /** + * Controls where to insert breaks + */ + breaks?: { + /** + * Controls if a line break comes after an at-rule; e.g. `@charset`; defaults to `false` + */ + afterAtRule?: boolean; + + /** + * Controls if a line break comes after a block begins; e.g. `@media`; defaults to `false` + */ + afterBlockBegins?: boolean; + + /** + * Controls if a line break comes after a block ends, defaults to `false` + */ + afterBlockEnds?: boolean; + + /** + * Controls if a line break comes after a comment; defaults to `false` + */ + afterComment?: boolean; + + /** + * Controls if a line break comes after a property; defaults to `false` + */ + afterProperty?: boolean; + + /** + * Controls if a line break comes after a rule begins; defaults to `false` + */ + afterRuleBegins?: boolean; + + /** + * Controls if a line break comes after a rule ends; defaults to `false` + */ + afterRuleEnds?: boolean; + + /** + * Controls if a line break comes before a block ends; defaults to `false` + */ + beforeBlockEnds?: boolean; + + /** + * Controls if a line break comes between selectors; defaults to `false` + */ + betweenSelectors?: boolean; + }; + /** + * Controls the new line character, can be `'\r\n'` or `'\n'`(aliased as `'windows'` and `'unix'` + * or `'crlf'` and `'lf'`); defaults to system one, so former on Windows and latter on Unix + */ + breakWith?: string; + + /** + * Controls number of characters to indent with; defaults to `0` + */ + indentBy?: number; + + /** + * Controls a character to indent with, can be `'space'` or `'tab'`; defaults to `'space'` + */ + indentWith?: "space" | "tab"; + + /** + * Controls where to insert spaces + */ + spaces?: { + /** + * Controls if spaces come around selector relations; e.g. `div > a`; defaults to `false` + */ + aroundSelectorRelation?: boolean; + + /** + * Controls if a space comes before a block begins; e.g. `.block {`; defaults to `false` + */ + beforeBlockBegins?: boolean; + + /** + * Controls if a space comes before a value; e.g. `width: 1rem`; defaults to `false` + */ + beforeValue?: boolean; + }; + /** + * Controls maximum line length; defaults to `false` + */ + wrapAt?: false | number; + } + + /** + * Fine grained options for configuring optimizations + */ + interface OptimizationsOptions { + 1?: { + /** + * Sets all optimizations at this level unless otherwise specified + */ + all?: boolean; + + /** + * Controls `@charset` moving to the front of a stylesheet; defaults to `true` + */ + cleanupCharsets?: boolean; + + /** + * Controls URL normalization; defaults to `true` + */ + normalizeUrls?: boolean; + + /** + * Controls `background` property optimizations; defaults to `true` + */ + optimizeBackground?: boolean; + + /** + * Controls `border-radius` property optimizations; defaults to `true` + */ + optimizeBorderRadius?: boolean; + + /** + * Controls `filter` property optimizations; defaults to `true` + */ + optimizeFilter?: boolean; + + /** + * Controls `font` property optimizations; defaults to `true` + */ + optimizeFont?: boolean; + + /** + * Controls `font-weight` property optimizations; defaults to `true` + */ + optimizeFontWeight?: boolean; + + /** + * Controls `outline` property optimizations; defaults to `true` + */ + optimizeOutline?: boolean; + + /** + * Controls removing empty rules and nested blocks; defaults to `true` + */ + removeEmpty?: boolean; + + /** + * Controls removing negative paddings; defaults to `true` + */ + removeNegativePaddings?: boolean; + + /** + * Controls removing quotes when unnecessary; defaults to `true` + */ + removeQuotes?: boolean; + + /** + * Controls removing unused whitespace; defaults to `true` + */ + removeWhitespace?: boolean; + + /** + * Contols removing redundant zeros; defaults to `true` + */ + replaceMultipleZeros?: boolean; + + /** + * Controls replacing time units with shorter values; defaults to `true` + */ + replaceTimeUnits?: boolean; + + /** + * Controls replacing zero values with units; defaults to `true` + */ + replaceZeroUnits?: boolean; + + /** + * Rounds pixel values to `N` decimal places; `false` disables rounding; defaults to `false` + */ + roundingPrecision?: boolean; + + /** + * denotes selector sorting method; can be `'natural'` or `'standard'`, `'none'`, or false (the last two + * since 4.1.0); defaults to `'standard'` + */ + selectorsSortingMethod?: "standard" | "natural" | "none"; + + /** + * denotes a number of /*! ... * / comments preserved; defaults to `all` + */ + specialComments?: string; + + /** + * Controls at-rules (e.g. `@charset`, `@import`) optimizing; defaults to `true` + */ + tidyAtRules?: boolean; + + /** + * Controls block scopes (e.g. `@media`) optimizing; defaults to `true` + */ + tidyBlockScopes?: boolean; + + /** + * Controls selectors optimizing; defaults to `true` + */ + tidySelectors?: boolean; + + /** + * Controls removing trailing semicolons in rule; defaults to `false` - means remove + */ + semicolonAfterLastProperty?: boolean; + + /** + * Defines a callback for fine-grained property optimization; defaults to no-op + */ + transform?: (propertyName: string, propertyValue: string, selector?: string) => string; + }; + 2?: { + /** + * Sets all optimizations at this level unless otherwise specified + */ + all?: boolean; + + /** + * Controls adjacent rules merging; defaults to true + */ + mergeAdjacentRules?: boolean; + + /** + * Controls merging properties into shorthands; defaults to true + */ + mergeIntoShorthands?: boolean; + + /** + * Controls `@media` merging; defaults to true + */ + mergeMedia?: boolean; + + /** + * Controls non-adjacent rule merging; defaults to true + */ + mergeNonAdjacentRules?: boolean; + + /** + * Controls semantic merging; defaults to false + */ + mergeSemantically?: boolean; + + /** + * Controls property overriding based on understandably; defaults to true + */ + overrideProperties?: boolean; + + /** + * Controls removing empty rules and nested blocks; defaults to `true` + */ + removeEmpty?: boolean; + + /** + * Controls non-adjacent rule reducing; defaults to true + */ + reduceNonAdjacentRules?: boolean; + + /** + * Controls duplicate `@font-face` removing; defaults to true + */ + removeDuplicateFontRules?: boolean; + + /** + * Controls duplicate `@media` removing; defaults to true + */ + removeDuplicateMediaBlocks?: boolean; + + /** + * Controls duplicate rules removing; defaults to true + */ + removeDuplicateRules?: boolean; + + /** + * Controls unused at rule removing; defaults to false (available since 4.1.0) + */ + removeUnusedAtRules?: boolean; + + /** + * Controls rule restructuring; defaults to false + */ + restructureRules?: boolean; + + /** + * Controls which properties won't be optimized, defaults to `[]` which means all will be optimized (since 4.1.0) + */ + skipProperties?: ReadonlyArray; + }; + } + + /** + * Hash of input source(s). Passing an array of hashes allows you to explicitly specify the order in which the input files + * are concatenated. Whereas when you use a single hash the order is determined by the traversal order of object properties + */ + interface Source { + /** + * Path to file + */ + [path: string]: { + /** + * The contents of the file, should be css + */ + styles: string; + + /** + * The source map of the file, if needed + */ + sourceMap?: string; + }; + } + + /** + * Callback type when fetch is used + */ + type FetchCallback = (message: string | number, body: string) => void; + + /** + * Union of all types acceptable as input for the minify function + */ + type Sources = string | ReadonlyArray | Source | ReadonlyArray | Buffer; + + /** + * Union type for both types of minifier functions + */ + type Minifier = MinifierOutput | MinifierPromise; + + /** + * Interface exposed when a new CleanCSS object is created + */ + interface MinifierOutput { + minify(sources: Sources, callback?: (error: any, output: Output) => void): Output; + minify(sources: Sources, sourceMap: string, callback?: (error: any, output: Output) => void): Output; + } + /** + * Interface exposed when a new CleanCSS object is created with returnPromise set to true + */ + interface MinifierPromise { + minify(sources: Sources, sourceMap?: string): Promise; + } + + /** + * Options when returning a promise + */ + type OptionsPromise = OptionsBase & { + /** + * If you prefer clean-css to return a Promise object then you need to explicitly ask for it; defaults to `false` + */ + returnPromise: true + }; + + /** + * Options when returning an output + */ + type OptionsOutput = OptionsBase & { + /** + * If you prefer clean-css to return a Promise object then you need to explicitly ask for it; defaults to `false` + */ + returnPromise?: false + }; + + /** + * Discriminant union of both sets of options types. If you initialize without setting `returnPromise: true` + * and want to return a promise, you will need to cast to the correct options type so that TypeScript + * knows what the expected return type will be: + * `(options = options as CleanCSS.OptionsPromise).returnPromise = true` + */ + type Options = OptionsPromise | OptionsOutput; + + /** + * Constructor interface for CleanCSS + */ + interface Constructor { + new(options: OptionsPromise): MinifierPromise; + new(options?: OptionsOutput): MinifierOutput; + } } -declare class CleanCSS { - constructor(options?: CleanCSS.Options); - minify(sources: string | Array | Object, callback?: (error: any, minified: CleanCSS.Output) => void): CleanCSS.Output; -} +/** + * Creates a new CleanCSS object which can be used to minify css + */ +declare const CleanCSS: CleanCSS.Constructor; export = CleanCSS; diff --git a/types/clean-css/tslint.json b/types/clean-css/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/clean-css/tslint.json +++ b/types/clean-css/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/clean-css/v3/clean-css-tests.ts b/types/clean-css/v3/clean-css-tests.ts new file mode 100644 index 0000000000..b9b958d51b --- /dev/null +++ b/types/clean-css/v3/clean-css-tests.ts @@ -0,0 +1,54 @@ + +import * as CleanCSS from 'clean-css'; + +var source = 'a{font-weight:bold;}'; +var minified = new CleanCSS().minify(source).styles; + +var source = '@import url(http://path/to/remote/styles);'; +new CleanCSS().minify(source, function (error, minified) { + console.log(minified.styles); +}); + +const pathToOutputDirectory = 'path'; + +new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }) + .minify(source, function (error, minified) { + // access minified.sourceMap for SourceMapGenerator object + // see https://github.com/mozilla/source-map/#sourcemapgenerator for more details + // see https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L114 on how it's used in clean-css' CLI + console.log(minified.sourceMap); +}); + +const inputSourceMapAsString = 'input'; +new CleanCSS({ sourceMap: inputSourceMapAsString, target: pathToOutputDirectory }) + .minify(source, function (error, minified) { + // access minified.sourceMap to access SourceMapGenerator object + // see https://github.com/mozilla/source-map/#sourcemapgenerator for more details + // see https://github.com/jakubpawlowicz/clean-css/blob/master/bin/cleancss#L114 on how it's used in clean-css' CLI + console.log(minified.sourceMap); +}); + +new CleanCSS({ sourceMap: true, target: pathToOutputDirectory }).minify({ + 'path/to/source/1': { + styles: '...styles...', + sourceMap: '...source-map...' + }, + 'path/to/source/2': { + styles: '...styles...', + sourceMap: '...source-map...' + } +}, function (error, minified) { + // access minified.sourceMap as above + console.log(minified.sourceMap); +}); + +new CleanCSS().minify(['path/to/file/one', 'path/to/file/two']); + +new CleanCSS().minify({ + 'path/to/file/one': { + styles: 'contents of file one' + }, + 'path/to/file/two': { + styles: 'contents of file two' + } +}); \ No newline at end of file diff --git a/types/clean-css/v3/index.d.ts b/types/clean-css/v3/index.d.ts new file mode 100644 index 0000000000..87fb7e7f6c --- /dev/null +++ b/types/clean-css/v3/index.d.ts @@ -0,0 +1,108 @@ +// Type definitions for clean-css v3.4.9 +// Project: https://github.com/jakubpawlowicz/clean-css +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare namespace CleanCSS { + interface Options { + // Set to false to disable advanced optimizations - selector & property merging, reduction, etc. + advanced?: boolean; + + // Set to false to disable aggressive merging of properties. + aggressiveMerging?: boolean; + + // Turns on benchmarking mode measuring time spent on cleaning up (run npm run bench to see example) + benchmark?: boolean; + + // Enables compatibility mode + compatibility?: Object; + + // Set to true to get minification statistics under stats property (see test/custom-test.js for examples) + debug?: boolean; + + // A hash of options for @import inliner, see test/protocol-imports-test.js for examples, or this comment for a proxy use case. + inliner?: Object; + + // Whether to keep line breaks (default is false) + keepBreaks?: boolean; + + // * for keeping all (default), 1 for keeping first one only, 0 for removing all + keepSpecialComments?: string | number; + + // Whether to merge @media at-rules (default is true) + mediaMerging?: boolean; + + // Whether to process @import rules + processImport?: boolean; + + // A list of @import rules, can be ['all'] (default), ['local'], ['remote'], or a blacklisted path e.g. ['!fonts.googleapis.com'] + processImportFrom?: Array; + + // Set to false to skip URL rebasing + rebase?: boolean; + + // Path to resolve relative @import rules and URLs + relativeTo?: string; + + // Set to false to disable restructuring in advanced optimizations + restructuring?: boolean; + + // Path to resolve absolute @import rules and rebase relative URLs + root?: string; + + // Rounding precision; defaults to 2; -1 disables rounding + roundingPrecision?: number; + + // Set to true to enable semantic merging mode which assumes BEM-like content (default is false as it's highly likely this will break your stylesheets - use with caution!) + semanticMerging?: boolean; + + // Set to false to skip shorthand compacting (default is true unless sourceMap is set when it's false) + shorthandCompacting?: boolean; + + // Exposes source map under sourceMap property, e.g. new CleanCSS().minify(source).sourceMap (default is false) If input styles are a product of CSS preprocessor (Less, Sass) an input source map can be passed as a string. + sourceMap?: boolean | string; + + // Set to true to inline sources inside a source map's sourcesContent field (defaults to false) It is also required to process inlined sources from input source maps. + sourceMapInlineSources?: boolean; + + // Path to a folder or an output file to which rebase all URLs + target?: string; + } + + interface Output { + // Optimized output CSS as a string + styles: string; + + // Output source map (if requested with sourceMap option) + sourceMap: string; + + // A list of errors raised + errors: Array; + + // A list of warnings raised + warnings: Array; + + // A hash of statistic information (if requested with debug option) + stats: { + // Original content size (after import inlining) + originalSize: number; + + // Optimized content size + minifiedSize: number; + + // Time spent on optimizations + timeSpent: number; + + // A ratio of output size to input size (e.g. 25% if content was reduced from 100 bytes to 75 bytes) + efficiency: number; + }; + } +} + +declare class CleanCSS { + constructor(options?: CleanCSS.Options); + minify(sources: string | Array | Object, callback?: (error: any, minified: CleanCSS.Output) => void): CleanCSS.Output; +} + +export = CleanCSS; \ No newline at end of file diff --git a/types/clean-css/v3/tsconfig.json b/types/clean-css/v3/tsconfig.json new file mode 100644 index 0000000000..8a2c2eae67 --- /dev/null +++ b/types/clean-css/v3/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "clean-css": [ + "clean-css/v3" + ], + "clean-css/*": [ + "clean-css/v3/*" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "clean-css-tests.ts" + ] +} \ No newline at end of file diff --git a/types/clean-css/v3/tslint.json b/types/clean-css/v3/tslint.json new file mode 100644 index 0000000000..a4c53997aa --- /dev/null +++ b/types/clean-css/v3/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} \ No newline at end of file diff --git a/types/clean-regexp/clean-regexp-tests.ts b/types/clean-regexp/clean-regexp-tests.ts new file mode 100644 index 0000000000..e111e4e78e --- /dev/null +++ b/types/clean-regexp/clean-regexp-tests.ts @@ -0,0 +1,12 @@ +import cleanRegexp = require('clean-regexp'); + +// $ExpectType string +cleanRegexp('[0-9]'); +cleanRegexp('[^0-9]'); +cleanRegexp('[a-zA-Z0-9_]'); +cleanRegexp('[a-z0-9_]', 'i'); +cleanRegexp('[^a-zA-Z0-9_]'); +cleanRegexp('[^a-z0-9_]', 'i'); +cleanRegexp('[a-zA-Z\\d_]'); +cleanRegexp('[^a-zA-Z\\d_]'); +cleanRegexp('[0-9]+\\.[a-zA-Z0-9_]?'); diff --git a/types/clean-regexp/index.d.ts b/types/clean-regexp/index.d.ts new file mode 100644 index 0000000000..7418cfd253 --- /dev/null +++ b/types/clean-regexp/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for clean-regexp 1.0 +// Project: https://github.com/samverschueren/clean-regexp#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = cleanRegexp; + +declare function cleanRegexp(regexp: string, flags?: string): string; diff --git a/types/clean-regexp/tsconfig.json b/types/clean-regexp/tsconfig.json new file mode 100644 index 0000000000..e1bbe6de0b --- /dev/null +++ b/types/clean-regexp/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "clean-regexp-tests.ts" + ] +} diff --git a/types/clean-regexp/tslint.json b/types/clean-regexp/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/clean-regexp/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cli-boxes/cli-boxes-tests.ts b/types/cli-boxes/cli-boxes-tests.ts new file mode 100644 index 0000000000..9885f28777 --- /dev/null +++ b/types/cli-boxes/cli-boxes-tests.ts @@ -0,0 +1,17 @@ +import cliBoxes = require('cli-boxes'); + +cliBoxes.single; // $ExpectType BoxDefinition +cliBoxes.double; // $ExpectType BoxDefinition +cliBoxes.round; // $ExpectType BoxDefinition +cliBoxes['single-double']; // $ExpectType BoxDefinition +cliBoxes['double-single']; // $ExpectType BoxDefinition +cliBoxes.classic; // $ExpectType BoxDefinition + +const single = cliBoxes.single; + +single.bottomLeft; // $ExpectType string +single.bottomRight; // $ExpectType string +single.horizontal; // $ExpectType string +single.topLeft; // $ExpectType string +single.topRight; // $ExpectType string +single.vertical; // $ExpectType string diff --git a/types/cli-boxes/index.d.ts b/types/cli-boxes/index.d.ts new file mode 100644 index 0000000000..e3b4c7be79 --- /dev/null +++ b/types/cli-boxes/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for cli-boxes 1.0 +// Project: https://github.com/sindresorhus/cli-boxes +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export = boxes; +declare const boxes: boxes.Boxes; + +declare namespace boxes { + type BoxNames = 'single' | 'double' | 'round' | 'single-double' | 'double-single' | 'classic'; + + type Boxes = Record; + + interface BoxDefinition { + topLeft: string; + topRight: string; + bottomRight: string; + bottomLeft: string; + vertical: string; + horizontal: string; + } +} diff --git a/types/cli-boxes/tsconfig.json b/types/cli-boxes/tsconfig.json new file mode 100644 index 0000000000..f8a8653c69 --- /dev/null +++ b/types/cli-boxes/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cli-boxes-tests.ts" + ] +} diff --git a/types/cli-boxes/tslint.json b/types/cli-boxes/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cli-boxes/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cli-cursor/cli-cursor-tests.ts b/types/cli-cursor/cli-cursor-tests.ts new file mode 100644 index 0000000000..877ce32f94 --- /dev/null +++ b/types/cli-cursor/cli-cursor-tests.ts @@ -0,0 +1,11 @@ +import { show, hide, toggle } from 'cli-cursor'; + +hide(); +hide(process.stderr); + +show(); +show(process.stderr); + +toggle(); +toggle(false); +toggle(false, process.stderr); diff --git a/types/cli-cursor/index.d.ts b/types/cli-cursor/index.d.ts new file mode 100644 index 0000000000..d6decf8479 --- /dev/null +++ b/types/cli-cursor/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for cli-cursor 2.1 +// Project: https://github.com/sindresorhus/cli-cursor#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** + * Show cursor. + * + * @param stream defaults to `process.stderr` + */ +export function show(stream?: NodeJS.WritableStream): void; + +/** + * Hide cursor. + * + * @param stream defaults to `process.stderr` + */ +export function hide(stream?: NodeJS.WritableStream): void; + +/** + * Toggle cursor visibility. + * + * @param force is useful to show or hide the cursor based on a boolean. + * @param stream defaults to `process.stderr` + */ +export function toggle(force?: boolean, stream?: NodeJS.WritableStream): void; diff --git a/types/cli-cursor/tsconfig.json b/types/cli-cursor/tsconfig.json new file mode 100644 index 0000000000..2d57093f55 --- /dev/null +++ b/types/cli-cursor/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cli-cursor-tests.ts" + ] +} diff --git a/types/cli-cursor/tslint.json b/types/cli-cursor/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cli-cursor/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cli-spinners/cli-spinners-tests.ts b/types/cli-spinners/cli-spinners-tests.ts new file mode 100644 index 0000000000..45acb25db7 --- /dev/null +++ b/types/cli-spinners/cli-spinners-tests.ts @@ -0,0 +1,3 @@ +import cliSpinners = require('cli-spinners'); + +cliSpinners.dots; // $ExpectType Spinner diff --git a/types/cli-spinners/index.d.ts b/types/cli-spinners/index.d.ts new file mode 100644 index 0000000000..db04ab5cc1 --- /dev/null +++ b/types/cli-spinners/index.d.ts @@ -0,0 +1,87 @@ +// Type definitions for cli-spinners 1.3 +// Project: https://github.com/sindresorhus/cli-spinners#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export = cliSpinners; + +declare const cliSpinners: Record; + +declare namespace cliSpinners { + type SpinnerName = + | 'dots' + | 'dots2' + | 'dots3' + | 'dots4' + | 'dots5' + | 'dots6' + | 'dots7' + | 'dots8' + | 'dots9' + | 'dots10' + | 'dots11' + | 'dots12' + | 'line' + | 'line2' + | 'pipe' + | 'simpleDots' + | 'simpleDotsScrolling' + | 'star' + | 'star2' + | 'flip' + | 'hamburger' + | 'growVertical' + | 'growHorizontal' + | 'balloon' + | 'balloon2' + | 'noise' + | 'bounce' + | 'boxBounce' + | 'boxBounce2' + | 'triangle' + | 'arc' + | 'circle' + | 'squareCorners' + | 'circleQuarters' + | 'circleHalves' + | 'squish' + | 'toggle' + | 'toggle2' + | 'toggle3' + | 'toggle4' + | 'toggle5' + | 'toggle6' + | 'toggle7' + | 'toggle8' + | 'toggle9' + | 'toggle10' + | 'toggle11' + | 'toggle12' + | 'toggle13' + | 'arrow' + | 'arrow2' + | 'arrow3' + | 'bouncingBar' + | 'bouncingBall' + | 'smiley' + | 'monkey' + | 'hearts' + | 'clock' + | 'earth' + | 'moon' + | 'runner' + | 'pong' + | 'shark' + | 'dqpb' + | 'weather' + | 'christmas' + | 'grenade' + | 'point' + | 'layer'; + + interface Spinner { + interval: number; + frames: string[]; + } +} diff --git a/types/cli-spinners/tsconfig.json b/types/cli-spinners/tsconfig.json new file mode 100644 index 0000000000..8b4a54bd83 --- /dev/null +++ b/types/cli-spinners/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cli-spinners-tests.ts" + ] +} diff --git a/types/cli-spinners/tslint.json b/types/cli-spinners/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cli-spinners/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/clovelced-plugin-audiomanagement/clovelced-plugin-audiomanagement-tests.ts b/types/clovelced-plugin-audiomanagement/clovelced-plugin-audiomanagement-tests.ts new file mode 100644 index 0000000000..ed544553b9 --- /dev/null +++ b/types/clovelced-plugin-audiomanagement/clovelced-plugin-audiomanagement-tests.ts @@ -0,0 +1,29 @@ +import * as AudioManagement from 'clovelced-plugin-audiomanagement'; + +AudioManagement.setAudioMode(AudioManagement.AudioMode.NORMAL, () => { +}, (error: any) => { +}); + +AudioManagement.getAudioMode((results) => { + results.audioMode; + results.label; +}, (error: any) => { +}); + +AudioManagement.setVolume(AudioManagement.VolumeType.MUSIC, 5, () => { +}, (error: any) => { +}); + +AudioManagement.getVolume(AudioManagement.VolumeType.NOTIFICATION, (results) => { + results.volume; +}, (error: any) => { +}); + +AudioManagement.getMaxVolume(AudioManagement.VolumeType.RING, (results) => { + results.maxVolume; +}, (error: any) => { +}); + +AudioManagement.AudioMode.SILENT; +AudioManagement.AudioMode.VIBRATE; +AudioManagement.VolumeType.SYSTEM; diff --git a/types/clovelced-plugin-audiomanagement/index.d.ts b/types/clovelced-plugin-audiomanagement/index.d.ts new file mode 100644 index 0000000000..efd51a941a --- /dev/null +++ b/types/clovelced-plugin-audiomanagement/index.d.ts @@ -0,0 +1,67 @@ +// Type definitions for clovelced-plugin-audiomanagement 1.0 +// Project: https://github.com/clovelCed/cordova-plugin-audiomanagement#readme +// Definitions by: Marc Kassay +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export enum AudioMode { + SILENT = 0, + VIBRATE, + NORMAL +} + +export enum VolumeType { + RING = 0, + MUSIC, + NOTIFICATION, + SYSTEM +} + +/** + * Sets the `AudioManagement.AudioMode` for the device. + * + * @param mode the device can be set to: Silent, Normal, Vibrate + * @param onSuccess a callback when setting succeeds. + * @param onError a callback when setting fails. + * @returns void + */ +export function setAudioMode(mode: AudioMode, onSuccess: () => void, onError: (error: any) => void): void; + +/** + * Gets the current `AudioManagement.AudioMode` of the device. + * + * @param onSuccess a callback when succeeds with an object with `label` and `audioMode` properties. + * @param onError a callback when getting fails. + * @returns void + */ +export function getAudioMode(onSuccess: (results: { audioMode: AudioMode, label: string }) => void, onError: (error: any) => void): void; + +/** + * Sets the specified `AudioManagement.VolumeType` for the device with the value from `volume`. + * + * @param type the `AudioManagement.VolumeType` to set + * @param volume the volume value + * @param onSuccess a callback when setting succeeds. + * @param onError a callback when setting fails. + * @returns void + */ +export function setVolume(type: VolumeType, volume: number, onSuccess: () => void, onError: (error: any) => void): void; + +/** + * Gets the specified `AudioManagement.VolumeType`'s `volume`. + * + * @param type the `AudioManagement.VolumeType` to get + * @param onSuccess a callback when getting succeeds with an object with numeric `volume` property. + * @param onError a callback when getting fails. + * @returns void + */ +export function getVolume(type: VolumeType, onSuccess: (results: { volume: number }) => void, onError: (error: any) => void): void; + +/** + * Gets the specified `AudioManagement.VolumeType`'s maximum `volume` that the device is currently set to. + * + * @param type the `AudioManagement.VolumeType` to get + * @param onSuccess a callback when getting succeeds with an object with numeric `maxVolume` property. + * @param onError a callback when getting fails. + * @returns void + */ +export function getMaxVolume(type: VolumeType, onSuccess: (results: { maxVolume: number }) => void, onError: (error: any) => void): void; diff --git a/types/clovelced-plugin-audiomanagement/tsconfig.json b/types/clovelced-plugin-audiomanagement/tsconfig.json new file mode 100644 index 0000000000..5798a1f280 --- /dev/null +++ b/types/clovelced-plugin-audiomanagement/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "clovelced-plugin-audiomanagement-tests.ts" + ] +} diff --git a/types/clovelced-plugin-audiomanagement/tslint.json b/types/clovelced-plugin-audiomanagement/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/clovelced-plugin-audiomanagement/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/clusterize.js/index.d.ts b/types/clusterize.js/index.d.ts index 7c549761d6..47da5a2140 100644 --- a/types/clusterize.js/index.d.ts +++ b/types/clusterize.js/index.d.ts @@ -32,9 +32,9 @@ declare namespace Clusterize { } interface Callbacks { - clusterWillChange?(cb: () => void): void; - clusterChanged?(cb: () => void): void; - scrollingProgress?(cb: (progress: number) => void): void; + clusterWillChange?: () => void; + clusterChanged?: () => void; + scrollingProgress?: (progress: number) => void; } } diff --git a/types/codemirror/codemirror-tern.d.ts b/types/codemirror/codemirror-tern.d.ts new file mode 100644 index 0000000000..32a6f54e46 --- /dev/null +++ b/types/codemirror/codemirror-tern.d.ts @@ -0,0 +1,96 @@ +// Type definitions for CodeMirror +// Project: https://github.com/marijnh/CodeMirror +// Definitions by: Nikolaj Kappler +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// See docs https://codemirror.net/doc/manual.html#addon_tern and https://codemirror.net/addon/tern/tern.js (comments in the beginning of the file) +// Docs for tern itself might also be helpful: http://ternjs.net/doc/manual.html + +import * as CodeMirror from "codemirror"; +import * as Tern from "tern"; + +declare module "codemirror" { + + interface TernServer { + readonly options: TernOptions; + readonly docs: { + readonly [key: string]: { + doc: CodeMirror.Doc, + name: string, + changed?: { + from: CodeMirror.Position | number, + to: CodeMirror.Position | number + } + } + }; + readonly server: Tern.Server; + addDoc(name: string, doc: CodeMirror.Doc): { doc: CodeMirror.Doc, name: string, changed: { from: number, to: number } | null }; + delDoc(id: string | CodeMirror.Editor | CodeMirror.Doc): void; + hideDoc(id: string | CodeMirror.Editor | CodeMirror.Doc): void; + complete(cm: CodeMirror.Doc): void; + showType(cm: CodeMirror.Doc, pos?: CodeMirror.Position | number, callback?: Function): void; + showDocs(cm: CodeMirror.Doc, pos?: CodeMirror.Position | number, callback?: Function): void; + updateArgHints(cm: CodeMirror.Doc): void; + jumpToDef(cm: CodeMirror.Doc): void; + jumpBack(cm: CodeMirror.Doc): void; + rename(cm: CodeMirror.Doc): void; + selectName(cm: CodeMirror.Doc): void; + request(cm: CodeMirror.Doc, query: Q, callback: (error?: Error, data?: Tern.QueryRegistry[Q["type"]]["result"]) => void, pos?: CodeMirror.Position): void; + request(cm: CodeMirror.Doc, query: Q, callback: (error?: Error, data?: Tern.QueryRegistry[Q]["result"]) => void, pos?: CodeMirror.Position): void; + destroy(): void; + } + + interface TernConstructor { + new(options?: TernOptions): TernServer; + } + export const TernServer: TernConstructor; + + interface TernOptions { + /** An object mapping plugin names to configuration options. */ + plugins?: Tern.ConstructorOptions["plugins"]; + /** An array of JSON definition data structures. */ + defs?: Tern.Def[]; + /** + * Can be used to access files in + * the project that haven't been loaded yet. Simply do callback(null) to + * indicate that a file is not available. + */ + getFile?(name: string, callback: (doc: CodeMirror.Doc | null) => any): any; + /** + * This function will be applied + * to documents before passing them on to Tern. + */ + fileFilter?(value: string, docName: string, doc: CodeMirror.Doc): string; + /** This function should, when providing a multi-file view, switch the view or focus to the named file. */ + switchToDoc?(name: string, doc: CodeMirror.Doc): any; + /** Can be used to override the way errors are displayed. */ + showError?(editor: CodeMirror.Editor, message: Error): any; + /** + * Customize the content in tooltips for completions. + * Is passed a single argument — the completion's data as returned by + * Tern — and may return a string, DOM node, or null to indicate that + * no tip should be shown. By default the docstring is shown. + */ + completionTip?(data: Tern.CompletionsQueryResult): string | HTMLElement | null; + /** Like completionTip, but for the tooltips shown for type queries. */ + typeTip?(data: Tern.TypeQueryResult): string | HTMLElement | null; + /** This function will be applied to the Tern responses before treating them */ + responseFilter?(doc: CodeMirror.Doc, query: Tern.Query, request: Tern.Document, error: Error | undefined, data: Tern.QueryRegistry[Tern.Query["type"]]["result"] | undefined): any; + /** + * Set to true to enable web worker mode. You'll probably + * want to feature detect the actual value you use here, for example + * !!window.Worker. + */ + useWorker?: boolean; + /** The main script of the worker. Point this to wherever you are hosting worker.js from this directory. */ + workerScript?: string; + /** + * An array of paths pointing (relative to workerScript) + * to the Acorn and Tern libraries and any Tern plugins you want to + * load. Or, if you minified those into a single script and included + * them in the workerScript, simply leave this undefined. + */ + workerDeps?: string[]; + } + +} diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index cdc3c4cd7c..bfef4c5e88 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -6,6 +6,7 @@ // rileymiller // toddself // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 export = CodeMirror; export as namespace CodeMirror; diff --git a/types/codemirror/test/tern.ts b/types/codemirror/test/tern.ts new file mode 100644 index 0000000000..2f80a9aabd --- /dev/null +++ b/types/codemirror/test/tern.ts @@ -0,0 +1,24 @@ +const options: CodeMirror.TernOptions = { + + completionTip: (data) => { + const d = data.completions; + return ""; + }, + + showError: (editor, message) => { + alert(message); + } + +}; + +const ts = new CodeMirror.TernServer(options); + +ts.request(cm.getDoc(), "completions", (_e, d) => { + if (d) { + const c = d.completions; + } +}, { ch: 0, line: 0 }); + +ts.complete(cm.getDoc()); + +ts.showType(cm.getDoc()); \ No newline at end of file diff --git a/types/codemirror/tsconfig.json b/types/codemirror/tsconfig.json index d081586f6e..ffa5de2be5 100644 --- a/types/codemirror/tsconfig.json +++ b/types/codemirror/tsconfig.json @@ -19,18 +19,20 @@ }, "files": [ "index.d.ts", + "codemirror-comment.d.ts", "codemirror-matchbrackets.d.ts", "codemirror-panel.d.ts", "codemirror-runmode.d.ts", "codemirror-showhint.d.ts", - "codemirror-comment.d.ts", + "codemirror-tern.d.ts", "searchcursor.d.ts", + "test/comment.ts", "test/index.ts", "test/matchbrackets.ts", "test/panel.ts", "test/runmode.ts", "test/searchcursor.ts", "test/showhint.ts", - "test/comment.ts" + "test/tern.ts" ] } \ No newline at end of file diff --git a/types/coinbase/coinbase-tests.ts b/types/coinbase/coinbase-tests.ts index fb804ac566..65ec9693bd 100644 --- a/types/coinbase/coinbase-tests.ts +++ b/types/coinbase/coinbase-tests.ts @@ -25,7 +25,7 @@ client.getAccount("abcdef", (error: Error, account: coinbase.Account): void => { account.getBuy("abcdef", (error: Error, buy: coinbase.Buy): void => undefined); - account.getBuys((error: Error, buy: coinbase.Buy[]): void => undefined); + account.getBuys(null, (error: Error, buy: coinbase.Buy[]): void => undefined); account.getDeposit("abcdef", (error: Error, deposit: coinbase.Deposit): void => undefined); @@ -33,7 +33,7 @@ client.getAccount("abcdef", (error: Error, account: coinbase.Account): void => { account.getSell("abcdef", (error: Error, deposit: coinbase.Sell): void => undefined); - account.getSells((error: Error, deposit: coinbase.Sell[]): void => undefined); + account.getSells(null, (error: Error, deposit: coinbase.Sell[]): void => undefined); account.getTransaction("abcdef", (error: Error, deposit: coinbase.Transaction): void => undefined); diff --git a/types/coinbase/index.d.ts b/types/coinbase/index.d.ts index 6057f58142..82fc32a7d3 100644 --- a/types/coinbase/index.d.ts +++ b/types/coinbase/index.d.ts @@ -536,6 +536,21 @@ export class Account implements Resource { */ balance: MoneyHash; + /** + * Allow deposits + */ + allow_deposits: boolean; + + /** + * Allow withdrawls + */ + allow_withdrawals: boolean; + + /** + * Account worth in fiat. + */ + native_balance: MoneyHash; + /** * Promote an account as primary account. * Scope: wallet:accounts:update @@ -630,7 +645,7 @@ export class Account implements Resource { * Lists buys for an account. * Scope: wallet:buys:read */ - getBuys(cb: (error: Error, result: Buy[]) => void): void; + getBuys(opts: null, cb: (error: Error, result: Buy[]) => void): void; /** * Show an individual buy. @@ -663,7 +678,7 @@ export class Account implements Resource { * Lists sells for an account. * Scope: wallet:sells:read */ - getSells(cb: (error: Error, result: Sell[]) => void): void; + getSells(opts: null, cb: (error: Error, result: Sell[]) => void): void; /** * Show an individual sell. @@ -883,7 +898,7 @@ export class Buy implements Resource { /** * Fee associated to this buy */ - fee: MoneyHash; + fees: Fee[]; /** * Has this buy been committed? @@ -900,6 +915,26 @@ export class Buy implements Resource { */ payout_at?: string; + /** + * Unit price of the base currency. + */ + unit_price: UnitPrice; + + /** + * Hold period for transfer. + */ + hold_business_days: number; + + /** + * Is it the first buy for this symbol? + */ + is_first_buy: boolean; + + /** + * Is there another action required to make the transfer pass? + */ + requires_completion_step: boolean; + /** * Completes a buy that is created in commit: false state. * If the exchange rate has changed since the buy was created, this call will fail with the error “The exchange rate updated while you @@ -910,6 +945,32 @@ export class Buy implements Resource { commit(cb: (error: Error, transaction: Buy) => void): void; } +export interface Fee { + /** + * Amount associated to this fee + */ + amount: MoneyHash; + /** + * Fee beneficiary ("bank", "coinbase", ...) + */ + type: string; +} + +export interface UnitPrice { + /** + * Amount as floating-point in a string + */ + amount: string; + /** + * Currency e.g. "BTC" (see Client#getCurrencies() for available strings) + */ + currency: string; + /** + * Type of price + */ + scale: number; +} + export type SellStatus = "created" | "completed" | "canceled"; /** diff --git a/types/coinlist/coinlist-tests.ts b/types/coinlist/coinlist-tests.ts new file mode 100644 index 0000000000..17dbbae3df --- /dev/null +++ b/types/coinlist/coinlist-tests.ts @@ -0,0 +1,36 @@ +import coins = require('coinlist'); +import coinsJson = require('coinlist/src/coins.json'); + +// $ExpectType Coin[] & CoinsAPI +coins; + +// $ExpectType Coin[] +coinsJson; + +let coinsArr = [ + { + id: 'bitcoin', + symbol: 'BTC', + name: 'Bitcoin', + }, + { + id: 'litecoin', + symbol: 'LTC', + name: 'Litecoin', + }, +]; + +coinsArr = coins; +coinsArr = coinsJson; + +// $ExpectType Coin | undefined +coins.get('BTC'); + +// $ExpectType string | undefined +coins.get('BTC', 'name'); +// $ExpectType string | undefined +coins.get('BTC', 'symbol'); +// $ExpectType string | undefined +coins.get('BTC', 'id'); + +coins.map(coin => coin.name); diff --git a/types/coinlist/index.d.ts b/types/coinlist/index.d.ts new file mode 100644 index 0000000000..29aaa1dcaa --- /dev/null +++ b/types/coinlist/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for coinlist 3.1 +// Project: https://github.com/lukechilds/coinlist +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import coinsJson = require('./src/coins.json'); + +export = coins; + +declare const coins: coins.Coin[] & coins.CoinsAPI; + +declare namespace coins { + type Coin = coinsJson.Coin; + + interface CoinsAPI { + get(symbol: string): Coin | undefined; + get(symbol: string, property: 'id' | 'symbol' | 'name'): string | undefined; + } +} diff --git a/types/coinlist/src/coins.json.d.ts b/types/coinlist/src/coins.json.d.ts new file mode 100644 index 0000000000..96c947bd8a --- /dev/null +++ b/types/coinlist/src/coins.json.d.ts @@ -0,0 +1,11 @@ +export = coins; + +declare const coins: coins.Coin[]; + +declare namespace coins { + interface Coin { + id: string; + symbol: string; + name: string; + } +} diff --git a/types/coinlist/tsconfig.json b/types/coinlist/tsconfig.json new file mode 100644 index 0000000000..86b93f8380 --- /dev/null +++ b/types/coinlist/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "src/coins.json.d.ts", + "coinlist-tests.ts" + ] +} diff --git a/types/coinlist/tslint.json b/types/coinlist/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/coinlist/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/color-diff/color-diff-tests.ts b/types/color-diff/color-diff-tests.ts new file mode 100644 index 0000000000..684858c203 --- /dev/null +++ b/types/color-diff/color-diff-tests.ts @@ -0,0 +1,17 @@ +import diff from "color-diff"; + +const color = { R: 255, G: 1, B: 30 }; +// red, green, blue +const palette = [ + { R: 255, G: 0, B: 0 }, + { R: 0, G: 255, B: 0 }, + { R: 0, G: 0, B: 255 } +]; + +diff.closest(color, palette); // {R: 255, G: 0, B: 0 }, red + +const color1 = { R: 255, G: 255, B: 255 }; +// black, white +const palette1 = [{ R: 0, G: 0, B: 0 }, { R: 255, G: 255, B: 255 }]; + +diff.furthest(color1, palette1); // {R: 0, G: 0, B: 0 }, black diff --git a/types/color-diff/index.d.ts b/types/color-diff/index.d.ts new file mode 100644 index 0000000000..f331b7203c --- /dev/null +++ b/types/color-diff/index.d.ts @@ -0,0 +1,67 @@ +// Type definitions for color-diff 1.1 +// Project: https://github.com/markusn/color-diff#readme +// Definitions by: katsanva +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +export interface RGBColor { + R: number; + G: number; + B: number; + A?: number; +} + +export interface LabColor { + L: number; + a: number; + b: number; +} + +export function diff(c1: LabColor, c2: LabColor): number; + +export function rgb_to_lab(c: RGBColor): LabColor; +export function rgba_to_lab(c: RGBColor, bc?: RGBColor): LabColor; + +export function closest( + color: RGBColor, + palette: ReadonlyArray, + backgroundColor?: RGBColor +): RGBColor; + +export function furthest( + color: RGBColor, + palette: ReadonlyArray, + backgroundColor?: RGBColor +): RGBColor; + +export function map_palette( + a: ReadonlyArray, + b: ReadonlyArray, + type?: "closest" | "furthest", + backgroundColor?: RGBColor +): { [key: string]: RGBColor }; + +export function palette_map_key(c: RGBColor): string; + +export function closest_lab( + color: LabColor, + palette: ReadonlyArray +): LabColor; + +export function furthest_lab( + color: LabColor, + palette: ReadonlyArray +): LabColor; + +export function map_palette_lab( + p1: ReadonlyArray, + p2: ReadonlyArray +): { [key: string]: LabColor }; + +export function lab_palette_map_key(c: LabColor): string; + +export function match_palette_lab( + target_color: LabColor, + palette: ReadonlyArray, + find_furthest: boolean +): LabColor; diff --git a/types/color-diff/tsconfig.json b/types/color-diff/tsconfig.json new file mode 100644 index 0000000000..b8a60d5c99 --- /dev/null +++ b/types/color-diff/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "color-diff-tests.ts"] +} diff --git a/types/color-diff/tslint.json b/types/color-diff/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/color-diff/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/colornames/colornames-tests.ts b/types/colornames/colornames-tests.ts new file mode 100644 index 0000000000..6fc9bb712a --- /dev/null +++ b/types/colornames/colornames-tests.ts @@ -0,0 +1,29 @@ +import colorNames = require("colornames"); + +// $ExpectType Color +const color = colorNames("red"); + +// $ExpectType string +color.value; +// $ExpectType boolean | undefined +color.css; +// $ExpectType boolean | undefined +color.vga; +// $ExpectType string +color.name; + +// $ExpectType Color +colorNames.get("blue"); +// $ExpectType Color[] +colorNames.get.all(); +// $ExpectType Color[] +colorNames.get.css(); +// $ExpectType Color +colorNames.get.css("orange"); +// $ExpectType Color[] +colorNames.get.vga(); +// $ExpectType Color +colorNames.get.vga("violet"); + +// $ExpectType Color[] +colorNames.all(); diff --git a/types/colornames/index.d.ts b/types/colornames/index.d.ts new file mode 100644 index 0000000000..d9b331167b --- /dev/null +++ b/types/colornames/index.d.ts @@ -0,0 +1,93 @@ +// Type definitions for colornames 1.1 +// Project: https://github.com/timoxley/colornames#readme +// Definitions by: Manuel Thalmann +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Represents a color. + */ +interface Color { + /** + * Gets the value of the color. + */ + value: string; + + /** + * Gets a value indicating whether the color is a valid `CSS`-color. + */ + css?: boolean; + + /** + * Gets a value indicating whether the color is a valid `VGA`-color. + */ + vga?: boolean; + + /** + * Gets the name of the color. + */ + name: string; +} + +/** + * Povides the functionality to resolve colors of a specific type by its name. + */ +interface ColorResolver { + /** + * Gets the color with the specified name. + * + * @param name + * The name of the color to get. + */ + (name: string): Color; + + /** + * Gets all colors. + */ + (): Color[]; +} + +/** + * Provides the functionality to resolve any kind of color by its name. + */ +interface GlobalResolver { + /** + * Gets the color with the specified name. + */ + (name: string): Color; + + /** + * Provides the functionality to query colors. + */ + get: { + /** + * Gets the color with the specified name. + * + * @param name + * The name of the color to get. + */ + (name: string): Color; + + /** + * Gets all available colors. + */ + all(): Color[]; + + /** + * Provides the functionality to resolve `css`-colors. + */ + css: ColorResolver; + + /** + * Provides the functionality to resolve `vga`-colors. + */ + vga: ColorResolver; + }; + + /** + * Gets all available colors. + */ + all(): Color[]; +} + +declare let colorNames: GlobalResolver; +export = colorNames; diff --git a/types/colornames/tsconfig.json b/types/colornames/tsconfig.json new file mode 100644 index 0000000000..b494da59cd --- /dev/null +++ b/types/colornames/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "colornames-tests.ts" + ] +} diff --git a/types/colornames/tslint.json b/types/colornames/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/colornames/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/common-errors/index.d.ts b/types/common-errors/index.d.ts index da0230b084..eda538b1f3 100644 --- a/types/common-errors/index.d.ts +++ b/types/common-errors/index.d.ts @@ -183,6 +183,11 @@ export class HttpStatusError extends global.Error { * @param req the request object */ constructor(err: Error, req?: express.Request); + + /** + * Status code for this error. + */ + statusCode: number; } /** diff --git a/types/commonmark/index.d.ts b/types/commonmark/index.d.ts index 96bb2774c5..2f2899b44a 100644 --- a/types/commonmark/index.d.ts +++ b/types/commonmark/index.d.ts @@ -4,15 +4,18 @@ // Leonard Thieu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export type NodeType = + 'text' |'softbreak' | 'linebreak' | 'emph' | 'strong' | 'html_inline' | 'link' | 'image' | 'code' | 'document' | 'paragraph' | + 'block_quote' | 'item' | 'list' | 'heading' | 'code_block' | 'html_block' | 'thematic_break' | 'custom_inline' | 'custom_block'; + export class Node { - constructor(nodeType: string, sourcepos?: Position); + constructor(nodeType: NodeType, sourcepos?: Position); /** * (read-only): a String, one of text, softbreak, linebreak, emph, strong, html_inline, link, image, code, document, paragraph, * block_quote, item, list, heading, code_block, html_block, thematic_break. */ - readonly type: 'text' | 'softbreak' | 'linebreak' | 'emph' | 'strong' | 'html_inline' | 'link' | 'image' | 'code' | 'document' | 'paragraph' | - 'block_quote' | 'item' | 'list' | 'heading' | 'code_block' | 'html_block' | 'thematic_break' | 'custom_inline' | 'custom_block'; + readonly type: NodeType; /** * (read-only): a Node or null. */ diff --git a/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts b/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts index 423ca4cea7..a679b7f599 100644 --- a/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts +++ b/types/compression-webpack-plugin/compression-webpack-plugin-tests.ts @@ -1,15 +1,76 @@ import { Configuration } from 'webpack'; import CompressionPlugin = require('compression-webpack-plugin'); -const c: Configuration = { +new CompressionPlugin(); + +new CompressionPlugin({ + include: ["a"] as ReadonlyArray, + exclude: [/a/g] as ReadonlyArray, + test: "a", +}); + +const config: Configuration = { plugins: [ new CompressionPlugin({ - asset: "[path].gz[query]", algorithm: "gzip", cache: true, + filename: "[path].gz[query]", + minRatio: 0.8, test: /\.js$|\.html$/, threshold: 10240, - minRatio: 0.8 + deleteOriginalAssets: true + }) + ] +}; + +const configDefaultAlgo = new CompressionPlugin({ + compressionOptions: { level: 7 } +}); + +// $ExpectError +new CompressionPlugin({ asset: "[path].gz[query]" }); + +const zlib: Configuration = { + plugins: [ + new CompressionPlugin({ + algorithm: "deflate", + compressionOptions: { + flush: 5, + windowBits: 20, + level: 7 + } + }) + ] +}; + +const badZlib: Configuration = { + plugins: [ + // $ExpectError + new CompressionPlugin({ + algorithm: "deflate", + compressionOptions: 5 + }) + ] +}; + +function customAlgorithm(input: string, options: number, callback: (err: Error, result: Buffer) => void) { +} + +const custom: Configuration = { + plugins: [ + new CompressionPlugin({ + algorithm: customAlgorithm, + compressionOptions: 5 + }) + ] +}; + +const badCustom: Configuration = { + plugins: [ + // $ExpectError + new CompressionPlugin({ + algorithm: customAlgorithm, + compressionOptions: { flush: 5 } }) ] }; diff --git a/types/compression-webpack-plugin/index.d.ts b/types/compression-webpack-plugin/index.d.ts index a7b38383ef..5d72f1fca8 100644 --- a/types/compression-webpack-plugin/index.d.ts +++ b/types/compression-webpack-plugin/index.d.ts @@ -1,42 +1,47 @@ -// Type definitions for compression-webpack-plugin 0.4 +// Type definitions for compression-webpack-plugin 2.0 // Project: https://github.com/webpack-contrib/compression-webpack-plugin // Definitions by: Anton Kandybo +// Rhys van der Waerden // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 import { Plugin } from 'webpack'; +import { ZlibOptions as ZlibCompressionOptions } from 'zlib'; export = CompressionPlugin; -declare class CompressionPlugin extends Plugin { - constructor(options?: CompressionPlugin.Options); +declare class CompressionPlugin extends Plugin { + constructor(options?: CompressionPlugin.Options); } declare namespace CompressionPlugin { - interface Options { - asset?: string; - algorithm?: string; + type AlgorithmCallback = (error: Error | null, result: Buffer) => void; + type Algorithm = (source: string, options: O, callback: AlgorithmCallback) => void; + + // NOTE: These are the async compression algorithms on the zlib object. + type ZlibAlgorithm = 'deflate' | 'deflateRaw' | 'gzip'; + type Pattern = string | RegExp | ReadonlyArray | ReadonlyArray; + + interface BaseOptions { cache?: boolean | string; - test?: RegExp | RegExp[]; - regExp?: RegExp | RegExp[]; - threshold?: number; + deleteOriginalAssets?: boolean; + exclude?: Pattern; + filename?: string; + include?: Pattern; minRatio?: number; - - // zopfli options - verbose?: boolean; - verbose_more?: boolean; - numiterations?: number; - blocksplitting?: boolean; - blocksplittinglast?: boolean; - blocksplittingmax?: number; - - // zlib options - level?: number; - flush?: number; - chunkSize?: number; - windowBits?: number; - memLevel?: number; - strategy?: number; - dictionary?: any; + test?: Pattern; + threshold?: number; } + + interface ZlibOptions extends BaseOptions { + algorithm?: ZlibAlgorithm; + compressionOptions?: ZlibCompressionOptions; + } + + interface CustomOptions extends BaseOptions { + algorithm: Algorithm; + compressionOptions?: O; + } + + type Options = ZlibOptions | CustomOptions; } diff --git a/types/conf/conf-tests.ts b/types/conf/conf-tests.ts index 1da0e4de2d..ce67cd4799 100644 --- a/types/conf/conf-tests.ts +++ b/types/conf/conf-tests.ts @@ -4,18 +4,24 @@ const conf = new Conf(); new Conf({ defaults: { foo: 'bar', - unicorn: 'rainbow' + unicorn: 'rainbow', }, - configName: '', - projectName: 'foo', - cwd: '' }); +new Conf({ configName: '' }); +new Conf({ projectName: 'foo' }); +new Conf({ cwd: '' }); +new Conf({ encryptionKey: '' }); +new Conf({ encryptionKey: new Buffer('') }); +new Conf({ encryptionKey: new Uint8Array([1]) }); +new Conf({ encryptionKey: new DataView(new ArrayBuffer(2)) }); +new Conf({ fileExtension: '.foo' }); + // $ExpectError new Conf({ defaults: { foo: 'bar', - unicorn: ['rainbow'] - } + unicorn: ['rainbow'], + }, }); conf.set('foo', 'bar'); conf.set('hello', 1); @@ -28,10 +34,17 @@ conf.get('foo', null); // $ExpectError conf.delete('foo'); conf.has('foo'); // $ExpectType boolean conf.clear(); +conf.onDidChange('foo', (oldVal, newVal) => { + // $ExpectType string | number | boolean | undefined + oldVal; + // $ExpectType string | number | boolean | undefined + newVal; +}); +conf.size; // $ExpectType number conf.store = { foo: 'bar', - unicorn: 'rainbow' + unicorn: 'rainbow', }; conf.path; // $ExpectType string diff --git a/types/conf/index.d.ts b/types/conf/index.d.ts index e58dc3ede7..57d7285a3e 100644 --- a/types/conf/index.d.ts +++ b/types/conf/index.d.ts @@ -1,31 +1,37 @@ -// Type definitions for conf 1.4 +// Type definitions for conf 2.1 // Project: https://github.com/sindresorhus/conf // Definitions by: Sam Verschueren // BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -interface Options { - defaults?: {[key: string]: T}; - configName?: string; - projectName?: string; - cwd?: string; -} +/// declare class Conf implements Iterable<[string, T]> { - store: {[key: string]: T}; + store: { [key: string]: T }; readonly path: string; - readonly size: number; + readonly size: number; - constructor(options?: Options); - get(key: string, defaultValue?: T): T; - set(key: string, val: T): void; - set(object: {[key: string]: T}): void; - has(key: string): boolean; - delete(key: string): void; - clear(): void; - onDidChange(key: string, callback: (oldVal: any, newVal: any) => void): void; - [Symbol.iterator](): Iterator<[string, T]>; + constructor(options?: Conf.Options); + get(key: string, defaultValue?: T): T; + set(key: string, val: T): void; + set(object: { [key: string]: T }): void; + has(key: string): boolean; + delete(key: string): void; + clear(): void; + onDidChange(key: string, callback: (oldVal: T | undefined, newVal: T | undefined) => void): void; + [Symbol.iterator](): Iterator<[string, T]>; +} + +declare namespace Conf { + interface Options { + defaults?: { [key: string]: T }; + configName?: string; + projectName?: string; + cwd?: string; + encryptionKey?: string | Buffer | NodeJS.TypedArray | DataView; + fileExtension?: string; + } } export = Conf; diff --git a/types/conf/tsconfig.json b/types/conf/tsconfig.json index 84d6bf7657..479fa6b41f 100644 --- a/types/conf/tsconfig.json +++ b/types/conf/tsconfig.json @@ -21,4 +21,4 @@ "index.d.ts", "conf-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/conf/v1/conf-tests.ts b/types/conf/v1/conf-tests.ts new file mode 100644 index 0000000000..4ee492da8d --- /dev/null +++ b/types/conf/v1/conf-tests.ts @@ -0,0 +1,41 @@ +import Conf = require('conf'); + +const conf = new Conf(); +new Conf({ + defaults: { + foo: 'bar', + unicorn: 'rainbow', + }, + configName: '', + projectName: 'foo', + cwd: '', +}); +// $ExpectError +new Conf({ + defaults: { + foo: 'bar', + unicorn: ['rainbow'], + }, +}); +conf.set('foo', 'bar'); +conf.set('hello', 1); +conf.set('unicorn', false); +conf.set('null', null); // $ExpectError + +conf.get('foo'); // $ExpectType string | number | boolean +conf.get('foo', 'bar'); // $ExpectType string | number | boolean +conf.get('foo', null); // $ExpectError +conf.delete('foo'); +conf.has('foo'); // $ExpectType boolean +conf.clear(); + +conf.store = { + foo: 'bar', + unicorn: 'rainbow', +}; +conf.path; // $ExpectType string + +for (const [key, value] of conf) { + key; // $ExpectType string + value; // $ExpectType string | number | boolean +} diff --git a/types/conf/v1/index.d.ts b/types/conf/v1/index.d.ts new file mode 100644 index 0000000000..f08cff1584 --- /dev/null +++ b/types/conf/v1/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for conf 1.4 +// Project: https://github.com/sindresorhus/conf +// Definitions by: Sam Verschueren +// BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +interface Options { + defaults?: { [key: string]: T }; + configName?: string; + projectName?: string; + cwd?: string; +} + +declare class Conf implements Iterable<[string, T]> { + store: { [key: string]: T }; + readonly path: string; + readonly size: number; + + constructor(options?: Options); + get(key: string, defaultValue?: T): T; + set(key: string, val: T): void; + set(object: { [key: string]: T }): void; + has(key: string): boolean; + delete(key: string): void; + clear(): void; + onDidChange(key: string, callback: (oldVal: any, newVal: any) => void): void; + [Symbol.iterator](): Iterator<[string, T]>; +} + +export = Conf; diff --git a/types/conf/v1/tsconfig.json b/types/conf/v1/tsconfig.json new file mode 100644 index 0000000000..86b3a62f41 --- /dev/null +++ b/types/conf/v1/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "conf": [ + "conf/v1" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "conf-tests.ts" + ] +} diff --git a/types/conf/v1/tslint.json b/types/conf/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/conf/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/connect-mongo/index.d.ts b/types/connect-mongo/index.d.ts index ea39a13f42..7173cb50dc 100644 --- a/types/connect-mongo/index.d.ts +++ b/types/connect-mongo/index.d.ts @@ -110,6 +110,7 @@ declare namespace connectMongo { length: (callback: (err: any, length: number) => void) => void; clear: (callback?: (err?: any) => void) => void; touch: (sid: string, session: Express.SessionData, callback?: (err: any) => void) => void; + close: () => void; } } diff --git a/types/connect-timeout/index.d.ts b/types/connect-timeout/index.d.ts index 93114c1469..05cb91cb15 100644 --- a/types/connect-timeout/index.d.ts +++ b/types/connect-timeout/index.d.ts @@ -14,10 +14,9 @@ declare namespace Express { clearTimeout(): void; /** - * - * @return {boolean} true if timeout fired; false otherwise. + * @summary true if timeout fired; false otherwise. */ - timedout(event: string, message: string): boolean; + timedout: boolean; } } diff --git a/types/contains-path/contains-path-tests.ts b/types/contains-path/contains-path-tests.ts new file mode 100644 index 0000000000..896cf86fe4 --- /dev/null +++ b/types/contains-path/contains-path-tests.ts @@ -0,0 +1,5 @@ +import containsPath = require('contains-path'); + +containsPath('foo/bar', 'foo'); // $ExpectType boolean +containsPath('foo/bar', 'FOO', { nocase: true }); // $ExpectType boolean +containsPath('foobar', 'foo', { partialMatch: true }); // $ExpectType boolean diff --git a/types/contains-path/index.d.ts b/types/contains-path/index.d.ts new file mode 100644 index 0000000000..7d607c0cbb --- /dev/null +++ b/types/contains-path/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for contains-path 1.0 +// Project: https://github.com/jonschlinkert/contains-path +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = containsPath; + +declare function containsPath( + filepath: string, + substr: string, + options?: containsPath.Options +): boolean; + +declare namespace containsPath { + interface Options { + nocase?: boolean; + partialMatch?: boolean; + } +} diff --git a/types/contains-path/tsconfig.json b/types/contains-path/tsconfig.json new file mode 100644 index 0000000000..5302a9a8e0 --- /dev/null +++ b/types/contains-path/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "contains-path-tests.ts" + ] +} diff --git a/types/contains-path/tslint.json b/types/contains-path/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/contains-path/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/continuation-local-storage/continuation-local-storage-tests.ts b/types/continuation-local-storage/continuation-local-storage-tests.ts index aee44866af..9ab06a89d2 100644 --- a/types/continuation-local-storage/continuation-local-storage-tests.ts +++ b/types/continuation-local-storage/continuation-local-storage-tests.ts @@ -438,10 +438,10 @@ test("simple tracer built on contexts", function (t) { this.harvester = harvester; } runHandler(callback: any) { - const wrapped = tracer.bind(function () { + const wrapped = tracer.bind(() => { callback(); this.harvester.emit('finished', tracer.get('transaction')); - }.bind(this)); + }); wrapped(); } } diff --git a/types/cookiejar/index.d.ts b/types/cookiejar/index.d.ts index ba50b63ea2..b976a0e1dc 100644 --- a/types/cookiejar/index.d.ts +++ b/types/cookiejar/index.d.ts @@ -112,5 +112,5 @@ export class CookieJar { * grab all cookies matching this access_info * @param accessInfo CookieAccessInfo */ - getCookies(accessInfo: CookieAccessInfo): ReadonlyArray; + getCookies(accessInfo: CookieAccessInfo): ReadonlyArray & { toValueString(): string }; } diff --git a/types/copy/copy-tests.ts b/types/copy/copy-tests.ts new file mode 100644 index 0000000000..c72ad3532a --- /dev/null +++ b/types/copy/copy-tests.ts @@ -0,0 +1,35 @@ +import copy = require('copy'); +import File = require('vinyl'); + +copy.each(['a', 'b'], '.', { cwd: '..' }, () => {}); +copy.each(['a', 'b'], '.', { cwd: '..' }, (error, files) => { + error; // $ExpectType Error | null + files; // $ExpectType File[] | undefined +}); +copy.each(['a', 'b'], '.', () => {}); +copy.each(['a', 'b'], '.', (error, files) => { + error; // $ExpectType Error | null + files; // $ExpectType File[] | undefined +}); + +copy.one('a', '.', { cwd: '..' }, () => {}); +copy.one('a', '.', { cwd: '..' }, (error, files) => { + error; // $ExpectType Error | null + files; // $ExpectType File[] | undefined +}); +copy.one('a', '.', () => {}); +copy.one('a', '.', (error, files) => { + error; // $ExpectType Error | null + files; // $ExpectType File[] | undefined +}); + +copy(['a', 'b'], '.', { cwd: '..' }, () => {}); +copy(['a', 'b'], '.', { cwd: '..' }, (error, files) => { + error; // $ExpectType Error | null + files; // $ExpectType File[] | undefined +}); +copy(['a', 'b'], '.', () => {}); +copy(['a', 'b'], '.', (error, files) => { + error; // $ExpectType Error | null + files; // $ExpectType File[] | undefined +}); diff --git a/types/copy/index.d.ts b/types/copy/index.d.ts new file mode 100644 index 0000000000..567d6594d3 --- /dev/null +++ b/types/copy/index.d.ts @@ -0,0 +1,78 @@ +// Type definitions for copy 0.3 +// Project: https://github.com/jonschlinkert/copy +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import File = require('vinyl'); + +declare namespace copy { + /** + * Copy an array of files to the given destination `directory`, with + * `options` and callback function that exposes `err` and the array of + * vinyl files that are created by the copy operation. + * + * ```js + * copy.each(['foo.txt', 'bar.txt', 'baz.txt'], 'dist', function(err, files) { + * // exposes the vinyl `files` created when the files are copied + * }); + * ``` + * @param `files` Filepaths or vinyl files. + * @param `dir` Destination directory + * @param `options` or callback function + * @param `cb` Callback function if no options are specified + */ + function each(files: string[] | File[], dir: string, options: Options, cb: Callback): void; + function each(files: string[] | File[], dir: string, cb: Callback): void; + + /** + * Copy a single `file` to the given `dest` directory, using + * the specified options and callback function. + * + * ```js + * copy.one('foo.txt', 'dist', function(err, file) { + * if (err) throw err; + * // exposes the vinyl `file` that is created when the file is copied + * }); + * ``` + * @param `file` Filepath or vinyl file + * @param `dir` Destination directory + * @param `options` or callback function + * @param `cb` Callback function if no options are specified + */ + function one(pattern: string | File, dir: string, options: Options, cb: Callback): void; + function one(pattern: string | File, dir: string, cb: Callback): void; + + type Callback = (error: Error | null, files?: File[]) => void; + + interface Options { + cwd?: string; + srcBase?: string; + } +} + +/** + * Copy a filepath, vinyl file, array of files, or glob of files to the + * given destination `directory`, with `options` and callback function that + * exposes `err` and the array of vinyl files that are created by the copy + * operation. + * + * ```js + * copy('*.js', 'dist', function(err, file) { + * // exposes the vinyl `file` created when the file is copied + * }); + * ``` + * @param `patterns` Filepath(s), vinyl file(s) or glob of files. + * @param `dir` Destination directory + * @param `options` or callback function + * @param `cb` Callback function if no options are specified + */ +declare function copy( + patterns: string | File | string[] | File[], + dir: string, + options: copy.Options, + callback: copy.Callback, +): void; +declare function copy(patterns: string | File | string[] | File[], dir: string, callback: copy.Callback): void; + +export = copy; diff --git a/types/hibp/tsconfig.json b/types/copy/tsconfig.json similarity index 95% rename from types/hibp/tsconfig.json rename to types/copy/tsconfig.json index 58ecb92a11..0b3e1bd3d3 100644 --- a/types/hibp/tsconfig.json +++ b/types/copy/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "hibp-tests.ts" + "copy-tests.ts" ] } diff --git a/types/copy/tslint.json b/types/copy/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/copy/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/copyfiles/copyfiles-tests.ts b/types/copyfiles/copyfiles-tests.ts new file mode 100644 index 0000000000..e1549c3c82 --- /dev/null +++ b/types/copyfiles/copyfiles-tests.ts @@ -0,0 +1,6 @@ +import copyfiles = require('copyfiles'); + +copyfiles(['file'], () => {}); +copyfiles(['file'], error => {}); +copyfiles(['file'], {all: true}, error => {}); +copyfiles(['file'], 10, error => {}); diff --git a/types/copyfiles/index.d.ts b/types/copyfiles/index.d.ts new file mode 100644 index 0000000000..9fc6ecde87 --- /dev/null +++ b/types/copyfiles/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for copyfiles 2.1 +// Project: https://github.com/calvinmetcalf/copyfiles#readme +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace copyfiles { + interface Options { + /** include files & directories begining with a dot (.) */ + all?: boolean; + /** throw error if nothing is copied */ + error?: boolean; + /** pattern or glob to exclude */ + exclude?: string; + /** flatten the output */ + flat?: boolean; + /** do not overwrite destination files if they exist */ + soft?: boolean; + /** slice a path off the bottom of the paths */ + up?: number; + /** print more information to console */ + verbose?: boolean; + } + + type Callback = (error?: Error) => void; +} + +declare function copyfiles(paths: string[], options: copyfiles.Options | number, callback: copyfiles.Callback): void; +declare function copyfiles(paths: string[], callback: copyfiles.Callback): void; + +export = copyfiles; diff --git a/types/copyfiles/tsconfig.json b/types/copyfiles/tsconfig.json new file mode 100644 index 0000000000..83672e27b7 --- /dev/null +++ b/types/copyfiles/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "copyfiles-tests.ts" + ] +} diff --git a/types/copyfiles/tslint.json b/types/copyfiles/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/copyfiles/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts b/types/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts index 6e4317ac9d..f7830c18b2 100644 --- a/types/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts +++ b/types/cordova-plugin-ble-central/cordova-plugin-ble-central-tests.ts @@ -61,59 +61,89 @@ var demoExtendedData : BLECentralPlugin.PeripheralDataExtended = { //get updates about the bluethooth states ble.startStateNotifications((state) => log(`BLE state ${state}`)); +ble.startStateNotifications((state) => log(`BLE state ${state}`), (err: string) => log(`things when wrong ${err}`)); -ble.isEnabled(()=> log(`bluetooth is enabled`), ()=>log(`bluetooth is not enabled`)); +ble.isEnabled(()=> log(`bluetooth is enabled`), err =>log(`bluetooth is not enabled: ${err}`)); //here we try to enable bluetooth -ble.enable(() => log(`yes it worked, or it was already enabled `), () => log(`nope it didn't work, the user pressed cancel, or we are in iOS`)); +ble.enable(() => log(`yes it worked, or it was already enabled `), err => log(`nope it didn't work, the user pressed cancel, or we are in iOS: ${err}`)); ble.showBluetoothSettings(() => log(`yes it worked`), () => log(`nope it didn't work`)) //stop getting updates about the bluethooth states ble.stopStateNotifications() +ble.stopStateNotifications(() => log(`yes it worked`)) +ble.stopStateNotifications(() => log(`yes it worked`), () => log(`nope it didn't work`)) //scan 5 seconds -ble.scan([], 5000, (data) => { devices.push(data); }, ()=> log('couldn\'t connect') ); +ble.scan([], 5000, (data) => { devices.push(data); }); +ble.scan([], 5000, (data) => { devices.push(data); }, () => log(`couldn't connect`) ); +ble.scan([], 5000, (data) => { devices.push(data); }, err => log(`couldn't connect: ${err}`) ); //scan continously -ble.startScan([], (data) => { devices.push(data); }, ()=> log('couldn\'t connect') ) +ble.startScan([], (data) => { devices.push(data); }) +ble.startScan([], (data) => { devices.push(data); }, () => log('couldn\'t connect') ) +ble.startScan([], (data) => { devices.push(data); }, err => log(`couldn't connect: ${err}`) ); ////scan continously -ble.startScanWithOptions([], {reportDuplicates:false }, (data) => { devices.push(data); }, ()=> log('couldn\'t connect') ) +ble.startScanWithOptions([], {reportDuplicates:false }, (data) => { devices.push(data); }); +ble.startScanWithOptions([], {reportDuplicates:false }, (data) => { devices.push(data); }, err => log(`couldn't connect: ${err}`)); //stop scanning ble.stopScan(()=> log('all good'), ()=> log('couldn\'t stop scanning')); //are we conenected to that device? +ble.isConnected(demoDevice.id, () => log(`already connected to this device`)); ble.isConnected(demoDevice.id, () => log(`already connected to this device`), ()=> log(`not yet connected to that device`)); //connect to a specific device var extendedData : BLECentralPlugin.PeripheralDataExtended; -ble.connect(demoDevice.id, (data)=> extendedData = data, () => log(`couldn't connect to the device`) ); +ble.connect(demoDevice.id, (data)=> extendedData = data, err => log(`couldn't connect to the device: ${err}`) ); //read some data from a characteristic var charsOfOneOfItsServices = demoExtendedData.characteristics.filter((value) => value.service == demoExtendedData.services[0]); +ble.read(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic); ble.read(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, (data) => log(`we've received some data`), ()=> log(`couldn't read any data`)); //read the rssi ble.readRSSI(demoDevice.id, (rssi)=>log(`Device ${demoDevice.name} has an RSSI of ${rssi}`)); +ble.readRSSI(demoDevice.id, (rssi)=>log(`Device ${demoDevice.name} has an RSSI of ${rssi}`), err => log(`Unable to read RSSI: ${err}`)); + + +// request mtu +ble.requestMtu(demoDevice.id, 10); +ble.requestMtu(demoDevice.id, 10, () => log('it worked')); +ble.requestMtu(demoDevice.id, 10, () => log('it worked'), () => log('it failed')); + +// refreshDeviceCache +ble.refreshDeviceCache(demoDevice.id, 10); +ble.refreshDeviceCache(demoDevice.id, 10, () => log('it worked')); +ble.refreshDeviceCache(demoDevice.id, 10, () => log('it worked'), () => log('it failed')); var notificationsReceived : number = 0; //get notified of changes for that characteristic -ble.startNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, (data)=> notificationsReceived++, ()=> log(`darn`)); +ble.startNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, + (data)=> notificationsReceived++); +ble.startNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, + (data)=> notificationsReceived++, err => log(`darn: ${err}`)); //write some data +ble.write(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40)); +ble.write(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40), ()=> log(`all good`)); ble.write(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40), ()=> log(`all good`), ()=> log(`could't write`)); //write some data without getting notified +ble.writeWithoutResponse(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40)); +ble.writeWithoutResponse(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40), ()=> log(`all good`)); ble.writeWithoutResponse(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, new ArrayBuffer(40), ()=> log(`all good`), ()=> log(`could't write`)); //stop getting notified of changes. ble.stopNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic); +ble.stopNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, () => log('it worked')); +ble.stopNotification(demoDevice.id, charsOfOneOfItsServices[0].service, charsOfOneOfItsServices[0].characteristic, () => log('it worked'), () => log('it failed')); //notificationsReceived == 1 //just disconnect ble.disconnect(demoDevice.id); - - - +ble.disconnect(demoDevice.id, () => log('it worked')); +ble.disconnect(demoDevice.id, () => log('it worked'), () => log('it failed')); diff --git a/types/cordova-plugin-ble-central/index.d.ts b/types/cordova-plugin-ble-central/index.d.ts index ccf2396833..070b62ff9e 100644 --- a/types/cordova-plugin-ble-central/index.d.ts +++ b/types/cordova-plugin-ble-central/index.d.ts @@ -1,12 +1,13 @@ -// Type definitions for cordova-plugin-ble-central 1.1.2 +// Type definitions for cordova-plugin-ble-central 1.2.2 // Project: https://github.com/don/cordova-plugin-ble-central // Definitions by: Gidon Junge +// Philip Peitsch // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace BLECentralPlugin { - interface PeripheralCharacteristic { + interface PeripheralCharacteristic { service: string; characteristic: string; properties: string[]; @@ -26,7 +27,12 @@ declare namespace BLECentralPlugin { characteristics: PeripheralCharacteristic[] } - + + interface BLEError { + name: string; + id: string; + errorMessage: string; + } interface StartScanOptions { @@ -34,75 +40,80 @@ declare namespace BLECentralPlugin { } export interface BLECentralPluginStatic { - scan(services: string[], seconds: number, success : (data: PeripheralData) => any): void; - scan(services: string[], seconds: number, success : (data: PeripheralData) => any, failure : () => any): void; - - startScan(services: string[], success: (data: PeripheralData) => any): void; - startScan(services: string[], success: (data: PeripheralData) => any, failure: () => any): void; + scan(services: string[], seconds: number, success : (data: PeripheralData) => any, failure? : (error: string) => any): void; - startScanWithOptions(services: string[], options: StartScanOptions, success: (data: PeripheralData) => any): void; - startScanWithOptions(services: string[], options: StartScanOptions, success: (data: PeripheralData) => any, failure: () => any): void; + startScan(services: string[], success: (data: PeripheralData) => any, failure?: (error: string|BLEError) => any): void; + + startScanWithOptions(services: string[], options: StartScanOptions, success: (data: PeripheralData) => any, failure?: (error: string) => any): void; stopScan(): void; - stopScan(success: () => any): void; - stopScan(success: () => any, failure: () => any): void; - - connect(device_id:string, success: (data: PeripheralDataExtended) => any, failure: () => any): void; + stopScan(success: () => any, failure?: () => any): void; - disconnect(device_id:string): void; - disconnect(device_id:string, success: () => any): void; - disconnect(device_id:string, success: () => any, failure: () => any): void; + connect(device_id:string, success: (data: PeripheralDataExtended) => any, failure: (error: string|BLEError) => any): void; - read(device_id: string, service_uuid:string, characteristic_uuid:string): void; - read(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any): void; - read(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any, failure: () => any): void; + /* Automatically connect to a device when it is in range of the phone + [iOS] background notifications on ios must be enabled if you want to run in the background + [Android] this relies on the autoConnect argument of BluetoothDevice.connectGatt(). Not all Android devices implement this feature correctly. */ + autoConnect(device_id:string, success: (data: PeripheralDataExtended) => any, failure: (error: string|BLEError) => any): void; - write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer): void; - write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any): void; - write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any, failure: () => any): void; + disconnect(device_id:string, success?: () => any, failure?: (error: string|BLEError) => any): void; - /* Writes data to a characteristic without a response from the peripheral. You are not notified if the write fails in the BLE stack. + read(device_id: string, service_uuid:string, characteristic_uuid:string, success?: (rawData: ArrayBuffer) => any, failure?: (error: string|BLEError) => any): void; + + write(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success?: () => any, failure?: (error: string|BLEError) => any): void; + + /* Writes data to a characteristic without a response from the peripheral. You are not notified if the write fails in the BLE stack. The success callback is be called when the characteristic is written.*/ - writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer): void; - writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any): void; - writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success : () => any, failure: () => any): void; + writeWithoutResponse(device_id: string, service_uuid:string, characteristic_uuid:string, data: ArrayBuffer, success?: () => any, failure?: (error: string) => any): void; /* Register to be notified when the value of a characteristic changes. */ - startNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any): void; - startNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any, failure: () => any): void; - - stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string): void; - stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: () => any): void; - stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: () => any, failure: () => any): void; + startNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success: (rawData: ArrayBuffer) => any, failure?: (error: string|BLEError) => any): void; + + stopNotification(device_id: string, service_uuid:string, characteristic_uuid:string, success?: () => any, failure?: (error: string|BLEError) => any): void; /* Reports if bluetooth is enabled. */ - isEnabled(success: () => any , failure: () => any): void; + isEnabled(success: () => any , failure: (error: string) => any): void; /* Calls the success callback when the peripheral is connected and the failure callback when not connected. */ - isConnected(device_id: string, success: () => any): void; - isConnected(device_id: string, success: () => any, failure: () => any): void; + isConnected(device_id: string, success: () => any, failure?: (error: string) => any): void; - startStateNotifications(success: (state: string) => any): void; - startStateNotifications(success: (state: string) => any, failure: () => any): void; + /* May be used to request (on Android) a larger MTU size to be able to send more data at once + [iOS] requestMtu is not supported on iOS. */ + requestMtu(device_id: string, mtu: number, success?: () => any, failure?: () => any): void; + + /* Clears cached services and characteristics info for some poorly behaved devices. Uses an undocumented API, + so it is not guaranteed to work. + [iOS] refreshDeviceCache is not supported on iOS. */ + refreshDeviceCache(device_id: string, timeout_millis: number, success?: (data: PeripheralDataExtended) => any, failure?: (error: string|BLEError) => any): void; + + startStateNotifications(success: (state: string) => any, failure?: (error: string) => any): void; + + stopStateNotifications(success?: () => any, failure?: () => any): void; - stopStateNotifications(): void; - stopStateNotifications(success: () => any): void; - stopStateNotifications(success: () => any, failure: () => any): void; - /* Opens the Bluetooth settings for the operating systems. [iOS] showBluetoothSettings is not supported on iOS. */ - showBluetoothSettings(): void; - showBluetoothSettings(success: () => any): void; showBluetoothSettings(success: () => any, failure: () => any): void; - + /* Enable Bluetooth on the device. [iOS] enable is not supported on iOS. */ - enable(success: () => any, failure: () => any): void; - + enable(success: () => any, failure: (error: string) => any): void; - readRSSI(device_id:string, success: (rssi: number) => any): void; - readRSSI(device_id:string, success: (rssi: number) => any, failure: () => any): void; + readRSSI(device_id:string, success: (rssi: number) => any, failure?: (error: string) => any): void; + + /* Find connected peripherals offering the listed service UUIDs. + This function wraps CBCentralManager.retrieveConnectedPeripheralsWithServices. + [Android] peripheralsWithIdentifiers is not supported on Android. */ + connectedPeripheralsWithServices(services: string[], success: (data: PeripheralData[]) => any, failure: () => any): void; + + /* Find known (but not necessarily connected) peripherals offering the listed service UUIDs. + This function wraps CBCentralManager.retrievePeripheralsWithIdentifiers + [Android] peripheralsWithIdentifiers is not supported on Android. */ + peripheralsWithIdentifiers(services: string[], success: (data: PeripheralData[]) => any, failure: () => any): void; + + /* Find the bonded devices. + [iOS] bondedDevices is not supported on iOS. */ + bondedDevices(success: (data: PeripheralData[]) => any, failure: () => any): void; } } -declare var ble: BLECentralPlugin.BLECentralPluginStatic; \ No newline at end of file +declare var ble: BLECentralPlugin.BLECentralPluginStatic; diff --git a/types/cordova-plugin-x-socialsharing/index.d.ts b/types/cordova-plugin-x-socialsharing/index.d.ts index a5105c898c..d1a4740b58 100644 --- a/types/cordova-plugin-x-socialsharing/index.d.ts +++ b/types/cordova-plugin-x-socialsharing/index.d.ts @@ -1,13 +1,13 @@ -// Type definitions for SocialSharing-PhoneGap-Plugin v5.1.8 +// Type definitions for SocialSharing-PhoneGap-Plugin v5.1.9 // Project: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin // Definitions by: Markus Wagner , Larry Bahr // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface Window { - plugins: Plugins; + plugins: CordovaPlugins; } -interface Plugins { +interface CordovaPlugins { socialsharing: SocialSharingPlugin.SocialSharing; } diff --git a/types/country-data/country-data-tests.ts b/types/country-data/country-data-tests.ts new file mode 100644 index 0000000000..850116dc63 --- /dev/null +++ b/types/country-data/country-data-tests.ts @@ -0,0 +1,14 @@ +import * as lib from 'country-data'; + +lib.callingCodes.all; // $ExpectType ReadonlyArray +lib.callingCountries.all; // $ExpectType ReadonlyArray +lib.continents.africa; // $ExpectType Continent +lib.continents.africa.countries; // $ExpectType ReadonlyArray +lib.countries.all; // $ExpectType ReadonlyArray +lib.currencies.all; // $ExpectType ReadonlyArray +lib.languages.all; // $ExpectType ReadonlyArray +lib.regions.antarctica; // $ExpectType Region +lib.regions.antarctica.countries; // $ExpectType ReadonlyArray +lib.lookup.countries(""); // $ExpectType ReadonlyArray +lib.lookup.currencies(""); // $ExpectType ReadonlyArray +lib.lookup.languages(""); // $ExpectType ReadonlyArray diff --git a/types/country-data/index.d.ts b/types/country-data/index.d.ts new file mode 100644 index 0000000000..80acbbcbba --- /dev/null +++ b/types/country-data/index.d.ts @@ -0,0 +1,103 @@ +// Type definitions for country-data 0.0 +// Project: https://github.com/OpenBookPrices/country-data +// Definitions by: Logan Dam +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Country { + readonly alpha2: string; + readonly alpha3: string; + readonly countryCallingCodes: ReadonlyArray; + readonly currencies: ReadonlyArray; + readonly emoji: string; + readonly ioc: string; + readonly languages: ReadonlyArray; + readonly name: string; + readonly status: string; +} + +export interface Currency { + readonly code: string; + readonly decimals: number; + readonly name: string; + readonly number: number; +} + +export interface Language { + readonly alpha2: string; + readonly alpha3: string; + readonly bibliographic: string; + readonly name: string; +} + +export interface Continent { + readonly name: string; + readonly regions: ReadonlyArray; + readonly countries: ReadonlyArray; +} + +export interface Region { + readonly name: string; + readonly countries: ReadonlyArray; +} + +export const countries: { + readonly all: ReadonlyArray; +}; + +export const continents: { + readonly africa: Continent; + readonly antarctica: Continent; + readonly asia: Continent; + readonly europe: Continent; + readonly northAmerica: Continent; + readonly oceania: Continent; + readonly southAmerica: Continent; +}; + +export const callingCodes: { + readonly all: ReadonlyArray; +}; + +export const callingCountries: { + readonly all: ReadonlyArray; +}; + +export const currencies: { + readonly all: ReadonlyArray; +}; + +export const languages: { + readonly all: ReadonlyArray; +}; + +export const regions: { + readonly centralAsia: Region; + readonly southernAsia: Region; + readonly southeastAsia: Region; + readonly eastAsia: Region; + readonly westernAsia: Region; + readonly centralAfrica: Region; + readonly northAfrica: Region; + readonly southernAfrica: Region; + readonly eastAfrica: Region; + readonly westAfrica: Region; + readonly centralAmerica: Region; + readonly northernAmerica: Region; + readonly caribbean: Region; + readonly southAmerica: Region; + readonly antarctica: Region; + readonly northernEurope: Region; + readonly southernEurope: Region; + readonly easternEurope: Region; + readonly westernEurope: Region; + readonly australia: Region; + readonly melanesia: Region; + readonly micronesia: Region; + readonly polynesia: Region; +}; + +export const lookup: { + readonly countries: (query: any) => ReadonlyArray; + readonly currencies: (query: any) => ReadonlyArray; + readonly languages: (query: any) => ReadonlyArray; +}; diff --git a/types/country-data/tsconfig.json b/types/country-data/tsconfig.json new file mode 100644 index 0000000000..ccbbf6ecd6 --- /dev/null +++ b/types/country-data/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "country-data-tests.ts" + ] +} diff --git a/types/country-data/tslint.json b/types/country-data/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/country-data/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/create-html-element/create-html-element-tests.ts b/types/create-html-element/create-html-element-tests.ts new file mode 100644 index 0000000000..e94b6cb617 --- /dev/null +++ b/types/create-html-element/create-html-element-tests.ts @@ -0,0 +1,48 @@ +import createHtmlElement = require('create-html-element'); + +createHtmlElement(); // $ExpectType HTMLDivElement +// $ExpectType HTMLDivElement +createHtmlElement({ + attributes: { + class: 'unicorn', + rainbow: true, + horse: false, + number: 1, + multiple: ['a', 'b'], + }, +}); +createHtmlElement({ html: '🦄' }); // $ExpectType HTMLDivElement +createHtmlElement({ text: 'Hello World' }); // $ExpectType HTMLDivElement +createHtmlElement({ html: '🦄', text: 'Hello World' }); // $ExpectError + +createHtmlElement({ name: 'h1' }); // $ExpectType HTMLHeadingElement +// $ExpectType HTMLHeadingElement +createHtmlElement({ + name: 'h1', + attributes: { + class: 'unicorn', + rainbow: true, + horse: false, + number: 1, + multiple: ['a', 'b'], + }, +}); +createHtmlElement({ name: 'h1', html: '🦄' }); // $ExpectType HTMLHeadingElement +createHtmlElement({ name: 'h1', text: 'Hello World' }); // $ExpectType HTMLHeadingElement +createHtmlElement({ name: 'h1', html: '🦄', text: 'Hello World' }); // $ExpectError + +createHtmlElement({ name: 'foo' }); // $ExpectType HTMLElement +// $ExpectType HTMLElement +createHtmlElement({ + name: 'foo', + attributes: { + class: 'unicorn', + rainbow: true, + horse: false, + number: 1, + multiple: ['a', 'b'], + }, +}); +createHtmlElement({ name: 'foo', html: '🦄' }); // $ExpectType HTMLElement +createHtmlElement({ name: 'foo', text: 'Hello World' }); // $ExpectType HTMLElement +createHtmlElement({ name: 'foo', html: '🦄', text: 'Hello World' }); // $ExpectError diff --git a/types/create-html-element/index.d.ts b/types/create-html-element/index.d.ts new file mode 100644 index 0000000000..86fd758b3e --- /dev/null +++ b/types/create-html-element/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for create-html-element 2.0 +// Project: https://github.com/sindresorhus/create-html-element#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +export = createHtmlElement; + +declare function createHtmlElement( + options?: createHtmlElement.OptionsWithoutTagName +): HTMLDivElement; +declare function createHtmlElement( + options: createHtmlElement.Options +): HTMLElementTagNameMap[K]; +declare function createHtmlElement(options: createHtmlElement.Options): HTMLElement; + +declare namespace createHtmlElement { + type Without = { [P in Exclude]?: never }; + type XOR = (T | U) extends object ? (Without & U) | (Without & T) : T | U; + + interface AttributesOptions { + attributes?: { [key: string]: string | boolean | number | string[] }; + } + + interface HtmlOptions { + html?: string; + } + + interface TextOptions { + text?: string; + } + + type OptionsWithoutTagName = AttributesOptions & XOR; + + interface OptionsWithTagName extends AttributesOptions { + name: K; + } + + type Options = OptionsWithTagName & XOR; +} diff --git a/types/create-html-element/package.json b/types/create-html-element/package.json new file mode 100644 index 0000000000..bb80441dc0 --- /dev/null +++ b/types/create-html-element/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "types": "index", + "typesVersions": { + ">=3.1.0-0": { "*": ["ts3.1/*"] } + } +} diff --git a/types/create-html-element/ts3.1/create-html-element-tests.ts b/types/create-html-element/ts3.1/create-html-element-tests.ts new file mode 100644 index 0000000000..6d44f3df60 --- /dev/null +++ b/types/create-html-element/ts3.1/create-html-element-tests.ts @@ -0,0 +1,64 @@ +import createHtmlElement = require('create-html-element'); + +createHtmlElement(); // $ExpectType HTMLDivElement +// $ExpectType HTMLDivElement +createHtmlElement({ + attributes: { + class: 'unicorn', + rainbow: true, + horse: false, + number: 1, + multiple: ['a', 'b'], + }, +}); +createHtmlElement({ html: '🦄' }); // $ExpectType HTMLDivElement +createHtmlElement({ text: 'Hello World' }); // $ExpectType HTMLDivElement +createHtmlElement({ html: '🦄', text: 'Hello World' }); // $ExpectError + +createHtmlElement({ name: 'h1' }); // $ExpectType HTMLHeadingElement +// $ExpectType HTMLHeadingElement +createHtmlElement({ + name: 'h1', + attributes: { + class: 'unicorn', + rainbow: true, + horse: false, + number: 1, + multiple: ['a', 'b'], + }, +}); +createHtmlElement({ name: 'h1', html: '🦄' }); // $ExpectType HTMLHeadingElement +createHtmlElement({ name: 'h1', text: 'Hello World' }); // $ExpectType HTMLHeadingElement +createHtmlElement({ name: 'h1', html: '🦄', text: 'Hello World' }); // $ExpectError + +createHtmlElement({ name: 'listing' }); // $ExpectType HTMLPreElement +// $ExpectType HTMLPreElement +createHtmlElement({ + name: 'listing', + attributes: { + class: 'unicorn', + rainbow: true, + horse: false, + number: 1, + multiple: ['a', 'b'], + }, +}); +createHtmlElement({ name: 'listing', html: '🦄' }); // $ExpectType HTMLPreElement +createHtmlElement({ name: 'listing', text: 'Hello World' }); // $ExpectType HTMLPreElement +createHtmlElement({ name: 'listing', html: '🦄', text: 'Hello World' }); // $ExpectError + +createHtmlElement({ name: 'foo' }); // $ExpectType HTMLElement +// $ExpectType HTMLElement +createHtmlElement({ + name: 'foo', + attributes: { + class: 'unicorn', + rainbow: true, + horse: false, + number: 1, + multiple: ['a', 'b'], + }, +}); +createHtmlElement({ name: 'foo', html: '🦄' }); // $ExpectType HTMLElement +createHtmlElement({ name: 'foo', text: 'Hello World' }); // $ExpectType HTMLElement +createHtmlElement({ name: 'foo', html: '🦄', text: 'Hello World' }); // $ExpectError diff --git a/types/create-html-element/ts3.1/index.d.ts b/types/create-html-element/ts3.1/index.d.ts new file mode 100644 index 0000000000..113f9ba588 --- /dev/null +++ b/types/create-html-element/ts3.1/index.d.ts @@ -0,0 +1,38 @@ +export = createHtmlElement; + +declare function createHtmlElement( + options?: createHtmlElement.OptionsWithoutTagName +): HTMLDivElement; +declare function createHtmlElement( + options: createHtmlElement.Options +): HTMLElementTagNameMap[K]; +/** @deprecated */ +declare function createHtmlElement( + options: createHtmlElement.Options +): HTMLElementDeprecatedTagNameMap[K]; +declare function createHtmlElement(options: createHtmlElement.Options): HTMLElement; + +declare namespace createHtmlElement { + type Without = { [P in Exclude]?: never }; + type XOR = (T | U) extends object ? (Without & U) | (Without & T) : T | U; + + interface AttributesOptions { + attributes?: { [key: string]: string | boolean | number | string[] }; + } + + interface HtmlOptions { + html?: string; + } + + interface TextOptions { + text?: string; + } + + type OptionsWithoutTagName = AttributesOptions & XOR; + + interface OptionsWithTagName extends AttributesOptions { + name: K; + } + + type Options = OptionsWithTagName & XOR; +} diff --git a/types/create-html-element/ts3.1/tsconfig.json b/types/create-html-element/ts3.1/tsconfig.json new file mode 100644 index 0000000000..6c82d9de10 --- /dev/null +++ b/types/create-html-element/ts3.1/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "create-html-element-tests.ts" + ] +} diff --git a/types/create-html-element/ts3.1/tslint.json b/types/create-html-element/ts3.1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/create-html-element/ts3.1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/create-html-element/tsconfig.json b/types/create-html-element/tsconfig.json new file mode 100644 index 0000000000..44a7146986 --- /dev/null +++ b/types/create-html-element/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "create-html-element-tests.ts" + ] +} diff --git a/types/create-html-element/tslint.json b/types/create-html-element/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/create-html-element/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/crypto-hash/crypto-hash-tests.ts b/types/crypto-hash/crypto-hash-tests.ts new file mode 100644 index 0000000000..73e62ad1c6 --- /dev/null +++ b/types/crypto-hash/crypto-hash-tests.ts @@ -0,0 +1,29 @@ +import { sha1, sha256, sha384, sha512 } from 'crypto-hash'; + +// $ExpectType Promise +sha1('🦄'); +// $ExpectType Promise +sha1('🦄', { outputFormat: 'buffer' }); +// $ExpectType Promise +sha1('🦄', { outputFormat: 'hex' }); + +// $ExpectType Promise +sha256('🦄'); +// $ExpectType Promise +sha256('🦄', { outputFormat: 'buffer' }); +// $ExpectType Promise +sha256('🦄', { outputFormat: 'hex' }); + +// $ExpectType Promise +sha384('🦄'); +// $ExpectType Promise +sha384('🦄', { outputFormat: 'buffer' }); +// $ExpectType Promise +sha384('🦄', { outputFormat: 'hex' }); + +// $ExpectType Promise +sha512('🦄'); +// $ExpectType Promise +sha512('🦄', { outputFormat: 'buffer' }); +// $ExpectType Promise +sha512('🦄', { outputFormat: 'hex' }); diff --git a/types/crypto-hash/index.d.ts b/types/crypto-hash/index.d.ts new file mode 100644 index 0000000000..c22864b2ae --- /dev/null +++ b/types/crypto-hash/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for crypto-hash 1.0 +// Project: https://github.com/sindresorhus/crypto-hash#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function sha1( + buffer: string | ArrayBuffer | ArrayBufferView, + options?: OptionsHexOutput +): Promise; +export function sha1( + buffer: string | ArrayBuffer | ArrayBufferView, + options: OptionBufferOutput +): Promise; + +export function sha256( + buffer: string | ArrayBuffer | ArrayBufferView, + options?: OptionsHexOutput +): Promise; +export function sha256( + buffer: string | ArrayBuffer | ArrayBufferView, + options: OptionBufferOutput +): Promise; + +export function sha384( + buffer: string | ArrayBuffer | ArrayBufferView, + options?: OptionsHexOutput +): Promise; +export function sha384( + buffer: string | ArrayBuffer | ArrayBufferView, + options: OptionBufferOutput +): Promise; + +export function sha512( + buffer: string | ArrayBuffer | ArrayBufferView, + options?: OptionsHexOutput +): Promise; +export function sha512( + buffer: string | ArrayBuffer | ArrayBufferView, + options: OptionBufferOutput +): Promise; + +export interface OptionsHexOutput { + outputFormat?: 'hex'; +} + +export interface OptionBufferOutput { + outputFormat: 'buffer'; +} diff --git a/types/crypto-hash/tsconfig.json b/types/crypto-hash/tsconfig.json new file mode 100644 index 0000000000..410ee34985 --- /dev/null +++ b/types/crypto-hash/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "crypto-hash-tests.ts" + ] +} diff --git a/types/crypto-hash/tslint.json b/types/crypto-hash/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/crypto-hash/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/custom-functions-runtime/custom-functions-runtime-tests.ts b/types/custom-functions-runtime/custom-functions-runtime-tests.ts index fc24ae6491..3b773e95b1 100644 --- a/types/custom-functions-runtime/custom-functions-runtime-tests.ts +++ b/types/custom-functions-runtime/custom-functions-runtime-tests.ts @@ -1,22 +1,29 @@ -/* Note that this is a sample function for the purpose of running the below CustomFunctionsMappings test. */ -function addTen(n: number) { +/* Note that this is a sample function for the purpose of running the below CustomFunctions.associate() test */ +function add10(n: number) { return n + 10; } -/* Assume that the function id for addTen in the function's JSON metadata is specified as ADDTEN. */ -CustomFunctionMappings.ADDTEN = addTen; +CustomFunctions.associate('ADD10', add10); + +CustomFunctions.associate({ + ADD10: add10, + RANDOM: (n: number) => n * Math.random() +}); + +function callerAddress(invocation: CustomFunctions.Invocation) { + return invocation.address; +} async function getStockValues(ticker: string): Promise { const response = await fetch(`myService.com/prices/${ticker}`); return (await response.json())["price"]; } -async function getStockValuesCancellable( - ticker: string, - handler: CustomFunctions.CancelableHandler -): Promise { +async function getStockValuesCancellable(ticker: string, + invocation: CustomFunctions.CancelableInvocation): Promise { + const address = invocation.address; let shouldStop = false; - handler.onCanceled = () => (shouldStop = true); + invocation.onCanceled = () => (shouldStop = true); await pause(1000); if (shouldStop) { @@ -27,10 +34,9 @@ async function getStockValuesCancellable( return (await response.json())["price"]; } -function stockPriceStream( - ticker: string, - handler: CustomFunctions.StreamingHandler -) { +function stockPriceStream(ticker: string, + invocation: CustomFunctions.StreamingInvocation) { + const address = invocation.address; const updateFrequency = 10 /* milliseconds*/; let isPending = false; @@ -45,14 +51,14 @@ function stockPriceStream( try { const response = await fetch(url); const data = await response.json(); - handler.setResult(data.price); + invocation.setResult(data.price); } catch (error) { - handler.setResult(error); + invocation.setResult(error); } isPending = false; }, updateFrequency); - handler.onCanceled = () => { + invocation.onCanceled = () => { clearInterval(timer); }; } diff --git a/types/custom-functions-runtime/index.d.ts b/types/custom-functions-runtime/index.d.ts index 1363f0de25..c907fe327e 100644 --- a/types/custom-functions-runtime/index.d.ts +++ b/types/custom-functions-runtime/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for Custom Functions 1.4 // Project: https://github.com/OfficeDev/office-js -// Definitions by: OfficeDev , Michael Zlatkovsky , Michelle Scharlock +// Definitions by: OfficeDev , +// Adam Krantz , +// Michael Zlatkovsky , +// Michelle Scharlock // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -10,40 +13,83 @@ Copyright (c) Microsoft Corporation */ /** - * Specific to Excel Custom Functions. - * Enables you to set key-value pairs which map - * a function's id in the JSON metadata to the JS function name. * @beta - */ -declare let CustomFunctionMappings: { [key: string]: Function }; -/** * CustomFunctions namespace, used by Excel Custom Functions - * @beta */ declare namespace CustomFunctions { /** - * A handler passed automatically as the last parameter - * to a streaming function. With this parameter, a - * function can use handler.setResult to set a cell value - * or hook into the handler.onCanceled event to - * to handle what happens when the function stops streaming. * @beta + * Associates the JavaScript function to the name given by the "id" property in the metadata JSON file. */ - interface StreamingHandler extends CancelableHandler { - /** - * Sets the returned result for a streaming custom function. - * @beta - */ - setResult: (value: T | Error) => void; - } + function associate(id: string, functionObject: Function): void; /** - * CancelableHandler interface + * @beta + * Associates the JavaScript functions to the names given by the "id" properties in the metadata JSON file. */ - interface CancelableHandler { + function associate(mappings: { [key: string]: Function }): void; + + /** + * @beta + * Provides information about the invocation of a custom function. + */ + interface Invocation { /** - * Handles what should occur when a custom function is canceled. * @beta + * The cell address where the function is being called, if requested, otherwise undefined. + * + * To request the address for the function, in the metadata JSON file, the function options should specify: + * `{ "requiresAddress": true }` + * + * If the metadata JSON file is being generated from JSDoc comments, include the tag `@requiresAddress`. + */ + address?: string; + } + + /** + * @beta + * Provides information about the invocation of a cancelable custom function. + * A cancelable custom function can provide a handler for the onCanceled event. + * + * To indicate that a function is cancelable, in the metadata JSON file, the function options should specify: + * `{ "cancelable": true }` + * + * If the metadata JSON file is being generated from JSDoc comments, include the tag `@cancelable`. + */ + interface CancelableInvocation extends Invocation { + /** + * @beta + * Event handler called when the custom function is canceled. */ onCanceled: () => void; } + + /** + * @beta + * @deprecated Use `CancelableInvocation` instead. + */ + interface CancelableHandler extends CancelableInvocation { + } + + /** + * @beta + * Provides information about the invocation of a streaming custom function. + * A streaming custom function can provide results which can change over time. + * + * Call `setResult()` one or more times to provide the result instead of returning + * a result from the function. + */ + interface StreamingInvocation extends CancelableInvocation { + /** + * @beta + * Set the result for the custom function. May be called more than once. + */ + setResult: (value: ResultType | Error) => void; + } + + /** + * @beta + * @deprecated Use `StreamingInvocation` instead. + */ + interface StreamingHandler extends StreamingInvocation { + } } diff --git a/types/custom-functions-runtime/tslint.json b/types/custom-functions-runtime/tslint.json index ad17c76132..bb858f4682 100644 --- a/types/custom-functions-runtime/tslint.json +++ b/types/custom-functions-runtime/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { "ban-types": false, - "file-name-casing": false + "file-name-casing": false, + "no-empty-interface": false } } diff --git a/types/cwd/cwd-tests.ts b/types/cwd/cwd-tests.ts new file mode 100644 index 0000000000..f1e6abc27b --- /dev/null +++ b/types/cwd/cwd-tests.ts @@ -0,0 +1,6 @@ +import cwd = require('cwd'); + +cwd(); // $ExpectType string +cwd('one/two.js'); // $ExpectType string +cwd('one', 'two.js'); // $ExpectType string +cwd(['one', 'two.js']); // $ExpectType string diff --git a/types/cwd/index.d.ts b/types/cwd/index.d.ts new file mode 100644 index 0000000000..3624944f7a --- /dev/null +++ b/types/cwd/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for cwd 0.10 +// Project: https://github.com/jonschlinkert/cwd +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = cwd; + +declare function cwd(pathSegments: string[]): string; +declare function cwd(...pathSegments: string[]): string; diff --git a/types/cwd/tsconfig.json b/types/cwd/tsconfig.json new file mode 100644 index 0000000000..65d5cac30e --- /dev/null +++ b/types/cwd/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", + "cwd-tests.ts" + ] +} diff --git a/types/cwd/tslint.json b/types/cwd/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cwd/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cycled/cycled-tests.ts b/types/cycled/cycled-tests.ts new file mode 100644 index 0000000000..f5945be629 --- /dev/null +++ b/types/cycled/cycled-tests.ts @@ -0,0 +1,53 @@ +import Cycled = require('cycled'); + +const cycled = new Cycled([1, 2, 3]); +// $ExpectType Cycled +cycled; + +// $ExpectType number +cycled.index; +cycled.index = 1; + +// $ExpectType number +cycled.current(); + +// $ExpectType number +cycled.next(); + +// $ExpectType number +cycled.previous(); + +// $ExpectType number +cycled.step(10); + +// $ExpectType Iterator +cycled.indefinitely(); + +// $ExpectType Iterator +cycled.indefinitelyReversed(); + +// $ExpectType number[] +[...cycled]; + +class TabComponent { + views: Cycled; + activeView: string; + + constructor(views: string[]) { + this.activeView = views[0]; + this.views = new Cycled(views); + } + + setActiveView(view: string) { + this.activeView = view; + this.views.index = this.views.indexOf(view); + } + + nextView() { + this.setActiveView(this.views.next()); + } + + previousView() { + this.setActiveView(this.views.previous()); + } +} diff --git a/types/cycled/index.d.ts b/types/cycled/index.d.ts new file mode 100644 index 0000000000..a0940934b8 --- /dev/null +++ b/types/cycled/index.d.ts @@ -0,0 +1,58 @@ +// Type definitions for cycled 1.0 +// Project: https://github.com/sindresorhus/cycled#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = Cycled; + +// tslint:disable:jsdoc-format +declare class Cycled extends Array { + /** + * Initiates an array subclass with the methods documented below. + * Since it's an array, you can use all the normal array methods on it. + * + * The instance is an iterable that will cycle through the array. + * It will cycle through the number of elements equaling the length of the array from the current index. + * ``` +const numberCycle = new Cycled([1,2,3,4,5]); + +console.log(...numberCycle); +//=> 1 2 3 4 5 +``` + * + * @param input + */ + constructor(input: T[]); + + /** + * Get or set the current index. + */ + index: number; + + /** + * Returns the current item. + */ + current(): T; + /** + * Returns the next item. + */ + next(): T; + /** + * Returns the previous item. + */ + previous(): T; + /** + * Returns the item by going the given amount of `steps` through the array. + * For example, calling `step(2)` is like calling `next()` twice. You go backward by specifying a negative number. + * @param steps + */ + step(steps: number): T; + /** + * Returns an iterable that will cycle through the array indefinitely. + */ + indefinitely(): Iterator; + /** + * Returns an iterable that will cycle through the array backward indefinitely. + */ + indefinitelyReversed(): Iterator; +} diff --git a/types/cycled/tsconfig.json b/types/cycled/tsconfig.json new file mode 100644 index 0000000000..a8fb15e11e --- /dev/null +++ b/types/cycled/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", + "cycled-tests.ts" + ] +} diff --git a/types/cycled/tslint.json b/types/cycled/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cycled/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cypress-axe/cypress-axe-tests.ts b/types/cypress-axe/cypress-axe-tests.ts new file mode 100644 index 0000000000..46bfe99c37 --- /dev/null +++ b/types/cypress-axe/cypress-axe-tests.ts @@ -0,0 +1 @@ +import 'cypress-axe'; diff --git a/types/cypress-axe/index.d.ts b/types/cypress-axe/index.d.ts new file mode 100644 index 0000000000..507a5f773d --- /dev/null +++ b/types/cypress-axe/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for cypress-axe 0.3 +// Project: https://github.com/avanslaars/cypress-axe#readme +// Definitions by: Justin Hall +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare namespace Cypress { + interface Chainable { + injectAxe(): void; + checkA11y(): void; + } +} diff --git a/types/cypress-axe/tsconfig.json b/types/cypress-axe/tsconfig.json new file mode 100644 index 0000000000..e71d30fe7d --- /dev/null +++ b/types/cypress-axe/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", + "cypress-axe-tests.ts" + ] +} diff --git a/types/cypress-axe/tslint.json b/types/cypress-axe/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cypress-axe/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index 7ea05577be..df6870c70a 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -1146,6 +1146,7 @@ declare namespace cytoscape { extends CollectionGraphManipulation, CollectionEvents, CollectionData, CollectionPosition, + CollectionTraversing, CollectionLayout, CollectionSelection, CollectionStyle, CollectionAnimation, CollectionComparision, CollectionIteration, diff --git a/types/d/auto-bind.d.ts b/types/d/auto-bind.d.ts new file mode 100644 index 0000000000..f52f8a955d --- /dev/null +++ b/types/d/auto-bind.d.ts @@ -0,0 +1,13 @@ +export = autoBind; + +declare function autoBind( + obj: { [key: string]: PropertyDescriptor }, + options?: autoBind.Options +): PropertyDescriptorMap; + +declare namespace autoBind { + interface Options { + overwriteDefinition?: boolean; + resolveContext?: (context: any) => any; + } +} diff --git a/types/d/d-tests.ts b/types/d/d-tests.ts new file mode 100644 index 0000000000..e08582cf0e --- /dev/null +++ b/types/d/d-tests.ts @@ -0,0 +1,85 @@ +import d = require('d'); +import autoBind = require('d/auto-bind'); +import lazy = require('d/lazy'); + +class Account {} +Object.defineProperties(Account.prototype, { + deposit: d(() => {}), + withdraw: d(() => {}), + balance: d.gs(() => {}), +}); + +d('foo'); // $ExpectType PropertyDescriptor +d('foo', { enumerable: true }); // $ExpectType PropertyDescriptor +d('c', 'foo'); // $ExpectType PropertyDescriptor +d('c', 'foo', { enumerable: true }); // $ExpectType PropertyDescriptor + +d('c', 'foo'); // $ExpectType PropertyDescriptor +d('e', 'foo'); // $ExpectType PropertyDescriptor +d('w', 'foo'); // $ExpectType PropertyDescriptor +d('ce', 'foo'); // $ExpectType PropertyDescriptor +d('cw', 'foo'); // $ExpectType PropertyDescriptor +d('ew', 'foo'); // $ExpectType PropertyDescriptor +d('cew', 'foo'); // $ExpectType PropertyDescriptor +d('foo', 'foo'); // $ExpectError + +d.gs('c', { enumerable: true }); // $ExpectType PropertyDescriptor +d.gs('c', () => ({}), { enumerable: true }); // $ExpectType PropertyDescriptor +d.gs(() => ({})); // $ExpectType PropertyDescriptor +d.gs(null, () => ({})); // $ExpectType PropertyDescriptor +d.gs(undefined, () => ({})); // $ExpectType PropertyDescriptor +d.gs('c', () => ({})); // $ExpectType PropertyDescriptor +d.gs('c', null, () => ({})); // $ExpectType PropertyDescriptor +d.gs('c', undefined, () => ({})); // $ExpectType PropertyDescriptor +d.gs('c', null, () => ({}), { enumerable: true }); // $ExpectType PropertyDescriptor +d.gs('c', undefined, () => ({}), { enumerable: true }); // $ExpectType PropertyDescriptor + +d.gs('c', () => ({})); // $ExpectType PropertyDescriptor +d.gs('e', () => ({})); // $ExpectType PropertyDescriptor +d.gs('ce', () => ({})); // $ExpectType PropertyDescriptor +d.gs('cew', () => ({})); // $ExpectError + +class Foo { + _count: number; +} + +Object.defineProperties( + Foo.prototype, + autoBind({ + increment: d(function(this: any) { + ++this._count; + }), + }) +); +autoBind( + { + increment: d(function(this: any) { + ++this._count; + }), + }, + { overwriteDefinition: true } +); +autoBind( + { + increment: d(function(this: any) { + ++this._count; + }), + }, + { + resolveContext(ctx: any) { + return ctx; + }, + } +); + +Object.defineProperties( + Foo.prototype, + lazy({ + items: d(() => { + return []; + }), + }) +); + +const foo = new Foo(); +(foo as any).items.push(1, 2); // foo.items array created and defined directly on foo diff --git a/types/d/index.d.ts b/types/d/index.d.ts new file mode 100644 index 0000000000..9130000999 --- /dev/null +++ b/types/d/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for d 1.0 +// Project: https://github.com/medikoo/d#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +export = d; + +declare function d(value: any, options?: PropertyDescriptor): PropertyDescriptor; +declare function d(flags: d.Flags, value: any, options?: PropertyDescriptor): PropertyDescriptor; + +declare namespace d { + function gs(flags: GetSetFlags, options: PropertyDescriptor): PropertyDescriptor; + function gs(flags: GetSetFlags, get: (...args: any[]) => any, options: PropertyDescriptor): PropertyDescriptor; + function gs( + get: (...args: any[]) => any, + set?: ((...args: any[]) => any) | null, + options?: PropertyDescriptor + ): PropertyDescriptor; + function gs( + get: ((...args: any[]) => any) | null | undefined, + set: (...args: any[]) => any, + options?: PropertyDescriptor + ): PropertyDescriptor; + function gs( + flags: GetSetFlags, + get: (...args: any[]) => any, + set?: ((...args: any[]) => any) | null, + options?: PropertyDescriptor + ): PropertyDescriptor; + function gs( + flags: GetSetFlags, + get: ((...args: any[]) => any) | null | undefined, + set: (...args: any[]) => any, + options?: PropertyDescriptor + ): PropertyDescriptor; + + type GetSetFlags = 'c' | 'e' | 'ce'; + type Flags = GetSetFlags | 'w' | 'cw' | 'ew' | 'cew'; +} diff --git a/types/d/lazy.d.ts b/types/d/lazy.d.ts new file mode 100644 index 0000000000..3cba797050 --- /dev/null +++ b/types/d/lazy.d.ts @@ -0,0 +1,3 @@ +export = lazy; + +declare function lazy(obj: { [key: string]: PropertyDescriptor }): PropertyDescriptorMap; diff --git a/types/d/tsconfig.json b/types/d/tsconfig.json new file mode 100644 index 0000000000..26c1a65f3e --- /dev/null +++ b/types/d/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "auto-bind.d.ts", + "lazy.d.ts", + "d-tests.ts" + ] +} diff --git a/types/d/tslint.json b/types/d/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/d/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/d3-cloud/d3-cloud-tests.ts b/types/d3-cloud/d3-cloud-tests.ts index 862b7f0d82..e3bffed4cb 100644 --- a/types/d3-cloud/d3-cloud-tests.ts +++ b/types/d3-cloud/d3-cloud-tests.ts @@ -1,3 +1,12 @@ +import d3Cloud = require('./index.d'); +import d3 = require('d3'); + +// $ExpectType Cloud +d3Cloud(); + +// $ExpectType Cloud +d3.layout.cloud(); + interface ICompTextSize{ text:string; size:number; diff --git a/types/d3-cloud/index.d.ts b/types/d3-cloud/index.d.ts index 70e2140bd5..fdf2dbc719 100644 --- a/types/d3-cloud/index.d.ts +++ b/types/d3-cloud/index.d.ts @@ -5,6 +5,8 @@ import * as d3 from 'd3'; +export = d3.layout.cloud; + declare module 'd3' { namespace layout { export function cloud(): Cloud; diff --git a/types/d3-dsv/d3-dsv-tests.ts b/types/d3-dsv/d3-dsv-tests.ts index 259180632f..8e05b04e61 100644 --- a/types/d3-dsv/d3-dsv-tests.ts +++ b/types/d3-dsv/d3-dsv-tests.ts @@ -21,6 +21,9 @@ const csvTestStringWithHeader = `Year,Make,Model,Length\n${csvTestString}`; const tsvTestStringWithHeader = `Year\tMake\tModel\tLength\n${tsvTestString}`; const pipedTestStringWithHeader = `Year|Make|Model|Length\n${pipedTestString}`; +type Headers = "Year" | "Make" | "Model" | "Length"; +type ParsedHeaders = "year" | "make" | "model" | "length"; + interface ParsedTestObject { year: Date | null; make: string; @@ -28,17 +31,56 @@ interface ParsedTestObject { length: number; } -let parseArray: d3Dsv.DSVParsedArray; -let parseMappedArray: d3Dsv.DSVParsedArray; - let parseRowsArray: string[][]; let parseRowsMappedArray: ParsedTestObject[]; - let parsedTestObject: ParsedTestObject; -let columns: string[]; + +let num: number; let str: string; let strMaybe: string | undefined; +let columns: string[]; +let headers: Headers[]; +let parsedHeaders: ParsedHeaders[]; + +// ------------------------------------------------------------------------------------------ +// Test Shared Types and Interfaces +// ------------------------------------------------------------------------------------------ + +declare let row: d3Dsv.DSVRowString; +strMaybe = row.property; + +declare let row2: d3Dsv.DSVRowString; +strMaybe = row2.Make; +strMaybe = row2.Property; // $ExpectError + +declare let raw: d3Dsv.DSVRaw; +strMaybe = raw.make; +strMaybe = raw.property; // $ExpectError + +declare let rowArray: d3Dsv.DSVRowArray; +strMaybe = rowArray[0].property; +columns = rowArray.columns; +num = rowArray.length; + +declare let rowArrayHeader: d3Dsv.DSVRowArray; +strMaybe = rowArrayHeader[0].Make; +strMaybe = rowArrayHeader[0].Property; // $ExpectError +headers = rowArrayHeader.columns; +num = rowArrayHeader.length; + +declare let parseMappedArray: d3Dsv.DSVParsedArray; +strMaybe = parseMappedArray[0].make; +strMaybe = parseMappedArray[0].property; // $ExpectError +parsedTestObject = parseMappedArray[0]; +parsedHeaders = parseMappedArray.columns; +num = parseMappedArray.length; + +declare let parseArray: d3Dsv.DSVParsedArray; +strMaybe = parseArray[0].property; +columns = parseArray.columns; +num = parseArray.length; + // ------------------------------------------------------------------------------------------ // Test CSV // ------------------------------------------------------------------------------------------ @@ -48,8 +90,7 @@ let strMaybe: string | undefined; // without row mapper ----------------------------------------------------------------------- parseArray = d3Dsv.csvParse(csvTestStringWithHeader); -columns = parseArray.columns; -strMaybe = parseArray[0].Year; +rowArrayHeader = d3Dsv.csvParse(csvTestStringWithHeader); // with row mapper --------------------------------------------------------------------------- @@ -73,8 +114,12 @@ parseMappedArray = d3Dsv.csvParse(csvTestStringWithHeader, (rawRow, index, colum return pr; }); -columns = parseMappedArray.columns; -parsedTestObject = parseMappedArray[0]; +parseMappedArray = d3Dsv.csvParse(csvTestStringWithHeader, (rawRow, index, columns) => { + const rr: d3Dsv.DSVRowString = rawRow; + const i: number = index; + const c: Headers[] = columns; + return parsedTestObject; +}); // csvParseRows(...) ============================================================================ @@ -108,12 +153,11 @@ parseRowsMappedArray = d3Dsv.csvParseRows(csvTestString, (rawRow, index) => { str = d3Dsv.csvFormat(parseRowsMappedArray); str = d3Dsv.csvFormat(parseRowsMappedArray, ["year", "length"]); -// $ExpectError -str = d3Dsv.csvFormat(parseRowsMappedArray, ["year", "unknown"]); +str = d3Dsv.csvFormat(parseRowsMappedArray, ["year", "unknown"]); // $ExpectError // csvFormatRows(...) ======================================================================== -str = d3Dsv.csvFormatRows(parseRowsMappedArray.map((d, i) => [ +str = d3Dsv.csvFormatRows(parseRowsMappedArray.map((d) => [ d.year ? d.year.getFullYear().toString() : '', d.make, d.model, @@ -129,8 +173,7 @@ str = d3Dsv.csvFormatRows(parseRowsMappedArray.map((d, i) => [ // without row mapper ----------------------------------------------------------------------- parseArray = d3Dsv.tsvParse(tsvTestStringWithHeader); -columns = parseArray.columns; -strMaybe = parseArray[0].Year; +rowArrayHeader = d3Dsv.tsvParse(csvTestStringWithHeader); // with row mapper --------------------------------------------------------------------------- @@ -154,8 +197,12 @@ parseMappedArray = d3Dsv.tsvParse(tsvTestStringWithHeader, (rawRow, index, colum return pr; }); -columns = parseMappedArray.columns; -parsedTestObject = parseMappedArray[0]; +parseMappedArray = d3Dsv.tsvParse(tsvTestStringWithHeader, (rawRow, index, columns) => { + const rr: d3Dsv.DSVRowString = rawRow; + const i: number = index; + const c: Headers[] = columns; + return parsedTestObject; +}); // tsvParseRows(...) ============================================================================ @@ -189,12 +236,11 @@ parseRowsMappedArray = d3Dsv.tsvParseRows(tsvTestString, (rawRow, index) => { str = d3Dsv.tsvFormat(parseRowsMappedArray); str = d3Dsv.tsvFormat(parseRowsMappedArray, ["year", "length"]); -// $ExpectError -str = d3Dsv.tsvFormat(parseRowsMappedArray, ["year", "unknown"]); +str = d3Dsv.tsvFormat(parseRowsMappedArray, ["year", "unknown"]); // $ExpectError // tsvFormatRows(...) ======================================================================== -str = d3Dsv.tsvFormatRows(parseRowsMappedArray.map((d, i) => [ +str = d3Dsv.tsvFormatRows(parseRowsMappedArray.map((d) => [ d.year ? d.year.getFullYear().toString() : '', d.make, d.model, @@ -215,8 +261,7 @@ dsv = d3Dsv.dsvFormat('|'); // without row mapper ----------------------------------------------------------------------- parseArray = dsv.parse(pipedTestStringWithHeader); -columns = parseArray.columns; -strMaybe = parseArray[0].Year; +rowArrayHeader = dsv.parse(csvTestStringWithHeader); // with row mapper --------------------------------------------------------------------------- @@ -240,8 +285,12 @@ parseMappedArray = dsv.parse(pipedTestStringWithHeader, (rawRow, index, columns) return pr; }); -columns = parseMappedArray.columns; -parsedTestObject = parseMappedArray[0]; +parseMappedArray = dsv.parse(pipedTestStringWithHeader, (rawRow, index, columns) => { + const rr: d3Dsv.DSVRowString = rawRow; + const i: number = index; + const c: Headers[] = columns; + return parsedTestObject; +}); // parseRows(...) ============================================================================ @@ -275,12 +324,11 @@ parseRowsMappedArray = dsv.parseRows(pipedTestString, (rawRow, index) => { str = dsv.format(parseRowsMappedArray); str = dsv.format(parseRowsMappedArray, ["year", "length"]); -// $ExpectError -str = dsv.format(parseRowsMappedArray, ["year", "unknown"]); +str = dsv.format(parseRowsMappedArray, ["year", "unknown"]); // $ExpectError // formatRows(...) ======================================================================== -str = dsv.formatRows(parseRowsMappedArray.map((d, i) => [ +str = dsv.formatRows(parseRowsMappedArray.map((d) => [ d.year ? d.year.getFullYear().toString() : '', d.make, d.model, diff --git a/types/d3-dsv/index.d.ts b/types/d3-dsv/index.d.ts index bdebc5ca01..fcfaa67339 100644 --- a/types/d3-dsv/index.d.ts +++ b/types/d3-dsv/index.d.ts @@ -15,21 +15,41 @@ /** * An object representing a DSV parsed row with values represented as strings. + * When the DSV content is not well-structured and some column-values are missing, `undefined` is used as value. */ -export interface DSVRowString { - [key: string]: string | undefined; -} +export type DSVRowString = { + [key in Columns]: string | undefined; +}; + +/** + * An object in raw format before parsing, that is with only string values. + * When the DSV content is not well-structured and some column-values are missing, `undefined` is used as value. + */ +export type DSVRaw = { + [key in keyof T]: string | undefined; +}; /** * An object representing a DSV parsed row with values represented as an arbitrary datatype, depending * on the performed parsed row mapping. * - * @deprecated + * @deprecated Use `object` instead. */ export interface DSVRowAny { [key: string]: any; } +/** + * An array object representing all deserialized rows. The array is enhanced with a property listing + * the names of the parsed columns. + */ +export interface DSVRowArray extends Array> { + /** + * List of column names. + */ + columns: Columns[]; +} + /** * An array object representing all parsed rows. The array is enhanced with a property listing * the names of the parsed columns. @@ -38,7 +58,7 @@ export interface DSVParsedArray extends Array { /** * List of column names. */ - columns: string[]; + columns: Array; } // ------------------------------------------------------------------------------------------ @@ -55,11 +75,12 @@ export interface DSVParsedArray extends Array { * * The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary). * - * Equivalent to dsvFormat(",").parse. + * Equivalent to `dsvFormat(",").parse`. * * @param csvString A string, which must be in the comma-separated values format. */ -export function csvParse(csvString: string): DSVParsedArray; +// tslint:disable-next-line:no-unnecessary-generics +export function csvParse(csvString: string): DSVRowArray; /** * Parses the specified string, which must be in the comma-separated values format, returning an array of objects representing the parsed rows. * @@ -68,7 +89,7 @@ export function csvParse(csvString: string): DSVParsedArray; * * The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary). * - * Equivalent to dsvFormat(",").parse. + * Equivalent to `dsvFormat(",").parse`. * * @param csvString A string, which must be in the comma-separated values format. * @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d), @@ -76,9 +97,9 @@ export function csvParse(csvString: string): DSVParsedArray; * the row is skipped and will be omitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object. * In effect, row is similar to applying a map and filter operator to the returned rows. */ -export function csvParse( +export function csvParse( csvString: string, - row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null + row: (rawRow: DSVRowString, index: number, columns: Columns[]) => ParsedRow | undefined | null ): DSVParsedArray; // csvParseRows(...) ======================================================================== @@ -92,7 +113,7 @@ export function csvParse( * If a row conversion function is not specified, field values are strings. For safety, there is no automatic conversion to numbers, dates, or other types. * In some cases, JavaScript may coerce strings to numbers for you automatically (for example, using the + operator), but better is to specify a row conversion function. * - * Equivalent to dsvFormat(",").parseRows. + * Equivalent to `dsvFormat(",").parseRows`. * * @param csvString A string, which must be in the comma-separated values format. */ @@ -103,7 +124,7 @@ export function csvParseRows(csvString: string): string[][]; * Unlike csvParse, this method treats the header line as a standard row, and should be used whenever CSV content does not contain a header. * Each row is represented as an array rather than an object. Rows may have variable length. * - * Equivalent to dsvFormat(",").parseRows. + * Equivalent to `dsvFormat(",").parseRows`. * * @param csvString A string, which must be in the comma-separated values format. * @param row A row conversion function which is invoked for each row, being passed an array representing the current row (d), the index (i) @@ -127,7 +148,7 @@ export function csvParseRows( * If columns is not specified, the list of column names that forms the header row is determined by the union of all properties on all objects in rows; * the order of columns is nondeterministic. * - * Equivalent to dsvFormat(",").format. + * Equivalent to `dsvFormat(",").format`. * * @param rows Array of object rows. * @param columns An array of strings representing the column names. @@ -145,7 +166,7 @@ export function csvFormat(rows: T[], columns?: Array) * To convert an array of objects to an array of arrays while explicitly specifying the columns, use array.map. * If you like, you can also array.concat this result with an array of column names to generate the first row. * - * Equivalent to dsvFormat(",").formatRows. + * Equivalent to `dsvFormat(",").formatRows`. * * @param rows An array of array of string rows. */ @@ -165,11 +186,12 @@ export function csvFormatRows(rows: string[][]): string; * * The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary). * - * Equivalent to dsvFormat("\t").parse. + * Equivalent to `dsvFormat("\t").parse`. * * @param tsvString A string, which must be in the tab-separated values format. */ -export function tsvParse(tsvString: string): DSVParsedArray; +// tslint:disable-next-line:no-unnecessary-generics +export function tsvParse(tsvString: string): DSVRowArray; /** * Parses the specified string, which must be in the tab-separated values format, returning an array of objects representing the parsed rows. * @@ -178,7 +200,7 @@ export function tsvParse(tsvString: string): DSVParsedArray; * * The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary). * - * Equivalent to dsvFormat("\t").parse. + * Equivalent to `dsvFormat("\t").parse`. * * @param tsvString A string, which must be in the tab-separated values format. * @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d), @@ -186,10 +208,10 @@ export function tsvParse(tsvString: string): DSVParsedArray; * the row is skipped and will be omitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object. * In effect, row is similar to applying a map and filter operator to the returned rows. */ -export function tsvParse( +export function tsvParse( tsvString: string, - row: (rawRow: DSVRowString, index: number, columns: string[]) => MappedRow | undefined | null -): DSVParsedArray; + row: (rawRow: DSVRowString, index: number, columns: Columns[]) => ParsedRow | undefined | null +): DSVParsedArray; // tsvParseRows(...) ======================================================================== @@ -202,7 +224,7 @@ export function tsvParse( * If a row conversion function is not specified, field values are strings. For safety, there is no automatic conversion to numbers, dates, or other types. * In some cases, JavaScript may coerce strings to numbers for you automatically (for example, using the + operator), but better is to specify a row conversion function. * - * Equivalent to dsvFormat("\t").parseRows. + * Equivalent to `dsvFormat("\t").parseRows`. * * @param tsvString A string, which must be in the tab-separated values format. */ @@ -213,7 +235,7 @@ export function tsvParseRows(tsvString: string): string[][]; * Unlike tsvParse, this method treats the header line as a standard row, and should be used whenever TSV content does not contain a header. * Each row is represented as an array rather than an object. Rows may have variable length. * - * Equivalent to dsvFormat("\t").parseRows. + * Equivalent to `dsvFormat("\t").parseRows`. * * @param tsvString A string, which must be in the tab-separated values format. * @param row A row conversion function which is invoked for each row, being passed an array representing the current row (d), the index (i) @@ -221,10 +243,10 @@ export function tsvParseRows(tsvString: string): string[][]; * the row is skipped and will be omitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object. * In effect, row is similar to applying a map and filter operator to the returned rows. */ -export function tsvParseRows( +export function tsvParseRows( tsvString: string, - row: (rawRow: string[], index: number) => MappedRow | undefined | null -): MappedRow[]; + row: (rawRow: string[], index: number) => ParsedRow | undefined | null +): ParsedRow[]; // tsvFormat(...) ============================================================================ @@ -237,7 +259,7 @@ export function tsvParseRows( * If columns is not specified, the list of column names that forms the header row is determined by the union of all properties on all objects in rows; * the order of columns is nondeterministic. * - * Equivalent to dsvFormat("\t").format. + * Equivalent to `dsvFormat("\t").format`. * * @param rows Array of object rows. * @param columns An array of strings representing the column names. @@ -255,7 +277,7 @@ export function tsvFormat(rows: T[], columns?: Array) * To convert an array of objects to an array of arrays while explicitly specifying the columns, use array.map. * If you like, you can also array.concat this result with an array of column names to generate the first row. * - * Equivalent to dsvFormat("\t").formatRows. + * Equivalent to `dsvFormat("\t").formatRows`. * * @param rows An array of array of string rows. */ @@ -279,7 +301,8 @@ export interface DSV { * * @param dsvString A string, which must be in the delimiter-separated values format with the appropriate delimiter. */ - parse(dsvString: string): DSVParsedArray; + // tslint:disable-next-line:no-unnecessary-generics + parse(dsvString: string): DSVRowArray; /** * Parses the specified string, which must be in the delimiter-separated values format with the appropriate delimiter, returning an array of objects representing the parsed rows. * @@ -294,9 +317,9 @@ export interface DSV { * the row is skipped and will be omitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object. * In effect, row is similar to applying a map and filter operator to the returned rows. */ - parse( + parse( dsvString: string, - row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null + row: (rawRow: DSVRowString, index: number, columns: Columns[]) => ParsedRow | undefined | null ): DSVParsedArray; /** diff --git a/types/d3-fetch/d3-fetch-tests.ts b/types/d3-fetch/d3-fetch-tests.ts index 9712a0da15..8d6b862afc 100644 --- a/types/d3-fetch/d3-fetch-tests.ts +++ b/types/d3-fetch/d3-fetch-tests.ts @@ -1,62 +1,158 @@ import * as d3Fetch from 'd3-fetch'; -import { DSVParsedArray, DSVRowString, DSVRowAny } from 'd3-dsv'; +import { DSVParsedArray, DSVRaw, DSVRowString } from 'd3-dsv'; -interface MyType { - foo: string; +// ---------------------------------------------------------------------------- +// Preparatory Steps +// ---------------------------------------------------------------------------- + +type Headers = "Year" | "Make" | "Model" | "Length"; + +interface Car { + year: Date; + make: string; + model: string; + length: number; } -const url = 'foo.bar'; - -const init: RequestInit = {}; - -let p1: Promise = d3Fetch.blob(url); -p1 = d3Fetch.blob(url, init); - -let p2: Promise = d3Fetch.buffer(url); -p2 = d3Fetch.buffer(url, init); - -let p3: Promise = d3Fetch.image(url); -const imageProperties = { - width: '300px', - height: '500px' -}; -p3 = d3Fetch.image(url, imageProperties); - -let p4: Promise = d3Fetch.json(url); -p4 = d3Fetch.json(url, init); -let p5: Promise = d3Fetch.json(url); -p5 = d3Fetch.json(url, init); - -let myString: Promise; -myString = d3Fetch.text(url); -myString = d3Fetch.text(url, init); - -const parseRow = (rawRow: DSVRowString, index: number, columns: string[]): (MyType | undefined | null) => { - const myType: MyType | null = rawRow['foo'] ? { foo: rawRow['foo'] + '+ bar' } : null; - return myType; -}; -let promise1: Promise>; -let promise2: Promise>; -promise1 = d3Fetch.csv(url); -promise1 = d3Fetch.csv(url, init); -promise2 = d3Fetch.csv(url, parseRow); -promise2 = d3Fetch.csv(url, init, parseRow); -promise1 = d3Fetch.dsv(';', url); -promise1 = d3Fetch.dsv(';', url, init); -promise2 = d3Fetch.dsv(';', url, parseRow); -promise2 = d3Fetch.dsv(';', url, init, parseRow); -promise1 = d3Fetch.tsv(url); -promise1 = d3Fetch.tsv(url, init); -promise2 = d3Fetch.tsv(url, parseRow); -promise2 = d3Fetch.tsv(url, init, parseRow); - +let anyPromise: Promise; +let arrayPromise: Promise; +let blobPromise: Promise; let docPromise: Promise; +let imagePromise: Promise; +let carPromise: Promise; +let stringPromise: Promise; +let xmlDocPromise: Promise; + +const url = 'example.org'; +const init: RequestInit = {}; +const map = new Map(); + +const imageProperties = { + width: 300, + height: 500, + crossOrigin: "anonymous", +}; + +// ---------------------------------------------------------------------------- +// Non DSV file format +// ---------------------------------------------------------------------------- + +blobPromise = d3Fetch.blob(url); +blobPromise = d3Fetch.blob(url, init); + +arrayPromise = d3Fetch.buffer(url); +arrayPromise = d3Fetch.buffer(url, init); + +imagePromise = d3Fetch.image(url); +imagePromise = d3Fetch.image(url, imageProperties); +// $ExpectError +imagePromise = d3Fetch.image(url, {width: "500px"}); // fails, string not assignable to number | undefined + +anyPromise = d3Fetch.json(url); +anyPromise = d3Fetch.json(url, init); + +carPromise = d3Fetch.json(url); +carPromise = d3Fetch.json(url, init); + +stringPromise = d3Fetch.text(url); +stringPromise = d3Fetch.text(url, init); + docPromise = d3Fetch.html(url); docPromise = d3Fetch.html(url, init); docPromise = d3Fetch.svg(url); docPromise = d3Fetch.svg(url, init); -let xmlDocPromise: Promise; xmlDocPromise = d3Fetch.xml(url); xmlDocPromise = d3Fetch.xml(url, init); + +// ---------------------------------------------------------------------------- +// DSV file format +// ---------------------------------------------------------------------------- + +let rawPromise: Promise>; +let rawPromiseHeader: Promise>>; +let parsedPromise: Promise>; + +declare const parseRowString: (rawRow: DSVRowString, index: number, columns: string[]) => Car | undefined | null; + +const parseRow = (d: DSVRowString, index: number, columns: Headers[]): Car | undefined | null => { + const item: string | undefined = d[columns[0]]; + const car = d.Make === 'Ford' ? null : + { + year: new Date(+d.Make!, 0, 1), + make: d.Make!, + model: d.Model!, + length: +d.Length!, + }; + return index % 2 === 0 ? undefined : car; +}; + +const parseRowSimple = (d: DSVRaw) => { + return { + year: new Date(+d.make!, 0, 1), + make: d.make!, + model: d.model!, + length: +d.length!, + }; +}; + +// CSV + +rawPromise = d3Fetch.csv(url); +rawPromise = d3Fetch.csv(url, init); + +rawPromiseHeader = d3Fetch.csv(url); +rawPromiseHeader = d3Fetch.csv(url, init); + +parsedPromise = d3Fetch.csv(url, parseRowString); +parsedPromise = d3Fetch.csv(url, init, parseRowString); + +parsedPromise = d3Fetch.csv(url, parseRow); +parsedPromise = d3Fetch.csv(url, init, parseRow); + +parsedPromise = d3Fetch.csv(url, parseRow); +parsedPromise = d3Fetch.csv(url, init, parseRow); +parsedPromise = d3Fetch.csv(url, parseRowSimple); + +anyPromise = d3Fetch.csv(url, (d: DSVRaw) => map.set(d.model!, +d.year!)); + +// DSV + +rawPromise = d3Fetch.dsv("|", url); +rawPromise = d3Fetch.dsv("|", url, init); + +rawPromiseHeader = d3Fetch.dsv("|", url); +rawPromiseHeader = d3Fetch.dsv("|", url, init); + +parsedPromise = d3Fetch.dsv("|", url, parseRowString); +parsedPromise = d3Fetch.dsv("|", url, init, parseRowString); + +parsedPromise = d3Fetch.dsv("|", url, parseRow); +parsedPromise = d3Fetch.dsv("|", url, init, parseRow); + +parsedPromise = d3Fetch.dsv("|", url, parseRow); +parsedPromise = d3Fetch.dsv("|", url, init, parseRow); +parsedPromise = d3Fetch.dsv("|", url, parseRowSimple); + +anyPromise = d3Fetch.dsv("|", url, (d: DSVRaw) => map.set(d.model!, +d.year!)); + +// TSV + +rawPromise = d3Fetch.tsv(url); +rawPromise = d3Fetch.tsv(url, init); + +rawPromiseHeader = d3Fetch.tsv(url); +rawPromiseHeader = d3Fetch.tsv(url, init); + +parsedPromise = d3Fetch.tsv(url, parseRowString); +parsedPromise = d3Fetch.tsv(url, init, parseRowString); + +parsedPromise = d3Fetch.tsv(url, parseRow); +parsedPromise = d3Fetch.tsv(url, init, parseRow); + +parsedPromise = d3Fetch.tsv(url, parseRow); +parsedPromise = d3Fetch.tsv(url, init, parseRow); +parsedPromise = d3Fetch.tsv(url, parseRowSimple); + +anyPromise = d3Fetch.csv(url, (d: DSVRaw) => map.set(d.model!, +d.year!)); diff --git a/types/d3-fetch/index.d.ts b/types/d3-fetch/index.d.ts index 3ea81690a0..4110ba4a7b 100644 --- a/types/d3-fetch/index.d.ts +++ b/types/d3-fetch/index.d.ts @@ -1,12 +1,13 @@ // Type definitions for d3-fetch 1.1 // Project: https://d3js.org/d3-fetch/ // Definitions by: Hugues Stefanski +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 // Last module patch version validated against: 1.1.0 -import { DSVParsedArray, DSVRowString, DSVRowAny } from 'd3-dsv'; +import { DSVParsedArray, DSVRowArray, DSVRowString } from "d3-dsv"; /** * Fetches the binary file at the specified input URL and returns it as a Promise of a Blob. @@ -33,13 +34,15 @@ export function buffer(url: string, init?: RequestInit): Promise; * * If init is specified, it is passed along to the underlying call to fetch. * + * The generic parameter describes the column names as a union of string literal types. + * * @param url A valid URL string. * @param init An optional request initialization object. */ -export function csv( +export function csv( url: string, - init?: RequestInit, -): Promise>; + init?: RequestInit +): Promise>; /** * Fetches the CSV file at the specified input URL and returns * a promise of an array of objects representing the parsed rows. @@ -47,7 +50,8 @@ export function csv( * The specified row conversion function is used to map and filter row objects to a more-specific representation; * see dsv.csvParse for details. * - * The generic parameter describes the type of the object representation of a parsed row. + * The first generic parameter describes the type of the object representation of a parsed row. + * The second generic parameter describes the column names as a union of string literal types. * * @param url A valid URL string. * @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d), @@ -55,9 +59,9 @@ export function csv( * the row is skipped and will be omitted from the array returned by dsv.csvParse; otherwise, the returned value defines the corresponding row object. * In effect, row is similar to applying a map and filter operator to the returned rows. */ -export function csv( +export function csv( url: string, - row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null + row: (rawRow: DSVRowString, index: number, columns: Columns[]) => ParsedRow | undefined | null ): Promise>; /** * Fetches the CSV file at the specified input URL and returns @@ -68,7 +72,8 @@ export function csv( * The specified row conversion function is used to map and filter row objects to a more-specific representation; * see dsv.csvParse for details. * - * The generic parameter describes the type of the object representation of a parsed row. + * The first generic parameter describes the type of the object representation of a parsed row. + * The second generic parameter describes the column names as a union of string literal types. * * @param url A valid URL string. * @param init An request initialization object. @@ -77,10 +82,10 @@ export function csv( * the row is skipped and will be omitted from the array returned by dsv.csvParse; otherwise, the returned value defines the corresponding row object. * In effect, row is similar to applying a map and filter operator to the returned rows. */ -export function csv( +export function csv( url: string, init: RequestInit, - row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null + row: (rawRow: DSVRowString, index: number, columns: Columns[]) => ParsedRow | undefined | null ): Promise>; /** @@ -90,15 +95,17 @@ export function csv( * * If init is specified, it is passed along to the underlying call to fetch. * + * The generic parameter describes the column names as a union of string literal types. + * * @param delimiter The delimiter character used in the DSV file to be fetched. * @param url A valid URL string. * @param init An optional request initialization object. */ -export function dsv( +export function dsv( delimiter: string, url: string, - init?: RequestInit, -): Promise>; + init?: RequestInit +): Promise>; /** * Fetches the DSV file with the specified delimiter character at the specified input URL and returns * a promise of an array of objects representing the parsed rows. @@ -106,7 +113,8 @@ export function dsv( * The specified row conversion function is used to map and filter row objects to a more-specific representation; * see dsv.parse for details. * - * The generic parameter describes the type of the object representation of a parsed row. + * The first generic parameter describes the type of the object representation of a parsed row. + * The second generic parameter describes the column names as a union of string literal types. * * @param delimiter The delimiter character used in the DSV file to be fetched. * @param url A valid URL string. @@ -115,10 +123,10 @@ export function dsv( * the row is skipped and will be omitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object. * In effect, row is similar to applying a map and filter operator to the returned rows. */ -export function dsv( +export function dsv( delimiter: string, url: string, - row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null + row: (rawRow: DSVRowString, index: number, columns: Columns[]) => ParsedRow | undefined | null ): Promise>; /** * Fetches the DSV file with the specified delimiter character at the specified input URL and returns @@ -129,7 +137,8 @@ export function dsv( * The specified row conversion function is used to map and filter row objects to a more-specific representation; * see dsv.parse for details. * - * The generic parameter describes the type of the object representation of a parsed row. + * The first generic parameter describes the type of the object representation of a parsed row. + * The second generic parameter describes the column names as a union of string literal types. * * @param delimiter The delimiter character used in the DSV file to be fetched. * @param url A valid URL string. @@ -139,11 +148,11 @@ export function dsv( * the row is skipped and will be omitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object. * In effect, row is similar to applying a map and filter operator to the returned rows. */ -export function dsv( +export function dsv( delimiter: string, url: string, init: RequestInit, - row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null + row: (rawRow: DSVRowString, index: number, columns: Columns[]) => ParsedRow | undefined | null ): Promise>; /** @@ -164,7 +173,7 @@ export function html(url: string, init?: RequestInit): Promise; * @param url A valid URL string. * @param init An optional object of image properties to set. */ -export function image(url: string, init?: {[key: string]: any}): Promise; +export function image(url: string, init?: Partial): Promise; /** * Fetches the json file at the specified input URL and returns it as a Promise of a parsed JSON object. @@ -204,13 +213,15 @@ export function text(url: string, init?: RequestInit): Promise; * * If init is specified, it is passed along to the underlying call to fetch. * + * The generic parameter describes the column names as a union of string literal types. + * * @param url A valid URL string. * @param init An optional request initialization object. */ -export function tsv( +export function tsv( url: string, - init?: RequestInit, -): Promise>; + init?: RequestInit +): Promise>; /** * Fetches the TSV file at the specified input URL and returns * a promise of an array of objects representing the parsed rows. The values of the properties of the parsed row @@ -219,7 +230,8 @@ export function tsv( * The specified row conversion function is used to map and filter row objects to a more-specific representation; * see dsv.tsvParse for details. * - * The generic parameter describes the type of the object representation of a parsed row. + * The first generic parameter describes the type of the object representation of a parsed row. + * The second generic parameter describes the column names as a union of string literal types. * * @param url A valid URL string. * @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d), @@ -227,9 +239,9 @@ export function tsv( * the row is skipped and will be omitted from the array returned by dsv.tsvParse; otherwise, the returned value defines the corresponding row object. * In effect, row is similar to applying a map and filter operator to the returned rows. */ -export function tsv( +export function tsv( url: string, - row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null + row: (rawRow: DSVRowString, index: number, columns: Columns[]) => ParsedRow | undefined | null ): Promise>; /** * Fetches the TSV file at the specified input URL and returns @@ -240,7 +252,8 @@ export function tsv( * The specified row conversion function is used to map and filter row objects to a more-specific representation; * see dsv.tsvParse for details. * - * The generic parameter describes the type of the object representation of a parsed row. + * The first generic parameter describes the type of the object representation of a parsed row. + * The second generic parameter describes the column names as a union of string literal types. * * @param url A valid URL string. * @param init An request initialization object. @@ -249,10 +262,10 @@ export function tsv( * the row is skipped and will be omitted from the array returned by dsv.tsvParse; otherwise, the returned value defines the corresponding row object. * In effect, row is similar to applying a map and filter operator to the returned rows. */ -export function tsv( +export function tsv( url: string, init: RequestInit, - row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null + row: (rawRow: DSVRowString, index: number, columns: Columns[]) => ParsedRow | undefined | null ): Promise>; /** diff --git a/types/d3-geo/d3-geo-tests.ts b/types/d3-geo/d3-geo-tests.ts index 6e824e8e69..36c4debbe3 100644 --- a/types/d3-geo/d3-geo-tests.ts +++ b/types/d3-geo/d3-geo-tests.ts @@ -371,6 +371,7 @@ const gnomonicRaw: d3Geo.GeoRawProjection = d3Geo.geoGnomonicRaw(); const mercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoMercatorRaw(); const orthographicRaw: d3Geo.GeoRawProjection = d3Geo.geoOrthographicRaw(); const stereographicRaw: d3Geo.GeoRawProjection = d3Geo.geoStereographicRaw(); +const equalEarthRaw: d3Geo.GeoRawProjection = d3Geo.geoEqualEarthRaw(); const transverseMercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoTransverseMercatorRaw(); const naturalEarth1Raw: d3Geo.GeoRawProjection = d3Geo.geoNaturalEarth1Raw(); @@ -398,6 +399,7 @@ const gnomonic: d3Geo.GeoProjection = d3Geo.geoGnomonic(); const mercator: d3Geo.GeoProjection = d3Geo.geoMercator(); const orthographic: d3Geo.GeoProjection = d3Geo.geoOrthographic(); const stereographic: d3Geo.GeoProjection = d3Geo.geoStereographic(); +const equalEarth: d3Geo.GeoProjection = d3Geo.geoEqualEarth(); const transverseMercator: d3Geo.GeoProjection = d3Geo.geoTransverseMercator(); const naturalEarth1: d3Geo.GeoProjection = d3Geo.geoNaturalEarth1(); diff --git a/types/d3-geo/index.d.ts b/types/d3-geo/index.d.ts index 8f22503d71..16c51dfae6 100644 --- a/types/d3-geo/index.d.ts +++ b/types/d3-geo/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for D3JS d3-geo module 1.10 +// Type definitions for D3JS d3-geo module 1.11 // Project: https://github.com/d3/d3-geo/ // Definitions by: Hugues Stefanski , Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Last module patch version validated against: 1.10.0 +// Last module patch version validated against: 1.11.3 import * as GeoJSON from 'geojson'; @@ -1345,11 +1345,22 @@ export function geoOrthographicRaw(): GeoRawProjection; * The stereographic projection. */ export function geoStereographic(): GeoProjection; + /** * The raw stereographic projection. */ export function geoStereographicRaw(): GeoRawProjection; +/** + * The Equal Eartch projection, by Bojan Šavrič et al., 2018. + */ +export function geoEqualEarth(): GeoProjection; + +/** + * The raw Equal Earth projection, by Bojan Šavrič et al., 2018. + */ +export function geoEqualEarthRaw(): GeoRawProjection; + // Composite Projections --------------------------------------------------- /** diff --git a/types/d3-hierarchy/d3-hierarchy-tests.ts b/types/d3-hierarchy/d3-hierarchy-tests.ts index 16b372993d..b5982a4d5f 100644 --- a/types/d3-hierarchy/d3-hierarchy-tests.ts +++ b/types/d3-hierarchy/d3-hierarchy-tests.ts @@ -12,6 +12,7 @@ import * as d3Hierarchy from 'd3-hierarchy'; // Preparatory Steps // ----------------------------------------------------------------------- +let str: string; let num: number; let numOrUndefined: number | undefined; let size: [number, number]; @@ -825,22 +826,34 @@ copiedPackNode = packRootNode.copy(); // Pack Siblings and Enclosure // ----------------------------------------------------------------------- -interface CircleData extends d3Hierarchy.PackCircle { - v: string; -} - -let circles: CircleData[] = [ +const radius = [ { r: 10, v: 'a' }, - { r: 1, v: 'b' }, + { r: 30, v: 'b' }, { r: 20, v: 'c' } ]; // packSiblings -circles = d3Hierarchy.packSiblings(circles); +const circles = d3Hierarchy.packSiblings(radius); +str = circles[0].v; +num = circles[0].r; +num = circles[0].x; +num = circles[0].y; // packEnclose -let enclosure: { r: number, x: number, y: number }; +const moreCircles = [ + { r: 10, v: 'a', x: 0, y: 10 }, + { r: 30, v: 'b', x: 5, y: 15 }, + { r: 20, v: 'c', x: 7, y: 30 } +]; -enclosure = d3Hierarchy.packEnclose(circles); +const circle = d3Hierarchy.packEnclose(moreCircles); +num = circle.r; +num = circle.x; +num = circle.y; +// $ExpectError +str = circle.v; // fails, property 'v' does not exist + +// $ExpectError +d3Hierarchy.packEnclose(radius); diff --git a/types/d3-hierarchy/index.d.ts b/types/d3-hierarchy/index.d.ts index 0ec823cc78..fb5ebd5656 100644 --- a/types/d3-hierarchy/index.d.ts +++ b/types/d3-hierarchy/index.d.ts @@ -802,7 +802,7 @@ export function pack(): PackLayout; // Pack Siblings and Enclosure // ----------------------------------------------------------------------- -export interface PackCircle { +export interface PackRadius { /** * The radius of the circle. */ @@ -819,10 +819,25 @@ export interface PackCircle { y?: number; } +export interface PackCircle { + /** + * The radius of the circle. + */ + r: number; + + /** + * The x-coordinate of the circle’s center. + */ + x: number; + + /** + * The y-coordinate of the circle’s center. + */ + y: number; +} + // TODO: Since packSiblings manipulates the circles array in place, technically the x and y properties // are optional on invocation, but will be created after execution for each entry. -// For invocation of packEnclose the x and y coordinates are mandatory. It seems easier to just comment -// on the mandatory nature, then to create separate interfaces and having to deal with recasting. /** * Packs the specified array of circles, each of which must have a `circle.r` property specifying the circle’s radius. @@ -830,7 +845,7 @@ export interface PackCircle { * * @param circles The specified array of circles to pack. */ -export function packSiblings(circles: Datum[]): Datum[]; +export function packSiblings(circles: Datum[]): Array; /** * Computes the smallest circle that encloses the specified array of circles, each of which must have @@ -839,4 +854,4 @@ export function packSiblings(circles: Datum[]): Datum[ * * @param circles The specified array of circles to pack. */ -export function packEnclose(circles: Datum[]): { r: number, x: number, y: number }; +export function packEnclose(circles: Datum[]): PackCircle; diff --git a/types/d3-request/index.d.ts b/types/d3-request/index.d.ts index a621ff47f1..65ac3849b7 100644 --- a/types/d3-request/index.d.ts +++ b/types/d3-request/index.d.ts @@ -10,7 +10,7 @@ // Last module patch version validated against: 1.0.6 -import { DSVParsedArray, DSVRowString, DSVRowAny } from 'd3-dsv'; +import { DSVParsedArray, DSVRowString } from 'd3-dsv'; export interface Request { /** @@ -230,7 +230,7 @@ export interface Request { } export interface DsvRequest extends Request { - row(value: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow): DsvRequest; + row(value: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow): DsvRequest; } /** @@ -247,7 +247,7 @@ export function csv(url: string, callback: (this: DsvRequest, error: any, d: DSV * And send a GET request. * Use a row conversion function to map and filter row objects to a more-specific representation; see `dsv.parse` for details. */ -export function csv( +export function csv( url: string, row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow, callback: (this: DsvRequest, error: any, d: DSVParsedArray) => void @@ -314,7 +314,7 @@ export function tsv(url: string, callback: (this: DsvRequest, error: any, d: DSV * And send a GET request. * Use a row conversion function to map and filter row objects to a more-specific representation; see `dsv.parse` for details. */ -export function tsv( +export function tsv( url: string, row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow, callback: (this: DsvRequest, error: any, d: DSVParsedArray) => void diff --git a/types/d3-scale/d3-scale-tests.ts b/types/d3-scale/d3-scale-tests.ts index 8fa070d992..ef5121d822 100644 --- a/types/d3-scale/d3-scale-tests.ts +++ b/types/d3-scale/d3-scale-tests.ts @@ -7,13 +7,14 @@ */ import * as d3Scale from 'd3-scale'; -import { interpolateCubehelix } from 'd3-interpolate'; +import { interpolateCubehelix, interpolateRound } from 'd3-interpolate'; import { timeHour } from 'd3-time'; import { schemePuRd, - interpolateRainbow, interpolateCool, - interpolateInferno + interpolateInferno, + interpolateRainbow, + interpolateSpectral, } from 'd3-scale-chromatic'; // ------------------------------------------------------------------------------- @@ -68,6 +69,7 @@ let numExtent: [number, number]; let numOrUndefinedExtent: [number | undefined, number | undefined]; let outputNumberMaybe: number | undefined; + // ------------------------------------------------------------------------------- // Linear Scale Factory // ------------------------------------------------------------------------------- @@ -357,7 +359,8 @@ logScaleNumString = logScaleNumString.interpolate((a, b) => { // chainable logScaleNumber = logScaleNumber.nice(); -// logScaleNumber = logScaleNumber.nice(5); // fails, logarithmic scale does not support count parameter. +// $ExpectError +logScaleNumber = logScaleNumber.nice(5); // fails, logarithmic scale does not support count parameter. // ticks(...) ----------------------------------------------------------------- @@ -514,7 +517,8 @@ localTimeScaleNumber = localTimeScaleNumber.nice(5); localTimeScaleNumber = localTimeScaleNumber.nice(timeHour); localTimeScaleNumber = localTimeScaleNumber.nice(timeHour, 5); -// localTimeScaleNumber = localTimeScaleNumber.nice(timeHour.every(5)); // fails, requires CountableTimeInterval +// $ExpectError +localTimeScaleNumber = localTimeScaleNumber.nice(timeHour.every(5)); // fails, requires CountableTimeInterval // ticks(...) ----------------------------------------------------------------- @@ -586,6 +590,74 @@ outputString = sequentialScaleColorString(10); const copiedSequentialScale: d3Scale.ScaleSequential = sequentialScaleColorString.copy(); +// ------------------------------------------------------------------------------- +// Diverging Scale Factory +// ------------------------------------------------------------------------------- + +// scaleQuantize() ----------------------------------------------------------------- + +const interpolateDouble = (t: number) => t * 2; +let divergingScaleNumber: d3Scale.ScaleDiverging; +let divergingScaleString: d3Scale.ScaleDiverging; + +// $ExpectError +d3Scale.scaleDiverging(); // fails, Expected 1 arguments, but got 0. + +divergingScaleNumber = d3Scale.scaleDiverging(interpolateRound(0, 1)); +divergingScaleNumber = d3Scale.scaleDiverging(interpolateDouble); +divergingScaleString = d3Scale.scaleDiverging(interpolateSpectral); + +// ScaleDiverging Interface ======================================================= + +// (...) value mapping from domain to output ----------------------------------- + +outputNumber = divergingScaleNumber(1); +outputString = divergingScaleString(1); + +// domain(...) ----------------------------------------------------------------- + +let domainDivergingScale: [number, number, number]; + +divergingScaleNumber = divergingScaleNumber.domain([0, 0.5, 1]); +divergingScaleNumber = divergingScaleNumber.domain([new NumCoercible(0), 0.5, new NumCoercible(1)]); +domainDivergingScale = divergingScaleNumber.domain(); + +// $ExpectError +divergingScaleNumber.domain([0, 1]); +// $ExpectError +divergingScaleNumber.domain([new NumCoercible(0), new NumCoercible(0.5)]); + +divergingScaleString = divergingScaleString.domain([0, 0.5, 1]); +divergingScaleString = divergingScaleString.domain([new NumCoercible(0), 0.5, new NumCoercible(1)]); +domainDivergingScale = divergingScaleString.domain(); + +// $ExpectError +divergingScaleString.domain([0, 1]); +// $ExpectError +divergingScaleString.domain([new NumCoercible(0), new NumCoercible(0.5)]); + +// clamp(...) ----------------------------------------------------------------- + +clampFlag = divergingScaleNumber.clamp(); +clampFlag = divergingScaleString.clamp(); + +divergingScaleNumber = divergingScaleNumber.clamp(true); +divergingScaleString = divergingScaleString.clamp(true); + +// interpolator(...) ----------------------------------------------------------------- + +const inum: (t: number) => number = divergingScaleNumber.interpolator(); +const istr: (t: number) => string = divergingScaleString.interpolator(); + +divergingScaleNumber = divergingScaleNumber.interpolator((t) => t + 2); +divergingScaleNumber = divergingScaleNumber.interpolator(interpolateRound(2, 3)); +divergingScaleString = divergingScaleString.interpolator(sequentialInterpolator); + +// copy(...) ----------------------------------------------------------------- + +const copiedDivergingScaleNumber: d3Scale.ScaleDiverging = divergingScaleNumber.copy(); +const copiedDivergingScaleString: d3Scale.ScaleDiverging = divergingScaleString.copy(); + // ------------------------------------------------------------------------------- // Quantize Scale Factory // ------------------------------------------------------------------------------- diff --git a/types/d3-scale/index.d.ts b/types/d3-scale/index.d.ts index cb6a0cf15e..db6f6a8761 100644 --- a/types/d3-scale/index.d.ts +++ b/types/d3-scale/index.d.ts @@ -1,10 +1,13 @@ -// Type definitions for D3JS d3-scale module 2.0 +// Type definitions for D3JS d3-scale module 2.1 // Project: https://github.com/d3/d3-scale/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions by: Tom Wanzek +// Alex Ford +// Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Last module patch version validated against: 2.0.0 +// Last module patch version validated against: 2.1.2 import { CountableTimeInterval, TimeInterval } from 'd3-time'; @@ -1082,6 +1085,82 @@ export interface ScaleSequential { */ export function scaleSequential(interpolator: ((t: number) => Output)): ScaleSequential; +// ------------------------------------------------------------------------------- +// Diverging Scale Factory +// ------------------------------------------------------------------------------- + +/** + * Diverging scales, like sequential scales, are similar to continuous scales in that they map a continuous, numeric input domain to a continuous output range. + * However, unlike continuous scales, the output range of a diverging scale is fixed by its interpolator and not configurable. + * These scales do not expose invert, range, rangeRound and interpolate methods. + * + * The generic corresponds to the data type of the interpolator return type. + */ +export interface ScaleDiverging { + /** + * Given a value from the domain, returns the corresponding value subject to interpolation. + * + * If the given value is outside the domain, and clamping is not enabled, the mapping may be extrapolated such that the returned value is outside the range. + * + * @param value A numeric value from the domain. + */ + (value: number | { valueOf(): number }): Output; + + /** + * Returns a copy of the scale’s current domain. + */ + domain(): [number, number, number]; + /** + * Sets the scale’s domain to the specified array of numbers. + * The domain must be numeric and must contain exactly three values. The default domain is [0, 0.5, 1]. + * If the elements in the given array are not numbers, they will be coerced to numbers + * + * @param domain Array of three numeric domain values. + */ + domain(domain: [number | { valueOf(): number }, number | { valueOf(): number }, number | { valueOf(): number }]): this; + + /** + * Returns whether or not the scale currently clamps values to within the range. + */ + clamp(): boolean; + /** + * Enables or disables clamping, respectively. If clamping is disabled and the scale is passed a value outside the domain, + * the scale may return a value outside the range through extrapolation. + * + * If clamping is enabled, the return value of the scale is always within the interpolator scale’s range. + * + * @param clamp A flag to enable (true) or disable (false) clamping. + */ + clamp(clamp: boolean): this; + + /** + * Returns the scale’s current interpolator. + */ + interpolator(): (t: number) => Output; + /** + * Sets the scale’s interpolator to the specified function. + * + * @param interpolator The scale’s interpolator. + */ + interpolator(interpolator?: (t: number) => Output): this; + + /** + * Returns an exact copy of this scale. Changes to this scale will not affect the returned scale, and vice versa. + */ + copy(): this; +} + +/** + * Constructs a new diverging scale with the given interpolator function. + * When the scale is applied, the interpolator will be invoked with a value typically in the range [0, 1], + * where 0 represents the extreme negative value, 0.5 represents the neutral value, and 1 represents the extreme positive value. + * + * The generic corresponds to the data type of the interpolator return type. + * + * @param interpolator The scale’s interpolator. + */ +export function scaleDiverging(interpolator: (t: number) => T): ScaleDiverging; + // ------------------------------------------------------------------------------- // Quantize Scale Factory // ------------------------------------------------------------------------------- diff --git a/types/d3-shape/d3-shape-tests.ts b/types/d3-shape/d3-shape-tests.ts index 8ad3e4809a..fb79b15e4a 100644 --- a/types/d3-shape/d3-shape-tests.ts +++ b/types/d3-shape/d3-shape-tests.ts @@ -161,8 +161,9 @@ accessorArcDatumNumberOrNull = svgArc.padRadius(); // centroid(...) --------------------------------------------------------------------- -const centroid: [number, number] = svgArc.centroid(arcDatum); -// centroid = svgArc.centroid(arcDefaultDatum); // fails, wrong datum type +let centroid: [number, number] = svgArc.centroid(arcDatum); +// $ExpectError +centroid = svgArc.centroid(arcDefaultDatum); // fails, wrong datum type // generate arc ---------------------------------------------------------------------- @@ -176,10 +177,13 @@ const wrongArc1: Selection = select = select('.arc-paths'); // mock pArc.attr('d', svgArc); -// wrongArc1.attr('d', svgArc); // fails, incompatible this contexts -// wrongArc2.attr('d', svgArc); // fails, incompatible datum types +// $ExpectError +wrongArc1.attr('d', svgArc); // fails, incompatible this contexts +// $ExpectError +wrongArc2.attr('d', svgArc); // fails, incompatible datum types -// pathStringMaybe = svgArc(arcDatum); // fails, wrong this type for invocation +// $ExpectError +pathStringMaybe = svgArc(arcDatum); // fails, wrong this type for invocation // Use with custom object @@ -270,13 +274,13 @@ let pie: d3Shape.Pie = d3Shape.pie(); // value(...) ------------------------------------------------------------------------- -let defaultPieValueAccessor: (d: number | { valueOf(): number }, i?: number, data?: Array) => number; +let defaultPieValueAccessor: (d: number | { valueOf(): number }, i: number, data: Array) => number; defaultPie = defaultPie.value(10); defaultPieValueAccessor = defaultPie.value(); -let pieValueAccessor: (d: PieDatum, i?: number, data?: PieDatum[]) => number; +let pieValueAccessor: (d: PieDatum, i: number, data: PieDatum[]) => number; pie = pie.value((d, i, data) => { console.log(data.length > 0 ? data[0].val : 'no data'); // data type is Array @@ -364,8 +368,8 @@ interface LineDatum { missing: boolean; } -let lineXYAccessorFn: (d: LineDatum, index?: number, data?: LineDatum[]) => number; -let lineDefAccessorFn: (d: LineDatum, index?: number, data?: LineDatum[]) => boolean; +let lineXYAccessorFn: (d: LineDatum, index: number, data: LineDatum[]) => number; +let lineDefAccessorFn: (d: LineDatum, index: number, data: LineDatum[]) => boolean; interface LineRadialDatum { angle: number; @@ -373,8 +377,8 @@ interface LineRadialDatum { missing: boolean; } -let lineRadialAngRAccessorFn: (d: LineRadialDatum, index?: number, data?: LineRadialDatum[]) => number; -let lineRadialDefAccessorFn: (d: LineRadialDatum, index?: number, data?: LineRadialDatum[]) => boolean; +let lineRadialAngRAccessorFn: (d: LineRadialDatum, index: number, data: LineRadialDatum[]) => number; +let lineRadialDefAccessorFn: (d: LineRadialDatum, index: number, data: LineRadialDatum[]) => boolean; // line(...) create Line generator ===================================================== @@ -541,9 +545,9 @@ interface AreaDatum { missing: boolean; } -let areaXYAccessorFn: (d: AreaDatum, index?: number, data?: AreaDatum[]) => number; -let areaXYAccessorFnMaybe: null | ((d: AreaDatum, index?: number, data?: AreaDatum[]) => number); -let areaDefAccessorFn: (d: AreaDatum, index?: number, data?: AreaDatum[]) => boolean; +let areaXYAccessorFn: (d: AreaDatum, index: number, data: AreaDatum[]) => number; +let areaXYAccessorFnMaybe: null | ((d: AreaDatum, index: number, data: AreaDatum[]) => number); +let areaDefAccessorFn: (d: AreaDatum, index: number, data: AreaDatum[]) => boolean; interface AreaRadialDatum { startAngle: number; @@ -553,9 +557,9 @@ interface AreaRadialDatum { missing: boolean; } -let areaRadialAngRAccessorFn: (d: AreaRadialDatum, index?: number, data?: AreaRadialDatum[]) => number; -let areaRadialAngRAccessorFnMaybe: null | ((d: AreaRadialDatum, index?: number, data?: AreaRadialDatum[]) => number); -let areaRadialDefAccessorFn: (d: AreaRadialDatum, index?: number, data?: AreaRadialDatum[]) => boolean; +let areaRadialAngRAccessorFn: (d: AreaRadialDatum, index: number, data: AreaRadialDatum[]) => number; +let areaRadialAngRAccessorFnMaybe: null | ((d: AreaRadialDatum, index: number, data: AreaRadialDatum[]) => number); +let areaRadialDefAccessorFn: (d: AreaRadialDatum, index: number, data: AreaRadialDatum[]) => boolean; // area(...) create Area generator ===================================================== @@ -662,7 +666,8 @@ areaDefAccessorFn = area.defined(); defaultArea = defaultArea.curve(d3Shape.curveLinear); area = area.curve(d3Shape.curveCardinal.tension(0.5)); -// area = area.curve(d3Shape.curveBundle.beta(0.5)); // fails, as curveBundle-based line generator does not support area-related methods +// $ExpectError +area = area.curve(d3Shape.curveBundle.beta(0.5)); // fails, as curveBundle-based line generator does not support area-related methods currentCurveFactory = area.curve(); @@ -800,7 +805,8 @@ areaRadialDefAccessorFn = areaRadial.defined(); defaultAreaRadial = defaultAreaRadial.curve(d3Shape.curveLinear); areaRadial = areaRadial.curve(d3Shape.curveCardinal.tension(0.5)); -// areaRadial = areaRadial.curve(d3Shape.curveBundle.beta(0.5)); // fails, as curveBundle-based line generator does not support area-related methods +// $ExpectError +areaRadial = areaRadial.curve(d3Shape.curveBundle.beta(0.5)); // fails, as curveBundle-based line generator does not support area-related methods currentCurveFactory = areaRadial.curve(); @@ -868,7 +874,8 @@ curveBundleFactory = d3Shape.curveBundle.beta(0.5); lineOnlyGenerator = d3Shape.curveBundle.beta(0.5)(context!); // force context to be non-null with post-fix for mock lineOnlyGenerator = d3Shape.curveBundle.beta(0.5)(path()); -// curveGenerator = d3Shape.curveBundle.beta(0.5)(context); // fails, no area related methods +// $ExpectError +curveGenerator = d3Shape.curveBundle.beta(0.5)(context); // fails, no area related methods let curveCardinalFactory: d3Shape.CurveCardinalFactory; @@ -1153,22 +1160,28 @@ defaultLinkRadial(defaultLinkDatum); // vertical/horizontal pLink.attr('d', svgLink); -// wrongLink1.attr('d', svgLink); // fails, incompatible this contexts -// wrongLink2.attr('d', svgLink); // fails, incompatible datum types +// $ExpectError +wrongLink1.attr('d', svgLink); // fails, incompatible this contexts +// $ExpectError +wrongLink2.attr('d', svgLink); // fails, incompatible datum types pathStringMaybe = link(linkDatum); -// pathStringMaybe = svgLink(linkDatum); // fails, wrong this type for invocation +// $ExpectError +pathStringMaybe = svgLink(linkDatum); // fails, wrong this type for invocation // radial pLink.attr('d', svgLinkRadial); -// wrongLink1.attr('d', svgLinkRadial); // fails, incompatible this contexts -// wrongLink2.attr('d', svgLinkRadial); // fails, incompatible datum types +// $ExpectError +wrongLink1.attr('d', svgLinkRadial); // fails, incompatible this contexts +// $ExpectError +wrongLink2.attr('d', svgLinkRadial); // fails, incompatible datum types pathStringMaybe = radialLink(linkDatum); -// pathStringMaybe = svgLinkRadial(linkDatum); // fails, wrong this type for invocation +// $ExpectError +pathStringMaybe = svgLinkRadial(linkDatum); // fails, wrong this type for invocation // ----------------------------------------------------------------------------------- // Test Symbols @@ -1259,10 +1272,13 @@ const wrongSymbol1: Selection = select< const wrongSymbol2: Selection = select('.symbol-path'); // mock pSymbol.attr('d', svgSymbol); -// wrongSymbol1.attr('d', svgSymbol); // fails, incompatible this contexts -// wrongSymbol2.attr('d', svgSymbol); // fails, incompatible datum types +// $ExpectError +wrongSymbol1.attr('d', svgSymbol); // fails, incompatible this contexts +// $ExpectError +wrongSymbol2.attr('d', svgSymbol); // fails, incompatible datum types -// pathStringMaybe = svgSymbol(symbolDatum); // fails, wrong this type for invocation +// $ExpectError +pathStringMaybe = svgSymbol(symbolDatum); // fails, wrong this type for invocation // Use with custom object @@ -1390,11 +1406,11 @@ keysAccessor = overlyComplicatedStack.keys(); defaultStack = defaultStack.value(30); -overlyComplicatedStack = overlyComplicatedStack.value((d, key, j, data) => { +overlyComplicatedStack = overlyComplicatedStack.value((d, key, i, data) => { return d.values[key.name]; }); -let valueAccessorFn: (this: any, d: StackDatum, key: StackKey, j?: number, data?: StackDatum[]) => number; +let valueAccessorFn: (d: StackDatum, key: StackKey, i: number, data: StackDatum[]) => number; valueAccessorFn = overlyComplicatedStack.value(); // order(...) ---------------------------------------------------------------------- diff --git a/types/d3-shape/index.d.ts b/types/d3-shape/index.d.ts index eccf7f1b80..ed64d6f827 100644 --- a/types/d3-shape/index.d.ts +++ b/types/d3-shape/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for D3JS d3-shape module 1.2 // Project: https://github.com/d3/d3-shape/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions by: Tom Wanzek +// Alex Ford +// Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -38,7 +41,7 @@ export interface CanvasPath_D3Shape { // ----------------------------------------------------------------------------------- /** - * Interface corresponding to the minimum data type assumed by the accessor functions of the Arc generator + * Interface corresponding to the minimum data type assumed by the accessor functions of the Arc generator. */ export interface DefaultArcObject { /** @@ -385,7 +388,7 @@ export function arc(): Arc; */ export interface PieArcDatum { /** - * The input datum; the corresponding element in the input data array of the Pie generator + * The input datum; the corresponding element in the input data array of the Pie generator. */ data: T; /** @@ -439,7 +442,6 @@ export interface Pie { /** * Returns the current value accessor, which defaults to a function returning the first argument passed into it. * The default value accessor assumes that the input data are numbers, or that they are coercible to numbers using valueOf. - * */ value(): (d: Datum, i: number, data: Datum[]) => number; /** @@ -455,7 +457,6 @@ export interface Pie { * The default value accessor assumes that the input data are numbers, or that they are coercible to numbers using valueOf. * If your data are not simply numbers, then you should specify an accessor that returns the corresponding numeric value for a given datum. * - * * @param value A value accessor function, which is invoked for each element in the input data array, being passed the element d, the index i, and the array data as three arguments. * It returns a numeric value. */ @@ -506,7 +507,6 @@ export interface Pie { * @param comparator The value comparator takes two arguments a and b which are values derived from the input data array using the value accessor, not the data elements. * If the arc for a should be before the arc for b, then the comparator must return a number less than zero; * if the arc for a should be after the arc for b, then the comparator must return a number greater than zero; returning zero means that the relative order of a and b is unspecified. - * */ sortValues(comparator: (a: number, b: number) => number): this; /** @@ -737,7 +737,7 @@ export interface Line { * Note that if a line segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. * - * @param defined A boolean constant + * @param defined A boolean constant. */ defined(defined: boolean): this; /** @@ -912,7 +912,7 @@ export interface LineRadial { * Note that if a radial line segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. * - * @param defined A boolean constant + * @param defined A boolean constant. */ defined(defined: boolean): this; /** @@ -994,14 +994,17 @@ export function lineRadial(): LineRadial<[number, number]>; */ export function lineRadial(): LineRadial; +/** + * @deprecated Use LineRadial + */ export type RadialLine = LineRadial; /** - * DEPRECATED: Use lineRadial() + * @deprecated Use lineRadial() */ export function radialLine(): RadialLine<[number, number]>; /** - * DEPRECATED: Use lineRadial() + * @deprecated Use lineRadial() */ export function radialLine(): RadialLine; @@ -1163,7 +1166,6 @@ export interface Area { * two-element array of numbers. * * If the y1 accessor is null, the previously-computed y0 value is reused for the y1 value. - * */ y1(): ((d: Datum, index: number, data: Datum[]) => number) | null; /** @@ -1206,9 +1208,9 @@ export interface Area { * As a result, the generated area may have several discrete segments. * * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. * - * @param defined A boolean constant + * @param defined A boolean constant. */ defined(defined: boolean): this; /** @@ -1225,7 +1227,7 @@ export interface Area { * As a result, the generated area may have several discrete segments. * * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. * * @param defined An accessor function which returns a boolean value. The accessor will be invoked for each defined element in the input data array, * being passed the element d, the index i, and the array data as three arguments. @@ -1245,7 +1247,6 @@ export interface Area { /** * Sets the curve factory and returns this area generator. * - * * @param curve A valid curve factory. */ curve(curve: CurveFactory): this; @@ -1467,7 +1468,6 @@ export interface AreaRadial { * two-element array of numbers. * * If the outerRadius accessor is null, the previously-computed innerRadius value is reused for the outerRadius value. - * */ outerRadius(): ((d: Datum, index: number, data: Datum[]) => number) | null; /** @@ -1512,9 +1512,9 @@ export interface AreaRadial { * As a result, the generated area may have several discrete segments. * * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. * - * @param defined A boolean constant + * @param defined A boolean constant. */ defined(defined: boolean): this; /** @@ -1530,7 +1530,7 @@ export interface AreaRadial { * As a result, the generated area may have several discrete segments. * * Note that if an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. - * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points + * In addition, some curves such as curveCardinalOpen only render a visible segment if it contains multiple points. * * @param defined An accessor function which returns a boolean value. The accessor will be invoked for each defined element in the input data array, * being passed the element d, the index i, and the array data as three arguments. @@ -1620,16 +1620,16 @@ export function areaRadial(): AreaRadial<[number, number]>; export function areaRadial(): AreaRadial; /** - * DEPRECATED: Use AreaRadial interface + * @deprecated Use AreaRadial interface */ export type RadialArea = AreaRadial; /** - * DEPRECATED: Use areaRadial() + * @deprecated Use areaRadial() */ export function radialArea(): RadialArea<[number, number]>; /** - * DEPRECATED: Use areaRadial() + * @deprecated Use areaRadial() */ export function radialArea(): RadialArea; @@ -1665,16 +1665,13 @@ export interface CurveGeneratorLineOnly { /** * A factory for curve generators addressing only lines, but not areas. */ -// This is a base interface to be extended, hence the suppression of the warning -// tslint:disable-next-line:callable-types -export interface CurveFactoryLineOnly { +export type CurveFactoryLineOnly = /** * Returns a "lines only" curve generator which renders to the specified context. * - * @param context A rendering context + * @param context A rendering context. */ - (context: CanvasRenderingContext2D | Path): CurveGeneratorLineOnly; -} + (context: CanvasRenderingContext2D | Path) => CurveGeneratorLineOnly; /** * A minimal interface for a curve generator which supports the rendering of lines and areas. @@ -1701,16 +1698,13 @@ export interface CurveGenerator extends CurveGeneratorLineOnly { /** * A factory for curve generators addressing both lines and areas. */ -// This is a base interface to be extended, hence the suppression of the warning -// tslint:disable-next-line:callable-types -export interface CurveFactory { +export type CurveFactory = /** * Returns a curve generator which renders to the specified context. * - * @param context A rendering context + * @param context A rendering context. */ - (context: CanvasRenderingContext2D | Path): CurveGenerator; -} + (context: CanvasRenderingContext2D | Path) => CurveGenerator; /** * A curve factory for cubic basis spline generators. @@ -1921,7 +1915,7 @@ export const curveStepBefore: CurveFactory; /** * An interface describing the default Link Data structure expected - * by the Link and LinkRadial generators + * by the Link and LinkRadial generators. */ export interface DefaultLinkObject { /** @@ -2074,7 +2068,7 @@ export function linkHorizontal(): Link * * The first generic corresponds to the datum type of the link object for which the link is to be generated. * - * The second generic corresponds to the datum type of the source/target node contained in the link object + * The second generic corresponds to the datum type of the source/target node contained in the link object. */ export function linkHorizontal(): Link; /** @@ -2088,7 +2082,7 @@ export function linkHorizontal(): Link(): Link; @@ -2108,7 +2102,7 @@ export function linkVertical(): Link; * * The first generic corresponds to the datum type of the link object for which the link is to be generated. * - * The second generic corresponds to the datum type of the source/target node contained in the link object + * The second generic corresponds to the datum type of the source/target node contained in the link object. */ export function linkVertical(): Link; /** @@ -2122,7 +2116,7 @@ export function linkVertical(): Link(): Link; @@ -2239,7 +2233,7 @@ export interface LinkRadial { } /** - * DEPRECATED: Use LinkRadial interface + * @deprecated Use LinkRadial interface */ export type RadialLink = LinkRadial; @@ -2259,7 +2253,7 @@ export function linkRadial(): LinkRadial(): LinkRadial; /** @@ -2273,7 +2267,7 @@ export function linkRadial(): LinkRadial(): LinkRadial; @@ -2286,7 +2280,7 @@ export function linkRadial(): LinkRadial { /** * Sets the symbol type to the specified symbol type and returns this symbol generator. * - * * @param type A constant symbol type. */ type(type: SymbolType): this; @@ -2482,7 +2475,7 @@ export function pointRadial(angle: number, radius: number): [number, number]; * the difference between y0 and y1 corresponds to the computed value for this point. * * SeriesPoint is a [number, number] two-element Array with added data and index properties - * related to the data element which formed the basis for theSeriesPoint + * related to the data element which formed the basis for theSeriesPoint. */ export interface SeriesPoint extends Array { /** @@ -2507,11 +2500,11 @@ export interface SeriesPoint extends Array { */ export interface Series extends Array> { /** - * Key of the series + * Key of the series. */ key: Key; /** - * Index of the series in the series array returned by stack generator + * Index of the series in the series array returned by stack generator. */ index: number; } @@ -2575,7 +2568,7 @@ export interface Stack { * * Thus, by default the stack generator assumes that the input data is an array of objects, with each object exposing named properties with numeric values; see stack for an example. */ - value(): (d: Datum, key: Key, j: number, data: Datum[]) => number; + value(): (d: Datum, key: Key, i: number, data: Datum[]) => number; /** * Sets the value accessor to the specified number and returns this stack generator. * @@ -2588,7 +2581,7 @@ export interface Stack { * @param value A value accessor function which returns the numeric value for a given data element and key combination. The accessor function is invoked for each data element and key being passed * the datum, the key, index of the data element in the input data array, and the complete data array. */ - value(value: (d: Datum, key: Key, j: number, data: Datum[]) => number): this; + value(value: (d: Datum, key: Key, i: number, data: Datum[]) => number): this; /** * Returns the current order accessor, which defaults to stackOrderNone; this uses the order given by the key accessor. @@ -2680,14 +2673,14 @@ export function stack(): Stack; /** * Returns a series order such that the smallest series (according to the sum of values) is at the bottom. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. */ export function stackOrderAscending(series: Series): number[]; /** * Returns a series order such that the largest series (according to the sum of values) is at the bottom. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. */ export function stackOrderDescending(series: Series): number[]; @@ -2695,28 +2688,28 @@ export function stackOrderDescending(series: Series): number[]; * Returns a series order such that the larger series (according to the sum of values) are on the inside and the smaller series are on the outside. * This order is recommended for streamgraphs in conjunction with the wiggle offset. See Stacked Graphs—Geometry & Aesthetics by Byron & Wattenberg for more information. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. */ export function stackOrderInsideOut(series: Series): number[]; /** * Returns the given series order [0, 1, … n - 1] where n is the number of elements in series. Thus, the stack order is given by the key accessor. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. */ export function stackOrderNone(series: Series): number[]; /** * Returns the reverse of the given series order [n - 1, n - 2, … 0] where n is the number of elements in series. Thus, the stack order is given by the reverse of the key accessor. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. */ export function stackOrderReverse(series: Series): number[]; /** * Applies a zero baseline and normalizes the values for each point such that the topline is always one. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. * @param order An array of numeric indexes representing the stack order. */ export function stackOffsetExpand(series: Series, order: number[]): void; @@ -2724,7 +2717,7 @@ export function stackOffsetExpand(series: Series, order: number[]): vo /** * Positive values are stacked above zero, while negative values are stacked below zero. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. * @param order An array of numeric indexes representing the stack order. */ export function stackOffsetDiverging(series: Series, order: number[]): void; @@ -2732,7 +2725,7 @@ export function stackOffsetDiverging(series: Series, order: number[]): /** * Applies a zero baseline. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. * @param order An array of numeric indexes representing the stack order. */ export function stackOffsetNone(series: Series, order: number[]): void; @@ -2740,7 +2733,7 @@ export function stackOffsetNone(series: Series, order: number[]): void /** * Shifts the baseline down such that the center of the streamgraph is always at zero. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. * @param order An array of numeric indexes representing the stack order. */ export function stackOffsetSilhouette(series: Series, order: number[]): void; @@ -2749,7 +2742,7 @@ export function stackOffsetSilhouette(series: Series, order: number[]) * Shifts the baseline so as to minimize the weighted wiggle of layers. This offset is recommended for streamgraphs in conjunction with the inside-out order. * See Stacked Graphs—Geometry & Aesthetics by Bryon & Wattenberg for more information. * - * @param series A series generated by a stack generator + * @param series A series generated by a stack generator. * @param order An array of numeric indexes representing the stack order. */ export function stackOffsetWiggle(series: Series, order: number[]): void; diff --git a/types/d3-shape/tsconfig.json b/types/d3-shape/tsconfig.json index 0436aafd66..093e9b98c3 100644 --- a/types/d3-shape/tsconfig.json +++ b/types/d3-shape/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-shape/tslint.json b/types/d3-shape/tslint.json index b1ba182ba6..54efb0b84e 100644 --- a/types/d3-shape/tslint.json +++ b/types/d3-shape/tslint.json @@ -1,10 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - // TODO - "no-this-assignment": false, "unified-signatures": false, - "callable-types": false, "no-unnecessary-generics": false } } diff --git a/types/d3-zoom/d3-zoom-tests.ts b/types/d3-zoom/d3-zoom-tests.ts index c758e83448..42393b9e82 100644 --- a/types/d3-zoom/d3-zoom-tests.ts +++ b/types/d3-zoom/d3-zoom-tests.ts @@ -9,7 +9,7 @@ import * as d3Zoom from 'd3-zoom'; import { ArrayLike, select, Selection, event } from 'd3-selection'; import { Transition } from 'd3-transition'; -import { scaleLinear, ScaleLinear } from 'd3-scale'; +import { scaleLinear, ScaleLinear, ScaleTime, scaleTime } from 'd3-scale'; import { interpolateZoom, interpolate, interpolateArray, ZoomInterpolator, ZoomView } from 'd3-interpolate'; // -------------------------------------------------------------------------- @@ -248,15 +248,15 @@ let zoomInterpolatorFactory: (a: ZoomView, b: ZoomView) => ZoomInterpolator; // Basic case without casting basicInterpolatorFactory = svgZoom.interpolate(); -// Assuming it is know that a specialized interpolation factory was used. E.g. ZoomInterpolator also has a duration -// argument +// Assuming it is know that a specialized interpolation factory was used. E.g. ZoomInterpolator also has a duration argument zoomInterpolatorFactory = svgZoom.interpolate<(a: ZoomView, b: ZoomView) => ZoomInterpolator>(); // on() -------------------------------------------------------------------- // chainable svgZoom = svgZoom.on('zoom', zoomedSVGOverlay); -// svgZoom = svgZoom.on('zoom', zoomedCanvas); // fails, zoom event handler has wrong this and datum type +// $ExpectError +svgZoom = svgZoom.on('zoom', zoomedCanvas); // fails, zoom event handler has wrong this and datum type let zoomHandler: ((this: SVGRectElement, datum: SVGDatum, index: number, group: SVGRectElement[] | ArrayLike) => void) | undefined; zoomHandler = svgZoom.on('zoom'); @@ -297,7 +297,8 @@ const svgOverlayTransition = svgOverlay.transition(); // use on selection svgZoom.transform(svgOverlay, d3Zoom.zoomIdentity); -// svgZoom.transform(groupsSelection, d3Zoom.zoomIdentity); // fails, as groupSelection mismatches DOM Element type and datum type +// $ExpectError +svgZoom.transform(groupsSelection, d3Zoom.zoomIdentity); // fails, as groupSelection mismatches DOM Element type and datum type svgZoom.transform(svgOverlay, function(datum, index, groups) { const that: SVGRectElement = this; @@ -308,9 +309,11 @@ svgZoom.transform(svgOverlay, function(datum, index, groups) { console.log('Filter Brush Event status as per datum: ', d.filterBrushEvent); // datum type is SVGDatum return d3Zoom.zoomIdentity; }); + // use on transition svgOverlayTransition.call(svgZoom.transform, d3Zoom.zoomIdentity); -// svgZoom.transform(groupsTransition, d3Zoom.zoomIdentity); // fails, as groupTransition mismatches DOM Element type and datum type +// $ExpectError +svgZoom.transform(groupsTransition, d3Zoom.zoomIdentity); // fails, as groupTransition mismatches DOM Element type and datum type svgZoom.transform(svgOverlayTransition, d3Zoom.zoomIdentity); svgZoom.transform(svgOverlayTransition, function(datum, index, groups) { @@ -327,7 +330,8 @@ svgZoom.transform(svgOverlayTransition, function(datum, index, groups) { // use on selection svgZoom.translateBy(svgOverlay, 20, 50); -// svgZoom.translateBy(groupsSelection, 20, 50); // fails, as groupSelection mismatches DOM Element type and datum type +// $ExpectError +svgZoom.translateBy(groupsSelection, 20, 50); // fails, as groupSelection mismatches DOM Element type and datum type svgZoom.translateBy( svgOverlay, @@ -376,7 +380,8 @@ svgZoom.translateBy( // use on transition svgZoom.translateBy(svgOverlayTransition, 20, 50); -// svgZoom.translateBy(groupsTransition, 20, 50); // fails, as groupTransition mismatches DOM Element type and datum type +// $ExpectError +svgZoom.translateBy(groupsTransition, 20, 50); // fails, as groupTransition mismatches DOM Element type and datum type svgZoom.translateBy( svgOverlayTransition, @@ -427,7 +432,8 @@ svgZoom.translateBy( // use on selection svgZoom.translateTo(svgOverlay, 20, 50); -// svgZoom.translateTo(groupsSelection, 20, 50); // fails, as groupSelection mismatches DOM Element type and datum type +// $ExpectError +svgZoom.translateTo(groupsSelection, 20, 50); // fails, as groupSelection mismatches DOM Element type and datum type svgZoom.translateTo( svgOverlay, @@ -476,7 +482,8 @@ svgZoom.translateTo( // use on transition svgZoom.translateTo(svgOverlayTransition, 20, 50); -// svgZoom.translateTo(groupsTransition, 20, 50); // fails, as groupTransition mismatches DOM Element type and datum type +// $ExpectError +svgZoom.translateTo(groupsTransition, 20, 50); // fails, as groupTransition mismatches DOM Element type and datum type svgZoom.translateTo( svgOverlayTransition, @@ -527,7 +534,8 @@ svgZoom.translateTo( // use on selection svgZoom.scaleBy(svgOverlay, 3); -// svgZoom.scaleBy(groupsSelection, 3); // fails, as groupSelection mismatches DOM Element type and datum type +// $ExpectError +svgZoom.scaleBy(groupsSelection, 3); // fails, as groupSelection mismatches DOM Element type and datum type svgZoom.scaleBy(svgOverlay, function(datum, index, groups) { const that: SVGRectElement = this; @@ -540,7 +548,8 @@ svgZoom.scaleBy(svgOverlay, function(datum, index, groups) { }); // use on transition svgZoom.scaleBy(svgOverlayTransition, 3); -// svgZoom.scaleBy(groupsTransition, 3); // fails, as groupTransition mismatches DOM Element type and datum type +// $ExpectError +svgZoom.scaleBy(groupsTransition, 3); // fails, as groupTransition mismatches DOM Element type and datum type svgZoom.scaleBy(svgOverlayTransition, function(datum, index, groups) { const that: SVGRectElement = this; @@ -556,7 +565,8 @@ svgZoom.scaleBy(svgOverlayTransition, function(datum, index, groups) { // use on selection svgZoom.scaleTo(svgOverlay, 3); -// svgZoom.scaleBy(groupsSelection, 3); // fails, as groupSelection mismatches DOM Element type and datum type +// $ExpectError +svgZoom.scaleBy(groupsSelection, 3); // fails, as groupSelection mismatches DOM Element type and datum type svgZoom.scaleTo(svgOverlay, function(datum, index, groups) { const that: SVGRectElement = this; @@ -569,7 +579,8 @@ svgZoom.scaleTo(svgOverlay, function(datum, index, groups) { }); // use on transition svgZoom.scaleTo(svgOverlayTransition, 3); -// svgZoom.scaleBy(groupsTransition, 3); // fails, as groupTransition mismatches DOM Element type and datum type +// $ExpectError +svgZoom.scaleBy(groupsTransition, 3); // fails, as groupTransition mismatches DOM Element type and datum type svgZoom.scaleTo(svgOverlayTransition, function(datum, index, groups) { const that: SVGRectElement = this; @@ -616,15 +627,18 @@ const invertedPoint: [number, number] = zTransform.invert([150, 240]); const invertedX: number = zTransform.invertX(150); const invertedY: number = zTransform.invertY(240); -// TODO: reScaleX, reScaleY - let linearScale: ScaleLinear = scaleLinear(); +let timeScale: ScaleTime = scaleTime(); linearScale = zTransform.rescaleX(linearScale); linearScale = zTransform.rescaleY(linearScale); +timeScale = zTransform.rescaleX(timeScale); +timeScale = zTransform.rescaleY(timeScale); + const transformation: string = zTransform.toString(); +zTransform = zTransform.scale(2); zTransform = zTransform.translate(50, 40); // zoomIdentity ------------------------------------------------------------- diff --git a/types/d3-zoom/index.d.ts b/types/d3-zoom/index.d.ts index 827390b871..3f6100d4b8 100644 --- a/types/d3-zoom/index.d.ts +++ b/types/d3-zoom/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for d3JS d3-zoom module 1.7 // Project: https://github.com/d3/d3-zoom/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions by: Tom Wanzek +// Alex Ford +// Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -26,12 +29,12 @@ export type ZoomedElementBaseType = Element; * that can be passed into zoomTransform methods rescaleX and rescaleY */ export interface ZoomScale { - domain(): number[]; - domain(domain: number[]): this; + domain(): number[] | Date[]; + domain(domain: Array): this; range(): number[]; range(range: number[]): this; copy(): ZoomScale; - invert(value: number): number; + invert(value: number): number | Date; } // -------------------------------------------------------------------------- diff --git a/types/d3/index.d.ts b/types/d3/index.d.ts index c249edf3cc..9b62c1e025 100644 --- a/types/d3/index.d.ts +++ b/types/d3/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for D3JS d3 standard bundle 5.0 +// Type definitions for D3JS d3 standard bundle 5.7 // Project: https://github.com/d3/d3 // Definitions by: Tom Wanzek // Alex Ford @@ -7,7 +7,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Last module patch version validated against: 5.0.0 RC3 +// Last module patch version validated against: 5.7.0 // NOTE TO MAINTAINERS: Review D3 v4.x module dependencies (see v4 sub-folder) and update its path-mappings in tsconfig (v4 folder), // if new MAJOR version of D3 v4 modules are released!!! diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index ed87028502..d0c8d50de2 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -1602,7 +1602,7 @@ declare namespace DataTables { /** * Class to assign to each cell in the column. Since: 1.10 */ - data?: number | string | ObjectColumnData | FunctionColumnData; + data?: number | string | ObjectColumnData | FunctionColumnData | null; /** * Set default, static, content for a column. Since: 1.10 diff --git a/types/dateformat/dateformat-tests.ts b/types/dateformat/dateformat-tests.ts index a06e3b509d..482615d9e0 100644 --- a/types/dateformat/dateformat-tests.ts +++ b/types/dateformat/dateformat-tests.ts @@ -2,55 +2,54 @@ * https://github.com/felixge/node-dateformat#usage */ -import * as dateFormat from 'dateformat' -const now = new Date() +import * as dateFormat from 'dateformat'; +const now = new Date(); // Basic usage -dateFormat(now, 'dddd, mmmm dS, yyyy, h:MM:ss TT') +dateFormat(now, 'dddd, mmmm dS, yyyy, h:MM:ss TT'); // Saturday, June 9th, 2007, 5:46:21 PM // You can use one of several named masks -dateFormat(now, 'isoDateTime') +dateFormat(now, 'isoDateTime'); // 2007-06-09T17:46:21 // ...Or add your own -dateFormat.masks['hammerTime'] = `HH:MM! "Can't touch this!"` -dateFormat(now, 'hammerTime') +dateFormat.masks.hammerTime = 'HH:MM! "Can\'t touch this!"'; +dateFormat(now, 'hammerTime'); // 17:46! Can't touch this! -// When using the standalone dateFormat function, -// you can also provide the date as a string -dateFormat('Jun 9 2007', 'fullDate') +// You can also provide the date as a string +dateFormat('Jun 9 2007', 'fullDate'); // Saturday, June 9, 2007 // Note that if you don't include the mask argument, // dateFormat.masks.default is used -dateFormat(now) +dateFormat(now); // Sat Jun 09 2007 17:46:21 // And if you don't include the date argument, // the current date and time is used -dateFormat() +dateFormat(); // Sat Jun 09 2007 17:46:22 // You can also skip the date argument (as long as your mask doesn't // contain any numbers), in which case the current date/time is used -dateFormat('longTime') +dateFormat('longTime'); // 5:46:22 PM EST // And finally, you can convert local time to UTC time. Simply pass in // true as an additional argument (no argument skipping allowed in this case): -dateFormat(now, 'longTime', true) +dateFormat(now, 'longTime', true); // 10:46:21 PM UTC -// ...Or add the prefix 'UTC:' or 'GMT:' to your mask. -dateFormat(now, 'UTC:h:MM:ss TT Z') +// ...Or add the prefix "UTC:" or "GMT:" to your mask. +dateFormat(now, 'UTC:h:MM:ss TT Z'); // 10:46:21 PM UTC // You can also get the ISO 8601 week of the year: -dateFormat(now, 'W') +dateFormat(now, 'W'); // 42 // and also get the ISO 8601 numeric representation of the day of the week: -dateFormat(now, 'N') +dateFormat(now, 'N'); // 6 diff --git a/types/dateformat/index.d.ts b/types/dateformat/index.d.ts index 9a97ba620f..14f9b6fc1f 100644 --- a/types/dateformat/index.d.ts +++ b/types/dateformat/index.d.ts @@ -1,58 +1,12 @@ -// Type definitions for dateformat v1.0.12 +// Type definitions for dateformat 3.0 // Project: https://github.com/felixge/node-dateformat // Definitions by: Kombu +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 -/** - * dateFormat.masks - * - * Predefined Formats - * - * https://github.com/felixge/node-dateformat/blob/master/lib/dateformat.js#L107 - */ -interface DateFormatMasks { - default: string; - shortDate: string; - mediumDate: string; - longDate: string; - fullDate: string; - shortTime: string; - mediumTime: string; - longTime: string; - isoDate: string; - isoTime: string; - isoDateTime: string; - isoUtcDateTime: string; - expiresHeaderFormat: string; - [key: string]: string; -} - -/** - * dateFormat.i18n - * - * Internationalization strings - * - * Example: - * - * ``` - * dateFormat.i18n = { - * dayNames: [ - * 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', - * 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' - * ], - * monthNames: [ - * 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', - * 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' - * ] - * } - * ``` - * - * https://github.com/felixge/node-dateformat/blob/master/lib/dateformat.js#L124 - */ -interface DateFormatI18n { - dayNames: string[]; - monthNames: string[]; -} +export as namespace dateFormat; +export = dateFormat; /** * dateFormat() @@ -64,14 +18,69 @@ interface DateFormatI18n { * * https://github.com/felixge/node-dateformat/blob/master/lib/dateformat.js#L18 */ -interface DateFormatStatic { - (date?: Date | string | number, mask?: string, utc?: boolean, gmt?: boolean): string; - (mask?: string, utc?: boolean, gmt?: boolean): string; - masks: DateFormatMasks; - i18n: DateFormatI18n; -} +declare function dateFormat( + date?: Date | string | number, + mask?: string, + utc?: boolean, + gmt?: boolean +): string; +declare function dateFormat(mask?: string, utc?: boolean, gmt?: boolean): string; -declare module 'dateformat' { - const dateFormat: DateFormatStatic; - export = dateFormat; +declare namespace dateFormat { + const masks: DateFormatMasks; + const i18n: DateFormatI18n; + + /** + * dateFormat.masks + * + * Predefined Formats + * + * @see https://github.com/felixge/node-dateformat/blob/master/lib/dateformat.js#L107 + */ + interface DateFormatMasks { + default: string; + shortDate: string; + mediumDate: string; + longDate: string; + fullDate: string; + shortTime: string; + mediumTime: string; + longTime: string; + isoDate: string; + isoTime: string; + isoDateTime: string; + isoUtcDateTime: string; + expiresHeaderFormat: string; + [key: string]: string; + } + + /** + * dateFormat.i18n + * + * Internationalization strings + * + * Example: + * + * @example ``` + * dateFormat.i18n = { + * dayNames: [ + * 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', + * 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' + * ], + * monthNames: [ + * 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', + * 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' + * ], + * timeNames: [ + * 'a', 'p', 'am', 'pm', 'A', 'P', 'AM', 'PM' + * ] + * };``` + * + * @see https://github.com/felixge/node-dateformat/blob/master/lib/dateformat.js#L124 + */ + interface DateFormatI18n { + dayNames: string[]; + monthNames: string[]; + timeNames: string[]; + } } diff --git a/types/dateformat/tsconfig.json b/types/dateformat/tsconfig.json index 1c5fc06611..e01cf7c531 100644 --- a/types/dateformat/tsconfig.json +++ b/types/dateformat/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "dateformat-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/dateformat/tslint.json b/types/dateformat/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/dateformat/tslint.json +++ b/types/dateformat/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/dateformat/v1/dateformat-tests.ts b/types/dateformat/v1/dateformat-tests.ts new file mode 100644 index 0000000000..e77be9884c --- /dev/null +++ b/types/dateformat/v1/dateformat-tests.ts @@ -0,0 +1,56 @@ +/** + * https://github.com/felixge/node-dateformat#usage + */ + +import * as dateFormat from 'dateformat'; +const now = new Date(); + +// Basic usage +dateFormat(now, 'dddd, mmmm dS, yyyy, h:MM:ss TT'); +// Saturday, June 9th, 2007, 5:46:21 PM + +// You can use one of several named masks +dateFormat(now, 'isoDateTime'); +// 2007-06-09T17:46:21 + +// ...Or add your own +dateFormat.masks['hammerTime'] = `HH:MM! "Can't touch this!"`; +dateFormat(now, 'hammerTime'); +// 17:46! Can't touch this! + +// When using the standalone dateFormat function, +// you can also provide the date as a string +dateFormat('Jun 9 2007', 'fullDate'); +// Saturday, June 9, 2007 + +// Note that if you don't include the mask argument, +// dateFormat.masks.default is used +dateFormat(now); +// Sat Jun 09 2007 17:46:21 + +// And if you don't include the date argument, +// the current date and time is used +dateFormat(); +// Sat Jun 09 2007 17:46:22 + +// You can also skip the date argument (as long as your mask doesn't +// contain any numbers), in which case the current date/time is used +dateFormat('longTime'); +// 5:46:22 PM EST + +// And finally, you can convert local time to UTC time. Simply pass in +// true as an additional argument (no argument skipping allowed in this case): +dateFormat(now, 'longTime', true); +// 10:46:21 PM UTC + +// ...Or add the prefix 'UTC:' or 'GMT:' to your mask. +dateFormat(now, 'UTC:h:MM:ss TT Z'); +// 10:46:21 PM UTC + +// You can also get the ISO 8601 week of the year: +dateFormat(now, 'W'); +// 42 + +// and also get the ISO 8601 numeric representation of the day of the week: +dateFormat(now, 'N'); +// 6 diff --git a/types/dateformat/v1/index.d.ts b/types/dateformat/v1/index.d.ts new file mode 100644 index 0000000000..aca56b652e --- /dev/null +++ b/types/dateformat/v1/index.d.ts @@ -0,0 +1,75 @@ +// Type definitions for dateformat 1.0 +// Project: https://github.com/felixge/node-dateformat +// Definitions by: Kombu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * dateFormat.masks + * + * Predefined Formats + * + * https://github.com/felixge/node-dateformat/blob/master/lib/dateformat.js#L107 + */ +interface DateFormatMasks { + default: string; + shortDate: string; + mediumDate: string; + longDate: string; + fullDate: string; + shortTime: string; + mediumTime: string; + longTime: string; + isoDate: string; + isoTime: string; + isoDateTime: string; + isoUtcDateTime: string; + expiresHeaderFormat: string; + [key: string]: string; +} + +/** + * dateFormat.i18n + * + * Internationalization strings + * + * Example: + * + * ``` + * dateFormat.i18n = { + * dayNames: [ + * 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', + * 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' + * ], + * monthNames: [ + * 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', + * 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' + * ] + * } + * ``` + * + * https://github.com/felixge/node-dateformat/blob/master/lib/dateformat.js#L124 + */ +interface DateFormatI18n { + dayNames: string[]; + monthNames: string[]; +} + +/** + * dateFormat() + * + * Accepts a date, a mask, or a date and a mask. + * Returns a formatted version of the given date. + * The date defaults to the current date/time. + * The mask defaults to dateFormat.masks.default. + * + * https://github.com/felixge/node-dateformat/blob/master/lib/dateformat.js#L18 + */ +interface DateFormatStatic { + (date?: Date | string | number, mask?: string, utc?: boolean, gmt?: boolean): string; + (mask?: string, utc?: boolean, gmt?: boolean): string; + masks: DateFormatMasks; + i18n: DateFormatI18n; +} + +declare const dateFormat: DateFormatStatic; +export = dateFormat; diff --git a/types/dateformat/v1/tsconfig.json b/types/dateformat/v1/tsconfig.json new file mode 100644 index 0000000000..cab656f828 --- /dev/null +++ b/types/dateformat/v1/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "dateformat": [ + "dateformat/v1" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dateformat-tests.ts" + ] +} diff --git a/types/dateformat/v1/tslint.json b/types/dateformat/v1/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/dateformat/v1/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/db-migrate-base/db-migrate-base-tests.ts b/types/db-migrate-base/db-migrate-base-tests.ts index e9c46f4873..b094be1280 100644 --- a/types/db-migrate-base/db-migrate-base-tests.ts +++ b/types/db-migrate-base/db-migrate-base-tests.ts @@ -318,4 +318,4 @@ db.runSqlAsync('DROP TABLE `pets`').then(onResolve); /// allAsync(sql, [params]) db.allAsync('SELECT * FROM `module_user` WHERE `?` = \'?\'', ['first_name', 'Test']).then(onResolve); -db.allAsync('SELECT * FROM `module_user`').then(onResolve); \ No newline at end of file +db.allAsync('SELECT * FROM `module_user`').then(onResolve); diff --git a/types/dd-trace/dd-trace-tests.ts b/types/dd-trace/dd-trace-tests.ts index 9d6936875a..cee1b6e3ee 100644 --- a/types/dd-trace/dd-trace-tests.ts +++ b/types/dd-trace/dd-trace-tests.ts @@ -2,14 +2,15 @@ import * as tracer from "dd-trace"; import SpanContext = require("dd-trace/src/opentracing/span_context"); tracer.init({ + enabled: true, service: "MyLovelyService", hostname: "localhost", port: 8126, + env: "dev", logger: { debug: msg => {}, error: err => {}, - }, - tags: { tracerEnv: 'dev'} + } }); function useWebFrameworkPlugin(plugin: "express" | "hapi" | "koa" | "restify") { diff --git a/types/dd-trace/index.d.ts b/types/dd-trace/index.d.ts index 311fa7675e..a55b7f8de7 100644 --- a/types/dd-trace/index.d.ts +++ b/types/dd-trace/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for dd-trace-js 0.6 +// Type definitions for dd-trace-js 0.7 // Project: https://github.com/DataDog/dd-trace-js // Definitions by: Colin Bradley // Eloy Durán @@ -54,6 +54,12 @@ declare class TraceProxy extends Tracer { } interface TracerOptions { + /** + * Whether to enable the tracer. + * @default true + */ + enabled?: boolean; + /** * Enable debug logging in the tracer. * @default false @@ -77,6 +83,11 @@ interface TracerOptions { */ port?: number | string; + /** + * Set an application’s environment e.g. prod, pre-prod, stage. + */ + env?: string; + /** * Percentage of spans to sample as a float between 0 and 1. * @default 1 @@ -185,6 +196,7 @@ declare class Scope { type Plugin = | "amqp10" | "amqplib" + | "bluebird" | "elasticsearch" | "express" | "graphql" @@ -197,8 +209,10 @@ type Plugin = | "mysql" | "mysql2" | "pg" + | "q" | "redis" - | "restify"; + | "restify" + | "when"; interface BasePluginOptions { /** diff --git a/types/debounce-fn/debounce-fn-tests.ts b/types/debounce-fn/debounce-fn-tests.ts new file mode 100644 index 0000000000..9f9d3881e9 --- /dev/null +++ b/types/debounce-fn/debounce-fn-tests.ts @@ -0,0 +1,10 @@ +import debounceFn = require('debounce-fn'); + +const debounced = debounceFn((s: string) => true); +debounced; // $ExpectType ((s: string) => boolean | undefined) & { cancel(): void; } + +debounceFn((s: string) => true); +debounceFn((s: string) => true, { wait: 100 }); +debounceFn((s: string) => true, { immediate: true }); + +debounced.cancel(); diff --git a/types/debounce-fn/index.d.ts b/types/debounce-fn/index.d.ts new file mode 100644 index 0000000000..01e147a14a --- /dev/null +++ b/types/debounce-fn/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for debounce-fn 1.0 +// Project: https://github.com/sindresorhus/debounce-fn#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +export = debounce; + +/** + * Returns a debounced function that delays calling the `input` function until after `wait` milliseconds + * have elapsed since the last time the debounced function was called. + * + * It comes with a `.cancel()` method to cancel any scheduled `input` function calls. + */ +declare function debounce( + input: (...args: TArgs) => TResult, + options?: debounce.Options +): ((...args: TArgs) => TResult | undefined) & { cancel(): void }; + +declare namespace debounce { + interface Options { + /** + * Time to wait until the `input` function is called. + * @default 0 + */ + wait?: number; + /** + * Trigger the function on the leading edge instead of the trailing edge of the `wait` interval. + * For example, can be useful for preventing accidental double-clicks on a "submit" button + * from firing a second time. + */ + immediate?: boolean; + } +} diff --git a/types/debounce-fn/tsconfig.json b/types/debounce-fn/tsconfig.json new file mode 100644 index 0000000000..f2d90018fb --- /dev/null +++ b/types/debounce-fn/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", + "debounce-fn-tests.ts" + ] +} diff --git a/types/debounce-fn/tslint.json b/types/debounce-fn/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/debounce-fn/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/debounce-promise/index.d.ts b/types/debounce-promise/index.d.ts index 905ca7fc50..2356d30060 100644 --- a/types/debounce-promise/index.d.ts +++ b/types/debounce-promise/index.d.ts @@ -11,12 +11,14 @@ declare namespace debounce { } } +type ArgumentsType = T extends (...args: infer A) => any ? A : never; + declare function debounce any>( func: T, wait?: number, options?: debounce.DebounceOptions ): ( - ...args: Parameters + ...args: ArgumentsType ) => ReturnType extends Promise ? ReturnType : Promise>; diff --git a/types/debounce-promise/package.json b/types/debounce-promise/package.json new file mode 100644 index 0000000000..bb80441dc0 --- /dev/null +++ b/types/debounce-promise/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "types": "index", + "typesVersions": { + ">=3.1.0-0": { "*": ["ts3.1/*"] } + } +} diff --git a/types/debounce-promise/ts3.1/debounce-promise-tests.ts b/types/debounce-promise/ts3.1/debounce-promise-tests.ts new file mode 100644 index 0000000000..75b53dc764 --- /dev/null +++ b/types/debounce-promise/ts3.1/debounce-promise-tests.ts @@ -0,0 +1,25 @@ +import debounce = require("debounce-promise"); +import { DebounceOptions } from "debounce-promise"; + +const options: DebounceOptions = {}; +const optionsA: DebounceOptions = { leading: true }; +const f = async () => 2; +const f2 = (a: string) => 2; +debounce(f, 100); +debounce(f, 0, options); +debounce(f, 100, optionsA); +debounce(f, 10, { accumulate: true }); +const foo = debounce(async () => f2, 10, { + leading: true, + accumulate: true +}); +foo().then(f => f("2")); +const bar = debounce(async () => [1, 2, 3], 100); +bar().then(ar => ar.concat()); + +// Converts the return value from the producer function to a promise +const two = debounce((a: string, b: number, c: { d: boolean }) => [4], 10, { + leading: true, + accumulate: true +}); +two("1", 2, { d: false }).then(ar => ar.pop(), () => 2); diff --git a/types/debounce-promise/ts3.1/index.d.ts b/types/debounce-promise/ts3.1/index.d.ts new file mode 100644 index 0000000000..29aa7356a1 --- /dev/null +++ b/types/debounce-promise/ts3.1/index.d.ts @@ -0,0 +1,18 @@ +declare namespace debounce { + interface DebounceOptions { + leading?: boolean; + accumulate?: boolean; + } +} + +declare function debounce any>( + func: T, + wait?: number, + options?: debounce.DebounceOptions +): ( + ...args: Parameters +) => ReturnType extends Promise + ? ReturnType + : Promise>; + +export = debounce; diff --git a/types/debounce-promise/ts3.1/tsconfig.json b/types/debounce-promise/ts3.1/tsconfig.json new file mode 100644 index 0000000000..cfd321d014 --- /dev/null +++ b/types/debounce-promise/ts3.1/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": ["../../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "debounce-promise-tests.ts"] +} diff --git a/types/debounce-promise/ts3.1/tslint.json b/types/debounce-promise/ts3.1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/debounce-promise/ts3.1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/decode-entities/decode-entities-tests.ts b/types/decode-entities/decode-entities-tests.ts new file mode 100644 index 0000000000..12df82aff7 --- /dev/null +++ b/types/decode-entities/decode-entities-tests.ts @@ -0,0 +1,4 @@ +import decodeEntities = require('decode-entities'); + +// $ExpectType string +decodeEntities('© !'); diff --git a/types/decode-entities/index.d.ts b/types/decode-entities/index.d.ts new file mode 100644 index 0000000000..965e974092 --- /dev/null +++ b/types/decode-entities/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for decode-entities 1.0 +// Project: https://github.com/waspothegreat/decode-entities#readme +// Definitions by: waspothegreat +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function decode(encodedString: string): string; + +export = decode; diff --git a/types/decode-entities/tsconfig.json b/types/decode-entities/tsconfig.json new file mode 100644 index 0000000000..3a3967c92c --- /dev/null +++ b/types/decode-entities/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", + "decode-entities-tests.ts" + ] +} \ No newline at end of file diff --git a/types/decode-entities/tslint.json b/types/decode-entities/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/decode-entities/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/decode-uri-component/decode-uri-component-tests.ts b/types/decode-uri-component/decode-uri-component-tests.ts new file mode 100644 index 0000000000..dfcd379031 --- /dev/null +++ b/types/decode-uri-component/decode-uri-component-tests.ts @@ -0,0 +1,12 @@ +import decodeUriComponent = require('decode-uri-component'); + +// $ExpectType string +decodeUriComponent('%25'); +decodeUriComponent('%'); +decodeUriComponent('st%C3%A5le'); +decodeUriComponent('%st%C3%A5le%'); +decodeUriComponent('%%7Bst%C3%A5le%7D%'); +decodeUriComponent('%7B%ab%%7C%de%%7D'); +decodeUriComponent('%FE%FF'); +decodeUriComponent('%C2'); +decodeUriComponent('%C2%B5'); diff --git a/types/decode-uri-component/index.d.ts b/types/decode-uri-component/index.d.ts new file mode 100644 index 0000000000..a1649d5830 --- /dev/null +++ b/types/decode-uri-component/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for decode-uri-component 0.2 +// Project: https://github.com/samverschueren/decode-uri-component#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = decodeUriComponent; + +declare function decodeUriComponent(encodedURI: string): string; diff --git a/types/decode-uri-component/tsconfig.json b/types/decode-uri-component/tsconfig.json new file mode 100644 index 0000000000..dfd7bc27ca --- /dev/null +++ b/types/decode-uri-component/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", + "decode-uri-component-tests.ts" + ] +} diff --git a/types/decode-uri-component/tslint.json b/types/decode-uri-component/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/decode-uri-component/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/default-gateway/default-gateway-tests.ts b/types/default-gateway/default-gateway-tests.ts new file mode 100644 index 0000000000..7e52d25dc1 --- /dev/null +++ b/types/default-gateway/default-gateway-tests.ts @@ -0,0 +1,11 @@ +import * as defaultGateway from 'default-gateway'; + +defaultGateway.v4().then(result => { + result; // $ExpectType Gateway +}); +defaultGateway.v6().then(result => { + result; // $ExpectType Gateway +}); + +defaultGateway.v4.sync(); // $ExpectType Gateway +defaultGateway.v6.sync(); // $ExpectType Gateway diff --git a/types/default-gateway/index.d.ts b/types/default-gateway/index.d.ts new file mode 100644 index 0000000000..23625451c3 --- /dev/null +++ b/types/default-gateway/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for default-gateway 3.0 +// Project: https://github.com/silverwind/default-gateway#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export const v4: DefaultGatewayFn; +export const v6: DefaultGatewayFn; + +export interface DefaultGatewayFn { + (): Promise; + sync(): Gateway; +} + +export interface Gateway { + gateway: string; + interface: string | null; +} diff --git a/types/default-gateway/tsconfig.json b/types/default-gateway/tsconfig.json new file mode 100644 index 0000000000..75e68a34db --- /dev/null +++ b/types/default-gateway/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", + "default-gateway-tests.ts" + ] +} diff --git a/types/default-gateway/tslint.json b/types/default-gateway/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/default-gateway/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/defaults-deep/defaults-deep-tests.ts b/types/defaults-deep/defaults-deep-tests.ts new file mode 100644 index 0000000000..daabc46d7d --- /dev/null +++ b/types/defaults-deep/defaults-deep-tests.ts @@ -0,0 +1,7 @@ +import defaults = require('defaults-deep'); + +defaults(); +defaults({a: 'foo'}); +defaults({a: 'foo'}, {a: 'bar'}); +defaults({a: 'foo'}, {a: 'bar'}, {a: 'foobar'}); +defaults({a: {b: 'foo'}}, {a: {b: 'bar'}}); diff --git a/types/defaults-deep/index.d.ts b/types/defaults-deep/index.d.ts new file mode 100644 index 0000000000..749257eb88 --- /dev/null +++ b/types/defaults-deep/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for defaults-deep 0.2 +// Project: https://github.com/jonschlinkert/defaults-deep +// Definitions by: Hugo Alliaume +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Obj { + [k: string]: any; +} + +declare function defaultsDeep(...objs: Obj[]): Obj; + +export = defaultsDeep; diff --git a/types/defaults-deep/tsconfig.json b/types/defaults-deep/tsconfig.json new file mode 100644 index 0000000000..9b7c12bf2b --- /dev/null +++ b/types/defaults-deep/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", + "defaults-deep-tests.ts" + ] +} diff --git a/types/defaults-deep/tslint.json b/types/defaults-deep/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/defaults-deep/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/detox/detox-tests.ts b/types/detox/detox-tests.ts deleted file mode 100644 index 58fe5c1912..0000000000 --- a/types/detox/detox-tests.ts +++ /dev/null @@ -1,31 +0,0 @@ -declare var describe: (test: string, callback: () => void) => void; -declare var beforeAll: (callback: () => void) => void; -declare var afterAll: (callback: () => void) => void; -declare var test: (test: string, callback: () => void) => void; - -describe('Test', () => { - beforeAll(async () => { - await device.reloadReactNative(); - }); - - afterAll(async () => { - await element(by.id('element')).clearText(); - }); - - test('Test', async () => { - await element(by.id('element')).replaceText('text'); - await element(by.id('element')).tap(); - await element(by.id('element')).scroll(50, 'down'); - await element(by.id('scrollView')).scrollTo('bottom'); - await expect(element(by.id('element')).atIndex(0)).toNotExist(); - await element(by.id('scrollView')).swipe('down', 'fast'); - await element(by.type('UIPickerView')).setColumnToValue(1, "6"); - - await expect(element(by.id('element').withAncestor(by.id('parent_element')))).toNotExist(); - await expect(element(by.id('element').withDescendant(by.id('child_element')))).toNotExist(); - - await waitFor(element(by.id('element'))).toBeVisible().withTimeout(2000); - await device.pressBack(); - await waitFor(element(by.text('Text5'))).toBeVisible().whileElement(by.id('ScrollView630')).scroll(50, 'down'); - }); -}); diff --git a/types/detox/index.d.ts b/types/detox/index.d.ts index a7bfa12bca..de74163bf1 100644 --- a/types/detox/index.d.ts +++ b/types/detox/index.d.ts @@ -3,428 +3,435 @@ // Definitions by: Tareq El-Masri , Steve Chun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare const detox: Detox.Detox; -declare const device: Detox.Device; -declare const element: Detox.Element; -declare const waitFor: Detox.WaitFor; -declare const expect: Detox.Expect>; -declare const by: Detox.Matchers; +declare global { + const detox: Detox.Detox; + const device: Detox.Device; + const element: Detox.Element; + const waitFor: Detox.WaitFor; + const expect: Detox.Expect>; + const by: Detox.Matchers; -declare namespace Detox { - interface Detox { - /** - * The setup phase happens inside detox.init(). This is the phase where detox reads its configuration, starts a server, loads its expection library and starts a simulator - * @param config - * @param options - * @example const config = require('../package.json').detox; - * - * before(async () => { - * await detox.init(config); - * }); - */ - init(config: any, options?: DetoxInitOptions): Promise; - /** - * Artifacts currently include only logs from the app process before each task - * @param args - */ - beforeEach(...args: any[]): Promise; - /** - * Artifacts currently include only logs from the app process after each task - * @param args - */ - afterEach(...args: any[]): Promise; - /** - * The cleanup phase should happen after all the tests have finished. This is the phase where detox-server shuts down. - * @example after(async () => { - * await detox.cleanup(); - * }); - */ - cleanup(): Promise; - } - interface Device { - /** - * Launch the app - * @param config - * @example // Terminate the app and launch it again. If set to false, the simulator will try to bring app from background, - * // if the app isn't running, it will launch a new instance. default is false - * await device.launchApp({newInstance: true}); - * // Grant or deny runtime permissions for your application. - * await device.launchApp({permissions: {calendar: 'YES'}}); - * // Mock opening the app from URL to test your app's deep link handling mechanism. - * await device.launchApp({url: url}); - */ - launchApp(config: DeviceLanchAppConfig): Promise; - /** - * By default, terminateApp() with no params will terminate the app - * To terminate another app, specify its bundle id - * @param bundle - * @example await device.terminateApp('other.bundle.id'); - */ - terminateApp(bundle?: string): Promise; - /** - * Send application to background by bringing com.apple.springboard to the foreground. - * Combining sendToHome() with launchApp({newInstance: false}) will simulate app coming back from background. - * @example await device.sendToHome(); - * await device.launchApp({newInstance: false}); - */ - sendToHome(): Promise; - /** - * If this is a React Native app, reload the React Native JS bundle. This action is much faster than device.launchApp(), and can be used if you just need to reset your React Native logic. - * @example await device.reloadReactNative() - */ - reloadReactNative(): Promise; - /** - * By default, installApp() with no params will install the app file defined in the current configuration. - * To install another app, specify its path - * @param path - * @example await device.installApp('path/to/other/app'); - */ - installApp(path?: any): Promise; - /** - * By default, uninstallApp() with no params will uninstall the app defined in the current configuration. - * To uninstall another app, specify its bundle id - * @param bundle - * @example await device.installApp('other.bundle.id'); - */ - uninstallApp(bundle?: string): Promise; - /** - * Mock opening the app from URL. sourceApp is an optional parameter to specify source application bundle id. - * @param url - */ - openURL(url: {url: string, sourceApp?: string}): Promise; - /** - * Mock handling of received user notification when app is in foreground. - * @param params - */ - sendUserNotification(...params: any[]): Promise; - /** - * Mock handling of received user activity when app is in foreground. - * @param params - */ - sendUserActivity(...params: any[]): Promise; - /** - * Takes "portrait" or "landscape" and rotates the device to the given orientation. Currently only available in the iOS Simulator. - * @param orientation - */ - setOrientation(orientation: Orientation): Promise; - /** - * Note: setLocation is dependent on fbsimctl. if fbsimctl is not installed, the command will fail, it must be installed. Sets the simulator location to the given latitude and longitude. - * @param lat - * @param lon - * @example await device.setLocation(32.0853, 34.7818); - */ - setLocation(lat: number, lon: number): Promise; - /** - * Disable EarlGrey's network synchronization mechanism on preffered endpoints. Usful if you want to on skip over synchronizing on certain URLs. - * @param urls - * @example await device.setURLBlacklist(['.*127.0.0.1.*']); - */ - setURLBlacklist(urls: string[]): Promise; - /** - * Enable EarlGrey's synchronization mechanism (enabled by default). This is being reset on every new instance of the app. - * @example await device.enableSynchronization(); - */ - enableSynchronization(): Promise; - /** - * Disable EarlGrey's synchronization mechanism (enabled by default) This is being reset on every new instance of the app. - * @example await device.disableSynchronization(); - */ - disableSynchronization(): Promise; - /** - * Resets the Simulator to clean state (like the Simulator > Reset Content and Settings... menu item), especially removing previously set permissions. - * @example await device.resetContentAndSettings(); - */ - resetContentAndSettings(): Promise; - /** - * Returns the current device, ios or android. - * @example if (device.getPlatform() === 'ios') { - * await expect(loopSwitch).toHaveValue('1'); - * } - */ - getPlatform(): "ios" | "android"; - /** - * Simulate press back button (Android Only) - */ - pressBack(): Promise; - /** - * Simulate shake (iOS Only) - */ - shake(): Promise; - } + namespace Detox { + interface Detox { + /** + * The setup phase happens inside detox.init(). This is the phase where detox reads its configuration, starts a server, loads its expection library and starts a simulator + * @param config + * @param options + * @example const config = require('../package.json').detox; + * + * before(async () => { + * await detox.init(config); + * }); + */ + init(config: any, options?: DetoxInitOptions): Promise; + /** + * Artifacts currently include only logs from the app process before each task + * @param args + */ + beforeEach(...args: any[]): Promise; + /** + * Artifacts currently include only logs from the app process after each task + * @param args + */ + afterEach(...args: any[]): Promise; + /** + * The cleanup phase should happen after all the tests have finished. This is the phase where detox-server shuts down. + * @example after(async () => { + * await detox.cleanup(); + * }); + */ + cleanup(): Promise; + } + interface Device { + /** + * Launch the app + * @param config + * @example // Terminate the app and launch it again. If set to false, the simulator will try to bring app from background, + * // if the app isn't running, it will launch a new instance. default is false + * await device.launchApp({newInstance: true}); + * // Grant or deny runtime permissions for your application. + * await device.launchApp({permissions: {calendar: 'YES'}}); + * // Mock opening the app from URL to test your app's deep link handling mechanism. + * await device.launchApp({url: url}); + */ + launchApp(config: DeviceLanchAppConfig): Promise; + /** + * By default, terminateApp() with no params will terminate the app + * To terminate another app, specify its bundle id + * @param bundle + * @example await device.terminateApp('other.bundle.id'); + */ + terminateApp(bundle?: string): Promise; + /** + * Send application to background by bringing com.apple.springboard to the foreground. + * Combining sendToHome() with launchApp({newInstance: false}) will simulate app coming back from background. + * @example await device.sendToHome(); + * await device.launchApp({newInstance: false}); + */ + sendToHome(): Promise; + /** + * If this is a React Native app, reload the React Native JS bundle. This action is much faster than device.launchApp(), and can be used if you just need to reset your React Native logic. + * @example await device.reloadReactNative() + */ + reloadReactNative(): Promise; + /** + * By default, installApp() with no params will install the app file defined in the current configuration. + * To install another app, specify its path + * @param path + * @example await device.installApp('path/to/other/app'); + */ + installApp(path?: any): Promise; + /** + * By default, uninstallApp() with no params will uninstall the app defined in the current configuration. + * To uninstall another app, specify its bundle id + * @param bundle + * @example await device.installApp('other.bundle.id'); + */ + uninstallApp(bundle?: string): Promise; + /** + * Mock opening the app from URL. sourceApp is an optional parameter to specify source application bundle id. + * @param url + */ + openURL(url: { url: string; sourceApp?: string }): Promise; + /** + * Mock handling of received user notification when app is in foreground. + * @param params + */ + sendUserNotification(...params: any[]): Promise; + /** + * Mock handling of received user activity when app is in foreground. + * @param params + */ + sendUserActivity(...params: any[]): Promise; + /** + * Takes "portrait" or "landscape" and rotates the device to the given orientation. Currently only available in the iOS Simulator. + * @param orientation + */ + setOrientation(orientation: Orientation): Promise; + /** + * Note: setLocation is dependent on fbsimctl. if fbsimctl is not installed, the command will fail, it must be installed. Sets the simulator location to the given latitude and longitude. + * @param lat + * @param lon + * @example await device.setLocation(32.0853, 34.7818); + */ + setLocation(lat: number, lon: number): Promise; + /** + * Disable EarlGrey's network synchronization mechanism on preffered endpoints. Usful if you want to on skip over synchronizing on certain URLs. + * @param urls + * @example await device.setURLBlacklist(['.*127.0.0.1.*']); + */ + setURLBlacklist(urls: string[]): Promise; + /** + * Enable EarlGrey's synchronization mechanism (enabled by default). This is being reset on every new instance of the app. + * @example await device.enableSynchronization(); + */ + enableSynchronization(): Promise; + /** + * Disable EarlGrey's synchronization mechanism (enabled by default) This is being reset on every new instance of the app. + * @example await device.disableSynchronization(); + */ + disableSynchronization(): Promise; + /** + * Resets the Simulator to clean state (like the Simulator > Reset Content and Settings... menu item), especially removing previously set permissions. + * @example await device.resetContentAndSettings(); + */ + resetContentAndSettings(): Promise; + /** + * Returns the current device, ios or android. + * @example if (device.getPlatform() === 'ios') { + * await expect(loopSwitch).toHaveValue('1'); + * } + */ + getPlatform(): "ios" | "android"; + /** + * Simulate press back button (Android Only) + */ + pressBack(): Promise; + /** + * Simulate shake (iOS Only) + */ + shake(): Promise; + } - type DetoxAny = Element & Actions & WaitFor; + type DetoxAny = Element & Actions & WaitFor; - interface Element { - (by: Matchers): DetoxAny; + interface Element { + (by: Matchers): DetoxAny; - /** - * Choose from multiple elements matching the same matcher using index - * @param index - * @example await element(by.text('Product')).atIndex(2); - */ - atIndex(index: number): DetoxAny; - } - interface Matchers { - (by: Matchers): Matchers; + /** + * Choose from multiple elements matching the same matcher using index + * @param index + * @example await element(by.text('Product')).atIndex(2); + */ + atIndex(index: number): DetoxAny; + } + interface Matchers { + (by: Matchers): Matchers; - /** - * by.id will match an id that is given to the view via testID prop. - * @param id - * @example // In a React Native component add testID like so: - * - * // Then match with by.id: - * await element(by.id('tap_me')); - */ - id(id: string): Matchers; - /** - * Find an element by text, useful for text fields, buttons. - * @param text - * @example await element(by.text('Tap Me')); - */ - text(text: string): Matchers; - /** - * Find an element by accessibilityLabel on iOS, or by contentDescription on Android. - * @param label - * @example await element(by.label('Welcome')); - */ - label(label: string): Matchers; - /** - * Find an element by native view type. - * @param nativeViewType - * @example await element(by.type('RCTImageView')); - */ - type(nativeViewType: string): Matchers; - /** - * Find an element with an accessibility trait. (iOS only) - * @example await element(by.traits(['button'])); - */ - traits(traits: string[]): Matchers; - /** - * Find an element by a matcher with a parent matcher - * @param parentBy - * @example await element(by.id('Grandson883').withAncestor(by.id('Son883'))); - */ - withAncestor(parentBy: Matchers): Matchers; - /** - * Find an element by a matcher with a child matcher - * @param childBy - * @example await element(by.id('Son883').withDescendant(by.id('Grandson883'))); - */ - withDescendant(childBy: Matchers): Matchers; - /** - * Find an element by multiple matchers - * @param by - * @example await element(by.text('Product').and(by.id('product_name')); - */ - and(by: Matchers): Matchers; - } - interface Expect { - (element: Element): Expect; - /** - * Expect the view to be at least 75% visible. - * @example await expect(element(by.id('UniqueId204'))).toBeVisible(); - */ - toBeVisible(): R; - /** - * Expect the view to not be visible. - * @example await expect(element(by.id('UniqueId205'))).toBeNotVisible(); - */ - toBeNotVisible(): R; - /** - * Expect the view to exist in the UI hierarchy. - * @example await expect(element(by.id('UniqueId205'))).toExist(); - */ - toExist(): R; - /** - * Expect the view to not exist in the UI hierarchy. - * @example await expect(element(by.id('RandomJunk959'))).toNotExist(); - */ - toNotExist(): R; - /** - * In React Native apps, expect UI component of type to have text. - * In native iOS apps, expect UI elements of type UIButton, UILabel, UITextField or UITextViewIn to have inputText with text. - * @param text - * @example await expect(element(by.id('UniqueId204'))).toHaveText('I contain some text'); - */ - toHaveText(text: string): R; - /** - * It searches by accessibilityLabel on iOS, or by contentDescription on Android. - * In React Native it can be set for both platforms by defining an accessibilityLabel on the view. - * @param label - * @example await expect(element(by.id('UniqueId204'))).toHaveLabel('Done'); - */ - toHaveLabel(label: string): R; - /** - * In React Native apps, expect UI component to have testID with that id. - * In native iOS apps, expect UI element to have accesibilityIdentifier with that id. - * @param id - * @example await expect(element(by.text('I contain some text'))).toHaveId('UniqueId204'); - */ - toHaveId(id: string): R; - /** - * Expect components like a Switch to have a value ('0' for off, '1' for on). - * @param value - * @example await expect(element(by.id('UniqueId533'))).toHaveValue('0'); - */ - toHaveValue(value: any): R; - } - interface WaitFor { - /** - * This API polls using the given expectation continuously until the expectation is met. Use manual synchronization with waitFor only as a last resort. - * NOTE: Every waitFor call must set a timeout using withTimeout(). Calling waitFor without setting a timeout will do nothing. - * @example await waitFor(element(by.id('UniqueId336'))).toExist().withTimeout(2000); - */ - (element: Element): Expect; - /** - * Waits for the condition to be met until the specified time (millis) have elapsed. - * @param millis number - * @example await waitFor(element(by.id('UniqueId336'))).toExist().withTimeout(2000); - */ - withTimeout(millis: number): Promise; - /** - * Performs the action repeatedly on the element until an expectation is met - * @param by - * @example await waitFor(element(by.text('Text5'))).toBeVisible().whileElement(by.id('ScrollView630')).scroll(50, 'down'); - */ - whileElement(by: Matchers): DetoxAny; - } - interface Actions { - /** - * Simulate tap on an element - * @example await element(by.id('tappable')).tap(); - */ - tap(): Promise>; - /** - * Simulate long press on an element - * @example await element(by.id('tappable')).longPress(); - */ - longPress(): Promise>; - /** - * Simulate multiple taps on an element. - * @param times number - * @example await element(by.id('tappable')).multiTap(3); - */ - multiTap(times: number): Promise>; - /** - * Simulate tap at a specific point on an element. - * Note: The point coordinates are relative to the matched element and the element size could changes on different devices or even when changing the device font size. - * @param point - * @example await element(by.id('tappable')).tapAtPoint({ x:5, y:10 }); - */ - tapAtPoint(point: { x: number, y: number }): Promise>; - /** - * Use the builtin keyboard to type text into a text field. - * @param text - * @example await element(by.id('textField')).typeText('passcode'); - */ - typeText(text: string): Promise>; - /** - * Paste text into a text field. - * @param text - * @example await element(by.id('textField')).replaceText('passcode again'); - */ - replaceText(text: string): Promise>; - /** - * Clear text from a text field. - * @example await element(by.id('textField')).clearText(); - */ - clearText(): Promise>; - /** - * - * @param pixels - * @param direction - * @example - * await element(by.id('scrollView')).scroll(100, 'down'); - * await element(by.id('scrollView')).scroll(100, 'up'); - */ - scroll(pixels: number, direction: Direction): Promise>; - /** - * Scroll to edge. - * @param edge - * @example await element(by.id('scrollView')).scrollTo('bottom'); - * await element(by.id('scrollView')).scrollTo('top'); - */ - scrollTo(edge: Direction): Promise>; - /** - * - * @param direction - * @param speed - * @param percentage - * @example await element(by.id('scrollView')).swipe('down'); - * await element(by.id('scrollView')).swipe('down', 'fast'); - * await element(by.id('scrollView')).swipe('down', 'fast', 0.5); - */ - swipe(direction: Direction, speed?: Speed, percentage?: number): Promise>; - /** - * (iOS Only) column - number of datepicker column (starts from 0) value - string value in setted column (must be correct) - * @param column - * @param value - * @example await expect(element(by.type('UIPickerView'))).toBeVisible(); - * await element(by.type('UIPickerView')).setColumnToValue(1,"6"); - * await element(by.type('UIPickerView')).setColumnToValue(2,"34"); - */ - setColumnToValue(column: number, value: string): Promise>; - } + /** + * by.id will match an id that is given to the view via testID prop. + * @param id + * @example // In a React Native component add testID like so: + * + * // Then match with by.id: + * await element(by.id('tap_me')); + */ + id(id: string): Matchers; + /** + * Find an element by text, useful for text fields, buttons. + * @param text + * @example await element(by.text('Tap Me')); + */ + text(text: string): Matchers; + /** + * Find an element by accessibilityLabel on iOS, or by contentDescription on Android. + * @param label + * @example await element(by.label('Welcome')); + */ + label(label: string): Matchers; + /** + * Find an element by native view type. + * @param nativeViewType + * @example await element(by.type('RCTImageView')); + */ + type(nativeViewType: string): Matchers; + /** + * Find an element with an accessibility trait. (iOS only) + * @example await element(by.traits(['button'])); + */ + traits(traits: string[]): Matchers; + /** + * Find an element by a matcher with a parent matcher + * @param parentBy + * @example await element(by.id('Grandson883').withAncestor(by.id('Son883'))); + */ + withAncestor(parentBy: Matchers): Matchers; + /** + * Find an element by a matcher with a child matcher + * @param childBy + * @example await element(by.id('Son883').withDescendant(by.id('Grandson883'))); + */ + withDescendant(childBy: Matchers): Matchers; + /** + * Find an element by multiple matchers + * @param by + * @example await element(by.text('Product').and(by.id('product_name')); + */ + and(by: Matchers): Matchers; + } + interface Expect { + (element: Element): Expect; + /** + * Expect the view to be at least 75% visible. + * @example await expect(element(by.id('UniqueId204'))).toBeVisible(); + */ + toBeVisible(): R; + /** + * Expect the view to not be visible. + * @example await expect(element(by.id('UniqueId205'))).toBeNotVisible(); + */ + toBeNotVisible(): R; + /** + * Expect the view to exist in the UI hierarchy. + * @example await expect(element(by.id('UniqueId205'))).toExist(); + */ + toExist(): R; + /** + * Expect the view to not exist in the UI hierarchy. + * @example await expect(element(by.id('RandomJunk959'))).toNotExist(); + */ + toNotExist(): R; + /** + * In React Native apps, expect UI component of type to have text. + * In native iOS apps, expect UI elements of type UIButton, UILabel, UITextField or UITextViewIn to have inputText with text. + * @param text + * @example await expect(element(by.id('UniqueId204'))).toHaveText('I contain some text'); + */ + toHaveText(text: string): R; + /** + * It searches by accessibilityLabel on iOS, or by contentDescription on Android. + * In React Native it can be set for both platforms by defining an accessibilityLabel on the view. + * @param label + * @example await expect(element(by.id('UniqueId204'))).toHaveLabel('Done'); + */ + toHaveLabel(label: string): R; + /** + * In React Native apps, expect UI component to have testID with that id. + * In native iOS apps, expect UI element to have accesibilityIdentifier with that id. + * @param id + * @example await expect(element(by.text('I contain some text'))).toHaveId('UniqueId204'); + */ + toHaveId(id: string): R; + /** + * Expect components like a Switch to have a value ('0' for off, '1' for on). + * @param value + * @example await expect(element(by.id('UniqueId533'))).toHaveValue('0'); + */ + toHaveValue(value: any): R; + } + interface WaitFor { + /** + * This API polls using the given expectation continuously until the expectation is met. Use manual synchronization with waitFor only as a last resort. + * NOTE: Every waitFor call must set a timeout using withTimeout(). Calling waitFor without setting a timeout will do nothing. + * @example await waitFor(element(by.id('UniqueId336'))).toExist().withTimeout(2000); + */ + (element: Element): Expect; + /** + * Waits for the condition to be met until the specified time (millis) have elapsed. + * @param millis number + * @example await waitFor(element(by.id('UniqueId336'))).toExist().withTimeout(2000); + */ + withTimeout(millis: number): Promise; + /** + * Performs the action repeatedly on the element until an expectation is met + * @param by + * @example await waitFor(element(by.text('Text5'))).toBeVisible().whileElement(by.id('ScrollView630')).scroll(50, 'down'); + */ + whileElement(by: Matchers): DetoxAny; + } + interface Actions { + /** + * Simulate tap on an element + * @example await element(by.id('tappable')).tap(); + */ + tap(): Promise>; + /** + * Simulate long press on an element + * @example await element(by.id('tappable')).longPress(); + */ + longPress(): Promise>; + /** + * Simulate multiple taps on an element. + * @param times number + * @example await element(by.id('tappable')).multiTap(3); + */ + multiTap(times: number): Promise>; + /** + * Simulate tap at a specific point on an element. + * Note: The point coordinates are relative to the matched element and the element size could changes on different devices or even when changing the device font size. + * @param point + * @example await element(by.id('tappable')).tapAtPoint({ x:5, y:10 }); + */ + tapAtPoint(point: { x: number; y: number }): Promise>; + /** + * Use the builtin keyboard to type text into a text field. + * @param text + * @example await element(by.id('textField')).typeText('passcode'); + */ + typeText(text: string): Promise>; + /** + * Paste text into a text field. + * @param text + * @example await element(by.id('textField')).replaceText('passcode again'); + */ + replaceText(text: string): Promise>; + /** + * Clear text from a text field. + * @example await element(by.id('textField')).clearText(); + */ + clearText(): Promise>; + /** + * + * @param pixels + * @param direction + * @example + * await element(by.id('scrollView')).scroll(100, 'down'); + * await element(by.id('scrollView')).scroll(100, 'up'); + */ + scroll(pixels: number, direction: Direction): Promise>; + /** + * Scroll to edge. + * @param edge + * @example await element(by.id('scrollView')).scrollTo('bottom'); + * await element(by.id('scrollView')).scrollTo('top'); + */ + scrollTo(edge: Direction): Promise>; + /** + * + * @param direction + * @param speed + * @param percentage + * @example await element(by.id('scrollView')).swipe('down'); + * await element(by.id('scrollView')).swipe('down', 'fast'); + * await element(by.id('scrollView')).swipe('down', 'fast', 0.5); + */ + swipe( + direction: Direction, + speed?: Speed, + percentage?: number + ): Promise>; + /** + * (iOS Only) column - number of datepicker column (starts from 0) value - string value in setted column (must be correct) + * @param column + * @param value + * @example await expect(element(by.type('UIPickerView'))).toBeVisible(); + * await element(by.type('UIPickerView')).setColumnToValue(1,"6"); + * await element(by.type('UIPickerView')).setColumnToValue(2,"34"); + */ + setColumnToValue( + column: number, + value: string + ): Promise>; + } - type Direction = "left" | "right" | "top" | "bottom" | "up" | "down"; - type Orientation = "portrait" | "landscape"; - type Speed = "fast" | "slow"; - - interface LanguageAndLocale { - language?: string; - locale?: string; - } - - interface DetoxInitOptions { - /** - * Detox exports device, expect, element, by and waitFor as globals by default, if you want to control their initialization manually, set init detox with initGlobals set to false. - * This is useful when during E2E tests you also need to run regular expectations in node. jest Expect for instance, will not be overriden by Detox when this option is used. - */ - initGlobals?: boolean; - /** - * By default await detox.init(config); will launch the installed app. If you wish to control when your app is launched, add {launchApp: false} param to your init. - */ - launchApp?: boolean; - } - - interface DeviceLanchAppConfig { - /** - * Restart the app - * Terminate the app and launch it again. If set to false, the simulator will try to bring app from background, if the app isn't running, it will launch a new instance. default is false - */ - newInstance?: boolean; - /** - * Set runtime permissions - * Grant or deny runtime permissions for your application. - */ - permissions?: any; - /** - * Launch from URL - * Mock opening the app from URL to test your app's deep link handling mechanism. - */ - url?: any; - /** - * Launch with user notifications - */ - userNotification?: any; - /** - * Launch with user activity - */ - userActivity?: any; - /** - * Launch into a fresh installation - * A flag that enables relaunching into a fresh installation of the app (it will uninstall and install the binary again), default is false. - */ - delete?: boolean; - /** - * Detox can start the app with additional launch arguments - * The added launchArgs will be passed through the launch command to the device and be accessible via [[NSProcessInfo processInfo] arguments] - */ - launchArgs?: any; - - /** - * Launch config for specifying the native language and locale - */ - languageAndLocale?: LanguageAndLocale; + type Direction = "left" | "right" | "top" | "bottom" | "up" | "down"; + type Orientation = "portrait" | "landscape"; + type Speed = "fast" | "slow"; + interface LanguageAndLocale { + language?: string; + locale?: string; + } + interface DetoxInitOptions { + /** + * Detox exports device, expect, element, by and waitFor as globals by default, if you want to control their initialization manually, set init detox with initGlobals set to false. + * This is useful when during E2E tests you also need to run regular expectations in node. jest Expect for instance, will not be overriden by Detox when this option is used. + */ + initGlobals?: boolean; + /** + * By default await detox.init(config); will launch the installed app. If you wish to control when your app is launched, add {launchApp: false} param to your init. + */ + launchApp?: boolean; + } + interface DeviceLanchAppConfig { + /** + * Restart the app + * Terminate the app and launch it again. If set to false, the simulator will try to bring app from background, if the app isn't running, it will launch a new instance. default is false + */ + newInstance?: boolean; + /** + * Set runtime permissions + * Grant or deny runtime permissions for your application. + */ + permissions?: any; + /** + * Launch from URL + * Mock opening the app from URL to test your app's deep link handling mechanism. + */ + url?: any; + /** + * Launch with user notifications + */ + userNotification?: any; + /** + * Launch with user activity + */ + userActivity?: any; + /** + * Launch into a fresh installation + * A flag that enables relaunching into a fresh installation of the app (it will uninstall and install the binary again), default is false. + */ + delete?: boolean; + /** + * Detox can start the app with additional launch arguments + * The added launchArgs will be passed through the launch command to the device and be accessible via [[NSProcessInfo processInfo] arguments] + */ + launchArgs?: any; + /** + * Launch config for specifying the native language and locale + */ + languageAndLocale?: LanguageAndLocale; + } } } + +export { by, detox, device, element, expect, waitFor }; diff --git a/types/detox/runners/jest/adapter/index.d.ts b/types/detox/runners/jest/adapter/index.d.ts new file mode 100644 index 0000000000..f479eda256 --- /dev/null +++ b/types/detox/runners/jest/adapter/index.d.ts @@ -0,0 +1,12 @@ +interface DetoxJestAdapter { + detox: Detox.Detox; + beforeEach: () => Promise; + afterAll: () => Promise; + // These are not publicly used, but are defined in order to overlap with the jasmine.CustomReporter interface (which is a weak interface) + specDone: () => void; + specStarted: () => void; +} + +declare const adapter: DetoxJestAdapter; + +export default adapter; diff --git a/types/detox/runners/mocha/adapter/index.d.ts b/types/detox/runners/mocha/adapter/index.d.ts new file mode 100644 index 0000000000..8e13b3bc01 --- /dev/null +++ b/types/detox/runners/mocha/adapter/index.d.ts @@ -0,0 +1,9 @@ +interface DetoxMochaAdapter { + detox: Detox.Detox; + beforeEach: (context: any) => Promise; + afterEach: (context: any) => Promise; +} + +declare const adapter: DetoxMochaAdapter; + +export default adapter; diff --git a/types/detox/test/detox-global-tests.ts b/types/detox/test/detox-global-tests.ts new file mode 100644 index 0000000000..42415c548d --- /dev/null +++ b/types/detox/test/detox-global-tests.ts @@ -0,0 +1,40 @@ +declare var describe: (test: string, callback: () => void) => void; +declare var beforeAll: (callback: () => void) => void; +declare var afterAll: (callback: () => void) => void; +declare var test: (test: string, callback: () => void) => void; + +describe("Test", () => { + beforeAll(async () => { + await device.reloadReactNative(); + }); + + afterAll(async () => { + await element(by.id("element")).clearText(); + }); + + test("Test", async () => { + await element(by.id("element")).replaceText("text"); + await element(by.id("element")).tap(); + await element(by.id("element")).scroll(50, "down"); + await element(by.id("scrollView")).scrollTo("bottom"); + await expect(element(by.id("element")).atIndex(0)).toNotExist(); + await element(by.id("scrollView")).swipe("down", "fast"); + await element(by.type("UIPickerView")).setColumnToValue(1, "6"); + + await expect( + element(by.id("element").withAncestor(by.id("parent_element"))) + ).toNotExist(); + await expect( + element(by.id("element").withDescendant(by.id("child_element"))) + ).toNotExist(); + + await waitFor(element(by.id("element"))) + .toBeVisible() + .withTimeout(2000); + await device.pressBack(); + await waitFor(element(by.text("Text5"))) + .toBeVisible() + .whileElement(by.id("ScrollView630")) + .scroll(50, "down"); + }); +}); diff --git a/types/detox/test/detox-jest-setup-tests.ts b/types/detox/test/detox-jest-setup-tests.ts new file mode 100644 index 0000000000..7a2a9a3901 --- /dev/null +++ b/types/detox/test/detox-jest-setup-tests.ts @@ -0,0 +1,31 @@ +declare var beforeAll: (callback: () => void) => void; +declare var beforeEach: (callback: () => void) => void; +declare var afterAll: (callback: () => void) => void; + +import adapter from "detox/runners/jest/adapter"; + +// Normally the Detox configuration from the project's package.json like so: +// const config = require("./package.json").detox; +declare const config: any; + +declare const jasmine: any; +jasmine.getEnv().addReporter(adapter); + +beforeAll(async () => { + await detox.init(config); + + const initOptions: Detox.DetoxInitOptions = { + initGlobals: false, + launchApp: false, + }; + await detox.init(config, initOptions); +}); + +beforeEach(async () => { + await adapter.beforeEach(); +}); + +afterAll(async () => { + await adapter.afterAll(); + await detox.cleanup(); +}); diff --git a/types/detox/test/detox-mocha-setup-tests.ts b/types/detox/test/detox-mocha-setup-tests.ts new file mode 100644 index 0000000000..c415eed696 --- /dev/null +++ b/types/detox/test/detox-mocha-setup-tests.ts @@ -0,0 +1,32 @@ +// tslint:disable:only-arrow-functions + +declare var before: (callback: () => void) => void; +declare var beforeEach: (callback: () => void) => void; +declare var after: (callback: () => void) => void; +declare var afterEach: (callback: () => void) => void; + +import adapter from "detox/runners/mocha/adapter"; + +// Normally the Detox configuration from the project's package.json like so: +// const config = require("./package.json").detox; +declare const config: any; + +// Normally, the beforeEach and afterEach function should take `this` as its argument, +// but `this` cannot be used since it doesn't have a type signature (and therefore always implicltly any) +declare const context: any; + +before(async function() { + await detox.init(config); +}); + +beforeEach(async function() { + await adapter.beforeEach(context); +}); + +afterEach(async function() { + await adapter.afterEach(context); +}); + +after(async function() { + await detox.cleanup(); +}); diff --git a/types/detox/test/detox-module-tests.ts b/types/detox/test/detox-module-tests.ts new file mode 100644 index 0000000000..318569c03d --- /dev/null +++ b/types/detox/test/detox-module-tests.ts @@ -0,0 +1,42 @@ +declare var describe: (test: string, callback: () => void) => void; +declare var beforeAll: (callback: () => void) => void; +declare var afterAll: (callback: () => void) => void; +declare var test: (test: string, callback: () => void) => void; + +import { by, device, element, expect, waitFor } from "detox"; + +describe("Test", () => { + beforeAll(async () => { + await device.reloadReactNative(); + }); + + afterAll(async () => { + await element(by.id("element")).clearText(); + }); + + test("Test", async () => { + await element(by.id("element")).replaceText("text"); + await element(by.id("element")).tap(); + await element(by.id("element")).scroll(50, "down"); + await element(by.id("scrollView")).scrollTo("bottom"); + await expect(element(by.id("element")).atIndex(0)).toNotExist(); + await element(by.id("scrollView")).swipe("down", "fast"); + await element(by.type("UIPickerView")).setColumnToValue(1, "6"); + + await expect( + element(by.id("element").withAncestor(by.id("parent_element"))) + ).toNotExist(); + await expect( + element(by.id("element").withDescendant(by.id("child_element"))) + ).toNotExist(); + + await waitFor(element(by.id("element"))) + .toBeVisible() + .withTimeout(2000); + await device.pressBack(); + await waitFor(element(by.text("Text5"))) + .toBeVisible() + .whileElement(by.id("ScrollView630")) + .scroll(50, "down"); + }); +}); diff --git a/types/detox/tsconfig.json b/types/detox/tsconfig.json index 2d1a22fb79..cd85bd9849 100644 --- a/types/detox/tsconfig.json +++ b/types/detox/tsconfig.json @@ -1,24 +1,25 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6" - ], + "lib": ["es6"], "target": "ES2015", "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "detox-tests.ts" + "runners/jest/adapter/index.d.ts", + "runners/mocha/adapter/index.d.ts", + "test/detox-global-tests.ts", + "test/detox-module-tests.ts", + "test/detox-jest-setup-tests.ts", + "test/detox-mocha-setup-tests.ts" ] } diff --git a/types/dialogflow/index.d.ts b/types/dialogflow/index.d.ts index 8329021bb8..98cfc8b53f 100644 --- a/types/dialogflow/index.d.ts +++ b/types/dialogflow/index.d.ts @@ -785,10 +785,10 @@ export interface Agent { classificationThreshold?: number; } -export interface Context { - name: string; +export interface Context { + name: N; lifespanCount?: number; - parameters?: any; + parameters?: T; } export interface EntityType { diff --git a/types/diff/diff-tests.ts b/types/diff/diff-tests.ts index 2f640da490..845b307132 100644 --- a/types/diff/diff-tests.ts +++ b/types/diff/diff-tests.ts @@ -1,47 +1,55 @@ -import jsdiff = require('diff'); +import * as diff from 'diff'; + const one = 'beep boop'; const other = 'beep boob blah'; -let diff = jsdiff.diffChars(one, other); -printDiff(diff); +let changes = diff.diffChars(one, other); +examineChanges(changes); -const diffArraysResult = jsdiff.diffArrays(['a', 'b', 'c'], ['a', 'c', 'd']); +// $ExpectType void +diff.diffChars(one, other, { + callback: (err, value) => { + err; // $ExpectType undefined + value; // $ExpectType Change[] | undefined + }, +}); +// $ExpectType void +diff.diffChars(one, other, (err, value) => { + err; // $ExpectType undefined + value; // $ExpectType Change[] | undefined +}); + +const diffArraysResult = diff.diffArrays(['a', 'b', 'c'], ['a', 'c', 'd']); diffArraysResult.forEach(result => { - if (result.added) { - console.log(`added ${result.value.length} line(s):`, ...result.value); - } else if (result.removed) { - console.log(`removed ${result.value.length} line(s):`, ...result.value); - } else { - console.log(`no changes`); - } + result.added; // $ExpectType boolean | undefined + result.removed; // $ExpectType boolean | undefined + result.value; // $ExpectType string[] + result.count; // $ExpectType number | undefined }); interface DiffObj { value: number; } -const a: DiffObj = {value: 0}; -const b: DiffObj = {value: 1}; -const c: DiffObj = {value: 2}; -const d: DiffObj = {value: 3}; -const arrayOptions: jsdiff.IArrayOptions = { - comparator: (left: DiffObj, right: DiffObj) => { - return left.value === right.value; - } +const a: DiffObj = { value: 0 }; +const b: DiffObj = { value: 1 }; +const c: DiffObj = { value: 2 }; +const d: DiffObj = { value: 3 }; +const arrayOptions: diff.ArrayOptions = { + comparator: (left, right) => { + return left.value === right.value; + }, }; -const diffResult = jsdiff.diffArrays([a, b, c], [a, b, d], arrayOptions); -diffResult.forEach(result => { - if (result.added) { - console.log(`added ${result.value.length} line(s):`, ...result.value); - } else if (result.removed) { - console.log(`removed ${result.value.length} line(s):`, ...result.value); - } else { - console.log(`no changes`); - } +const arrayChanges = diff.diffArrays([a, b, c], [a, b, d], arrayOptions); +arrayChanges.forEach(result => { + result.added; // $ExpectType boolean | undefined + result.removed; // $ExpectType boolean | undefined + result.value; // $ExpectType DiffObj[] + result.count; // $ExpectType number | undefined }); // -------------------------- -class LineDiffWithoutWhitespace extends jsdiff.Diff { +class LineDiffWithoutWhitespace extends diff.Diff { tokenize(value: string): any { return value.split(/^/m); } @@ -52,71 +60,62 @@ class LineDiffWithoutWhitespace extends jsdiff.Diff { } const obj = new LineDiffWithoutWhitespace(); -diff = obj.diff(one, other); -printDiff(diff); +changes = obj.diff(one, other); +examineChanges(changes); -function printDiff(diff: jsdiff.IDiffResult[]) { - function addLineHeader(decorator: string, str: string | string[]) { - return (typeof str === 'string' ? str.split("\n") : str).map((line, index, array) => { - if (index === array.length - 1 && line === "") { - return line; - } else { - return decorator + line; - } - }).join("\n"); - } - - diff.forEach((part) => { - if (part.added) { - console.log(addLineHeader("+", part.value)); - } else if (part.removed) { - console.log(addLineHeader("-", part.value)); - } else { - console.log(addLineHeader(" ", part.value)); - } +function examineChanges(diff: diff.Change[]) { + diff.forEach(part => { + part.added; // $ExpectType boolean | undefined + part.removed; // $ExpectType boolean | undefined + part.value; // $ExpectType string + part.count; // $ExpectType number | undefined }); } -function verifyPatchMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUniDiff) { - const verifyPatch = jsdiff.parsePatch( - jsdiff.createTwoFilesPatch("oldFile.ts", "newFile.ts", oldStr, newStr, - "old", "new", { context: 1 })); +function verifyPatchMethods(oldStr: string, newStr: string, uniDiff: diff.ParsedDiff) { + const verifyPatch = diff.parsePatch( + diff.createTwoFilesPatch('oldFile.ts', 'newFile.ts', oldStr, newStr, 'old', 'new', { + context: 1, + }) + ); - if (JSON.stringify(verifyPatch[0], Object.keys(verifyPatch[0]).sort()) !== JSON.stringify(uniDiff, Object.keys(uniDiff).sort())) { - console.error("Patch did not match uniDiff"); + if ( + JSON.stringify(verifyPatch[0], Object.keys(verifyPatch[0]).sort()) !== + JSON.stringify(uniDiff, Object.keys(uniDiff).sort()) + ) { + throw new Error('Patch did not match uniDiff'); } } -function verifyApplyMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUniDiff) { - const verifyApply = [ - jsdiff.applyPatch(oldStr, uniDiff), - jsdiff.applyPatch(oldStr, [uniDiff]) - ]; - jsdiff.applyPatches([uniDiff], { - loadFile: (index: number, callback: (err: Error, data: string) => void) => { +function verifyApplyMethods(oldStr: string, newStr: string, uniDiff: diff.ParsedDiff) { + const verifyApply = [diff.applyPatch(oldStr, uniDiff), diff.applyPatch(oldStr, [uniDiff])]; + diff.applyPatches([uniDiff], { + loadFile: (index, callback) => { + index; // $ExpectType ParsedDiff callback(undefined, one); }, - patched: (index: number, content: string) => { + patched: (index, content) => { + index; // $ExpectType ParsedDiff verifyApply.push(content); }, complete: (err?: Error) => { if (err) { - console.error(err); + throw err; } verifyApply.forEach(result => { if (result !== newStr) { - console.error("Result did not match newStr"); + throw new Error('Result did not match newStr'); } }); - } + }, }); } -const uniDiffPatch = jsdiff.structuredPatch("oldFile.ts", "newFile.ts", one, other, - "old", "new", { context: 1 }); +const uniDiffPatch = diff.structuredPatch('oldFile.ts', 'newFile.ts', one, other, 'old', 'new', { + context: 1, +}); verifyPatchMethods(one, other, uniDiffPatch); -const uniDiffStr = jsdiff.createPatch("file.ts", one, other, "old", "new", - { context: 1 }); -const uniDiffApply = jsdiff.parsePatch(uniDiffStr)[0]; +const uniDiffStr = diff.createPatch('file.ts', one, other, 'old', 'new', { context: 1 }); +const uniDiffApply = diff.parsePatch(uniDiffStr)[0]; verifyApplyMethods(one, other, uniDiffApply); diff --git a/types/diff/index.d.ts b/types/diff/index.d.ts index 760aee4e61..fa0e4e2e3d 100644 --- a/types/diff/index.d.ts +++ b/types/diff/index.d.ts @@ -1,121 +1,402 @@ -// Type definitions for diff 3.5 +// Type definitions for diff 4.0 // Project: https://github.com/kpdecker/jsdiff // Definitions by: vvakame // szdc // moc-yuto +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -export = JsDiff; -export as namespace JsDiff; +export as namespace Diff; -declare namespace JsDiff { - interface IOptions { - ignoreCase: boolean; - } +export type Callback = (err: undefined, value?: Change[]) => void; - interface ILinesOptions extends IOptions { - ignoreWhitespace?: boolean; - newlineIsToken?: boolean; - } - - interface IArrayOptions { - comparator?: (left: any, right: any) => boolean; - } - - interface IDiffResult { - value: string; - count?: number; - added?: boolean; - removed?: boolean; - } - - interface IDiffArraysResult { - value: T[]; - count?: number; - added?: boolean; - removed?: boolean; - } - - interface IBestPath { - newPos: number; - componenets: IDiffResult[]; - } - - interface IHunk { - oldStart: number; - oldLines: number; - newStart: number; - newLines: number; - lines: string[]; - } - - interface IUniDiff { - oldFileName: string; - newFileName: string; - oldHeader: string; - newHeader: string; - index: string; - hunks: IHunk[]; - } - - class Diff { - diff(oldString: string, newString: string, options?: IOptions): IDiffResult[]; - - pushComponent(components: IDiffResult[], added: boolean, removed: boolean): void; - - extractCommon(basePath: IBestPath, newString: string, oldString: string, diagonalPath: number): number; - - equals(left: string, right: string): boolean; - - removeEmpty(array: any[]): any[]; - - castInput(value: any): any; - - join(chars: string[]): string; - - tokenize(value: string): any; // return types are string or string[] - } - - function diffChars(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; - - function diffWords(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; - - function diffWordsWithSpace(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; - - function diffJson(oldObj: object, newObj: object, options?: IOptions): IDiffResult[]; - - function diffLines(oldStr: string, newStr: string, options?: ILinesOptions): IDiffResult[]; - - function diffCss(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; - - function diffTrimmedLines(oldStr: string, newStr: string, options?: ILinesOptions): IDiffResult[]; - - function diffSentences(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; - - function diffArrays(oldArr: T[], newArr: T[], options?: IArrayOptions): Array>; - - function createPatch(fileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string; - - function createTwoFilesPatch(oldFileName: string, newFileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string; - - function structuredPatch(oldFileName: string, newFileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): IUniDiff; - - function applyPatch(oldStr: string, uniDiff: string | IUniDiff | IUniDiff[]): string; - - function applyPatches(uniDiff: IUniDiff[], options: { - loadFile(index: number, callback: (err: Error, data: string) => void): void, - patched(index: number, content: string): void, - complete(err?: Error): void - }): void; - - function parsePatch(diffStr: string, options?: {strict: boolean}): IUniDiff[]; - - function convertChangesToXML(changes: IDiffResult[]): string; - - function convertChangesToDMP(changes: IDiffResult[]): Array<{0: number; 1: string; }>; - - function merge(mine: string, theirs: string, base: string): IUniDiff; - - function canonicalize(obj: any, stack: any[], replacementStack: any[]): any; +export interface CallbackOptions { + /** + * Callback to call with the result instead of returning the result directly. + */ + callback: Callback; } + +export interface BaseOptions { + /** + * `true` to ignore casing difference. + * @default false + */ + ignoreCase?: boolean; +} + +export interface WordsOptions extends BaseOptions { + /** + * `true` to ignore leading and trailing whitespace. This is the same as `diffWords()`. + */ + ignoreWhitespace?: boolean; +} + +export interface LinesOptions extends BaseOptions { + /** + * `true` to ignore leading and trailing whitespace. This is the same as `diffTrimmedLines()`. + */ + ignoreWhitespace?: boolean; + + /** + * `true` to treat newline characters as separate tokens. This allows for changes to the newline structure + * to occur independently of the line content and to be treated as such. In general this is the more + * human friendly form of `diffLines()` and `diffLines()` is better suited for patches and other computer + * friendly output. + */ + newlineIsToken?: boolean; +} + +export interface JsonOptions extends LinesOptions { + /** + * Replacer used to stringify the properties of the passed objects. + */ + stringifyReplacer?: (key: string, value: any) => any; + + /** + * The value to use when `undefined` values in the passed objects are encountered during stringification. + * Will only be used if `stringifyReplacer` option wasn't specified. + * @default undefined + */ + undefinedReplacement?: any; +} + +export interface ArrayOptions extends BaseOptions { + /** + * Comparator for custom equality checks. + */ + comparator?: (left: TLeft, right: TRight) => boolean; +} + +export interface PatchOptions extends LinesOptions { + /** + * Describes how many lines of context should be included. + * @default 4 + */ + context?: number; +} + +export interface ApplyPatchOptions { + /** + * Number of lines that are allowed to differ before rejecting a patch. + * @default 0 + */ + fuzzFactor?: number; + + /** + * Callback used to compare to given lines to determine if they should be considered equal when patching. + * Should return `false` if the lines should be rejected. + * + * @default strict equality + */ + compareLine?: ( + lineNumber: number, + line: string, + operation: '-' | ' ', + patchContent: string + ) => boolean; +} + +export interface ApplyPatchesOptions { + loadFile(index: ParsedDiff, callback: (err: any, data: string) => void): void; + patched(index: ParsedDiff, content: string, callback: (err: any) => void): void; + complete(err: any): void; +} + +export interface Change { + count?: number; + /** + * Text content. + */ + value: string; + /** + * `true` if the value was inserted into the new string. + */ + added?: boolean; + /** + * `true` if the value was removed from the old string. + */ + removed?: boolean; +} + +export interface ArrayChange { + value: T[]; + count?: number; + added?: boolean; + removed?: boolean; +} + +export interface ParsedDiff { + index?: string; + oldFileName?: string; + newFileName?: string; + oldHeader?: string; + newHeader?: string; + hunks: Hunk[]; +} + +export interface Hunk { + oldStart: number; + oldLines: number; + newStart: number; + newLines: number; + lines: string[]; +} + +export interface BestPath { + newPos: number; + componenets: Change[]; +} + +export class Diff { + diff( + oldString: string, + newString: string, + options?: Callback | (ArrayOptions & Partial) + ): Change[]; + + pushComponent(components: Change[], added: boolean, removed: boolean): void; + + extractCommon( + basePath: BestPath, + newString: string, + oldString: string, + diagonalPath: number + ): number; + + equals(left: any, right: any): boolean; + + removeEmpty(array: any[]): any[]; + + castInput(value: any): any; + + join(chars: string[]): string; + + tokenize(value: string): any; // return types are string or string[] +} + +/** + * Diffs two blocks of text, comparing character by character. + * + * @returns A list of change objects. + */ +export function diffChars(oldStr: string, newStr: string, options?: BaseOptions): Change[]; +export function diffChars( + oldStr: string, + newStr: string, + options: Callback | (BaseOptions & CallbackOptions) +): void; + +/** + * Diffs two blocks of text, comparing word by word, ignoring whitespace. + * + * @returns A list of change objects. + */ +export function diffWords(oldStr: string, newStr: string, options?: WordsOptions): Change[]; +export function diffWords( + oldStr: string, + newStr: string, + options: Callback | (WordsOptions & CallbackOptions) +): void; + +/** + * Diffs two blocks of text, comparing word by word, treating whitespace as significant. + * + * @returns A list of change objects. + */ +export function diffWordsWithSpace( + oldStr: string, + newStr: string, + options?: WordsOptions +): Change[]; +export function diffWordsWithSpace( + oldStr: string, + newStr: string, + options: Callback | (WordsOptions & CallbackOptions) +): void; + +/** + * Diffs two blocks of text, comparing line by line. + * + * @returns A list of change objects. + */ +export function diffLines(oldStr: string, newStr: string, options?: LinesOptions): Change[]; +export function diffLines( + oldStr: string, + newStr: string, + options: Callback | (LinesOptions & CallbackOptions) +): void; + +/** + * Diffs two blocks of text, comparing line by line, ignoring leading and trailing whitespace. + * + * @returns A list of change objects. + */ +export function diffTrimmedLines(oldStr: string, newStr: string, options?: LinesOptions): Change[]; +export function diffTrimmedLines( + oldStr: string, + newStr: string, + options: Callback | (LinesOptions & CallbackOptions) +): void; + +/** + * Diffs two blocks of text, comparing sentence by sentence. + * + * @returns A list of change objects. + */ +export function diffSentences(oldStr: string, newStr: string, options?: BaseOptions): Change[]; +export function diffSentences( + oldStr: string, + newStr: string, + options: Callback | (BaseOptions & CallbackOptions) +): void; + +/** + * Diffs two blocks of text, comparing CSS tokens. + * + * @returns A list of change objects. + */ +export function diffCss(oldStr: string, newStr: string, options?: BaseOptions): Change[]; +export function diffCss( + oldStr: string, + newStr: string, + options: Callback | (BaseOptions & CallbackOptions) +): void; + +/** + * Diffs two JSON objects, comparing the fields defined on each. The order of fields, etc does not matter + * in this comparison. + * + * @returns A list of change objects. + */ +export function diffJson( + oldObj: string | object, + newObj: string | object, + options?: JsonOptions +): Change[]; +export function diffJson( + oldObj: string | object, + newObj: string | object, + options: Callback | (JsonOptions & CallbackOptions) +): void; + +/** + * Diffs two arrays, comparing each item for strict equality (`===`). + * + * @returns A list of change objects. + */ +export function diffArrays( + oldArr: TOld[], + newArr: TNew[], + options?: ArrayOptions +): Array>; + +/** + * Creates a unified diff patch. + * + * @param oldFileName String to be output in the filename section of the patch for the removals. + * @param newFileName String to be output in the filename section of the patch for the additions. + * @param oldStr Original string value. + * @param newStr New string value. + * @param oldHeader Additional information to include in the old file header. + * @param newHeader Additional information to include in the new file header. + */ +export function createTwoFilesPatch( + oldFileName: string, + newFileName: string, + oldStr: string, + newStr: string, + oldHeader?: string, + newHeader?: string, + options?: PatchOptions +): string; + +/** + * Creates a unified diff patch. + * Just like `createTwoFilesPatch()`, but with `oldFileName` being equal to `newFileName`. + * + * @param fileName String to be output in the filename section. + * @param oldStr Original string value. + * @param newStr New string value. + * @param oldHeader Additional information to include in the old file header. + * @param newHeader Additional information to include in the new file header. + */ +export function createPatch( + fileName: string, + oldStr: string, + newStr: string, + oldHeader?: string, + newHeader?: string, + options?: PatchOptions +): string; + +/** + * This method is similar to `createTwoFilesPatch()`, but returns a data structure suitable for further processing. + * Parameters are the same as `createTwoFilesPatch()`. + * + * @param oldFileName String to be output in the `oldFileName` hunk property. + * @param newFileName String to be output in the `newFileName` hunk property. + * @param oldStr Original string value. + * @param newStr New string value. + * @param oldHeader Additional information to include in the `oldHeader` hunk property. + * @param newHeader Additional information to include in the `newHeader` hunk property. + * @returns An object with an array of hunk objects. + */ +export function structuredPatch( + oldFileName: string, + newFileName: string, + oldStr: string, + newStr: string, + oldHeader?: string, + newHeader?: string, + options?: PatchOptions +): ParsedDiff; + +/** + * Applies a unified diff patch. + * + * @param patch May be a string diff or the output from the `parsePatch()` or `structuredPatch()` methods. + * @returns A string containing new version of provided data. + */ +export function applyPatch( + source: string, + patch: string | ParsedDiff | [ParsedDiff], + options?: ApplyPatchOptions +): string; + +/** + * Applies one or more patches. + * This method will iterate over the contents of the patch and apply to data provided through callbacks. + * + * The general flow for each patch index is: + * + * 1. `options.loadFile(index, callback)` is called. The caller should then load the contents of the file + * and then pass that to the `callback(err, data)` callback. Passing an `err` will terminate further patch execution. + * 2. `options.patched(index, content, callback)` is called once the patch has been applied. `content` will be + * the return value from `applyPatch()`. When it's ready, the caller should call `callback(err)` callback. + * Passing an `err` will terminate further patch execution. + * 3. Once all patches have been applied or an error occurs, the `options.complete(err)` callback is made. + */ +export function applyPatches(patch: string | ParsedDiff[], options: ApplyPatchesOptions): void; + +/** + * Parses a patch into structured data. + * + * @returns A JSON object representation of the a patch, suitable for use with the `applyPatch()` method. + */ +export function parsePatch(diffStr: string, options?: { strict?: boolean }): ParsedDiff[]; + +/** + * Converts a list of changes to a serialized XML format. + */ +export function convertChangesToXML(changes: Change[]): string; + +/** + * Converts a list of changes to [DMP](http://code.google.com/p/google-diff-match-patch/wiki/API) format. + */ +export function convertChangesToDMP(changes: Change[]): Array<[1 | 0 | -1, string]>; + +export function merge(mine: string, theirs: string, base: string): ParsedDiff; + +export function canonicalize(obj: any, stack: any[], replacementStack: any[]): any; diff --git a/types/diff/tsconfig.json b/types/diff/tsconfig.json index 9a1fdba840..b32089d091 100644 --- a/types/diff/tsconfig.json +++ b/types/diff/tsconfig.json @@ -2,12 +2,11 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -21,4 +20,4 @@ "index.d.ts", "diff-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/diff/tslint.json b/types/diff/tslint.json index 1b7b2672e6..3db14f85ea 100644 --- a/types/diff/tslint.json +++ b/types/diff/tslint.json @@ -1,7 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "interface-name": false, - "export-just-namespace": false - } -} +{ "extends": "dtslint/dt.json" } diff --git a/types/diff/v3/diff-tests.ts b/types/diff/v3/diff-tests.ts new file mode 100644 index 0000000000..2f640da490 --- /dev/null +++ b/types/diff/v3/diff-tests.ts @@ -0,0 +1,122 @@ +import jsdiff = require('diff'); +const one = 'beep boop'; +const other = 'beep boob blah'; + +let diff = jsdiff.diffChars(one, other); +printDiff(diff); + +const diffArraysResult = jsdiff.diffArrays(['a', 'b', 'c'], ['a', 'c', 'd']); +diffArraysResult.forEach(result => { + if (result.added) { + console.log(`added ${result.value.length} line(s):`, ...result.value); + } else if (result.removed) { + console.log(`removed ${result.value.length} line(s):`, ...result.value); + } else { + console.log(`no changes`); + } +}); + +interface DiffObj { + value: number; +} +const a: DiffObj = {value: 0}; +const b: DiffObj = {value: 1}; +const c: DiffObj = {value: 2}; +const d: DiffObj = {value: 3}; +const arrayOptions: jsdiff.IArrayOptions = { + comparator: (left: DiffObj, right: DiffObj) => { + return left.value === right.value; + } +}; +const diffResult = jsdiff.diffArrays([a, b, c], [a, b, d], arrayOptions); +diffResult.forEach(result => { + if (result.added) { + console.log(`added ${result.value.length} line(s):`, ...result.value); + } else if (result.removed) { + console.log(`removed ${result.value.length} line(s):`, ...result.value); + } else { + console.log(`no changes`); + } +}); + +// -------------------------- + +class LineDiffWithoutWhitespace extends jsdiff.Diff { + tokenize(value: string): any { + return value.split(/^/m); + } + + equals(left: string, right: string): boolean { + return left.trim() === right.trim(); + } +} + +const obj = new LineDiffWithoutWhitespace(); +diff = obj.diff(one, other); +printDiff(diff); + +function printDiff(diff: jsdiff.IDiffResult[]) { + function addLineHeader(decorator: string, str: string | string[]) { + return (typeof str === 'string' ? str.split("\n") : str).map((line, index, array) => { + if (index === array.length - 1 && line === "") { + return line; + } else { + return decorator + line; + } + }).join("\n"); + } + + diff.forEach((part) => { + if (part.added) { + console.log(addLineHeader("+", part.value)); + } else if (part.removed) { + console.log(addLineHeader("-", part.value)); + } else { + console.log(addLineHeader(" ", part.value)); + } + }); +} + +function verifyPatchMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUniDiff) { + const verifyPatch = jsdiff.parsePatch( + jsdiff.createTwoFilesPatch("oldFile.ts", "newFile.ts", oldStr, newStr, + "old", "new", { context: 1 })); + + if (JSON.stringify(verifyPatch[0], Object.keys(verifyPatch[0]).sort()) !== JSON.stringify(uniDiff, Object.keys(uniDiff).sort())) { + console.error("Patch did not match uniDiff"); + } +} +function verifyApplyMethods(oldStr: string, newStr: string, uniDiff: jsdiff.IUniDiff) { + const verifyApply = [ + jsdiff.applyPatch(oldStr, uniDiff), + jsdiff.applyPatch(oldStr, [uniDiff]) + ]; + jsdiff.applyPatches([uniDiff], { + loadFile: (index: number, callback: (err: Error, data: string) => void) => { + callback(undefined, one); + }, + patched: (index: number, content: string) => { + verifyApply.push(content); + }, + complete: (err?: Error) => { + if (err) { + console.error(err); + } + + verifyApply.forEach(result => { + if (result !== newStr) { + console.error("Result did not match newStr"); + } + }); + } + }); +} + +const uniDiffPatch = jsdiff.structuredPatch("oldFile.ts", "newFile.ts", one, other, + "old", "new", { context: 1 }); +verifyPatchMethods(one, other, uniDiffPatch); + +const uniDiffStr = jsdiff.createPatch("file.ts", one, other, "old", "new", + { context: 1 }); +const uniDiffApply = jsdiff.parsePatch(uniDiffStr)[0]; +verifyApplyMethods(one, other, uniDiffApply); diff --git a/types/diff/v3/index.d.ts b/types/diff/v3/index.d.ts new file mode 100644 index 0000000000..760aee4e61 --- /dev/null +++ b/types/diff/v3/index.d.ts @@ -0,0 +1,121 @@ +// Type definitions for diff 3.5 +// Project: https://github.com/kpdecker/jsdiff +// Definitions by: vvakame +// szdc +// moc-yuto +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export = JsDiff; +export as namespace JsDiff; + +declare namespace JsDiff { + interface IOptions { + ignoreCase: boolean; + } + + interface ILinesOptions extends IOptions { + ignoreWhitespace?: boolean; + newlineIsToken?: boolean; + } + + interface IArrayOptions { + comparator?: (left: any, right: any) => boolean; + } + + interface IDiffResult { + value: string; + count?: number; + added?: boolean; + removed?: boolean; + } + + interface IDiffArraysResult { + value: T[]; + count?: number; + added?: boolean; + removed?: boolean; + } + + interface IBestPath { + newPos: number; + componenets: IDiffResult[]; + } + + interface IHunk { + oldStart: number; + oldLines: number; + newStart: number; + newLines: number; + lines: string[]; + } + + interface IUniDiff { + oldFileName: string; + newFileName: string; + oldHeader: string; + newHeader: string; + index: string; + hunks: IHunk[]; + } + + class Diff { + diff(oldString: string, newString: string, options?: IOptions): IDiffResult[]; + + pushComponent(components: IDiffResult[], added: boolean, removed: boolean): void; + + extractCommon(basePath: IBestPath, newString: string, oldString: string, diagonalPath: number): number; + + equals(left: string, right: string): boolean; + + removeEmpty(array: any[]): any[]; + + castInput(value: any): any; + + join(chars: string[]): string; + + tokenize(value: string): any; // return types are string or string[] + } + + function diffChars(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; + + function diffWords(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; + + function diffWordsWithSpace(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; + + function diffJson(oldObj: object, newObj: object, options?: IOptions): IDiffResult[]; + + function diffLines(oldStr: string, newStr: string, options?: ILinesOptions): IDiffResult[]; + + function diffCss(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; + + function diffTrimmedLines(oldStr: string, newStr: string, options?: ILinesOptions): IDiffResult[]; + + function diffSentences(oldStr: string, newStr: string, options?: IOptions): IDiffResult[]; + + function diffArrays(oldArr: T[], newArr: T[], options?: IArrayOptions): Array>; + + function createPatch(fileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string; + + function createTwoFilesPatch(oldFileName: string, newFileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): string; + + function structuredPatch(oldFileName: string, newFileName: string, oldStr: string, newStr: string, oldHeader: string, newHeader: string, options?: {context: number}): IUniDiff; + + function applyPatch(oldStr: string, uniDiff: string | IUniDiff | IUniDiff[]): string; + + function applyPatches(uniDiff: IUniDiff[], options: { + loadFile(index: number, callback: (err: Error, data: string) => void): void, + patched(index: number, content: string): void, + complete(err?: Error): void + }): void; + + function parsePatch(diffStr: string, options?: {strict: boolean}): IUniDiff[]; + + function convertChangesToXML(changes: IDiffResult[]): string; + + function convertChangesToDMP(changes: IDiffResult[]): Array<{0: number; 1: string; }>; + + function merge(mine: string, theirs: string, base: string): IUniDiff; + + function canonicalize(obj: any, stack: any[], replacementStack: any[]): any; +} diff --git a/types/diff/v3/tsconfig.json b/types/diff/v3/tsconfig.json new file mode 100644 index 0000000000..92e1861ec8 --- /dev/null +++ b/types/diff/v3/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "diff": [ + "diff/v3" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "diff-tests.ts" + ] +} diff --git a/types/diff/v3/tslint.json b/types/diff/v3/tslint.json new file mode 100644 index 0000000000..1b7b2672e6 --- /dev/null +++ b/types/diff/v3/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": false, + "export-just-namespace": false + } +} diff --git a/types/dir-glob/dir-glob-tests.ts b/types/dir-glob/dir-glob-tests.ts new file mode 100644 index 0000000000..e8aaf721dc --- /dev/null +++ b/types/dir-glob/dir-glob-tests.ts @@ -0,0 +1,23 @@ +import dirGlob = require('dir-glob'); + +dirGlob('index.js').then(files => { + // ExpectType string[] + files; +}); +dirGlob(['index.js', 'test.js', 'fixtures']).then(files => { + // ExpectType string[] + files; +}); + +dirGlob(['index.js', 'inner_folder'], { cwd: 'fixtures' }); +dirGlob(['lib/**', 'fixtures'], { files: ['test', 'unicorn'] }); +dirGlob(['lib/**', 'fixtures'], { extensions: ['js'] }); + +// ExpectType string[] +dirGlob.sync('index.js'); +// ExpectType string[] +dirGlob.sync(['index.js', 'test.js', 'fixtures']); + +dirGlob.sync(['index.js', 'inner_folder'], { cwd: 'fixtures' }); +dirGlob.sync(['lib/**', 'fixtures'], { files: ['test', 'unicorn'] }); +dirGlob.sync(['lib/**', 'fixtures'], { extensions: ['js'] }); diff --git a/types/dir-glob/index.d.ts b/types/dir-glob/index.d.ts new file mode 100644 index 0000000000..c1e78ae111 --- /dev/null +++ b/types/dir-glob/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for dir-glob 2.0 +// Project: https://github.com/kevva/dir-glob#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = dirGlob; + +declare function dirGlob(input: string | string[], options?: dirGlob.Options): Promise; + +declare namespace dirGlob { + function sync(input: string | string[], options?: Options): string[]; + + interface Options { + extensions?: string[]; + files?: string[]; + cwd?: string; + } +} diff --git a/types/dir-glob/tsconfig.json b/types/dir-glob/tsconfig.json new file mode 100644 index 0000000000..2cf8fd31d8 --- /dev/null +++ b/types/dir-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", + "dir-glob-tests.ts" + ] +} diff --git a/types/dir-glob/tslint.json b/types/dir-glob/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dir-glob/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/dirname-regex/dirname-regex-tests.ts b/types/dirname-regex/dirname-regex-tests.ts new file mode 100644 index 0000000000..ab13046858 --- /dev/null +++ b/types/dirname-regex/dirname-regex-tests.ts @@ -0,0 +1,3 @@ +import dirnameRe = require('dirname-regex'); + +dirnameRe(); // $ExpectType RegExp diff --git a/types/dirname-regex/index.d.ts b/types/dirname-regex/index.d.ts new file mode 100644 index 0000000000..affb73abc3 --- /dev/null +++ b/types/dirname-regex/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for dirname-regex 1.0 +// Project: https://github.com/regexps/dirname-regex +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = dirnameRegex; + +declare function dirnameRegex(): RegExp; diff --git a/types/dirname-regex/tsconfig.json b/types/dirname-regex/tsconfig.json new file mode 100644 index 0000000000..282d660b6f --- /dev/null +++ b/types/dirname-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", + "dirname-regex-tests.ts" + ] +} diff --git a/types/dirname-regex/tslint.json b/types/dirname-regex/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dirname-regex/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/distributions/distributions-tests.ts b/types/distributions/distributions-tests.ts new file mode 100644 index 0000000000..04cb1b65bb --- /dev/null +++ b/types/distributions/distributions-tests.ts @@ -0,0 +1,17 @@ +import * as distributions from 'distributions'; + +const normal = distributions.Normal(); +normal.cdf(0); +normal.pdf(0); +normal.inv(0); +normal.mean(); +normal.median(); +normal.variance(); + +const uniform = distributions.Uniform(); +uniform.cdf(0); +uniform.pdf(0); +uniform.inv(0); +uniform.mean(); +uniform.median(); +uniform.variance(); diff --git a/types/distributions/index.d.ts b/types/distributions/index.d.ts new file mode 100644 index 0000000000..cdfbc93c6b --- /dev/null +++ b/types/distributions/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for distributions 2.0 +// Project: https://github.com/AndreasMadsen/distributions +// Definitions by: Marco Lanaro +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function Normal(mean?: number, sd?: number): Distribution; +export function Studentt(df: number): Distribution; +export function Uniform(a?: number, b?: number): Distribution; +export function Binomial(properbility: number, size: number): Distribution; + +export interface Distribution { + pdf: (x: number) => number; + cdf: (x: number) => number; + inv: (p: number) => number; + mean: () => number; + median: () => number; + variance: () => number; +} diff --git a/types/distributions/tsconfig.json b/types/distributions/tsconfig.json new file mode 100644 index 0000000000..995b1007ef --- /dev/null +++ b/types/distributions/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "distributions-tests.ts" + ] +} diff --git a/types/distributions/tslint.json b/types/distributions/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/distributions/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/dlv/dlv-tests.ts b/types/dlv/dlv-tests.ts new file mode 100644 index 0000000000..abe4b259c3 --- /dev/null +++ b/types/dlv/dlv-tests.ts @@ -0,0 +1,44 @@ +import dlv from 'dlv'; + +const obj = { + undef: undefined, + zero: 0, + one: 1, + n: null, + f: false, + a: { + two: 2, + b: { + three: 3, + c: { + four: 4 + } + } + } +}; + +// Test without defaults +dlv(obj, ''); +dlv(obj, 'one'); +dlv(obj, 'one.two'); +dlv(obj, 'a'); +dlv(obj, 'a.two'); +dlv(obj, 'a.b'); +dlv(obj, 'a.b.three'); +dlv(obj, 'a.b.c'); +dlv(obj, 'a.b.c.four'); +dlv(obj, 'n'); +dlv(obj, 'n.badkey'); +dlv(obj, 'f'); +dlv(obj, 'f.badkey'); + +// Test defaults +dlv(obj, '', 'foo'); +dlv(obj, 'undef', 'foo'); +dlv(obj, 'n', null); +dlv(obj, 'n.badkey', 'foo'); +dlv(obj, 'zero', 0); +dlv(obj, 'a.badkey', 'foo'); +dlv(obj, 'a.badkey.anotherbadkey', 'foo'); +dlv(obj, 'f', false); +dlv(obj, 'f.badkey', 'foo'); diff --git a/types/dlv/index.d.ts b/types/dlv/index.d.ts new file mode 100644 index 0000000000..5813ec0595 --- /dev/null +++ b/types/dlv/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for dlv 1.1 +// Project: https://github.com/developit/dlv#readme +// Definitions by: Ryan Sonshine +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/** + * Safely get a dot-notated path within a nested object, with ability to + * return a default if the full key path does not exist or the value is + * undefined + */ +export default function dlv(object: object, key: string | string[], defaultValue?: any): any; diff --git a/types/dlv/tsconfig.json b/types/dlv/tsconfig.json new file mode 100644 index 0000000000..222ce070e7 --- /dev/null +++ b/types/dlv/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", + "dlv-tests.ts" + ] +} diff --git a/types/dlv/tslint.json b/types/dlv/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dlv/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/dockerode/index.d.ts b/types/dockerode/index.d.ts index bab3ee6f2b..0581057dea 100644 --- a/types/dockerode/index.d.ts +++ b/types/dockerode/index.d.ts @@ -7,6 +7,7 @@ // Marius Meisenzahl // Rob Moran // Cameron Diver +// Pascal Sthamer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -15,8 +16,16 @@ import * as stream from 'stream'; import * as events from 'events'; +// The modem parameter is an instance of docker-modem, which is missing type declarations. +// https://github.com/apocas/docker-modem + declare namespace Dockerode { - interface Container { + class Container { + constructor(modem: any, id: string); + + modem: any; + id: string; + inspect(options: {}, callback: Callback): void; inspect(callback: Callback): void; inspect(options?: {}): Promise; @@ -100,18 +109,20 @@ declare namespace Dockerode { logs(callback: Callback): void; logs(options?: ContainerLogsOptions): Promise; - stats(options: {}, callback: Callback): void; - stats(callback: Callback): void; - stats(options?: {}): Promise; + stats(options: {}, callback: Callback): void; + stats(callback: Callback): void; + stats(options?: {}): Promise; - attach(options: {}, callback: Callback): void; - attach(options: {}): Promise; - - modem: any; - id?: string; + attach(options: {}, callback: Callback): void; + attach(options: {}): Promise; } - interface Image { + class Image { + constructor(modem: any, name: string); + + modem: any; + id: string; + inspect(callback: Callback): void; inspect(): Promise; @@ -132,24 +143,28 @@ declare namespace Dockerode { remove(options: {}, callback: Callback): void; remove(callback: Callback): void; remove(options?: {}): Promise; - - modem: any; - id?: string; } - interface Volume { - inspect(callback: Callback): void; - inspect(): Promise; + class Volume { + constructor(modem: any, name: string); + + modem: any; + name: string; + + inspect(callback: Callback): void; + inspect(): Promise; remove(options: {}, callback: Callback): void; remove(callback: Callback): void; remove(options?: {}): Promise; - - modem: any; - name?: string; } - interface Service { + class Service { + constructor(modem: any, id: string); + + modem: any; + id: string; + inspect(callback: Callback): void; inspect(): Promise; @@ -160,19 +175,27 @@ declare namespace Dockerode { update(options: {}, callback: Callback): void; update(options: {}): Promise; - modem: any; - id?: string; + logs(options: ContainerLogsOptions, callback: Callback): void; + logs(callback: Callback): void; + logs(options?: ContainerLogsOptions): Promise; } - interface Task { + class Task { + constructor(modem: any, id: string); + + modem: any; + id: string; + inspect(callback: Callback): void; inspect(): Promise; - - modem: any; - id?: string; } - interface Node { + class Node { + constructor(modem: any, id: string); + + modem: any; + id: string; + inspect(callback: Callback): void; inspect(): Promise; @@ -183,12 +206,11 @@ declare namespace Dockerode { remove(options: {}, callback: Callback): void; remove(callback: Callback): void; remove(options?: {}): Promise; - - modem: any; - id?: string; } - interface Plugin { + class Plugin { + constructor(modem: any, name: string, remote?: any); + modem: any; name: string; remote: any; @@ -227,7 +249,12 @@ declare namespace Dockerode { upgrade(auth: any, options?: {}): Promise; } - interface Secret { + class Secret { + constructor(modem: any, id: string); + + modem: any; + id: string; + inspect(callback: Callback): void; inspect(): Promise; @@ -238,12 +265,14 @@ declare namespace Dockerode { remove(options: {}, callback: Callback): void; remove(callback: Callback): void; remove(options?: {}): Promise; - - modem: any; - id?: string; } - interface Network { + class Network { + constructor(modem: any, id: string); + + modem: any; + id: string; + inspect(callback: Callback): void; inspect(): Promise; @@ -258,12 +287,14 @@ declare namespace Dockerode { disconnect(options: {}, callback: Callback): void; disconnect(callback: Callback): void; disconnect(options?: {}): Promise; - - modem: any; - id?: string; } - interface Exec { + class Exec { + constructor(modem: any, id: string); + + modem: any; + id: string; + inspect(callback: Callback): void; inspect(): Promise; @@ -272,9 +303,6 @@ declare namespace Dockerode { resize(options: {}, callback: Callback): void; resize(options: {}): Promise; - - modem: any; - id?: string; } interface ImageInfo { @@ -343,6 +371,22 @@ declare namespace Dockerode { Ingress: boolean; } + interface VolumeInspectInfo { + Name: string; + Driver: string; + Mountpoint: string; + Status?: { [key: string]: string }; + Labels: { [key: string]: string }; + Scope: 'local' | 'global'; + // Field is always present, but sometimes is null + Options: { [key: string]: string } | null; + // Field is sometimes present, and sometimes null + UsageData?: { + Size: number; + RefCount: number; + } | null; + } + interface ContainerInspectInfo { Id: string; Created: string; @@ -446,20 +490,99 @@ declare namespace Dockerode { GlobalIPv6Address: string; GlobalIPv6PrefixLen: number; MacAddress: string; - } + }; }; Node?: { - ID: string; - IP: string; - Addr: string; - Name: string; - Cpus: number; - Memory: number; - Labels: any; - } + ID: string; + IP: string; + Addr: string; + Name: string; + Cpus: number; + Memory: number; + Labels: any; + }; }; } + interface NetworkStats { + [name: string]: { + rx_bytes: number; + rx_dropped: number; + rx_errors: number; + rx_packets: number; + tx_bytes: number; + tx_dropped: number; + tx_errors: number; + tx_packets: number; + }; + } + + interface CPUStats { + cpu_usage: { + percpu_usage: number[]; + usage_in_usermode: number; + total_usage: number; + usage_in_kernelmode: number; + }; + system_cpu_usage: number; + online_cpus: number; + throttling_data: { + periods: number; + throttled_periods: number; + throttled_time: number; + }; + } + + interface MemoryStats { + stats: { + total_pgmajfault: number; + cache: number; + mapped_file: number; + total_inactive_file: number; + pgpgout: number; + rss: number; + total_mapped_file: number; + writeback: number; + unevictable: number; + pgpgin: number; + total_unevictable: number; + pgmajfault: number; + total_rss: number; + total_rss_huge: number; + total_writeback: number; + total_inactive_anon: number; + rss_huge: number; + hierarchical_memory_limit: number; + total_pgfault: number; + total_active_file: number; + active_anon: number; + total_active_anon: number; + total_pgpgout: number; + total_cache: number; + inactive_anon: number; + active_file: number; + pgfault: number; + inactive_file: number; + total_pgpgin: number; + }; + max_usage: number; + usage: number; + failcnt: number; + limit: number; + } + + interface ContainerStats { + read: string; + pid_stats: { + current: number; + }; + networks: NetworkStats; + memory_stats: MemoryStats; + blkio_stats: {}; + cpu_stats: CPUStats; + precpu_stats: CPUStats; + } + interface HostConfig { AutoRemove: boolean; Binds: string[]; @@ -652,13 +775,45 @@ declare namespace Dockerode { GlobalIPv6Address?: string; GlobalIPV6PrefixLen?: number; MacAddress?: string; - DriverOpts?: {[key: string]: string}; + DriverOpts?: { [key: string]: string }; } interface EndpointsConfig { [key: string]: EndpointSettings; } + type MountType = + | "bind" + | "volume" + | "tmpfs"; + + type MountConsistency = + | "default" + | "consistent" + | "cached" + | "delegated"; + + type MountPropagation = + | "private" + | "rprivate" + | "shared" + | "rshared" + | "slave" + | "rslave"; + + interface MountSettings { + Target: string; + Source: string; + Type: MountType; + ReadOnly ?: boolean; + Consistency ?: MountConsistency; + BindOptions ?: { + Propagation: MountPropagation; + }; + } + + type MountConfig = MountSettings[]; + interface ContainerCreateOptions { name?: string; Hostname?: string; @@ -715,6 +870,7 @@ declare namespace Dockerode { DnsSearch?: string[]; ExtraHosts?: any; VolumesFrom?: string[]; + Mounts?: MountConfig; CapAdd?: string[]; CapDrop?: string[]; GroupAdd?: string[]; @@ -894,8 +1050,8 @@ declare namespace Dockerode { } interface ImageBuildContext { - context: string; - src: string[]; + context: string; + src: string[]; } interface DockerVersion { @@ -906,7 +1062,7 @@ declare namespace Dockerode { Details: { ApiVersion: string; Arch: string; - BuilTime: Date; + BuildTime: Date; Experimental: string; GitCommit: string; GoVersion: string; @@ -1004,9 +1160,18 @@ declare class Dockerode { listPlugins(callback: Callback): void; listPlugins(options?: {}): Promise; - listVolumes(options: {}, callback: Callback): void; - listVolumes(callback: Callback): void; - listVolumes(options?: {}): Promise; + listVolumes(options: {}, callback: Callback<{ + Volumes: Dockerode.VolumeInspectInfo[]; + Warnings: string[]; + }>): void; + listVolumes(callback: Callback<{ + Volumes: Dockerode.VolumeInspectInfo[]; + Warnings: string[]; + }>): void; + listVolumes(options?: {}): Promise<{ + Volumes: Dockerode.VolumeInspectInfo[]; + Warnings: string[]; + }>; listNetworks(options: {}, callback: Callback): void; listNetworks(callback: Callback): void; diff --git a/types/doge-seed/doge-seed-tests.ts b/types/doge-seed/doge-seed-tests.ts new file mode 100644 index 0000000000..fa47414d65 --- /dev/null +++ b/types/doge-seed/doge-seed-tests.ts @@ -0,0 +1,4 @@ +import dogeSeed = require('doge-seed'); + +dogeSeed(); // $ExpectType string +dogeSeed(128); // $ExpectType string diff --git a/types/doge-seed/index.d.ts b/types/doge-seed/index.d.ts new file mode 100644 index 0000000000..8670f36332 --- /dev/null +++ b/types/doge-seed/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for doge-seed 1.0 +// Project: https://github.com/lukechilds/doge-seed#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = dogeSeed; + +/** + * Generates a cryptographically secure mnemonic seed phrase with added dankness. + * The first four words will be a randomly generated Doge-like sentence. + * + * The seed phrases are fully valid checksummed BIP39 seeds. They can be used with any cryptocurrency + * and can be imported into any BIP39 compliant wallet. + * + * @param bits The number of bits to derive a BIP39 mnemonic from. Default: `128`. + * @returns A BIP39 mnemonic seed phrase. + */ +declare function dogeSeed(bits?: 128 | 160 | 192 | 224 | 256): string; diff --git a/types/doge-seed/tsconfig.json b/types/doge-seed/tsconfig.json new file mode 100644 index 0000000000..cd46d1ee9c --- /dev/null +++ b/types/doge-seed/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", + "doge-seed-tests.ts" + ] +} diff --git a/types/doge-seed/tslint.json b/types/doge-seed/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/doge-seed/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/dom-helpers/activeElement.d.ts b/types/dom-helpers/activeElement.d.ts new file mode 100644 index 0000000000..3a964f0479 --- /dev/null +++ b/types/dom-helpers/activeElement.d.ts @@ -0,0 +1,6 @@ +/** + * Returns focused element safely + */ +declare const activeElement: (doc?: Document) => Element; + +export = activeElement; diff --git a/types/dom-helpers/class/addClass.d.ts b/types/dom-helpers/class/addClass.d.ts new file mode 100644 index 0000000000..5431a9d256 --- /dev/null +++ b/types/dom-helpers/class/addClass.d.ts @@ -0,0 +1,2 @@ +declare const addClass: (element: Element, className: string) => void; +export = addClass; diff --git a/types/dom-helpers/class/hasClass.d.ts b/types/dom-helpers/class/hasClass.d.ts new file mode 100644 index 0000000000..2ec83c8a2f --- /dev/null +++ b/types/dom-helpers/class/hasClass.d.ts @@ -0,0 +1,2 @@ +declare const hasClass: (element: Element, className: string) => boolean; +export = hasClass; diff --git a/types/dom-helpers/class/index.d.ts b/types/dom-helpers/class/index.d.ts new file mode 100644 index 0000000000..24b0dbd1e6 --- /dev/null +++ b/types/dom-helpers/class/index.d.ts @@ -0,0 +1,19 @@ +import * as addClass from "./addClass"; +import * as removeClass from "./removeClass"; +import * as hasClass from "./hasClass"; + +declare const _default: { + addClass: typeof addClass; + removeClass: typeof removeClass; + hasClass: typeof hasClass; +}; + +declare const _export: { + addClass: typeof addClass; + removeClass: typeof removeClass; + hasClass: typeof hasClass; + + default: typeof _export; +}; + +export = _export; diff --git a/types/dom-helpers/class/removeClass.d.ts b/types/dom-helpers/class/removeClass.d.ts new file mode 100644 index 0000000000..a67929344f --- /dev/null +++ b/types/dom-helpers/class/removeClass.d.ts @@ -0,0 +1,2 @@ +declare const removeClass: (element: Element, className: string) => void; +export = removeClass; diff --git a/types/dom-helpers/dom-helpers-tests.ts b/types/dom-helpers/dom-helpers-tests.ts new file mode 100644 index 0000000000..60266ae725 --- /dev/null +++ b/types/dom-helpers/dom-helpers-tests.ts @@ -0,0 +1,105 @@ +import * as helpers from "dom-helpers"; +import * as ownerDocument from "dom-helpers/ownerDocument"; +import * as ownerWindow from "dom-helpers/ownerWindow"; +import * as activeElement from "dom-helpers/activeElement"; + +import * as classes from "dom-helpers/class"; +import * as hasClass from "dom-helpers/class/hasClass"; +import * as removeClass from "dom-helpers/class/removeClass"; +import * as addClass from "dom-helpers/class/addClass"; + +import * as events from "dom-helpers/events"; +import * as on from "dom-helpers/events/on"; +import * as off from "dom-helpers/events/off"; +import * as listen from "dom-helpers/events/listen"; +import * as filter from "dom-helpers/events/filter"; + +import * as query from "dom-helpers/query"; +import * as matches from "dom-helpers/query/matches"; +import * as height from "dom-helpers/query/height"; +import * as width from "dom-helpers/query/width"; +import * as offset from "dom-helpers/query/offset"; +import * as offsetParent from "dom-helpers/query/offsetParent"; +import * as position from "dom-helpers/query/position"; +import * as contains from "dom-helpers/query/contains"; +import * as scrollParent from "dom-helpers/query/scrollParent"; +import * as scrollTop from "dom-helpers/query/scrollTop"; +import * as querySelectorAll from "dom-helpers/query/querySelectorAll"; +import * as closest from "dom-helpers/query/closest"; + +import * as css from "dom-helpers/style"; +import * as getComputedStyle from "dom-helpers/style/getComputedStyle"; +import * as removeStyle from "dom-helpers/style/removeStyle"; + +import * as transition from "dom-helpers/transition"; +import * as end from "dom-helpers/transition/end"; +import * as properties from "dom-helpers/transition/properties"; + +const element = helpers.activeElement() || activeElement(); +const win = + helpers.ownerWindow(element || null || undefined) || + ownerWindow(element || null || undefined); +const doc = helpers.ownerDocument(element) || ownerDocument(element); +const id = helpers.requestAnimationFrame(() => {}); +helpers.requestAnimationFrame.cancel(id); + +const padding: string = css(element, "padding"); +css(element, "padding", 10); +css(element, "padding", "12px"); + +events.on(element, "click", () => {}); +on(element, "click", () => {}); +events.off(element, "click", () => {}, true); +off(element, "click", () => {}, true); +events.listen(element, "click", () => {})(); +listen(element, "click", () => {})(); +events.on(element, "click", filter("div > a", () => {})); +on(element, "click", events.filter("div > a", () => {})); + +classes.addClass(element, "class"); +classes.removeClass(element, "class"); +classes.hasClass(element, "class"); + +addClass(element, "class"); +removeClass(element, "class"); +hasClass(element, "class"); + +const match: boolean = + query.matches(element, ".class") || matches(element, ".class"); +const h: number = query.height(element) || height(element); +const w: number = query.width(element) || width(element); +const _offset: { top: number; left: number; bottom: number; right: number } = + query.offset(element) || offset(element); +const _offsetParent: Element = + query.offsetParent(element) || offsetParent(element); +const _position: { top: number; left: number; bottom: number; right: number } = + query.position(element) || position(element); +const _contains: boolean = + query.contains(element, element) || contains(element, element); +const _scrollParent: Element = + query.scrollParent(element) || scrollParent(element); +const _scrollTop: number = query.scrollTop(element) || scrollTop(element); +query.scrollTop(element, 100); +scrollTop(element, 100); +const _querySelectorAll: HTMLElement[] = + (query.querySelectorAll(element, "*") as HTMLElement[]) || + (querySelectorAll(element, "*") as HTMLElement[]); +const _closest: Element = + query.closest(element, "*", element) || closest(element, "*", element); + +const _getComputedStyle: string = getComputedStyle(element).getPropertyValue( + "padding" +); +removeStyle(element, "padding"); + +transition.end(element, (event) => { + const currentTarget: Element = event.currentTarget; + const target: Element = event.target; +}, 100); + +end(element, (event) => { + const currentTarget: Element = event.currentTarget; + const target: Element = event.target; +}, 100); + +const transform: string = properties.transform; diff --git a/types/dom-helpers/events/filter.d.ts b/types/dom-helpers/events/filter.d.ts new file mode 100644 index 0000000000..fa54287155 --- /dev/null +++ b/types/dom-helpers/events/filter.d.ts @@ -0,0 +1,6 @@ +/** + * Returns a function handler that only fires when the target matches or is contained in the selector + * @example events.on(list, 'click', events.filter('li > a', handler)) + */ +declare const filter: (selector: string, listener: EventListener) => EventListener; +export = filter; diff --git a/types/dom-helpers/events/index.d.ts b/types/dom-helpers/events/index.d.ts new file mode 100644 index 0000000000..fb2e5e89c7 --- /dev/null +++ b/types/dom-helpers/events/index.d.ts @@ -0,0 +1,22 @@ +import * as on from './on'; +import * as off from './off'; +import * as listen from './listen'; +import * as filter from './filter'; + +declare const _default: { + on: typeof on; + off: typeof off; + listen: typeof listen; + filter: typeof filter; +}; + +declare const _export: { + on: typeof on; + off: typeof off; + listen: typeof listen; + filter: typeof filter; + + default: typeof _default; +}; + +export = _export; diff --git a/types/dom-helpers/events/listen.d.ts b/types/dom-helpers/events/listen.d.ts new file mode 100644 index 0000000000..ec12d5c0e3 --- /dev/null +++ b/types/dom-helpers/events/listen.d.ts @@ -0,0 +1,5 @@ +/** + * Wraps on and returns a function that calls off for you + */ +declare const listen: (element: Element, type: string, listener: EventListener, capture?: boolean) => () => void; +export = listen; diff --git a/types/dom-helpers/events/off.d.ts b/types/dom-helpers/events/off.d.ts new file mode 100644 index 0000000000..32699cb8a4 --- /dev/null +++ b/types/dom-helpers/events/off.d.ts @@ -0,0 +1,5 @@ +/** + * Capture is silently ignored in ie8 + */ +declare const off: (element: Element, type: string, listener: EventListener, capture?: boolean) => void; +export = off; diff --git a/types/dom-helpers/events/on.d.ts b/types/dom-helpers/events/on.d.ts new file mode 100644 index 0000000000..2028d70af6 --- /dev/null +++ b/types/dom-helpers/events/on.d.ts @@ -0,0 +1,5 @@ +/** + * Capture is silently ignored in ie8 + */ +declare const on: (element: Element, type: string, listener: EventListener, capture?: boolean) => void; +export = on; diff --git a/types/dom-helpers/index.d.ts b/types/dom-helpers/index.d.ts new file mode 100644 index 0000000000..3215fcc500 --- /dev/null +++ b/types/dom-helpers/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for dom-helpers 3.4 +// Project: https://github.com/react-bootstrap/dom-helpers +// Definitions by: Konstantin Vasiliev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { default as events } from "./events"; +import { default as query } from "./query"; +import * as style from "./style"; +import * as activeElement from "./activeElement"; +import * as ownerDocument from "./ownerDocument"; +import * as ownerWindow from "./ownerWindow"; +import * as requestAnimationFrame from "./util/requestAnimationFrame"; + +declare const _default: typeof events & + typeof query & { + style: typeof style; + activeElement: typeof activeElement; + ownerDocument: typeof ownerDocument; + ownerWindow: typeof ownerWindow; + requestAnimationFrame: typeof requestAnimationFrame; + }; + +declare const _export: { + style: typeof style; + activeElement: typeof activeElement; + ownerDocument: typeof ownerDocument; + ownerWindow: typeof ownerWindow; + requestAnimationFrame: typeof requestAnimationFrame; + + default: typeof _default; +}; + +export = _export; diff --git a/types/dom-helpers/ownerDocument.d.ts b/types/dom-helpers/ownerDocument.d.ts new file mode 100644 index 0000000000..248981141c --- /dev/null +++ b/types/dom-helpers/ownerDocument.d.ts @@ -0,0 +1,6 @@ +/** + * Returns the element's document owner + */ +declare const ownerDocument: (node?: Node | null) => Document; + +export = ownerDocument; diff --git a/types/dom-helpers/ownerWindow.d.ts b/types/dom-helpers/ownerWindow.d.ts new file mode 100644 index 0000000000..f827d3f073 --- /dev/null +++ b/types/dom-helpers/ownerWindow.d.ts @@ -0,0 +1,6 @@ +/** + * Returns the element's document window + */ +declare const ownerWindow: (node?: Node | null) => Window; + +export = ownerWindow; diff --git a/types/dom-helpers/query/closest.d.ts b/types/dom-helpers/query/closest.d.ts new file mode 100644 index 0000000000..5076d3bdf2 --- /dev/null +++ b/types/dom-helpers/query/closest.d.ts @@ -0,0 +1,7 @@ +declare const closest: ( + element: Element, + selector: string, + context: Element +) => Element; + +export = closest; diff --git a/types/dom-helpers/query/contains.d.ts b/types/dom-helpers/query/contains.d.ts new file mode 100644 index 0000000000..d5e03884aa --- /dev/null +++ b/types/dom-helpers/query/contains.d.ts @@ -0,0 +1,2 @@ +declare const contains: (context: Node, node: Node) => boolean; +export = contains; diff --git a/types/dom-helpers/query/height.d.ts b/types/dom-helpers/query/height.d.ts new file mode 100644 index 0000000000..807a3a0782 --- /dev/null +++ b/types/dom-helpers/query/height.d.ts @@ -0,0 +1,2 @@ +declare const height: (element: Element, useClientHeight?: boolean) => number; +export = height; diff --git a/types/dom-helpers/query/index.d.ts b/types/dom-helpers/query/index.d.ts new file mode 100644 index 0000000000..b0dff78ac1 --- /dev/null +++ b/types/dom-helpers/query/index.d.ts @@ -0,0 +1,43 @@ +import * as matches from "./matches"; +import * as height from "./height"; +import * as width from "./width"; +import * as offset from "./offset"; +import * as offsetParent from "./offsetParent"; +import * as position from "./position"; +import * as contains from "./contains"; +import * as scrollParent from "./scrollParent"; +import * as scrollTop from "./scrollTop"; +import * as querySelectorAll from "./querySelectorAll"; +import * as closest from "./closest"; + +declare const _default: { + matches: typeof matches; + height: typeof height; + width: typeof width; + offset: typeof offset; + offsetParent: typeof offsetParent; + position: typeof position; + contains: typeof contains; + scrollParent: typeof scrollParent; + scrollTop: typeof scrollTop; + querySelectorAll: typeof querySelectorAll; + closest: typeof closest; +}; + +declare const _export: { + matches: typeof matches; + height: typeof height; + width: typeof width; + offset: typeof offset; + offsetParent: typeof offsetParent; + position: typeof position; + contains: typeof contains; + scrollParent: typeof scrollParent; + scrollTop: typeof scrollTop; + querySelectorAll: typeof querySelectorAll; + closest: typeof closest; + + default: typeof _default; +}; + +export = _export; diff --git a/types/dom-helpers/query/isWindow.d.ts b/types/dom-helpers/query/isWindow.d.ts new file mode 100644 index 0000000000..e8e0c96534 --- /dev/null +++ b/types/dom-helpers/query/isWindow.d.ts @@ -0,0 +1,2 @@ +declare const isWindow: (node: any) => boolean; +export = isWindow; diff --git a/types/dom-helpers/query/matches.d.ts b/types/dom-helpers/query/matches.d.ts new file mode 100644 index 0000000000..709845bc61 --- /dev/null +++ b/types/dom-helpers/query/matches.d.ts @@ -0,0 +1,5 @@ +/** + * `matches()` polyfill that works in ie8 + */ +declare const matches: (element: Element, selectors: string) => boolean; +export = matches; diff --git a/types/dom-helpers/query/offset.d.ts b/types/dom-helpers/query/offset.d.ts new file mode 100644 index 0000000000..2b41598076 --- /dev/null +++ b/types/dom-helpers/query/offset.d.ts @@ -0,0 +1,11 @@ +declare namespace DomHelpersOffset { + interface DomHelpersRect { + bottom: number; + left: number; + right: number; + top: number; + } +} + +declare const DomHelpersOffset: (element: Element) => DomHelpersOffset.DomHelpersRect; +export = DomHelpersOffset; diff --git a/types/dom-helpers/query/offsetParent.d.ts b/types/dom-helpers/query/offsetParent.d.ts new file mode 100644 index 0000000000..ecdfeb9d71 --- /dev/null +++ b/types/dom-helpers/query/offsetParent.d.ts @@ -0,0 +1,5 @@ +/** + * Returns the parent node that the element is offset from + */ +declare const offsetParent: (element: Element) => Element; +export = offsetParent; diff --git a/types/dom-helpers/query/position.d.ts b/types/dom-helpers/query/position.d.ts new file mode 100644 index 0000000000..5f683f97e1 --- /dev/null +++ b/types/dom-helpers/query/position.d.ts @@ -0,0 +1,7 @@ +import { DomHelpersRect } from "./offset"; +/** + * Return "offset" of the node to its offsetParent, + * optionally you can specify the offset parent if different than the "real" one + */ +declare const position: (element: Element, offsetParent?: Node) => DomHelpersRect; +export = position; diff --git a/types/dom-helpers/query/querySelectorAll.d.ts b/types/dom-helpers/query/querySelectorAll.d.ts new file mode 100644 index 0000000000..21c256adfc --- /dev/null +++ b/types/dom-helpers/query/querySelectorAll.d.ts @@ -0,0 +1,8 @@ +/** + * Optimized qsa, uses `getElementBy{Id|TagName|ClassName}` if it can + */ +declare const querySelectorAll: ( + element: Element, + selector: string +) => Element[]; +export = querySelectorAll; diff --git a/types/dom-helpers/query/scrollLeft.d.ts b/types/dom-helpers/query/scrollLeft.d.ts new file mode 100644 index 0000000000..3a0c0a3fa3 --- /dev/null +++ b/types/dom-helpers/query/scrollLeft.d.ts @@ -0,0 +1,5 @@ +declare function _scrollLeft(element: Element): number; +declare function _scrollLeft(element: Element, value: number): void; + +declare const scrollLeft: typeof _scrollLeft; +export = scrollLeft; diff --git a/types/dom-helpers/query/scrollParent.d.ts b/types/dom-helpers/query/scrollParent.d.ts new file mode 100644 index 0000000000..f104f68bd3 --- /dev/null +++ b/types/dom-helpers/query/scrollParent.d.ts @@ -0,0 +1,2 @@ +declare const scrollParent: (element: Element) => Element; +export = scrollParent; diff --git a/types/dom-helpers/query/scrollTop.d.ts b/types/dom-helpers/query/scrollTop.d.ts new file mode 100644 index 0000000000..d56d9d17e1 --- /dev/null +++ b/types/dom-helpers/query/scrollTop.d.ts @@ -0,0 +1,6 @@ +declare function _scrollTop(element: Element): number; +declare function _scrollTop(element: Element, value: number): void; + +declare const scrollTop: typeof _scrollTop; + +export = scrollTop; diff --git a/types/dom-helpers/query/width.d.ts b/types/dom-helpers/query/width.d.ts new file mode 100644 index 0000000000..4b4fd15bb5 --- /dev/null +++ b/types/dom-helpers/query/width.d.ts @@ -0,0 +1,2 @@ +declare const width: (element: Element, useClientWidth?: boolean) => number; +export = width; diff --git a/types/dom-helpers/style/getComputedStyle.d.ts b/types/dom-helpers/style/getComputedStyle.d.ts new file mode 100644 index 0000000000..c8be2d3976 --- /dev/null +++ b/types/dom-helpers/style/getComputedStyle.d.ts @@ -0,0 +1,4 @@ +declare const getComputedStyle: ( + element: Element +) => { getPropertyValue: (prop: string) => string }; +export = getComputedStyle; diff --git a/types/dom-helpers/style/index.d.ts b/types/dom-helpers/style/index.d.ts new file mode 100644 index 0000000000..2cb8844194 --- /dev/null +++ b/types/dom-helpers/style/index.d.ts @@ -0,0 +1,9 @@ +declare function _style(element: Element, property: string): string; +declare function _style( + element: Element, + property: string | { [key: string]: any }, + value: any +): void; + +declare const style: typeof _style; +export = style; diff --git a/types/dom-helpers/style/removeStyle.d.ts b/types/dom-helpers/style/removeStyle.d.ts new file mode 100644 index 0000000000..4ccdcae438 --- /dev/null +++ b/types/dom-helpers/style/removeStyle.d.ts @@ -0,0 +1,2 @@ +declare const removeStyle: (element: Element, key: string) => void; +export = removeStyle; diff --git a/types/dom-helpers/transition/animate.d.ts b/types/dom-helpers/transition/animate.d.ts new file mode 100644 index 0000000000..9cd71843e5 --- /dev/null +++ b/types/dom-helpers/transition/animate.d.ts @@ -0,0 +1,23 @@ +interface DomHelpersAnimationArgs { + element: Element; + properties: { [key: string]: any }; + duration?: number; + easing?: boolean; + callback?: () => void; +} + +/** + * Programmatically start css transitions + */ +declare function _animate(args: DomHelpersAnimationArgs): { cancel: () => void }; +declare function _animate( + element: Element, + properties: { [key: string]: any }, + duration?: number, + easing?: boolean, + callback?: () => void +): { cancel: () => void }; + +declare const animate: typeof _animate; + +export = animate; diff --git a/types/dom-helpers/transition/end.d.ts b/types/dom-helpers/transition/end.d.ts new file mode 100644 index 0000000000..5b662395e4 --- /dev/null +++ b/types/dom-helpers/transition/end.d.ts @@ -0,0 +1,12 @@ +/** + * Listens for transition end, and ensures that the handler if called + * even if the transition fails to fire its end event. + * Will attempt to read duration from the element, otherwise one can be provided + */ +declare const end: ( + element: T, + handler: (event: { target: T, currentTarget: T }) => void, + duration?: number +) => void; + +export = end; diff --git a/types/dom-helpers/transition/index.d.ts b/types/dom-helpers/transition/index.d.ts new file mode 100644 index 0000000000..28b1ce9eb0 --- /dev/null +++ b/types/dom-helpers/transition/index.d.ts @@ -0,0 +1,16 @@ +import * as end from "./end"; +import * as properties from "./properties"; + +declare const _default: { + end: typeof end; + properties: typeof properties; +}; + +declare const _export: { + end: typeof end; + properties: typeof properties; + + default: typeof _default; +}; + +export = _export; diff --git a/types/dom-helpers/transition/properties.d.ts b/types/dom-helpers/transition/properties.d.ts new file mode 100644 index 0000000000..4049c19982 --- /dev/null +++ b/types/dom-helpers/transition/properties.d.ts @@ -0,0 +1,26 @@ +declare const _default: { + transform: string; + end: string; + property: string; + timing: string; + delay: string; + duration: string; +}; + +declare const _export: { + transform: string; + transitionProperty: string; + transitionTiming: string; + transitionDelay: string; + transitionDuration: string; + transitionEnd: string; + animationName: string; + animationDuration: string; + animationTiming: string; + animationDelay: string; + animationEnd: string; + + default: typeof _default, +}; + +export = _export; diff --git a/types/dom-helpers/tsconfig.json b/types/dom-helpers/tsconfig.json new file mode 100644 index 0000000000..bbaca98dbe --- /dev/null +++ b/types/dom-helpers/tsconfig.json @@ -0,0 +1,60 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "activeElement.d.ts", + "ownerDocument.d.ts", + "ownerWindow.d.ts", + "dom-helpers-tests.ts", + "class/addClass.d.ts", + "class/hasClass.d.ts", + "class/index.d.ts", + "class/removeClass.d.ts", + "events/filter.d.ts", + "events/index.d.ts", + "events/listen.d.ts", + "events/off.d.ts", + "events/on.d.ts", + "query/closest.d.ts", + "query/contains.d.ts", + "query/height.d.ts", + "query/index.d.ts", + "query/isWindow.d.ts", + "query/matches.d.ts", + "query/offset.d.ts", + "query/offsetParent.d.ts", + "query/position.d.ts", + "query/querySelectorAll.d.ts", + "query/scrollLeft.d.ts", + "query/scrollParent.d.ts", + "query/scrollTop.d.ts", + "query/width.d.ts", + "style/getComputedStyle.d.ts", + "style/index.d.ts", + "style/removeStyle.d.ts", + "transition/animate.d.ts", + "transition/end.d.ts", + "transition/index.d.ts", + "transition/properties.d.ts", + "util/requestAnimationFrame.d.ts", + "util/scrollbarSize.d.ts", + "util/scrollTo.d.ts" + ] +} diff --git a/types/dom-helpers/tslint.json b/types/dom-helpers/tslint.json new file mode 100644 index 0000000000..2d469ebdbd --- /dev/null +++ b/types/dom-helpers/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "prefer-declare-function": false + } +} diff --git a/types/dom-helpers/util/requestAnimationFrame.d.ts b/types/dom-helpers/util/requestAnimationFrame.d.ts new file mode 100644 index 0000000000..211fb7486f --- /dev/null +++ b/types/dom-helpers/util/requestAnimationFrame.d.ts @@ -0,0 +1,11 @@ +interface DomHelpersRaf { + /** + * Returns an ID for canceling + */ + (callback: () => void): number; + cancel: (id: number) => void; +} + +declare const requestAnimationFrame: DomHelpersRaf; + +export = requestAnimationFrame; diff --git a/types/dom-helpers/util/scrollTo.d.ts b/types/dom-helpers/util/scrollTo.d.ts new file mode 100644 index 0000000000..b336c1104a --- /dev/null +++ b/types/dom-helpers/util/scrollTo.d.ts @@ -0,0 +1,3 @@ +declare const scrollTo: (element: Element, scrollParent?: Element) => () => void; + +export = scrollTo; diff --git a/types/dom-helpers/util/scrollbarSize.d.ts b/types/dom-helpers/util/scrollbarSize.d.ts new file mode 100644 index 0000000000..67d6c840e2 --- /dev/null +++ b/types/dom-helpers/util/scrollbarSize.d.ts @@ -0,0 +1,6 @@ +/** + * Returns the scrollbar's width size in pixels + */ +declare const scrollbarSize: (recalc?: boolean) => number; + +export = scrollbarSize; diff --git a/types/dot-object/dot-object-tests.ts b/types/dot-object/dot-object-tests.ts index a553c6c68d..c87c6f5a80 100644 --- a/types/dot-object/dot-object-tests.ts +++ b/types/dot-object/dot-object-tests.ts @@ -47,12 +47,21 @@ var newObj = { nested: { value: 'Hi there!' } + }, + breath: { + value: 'Hello' } }; var val = dot.pick('some.nested.value', newObj); console.log(val); +// Set a new value +val = dot.str('breath.value', 'World', newObj); + +// Replacing with a new object +val = dot.set('breath', { value: 'Goodbye' }, newObj); + // Pick & Remove the value val = dot.pick('some.nested.value', newObj, true); diff --git a/types/dot-object/index.d.ts b/types/dot-object/index.d.ts index 8bb7d0657c..ef119a3424 100644 --- a/types/dot-object/index.d.ts +++ b/types/dot-object/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for Dot-Object v1.5 +// Type definitions for Dot-Object 1.7 // Project: https://github.com/rhalff/dot-object // Definitions by: Niko Kovačič // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 declare namespace DotObject { @@ -120,12 +121,25 @@ declare namespace DotObject { */ remove(path: string, obj: any): any; /** + * + * Replace/create with a string + * * @param {String} path dotted path * @param {String} v value to be set * @param {Object} obj object to be modified * @param {Function|Array} mods optional modifier */ - str(path: string, v: any, obj: Object, mods?: ModifierFunctionWrapper | Array): void; + str(path: string, v: any, obj: object, mods?: ModifierFunctionWrapper | Array): void; + /** + * + * Replace/merge an object to an existing object property + * + * @param {String} path dotted path + * @param {Object} v object to be set + * @param {Object} obj object to be modified + * @param {Boolean} merge optional merge + */ + set(path: string, v: any, obj: object, merge?: boolean): void; /** * * Transfer a property from one object to another object. diff --git a/types/dot-object/tslint.json b/types/dot-object/tslint.json index a41bf5d19a..a0357daa61 100644 --- a/types/dot-object/tslint.json +++ b/types/dot-object/tslint.json @@ -7,7 +7,6 @@ "ban-types": false, "callable-types": false, "comment-format": false, - "dt-header": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/dotenv-flow/dotenv-flow-tests.ts b/types/dotenv-flow/dotenv-flow-tests.ts new file mode 100644 index 0000000000..c1d12834db --- /dev/null +++ b/types/dotenv-flow/dotenv-flow-tests.ts @@ -0,0 +1,18 @@ +import dotenv = require("dotenv-flow"); + +const env = dotenv.config(); +const dbUrl: string | null = env.error || !env.parsed ? null : env.parsed["BASIC"]; + +dotenv.load({ + cwd: "someDir", + encoding: "utf8", + purge_dotenv: true +}); + +const parsed = dotenv.parse("NODE_ENV=production\nDB_HOST=a.b.c"); +const dbHost: string = parsed["DB_HOST"]; + +const parsedFromBuffer = dotenv.parse(new Buffer("JUSTICE=league\n"), { + debug: true +}); +const justice: string = parsedFromBuffer["JUSTICE"]; diff --git a/types/dotenv-flow/index.d.ts b/types/dotenv-flow/index.d.ts new file mode 100644 index 0000000000..33a494c4a8 --- /dev/null +++ b/types/dotenv-flow/index.d.ts @@ -0,0 +1,62 @@ +// Type definitions for dotenv-flow 0.2 +// Project: https://github.com/motdotla/dotenv +// Definitions by: Vincent Langlet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export interface DotenvParseOptions { + /** + * You may turn on logging to help debug why certain keys or values are not being set as you expect. + */ + debug?: boolean; +} + +export interface DotenvParseOutput { + [name: string]: string; +} + +/** + * Parses a string or buffer in the .env file format into an object. + * + * @param src - contents to be parsed + * @param options - additional options + * @returns an object with keys and values based on `src` + */ +export function parse( + src: string | Buffer, + options?: DotenvParseOptions +): DotenvParseOutput; + +export interface DotenvConfigOptions { + /** + * You may specify a custom path if your file containing environment variables is located elsewhere. + */ + cwd?: string; + + /** + * You may specify the encoding of your file containing environment variables. + */ + encoding?: string; + + /** + * In some cases the original "dotenv" library can be used by one of the dependent npm modules. Use to fix this. + */ + purge_dotenv?: boolean; +} + +export interface DotenvConfigOutput { + error?: Error; + parsed?: DotenvParseOutput; +} + +/** + * Loads `.env` file contents into {@link https://nodejs.org/api/process.html#process_process_env | `process.env`}. + * Example: 'KEY=value' becomes { parsed: { KEY: 'value' } } + * + * @param options - controls behavior + * @returns an object with a `parsed` key if successful or `error` key if an error occurred + * + */ +export function config(options?: DotenvConfigOptions): DotenvConfigOutput; +export const load: typeof config; diff --git a/types/dotenv-flow/tsconfig.json b/types/dotenv-flow/tsconfig.json new file mode 100644 index 0000000000..376a2532ce --- /dev/null +++ b/types/dotenv-flow/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", + "dotenv-flow-tests.ts" + ] +} diff --git a/types/dotenv-flow/tslint.json b/types/dotenv-flow/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dotenv-flow/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/dotenv-safe/index.d.ts b/types/dotenv-safe/index.d.ts index 3004b98ba6..39c17ebea5 100644 --- a/types/dotenv-safe/index.d.ts +++ b/types/dotenv-safe/index.d.ts @@ -24,7 +24,12 @@ export interface DotenvSafeOptions { */ path?: string, /** - * Path to example environment file. + * Path to example environment file. (Option 1) + * @default ".env.example" + */ + example?: string, + /** + * Path to example environment file. (Option 2 -- example takes precendence) * @default ".env.example" */ sample?: string, diff --git a/types/dotenv-webpack/dotenv-webpack-tests.ts b/types/dotenv-webpack/dotenv-webpack-tests.ts index 6605550529..b4d7e849d8 100644 --- a/types/dotenv-webpack/dotenv-webpack-tests.ts +++ b/types/dotenv-webpack/dotenv-webpack-tests.ts @@ -3,19 +3,27 @@ import DotenvWebpackPlugin = require('dotenv-webpack'); new DotenvWebpackPlugin(); // $ExpectType DotenvWebpackPlugin -const options: DotenvWebpackPlugin.Options = { +const optionsEmpty: DotenvWebpackPlugin.Options = {}; + +const optionsFull: DotenvWebpackPlugin.Options = { path: './some.other.env', safe: true, systemvars: true, - silent: true + silent: true, + expand: true, + defaults: true +}; + +const optionsStrings: DotenvWebpackPlugin.Options = { + safe: './some.other.env.example', + defaults: './some.other.env.defaults' }; const config: webpack.Configuration = { plugins: [ new DotenvWebpackPlugin(), - new DotenvWebpackPlugin({ - path: './some.other.env', - }), - new DotenvWebpackPlugin(options), + new DotenvWebpackPlugin(optionsEmpty), + new DotenvWebpackPlugin(optionsFull), + new DotenvWebpackPlugin(optionsStrings) ] }; diff --git a/types/dotenv-webpack/index.d.ts b/types/dotenv-webpack/index.d.ts index 2d330ace45..25c64b7905 100644 --- a/types/dotenv-webpack/index.d.ts +++ b/types/dotenv-webpack/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for dotenv-webpack 1.5 +// Type definitions for dotenv-webpack 1.7 // Project: https://github.com/mrsteele/dotenv-webpack // Definitions by: Karol Majewski +// Dave Cardwell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.7 @@ -20,7 +21,7 @@ declare namespace DotenvWebpackPlugin { /** * If `false` ignore safe-mode, if `true` load `'./.env.example'`, if a `string` load that file as the sample. Default: `false`. */ - safe?: boolean; + safe?: boolean | string; /** * Set to `true` if you would rather load all system variables as well (useful for CI purposes). Default: `false`. @@ -31,6 +32,17 @@ declare namespace DotenvWebpackPlugin { * If `true`, all warnings will be surpressed. Default: `false`. */ silent?: boolean; + + /** + * Allows your variables to be "expanded" for reusability within your .env file. Default: `false`. + */ + expand?: boolean; + + /** + * Adds support for dotenv-defaults. If set to `true`, uses `./.env.defaults`. If a `string`, uses that location for a defaults file. + * Read more at https://www.npmjs.com/package/dotenv-defaults. Default: `false`. + */ + defaults?: boolean | string; } } diff --git a/types/download/index.d.ts b/types/download/index.d.ts index 5d19321fb0..3dd8e4dea8 100644 --- a/types/download/index.d.ts +++ b/types/download/index.d.ts @@ -24,6 +24,12 @@ declare namespace download { * Proxy endpoint */ proxy?: string; + /** + * Request Headers + */ + headers?: { + [name: string]: string; + }; } } diff --git a/types/downloadjs/index.d.ts b/types/downloadjs/index.d.ts index 0379de8395..7f9c7cae2d 100644 --- a/types/downloadjs/index.d.ts +++ b/types/downloadjs/index.d.ts @@ -1,10 +1,11 @@ // Type definitions for downloadjs 1.4 // Project: http://danml.com/download.html // Definitions by: cwmoo740 +// josuedevmark // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 declare namespace download { } -declare function download(data: string | File | Blob, filename?: string, mimeType?: string): void; +declare function download(data: string | File | Blob, filename?: string, mimeType?: string): XMLHttpRequest | boolean; export = download; diff --git a/types/draft-js/draft-js-tests.tsx b/types/draft-js/draft-js-tests.tsx index c0c64256fd..2375da74d4 100644 --- a/types/draft-js/draft-js-tests.tsx +++ b/types/draft-js/draft-js-tests.tsx @@ -315,6 +315,7 @@ ReactDOM.render( const editorState = EditorState.createEmpty(); const contentState = editorState.getCurrentContent(); +const entityMap = contentState.getEntityMap(); const rawContentState: RawDraftContentState = convertToRaw(contentState); rawContentState.blocks.forEach((block: RawDraftContentBlock) => { diff --git a/types/draft-js/index.d.ts b/types/draft-js/index.d.ts index 4f2c34dd3a..4c00e7598f 100644 --- a/types/draft-js/index.d.ts +++ b/types/draft-js/index.d.ts @@ -9,6 +9,7 @@ // Santiago Vilar // Ulf Schwekendiek // Pablo Varela +// Claudio Procida // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -754,6 +755,7 @@ declare namespace Draft { createEntity(type: DraftEntityType, mutability: DraftEntityMutability, data?: Object): ContentState; getEntity(key: string): EntityInstance; + getEntityMap(): any; getLastCreatedEntityKey(): string; mergeEntityData(key: string, toMerge: { [key: string]: any }): ContentState; replaceEntityData(key: string, toMerge: { [key: string]: any }): ContentState; diff --git a/types/drivelist/drivelist-tests.ts b/types/drivelist/drivelist-tests.ts new file mode 100644 index 0000000000..9e1f04bf35 --- /dev/null +++ b/types/drivelist/drivelist-tests.ts @@ -0,0 +1,59 @@ +import * as drivelist from "drivelist"; + +drivelist.list((error, drives) => { + if (!error) { + drives.forEach(drive => { + const { + enumerator, + busType, + busVersion, + device, + devicePath, + raw, + description, + error, + size, + blockSize, + logicalBlockSize, + mountpoints, + isReadOnly, + isSystem, + isVirtual, + isRemovable, + isCard, + isSCSI, + isUSB, + isUAS + } = drive; + + enumerator; // $ExpectType string + busType; // $ExpectType BusType + busVersion; // $ExpectType string | null + device; // $ExpectType string + devicePath; // $ExpectType string | null + raw; // $ExpectType string + description; // $ExpectType string + error; // $ExpectType any + size; // $ExpectType number | null + blockSize; // $ExpectType number | null + logicalBlockSize; // $ExpectType number | null + + mountpoints; // $ExpectType MountPoint[] + mountpoints.forEach(mountpoint => { + const { path, label } = mountpoint; + + path; // $ExpectType string + label; // $ExpectType string | undefined + }); + + isReadOnly; // $ExpectType boolean + isSystem; // $ExpectType boolean + isVirtual; // $ExpectType boolean | null + isRemovable; // $ExpectType boolean | null + isCard; // $ExpectType boolean | null + isSCSI; // $ExpectType boolean | null + isUSB; // $ExpectType boolean | null + isUAS; // $ExpectType boolean | null + }); + } +}); diff --git a/types/drivelist/index.d.ts b/types/drivelist/index.d.ts new file mode 100644 index 0000000000..d2acd039df --- /dev/null +++ b/types/drivelist/index.d.ts @@ -0,0 +1,36 @@ +// Type definitions for drivelist 6.4 +// Project: https://github.com/resin-io-modules/drivelist +// Definitions by: Xiao Deng +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export type BusType = "SATA" | "SCSI" | "ATA" | "IDE" | "PCI" | "UNKNOWN"; + +export interface MountPoint { + path: string; + label?: string; +} + +export interface Drive { + enumerator: string; + busType: BusType; + busVersion: string | null; + device: string; + devicePath: string | null; + raw: string; + description: string; + error: any; // can be null + size: number | null; + blockSize: number | null; + logicalBlockSize: number | null; + mountpoints: MountPoint[]; + isReadOnly: boolean; + isSystem: boolean; + isVirtual: boolean | null; + isRemovable: boolean | null; + isCard: boolean | null; + isSCSI: boolean | null; + isUSB: boolean | null; + isUAS: boolean | null; +} + +export function list(callback: (error: any, drives: Drive[]) => void): void; diff --git a/types/drivelist/tsconfig.json b/types/drivelist/tsconfig.json new file mode 100644 index 0000000000..0dd1a9ecdd --- /dev/null +++ b/types/drivelist/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", + "drivelist-tests.ts" + ] +} diff --git a/types/drivelist/tslint.json b/types/drivelist/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/drivelist/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/dwt/Dynamsoft.d.ts b/types/dwt/Dynamsoft.d.ts new file mode 100644 index 0000000000..65569f61b3 --- /dev/null +++ b/types/dwt/Dynamsoft.d.ts @@ -0,0 +1,113 @@ +declare namespace Dynamsoft { + let Lib: DynamsoftLib; + let WebTwainEnv: dwtEnv; + namespace WebTwain { + namespace Addon { + let OCRPro: OCRProAddon; + } + } + namespace DWT { + let defaultEnv: dwtEnv; + } +} + +declare const dwt: WebTwain; + +interface dwtEnv { + ActiveXInstallWithCAB: boolean; + ActiveXVersion: string; + AutoLoad: boolean; + CloseDialog(): void; + ContainerMap: {}; + Containers: Container[]; + CreateDWTObject(newObjID: string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void; + CreateDWTObject(newObjID: string, ip: number | string, port: number | string, portSSL: number | string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void; + Debug: boolean; + DeleteDWTObject(objID: string): void; + DynamicContainers: string[]; + DynamicDWTMap: {}; + GetWebTwain(cid: string): WebTwain; + IfUpdateService: boolean; + IfUseActiveXForIE10Plus: boolean; + JSVersion: string; + Load(): void; + + /*ignored + OnWebTwainInitMessage OnWebTwainNeedUpgrade OnWebTwainNeedUpgradeWebJavascript OnWebTwainNotFound OnWebTwainOldPluginNotAllowed + */ + + OnWebTwainPostExecute(): void; + OnWebTwainPreExecute(): void; + + /*ignored + OnWebTwainReady + */ + + PluginVersion: string; + ProductKey: string; + RegisterEvent(event: string, fn: (...args: any[]) => void): void; + RemoveAllAuthorizations(): void; + ResourcesPath: string; + ServerVersionInfo: string; + ShowDialog(_dialogWidth: number, _dialogHeight: number, _strDialogMessageWithHtmlFormat: string, _bChangeImage: boolean, bHideCloseButton: boolean): void; + Trial: boolean; + Unload(): void; + UseDefaultInstallUI: boolean; + initQueue: any[]; + inited: boolean; +} + +interface DynamsoftLib { + /*ignored + Addon_Events Addon_Sendback_Events AttachAndShowImage BIO DOM DynamicLoadAddonFuns DynamicWebTwain EnumMouseButton + Errors Events IntToColorStr LS OnGetImageByURL OnGetImageFromServer Path ProgressBar UI Uri + addEventListener ajax all appendMessage appendRichMessage aryControlLoadImage attachAddon attachProperty + base64 bio cancelFrome clearMessage closeAll closeProgress colorStrToInt config css currentStyle + debug*/ + + detect: { + /*ignored + OnCreatWS OnDetectNext OnWebTwainPostExecute OnWebTwainPreExecute StartWSByIPTimeoutId StartWSTimeoutId + aryReconnectSTwains arySTwains arySTwainsByIP bFirst bNeedUpgradeEvent bNoControlEvent bOK bPromptJSOrServerOutdated + cUrlIndex dcpCallbackType dcpStatus detectType getVersionArray global_dlg hideMask isDWTVersionLatest onNoControl + onNotAllowedForChrome ports scriptLoaded showMask starting tryTimes*/ + ssl: boolean; + }; + + /*ignored + detectButton dialog dialogShowStatus dlgProgress dlgRef drawBoxBorder drawImageWithHermite + each empty endsWith + */ + + env: { + WSSession: number, WSVersion: string, + bChrome: boolean, bEdge: boolean, bFileSystem: boolean, bFirefox: boolean, + bIE: boolean, bLinux: boolean, bMac: boolean, bSafari: boolean, bWin: boolean, bWin64: boolean, + basePath: string, iPluginLength: number, isX64: boolean, pathType: number, + strChromeVersion: string, strFirefoxVersion: string, strIEVersion: string + }; + + /*ignored + error escapeHtml escapeRegExp extend filter fireEvent fromUnicode get getColor getCss + getElDimensions getHex getHexColor getHttpUrl getLogger getOffset getRandom getRealPath getScript + getWS getWSUrl getWheelDelta globalEval guid hide html5 imageControlCount indexOf install + io isArray isBoolean isDef isFunction isLocalIP isNaN isNull isNumber isObject + isPlainObject isString isUndef isUndefined isWindow keys log main makeArray mix + needShowTwiceShowDialog nil noop now obj one page param parse parseHTML parser + product progressMessage ready removeEventListener replaceAll replaceControl show showProgress startWS + startWSByIP startsWith stopPropagation stringify style support switchEvent tmp toggle trim + type unEscapeHtml unparam upperCaseFirst urlDecode urlEncode utf8 win + ...other internal ones + */ + hideMask(): void; + showMask(): void; +} + +/** + * interface for a DWT container which basically defines a DIV on the page + */ +interface Container { + ContainerId: string; + Width: string | number; + Height: string | number; +} diff --git a/types/dwt/addon.ocr.d.ts b/types/dwt/addon.ocr.d.ts new file mode 100644 index 0000000000..5020d5eec3 --- /dev/null +++ b/types/dwt/addon.ocr.d.ts @@ -0,0 +1,192 @@ +declare enum EnumDWT_OCRLanguage { + OCRL_ENG = "eng", + OCRL_ARA = "ara", + OCRL_CHI_SIM = "chi_sim", + OCRL_CHI_TRA = "chi_tra", + OCRL_HIN = "hin", + OCRL_URD = "urd", + OCRL_SPA = "spa", + OCRL_FRA = "fra", + OCRL_MSA = "msa", + OCRL_IND = "ind", + OCRL_RUS = "rus", + OCRL_BEN = "ben", + OCRL_POR = "por", + OCRL_PAN = "pan", + OCRL_DEU = "deu", + OCRL_JPN = "jpn", + OCRL_FAS = "fas", + OCRL_SWA = "swa", + OCRL_JAV = "jav", + OCRL_TEL = "tel", + OCRL_TUR = "tur", + OCRL_KOR = "kor", + OCRL_MAR = "mar", + OCRL_TAM = "tam", + OCRL_VIE = "vie", + OCRL_ITA = "ita", + OCRL_THA = "tha" +} + +declare enum EnumDWT_OCRPageSetMode { + OCRPSM_OSD_ONLY = 0, + PSM_AUTO_OSD = 1, + PSM_AUTO_ONLY = 2, + PSM_AUTO = 3, + PSM_SINGLE_COLUMN = 4, + PSM_SINGLE_BLOCK_VERT_TEXT = 5, + PSM_SINGLE_BLOCK = 6, + PSM_SINGLE_LINE = 7, + PSM_SINGLE_WORD = 8, + PSM_CIRCLE_WORD = 9, + PSM_SINGLE_CHAR = 10 +} + +declare enum EnumDWT_OCROutputFormat { + OCROF_TEXT = 0, + OCROF_PDFPLAINTEXT = 1, + OCROF_PDFIMAGEOVERTEXT = 2, + OCROF_PDFPLAINTEXT_PDFX = 3, + OCROF_PDFIMAGEOVERTEXT_PDFX = 4 +} + +/** + * @class + */ +interface OCR { + /** + * Downloads and installs the ocr add-on on the local system. + * @method Dynamsoft.WebTwain#Download + * @param {string} remoteFile specifies the value of which frame to get. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + Download(remoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void; + + /** + * Downloads and deploys the OCR language package on the local system. + * @method Dynamsoft.WebTwain#DownloadLangData + * @param {string} remoteFile specifies the value of which frame to get. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + DownloadLangData(remoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void; + + /** + * Performs OCR on a given image. + * @method Dynamsoft.WebTwain#Read + * @param {number} sImageIndex Specifies the index of the image. + * @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess. + * @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure. + * @return {boolean} + */ + Recognize(sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void; + + /** + * Peforms OCR on the given rectangle on a specified image. + * @method Dynamsoft.WebTwain#ReadRect + * @param {number} sImageIndex Specifies the index of the image. + * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. + * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. + * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. + * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. + * @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess. + * @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure. + * @return {boolean} + */ + RecognizeRect(sImageIndex: number, left: number, top: number, right: number, bottom: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void; + + /** + * Performs OCR on one or multiple specified local file(s) directly. + * @method Dynamsoft.WebTwain#Read + * @param {string} fileNames Specifies the local paths of the target files. If multiple files are given, they should be separated by the '|' character. + * @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess. + * @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure. + * @return {boolean} + */ + RecognizeFile(fileNames: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void; + + /** + * Performs OCR on the currently selected images in the buffer. + * @method Dynamsoft.WebTwain#Read + * @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess. + * @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure. + * @return {boolean} + */ + RecognizeSelectedImages(optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void; + + /** + * Specifies a font to be used by OCR when Addon.OCR.SetIfUseDetectedFont is set to false. + * @method Dynamsoft.WebTwain#SetUnicodeFontName + * @param {string} name Specifies a font to be used by + * @return {boolean} + */ + SetUnicodeFontName(name: string): void; + + /** + * Returns the detected OCR font name. + * @method Dynamsoft.WebTwain#GetUnicodeFontName + * @return {string} Returns the detected OCR font name. + */ + GetUnicodeFontName(): void; + + /** + * Determines whether PDF output should use the fonts detected by the OCR system, or the default/provided fonts instead. + * @method Dynamsoft.WebTwain#SetIfUseDetectedFont + * @param {boolean} bValue By default this is true, indicating detected fonts should be used. The detected fonts must exist on the user's system for this to be successful. + * @return {boolean} + */ + SetIfUseDetectedFont(bValue: boolean): void; + + /** + * Returns whether PDF output should use the fonts detected by the OCR system, or the default/provided fonts instead. + * @method Dynamsoft.WebTwain#GetIfUseDetectedFont + * @return {boolean} Returns whether PDF output should use the fonts detected by the OCR system, or the default/provided fonts instead. + */ + GetIfUseDetectedFont(): void; + + /** + * Applies higher-level accuracy of OCR to the area of the image where the font size is bigger than the value set here. + * @method Dynamsoft.WebTwain#SetIfUseDetectedFont + * @param {number} nValue Specifies the font size base to apply the higher-level accracy OCR. The default value is 0 which means no regional accurate OCR is performed. + * @return {boolean} + */ + SetMinFontSizeforMoreAccurateResult(nValue: number): void; + + /** + * Returns the font size base to apply higher-level regional accarate OCR which is set through Addon.OCR.SetMinFontSizeforMoreAccurateResult. + * @method Dynamsoft.WebTwain#GetMinFontSizeforMoreAccurateResult + * @return {boolean} Returns the font size base to apply higher-level regional accarate OCR. If the return value is 0, it indicates no regional accurate OCR is performed. + */ + GetMinFontSizeforMoreAccurateResult(): void; + + /** + * Sets the target language for OCR operations. + * @method Dynamsoft.WebTwain#SetLanguage + * @param {string} value Specifies the target language for OCR operation. + * @return {boolean} + */ + SetLanguage(value: string): void; + + /** + * Sets the mode for OCR page layout analysis. Determines how pages are determined when processing OCR. + * @method Dynamsoft.WebTwain#SetPageSetMode + * @param {EnumDWT_OCRPageSetMode} value Specifies the OCR Page layout analysis mode. + * @return {boolean} + */ + SetPageSetMode(value: EnumDWT_OCRPageSetMode): void; + + /** + * Sets the OCR result format. Determines whether the OCR output is in text or PDF format. + * @method Dynamsoft.WebTwain#SetOutputFormat + * @param {EnumDWT_OCROutputFormat} value Specifies the OCR result format. + * @return {boolean} + */ + SetOutputFormat(value: EnumDWT_OCROutputFormat): void; +} + +interface WebTwainAddon { + OCR: OCR; +} diff --git a/types/dwt/addon.ocrp.d.ts b/types/dwt/addon.ocrp.d.ts new file mode 100644 index 0000000000..48931bea9d --- /dev/null +++ b/types/dwt/addon.ocrp.d.ts @@ -0,0 +1,164 @@ +interface Redaction { + FindText: string; + FindTextFlags: EnumDWT_OCRFindTextFlags.OCRFT_WHOLEWORD; + FindTextAction: EnumDWT_OCRFindTextAction.OCRFT_MARKFORREDACT; +} + +interface OCRZone { + left: number; + top: number; + right: number; + bottom: number; +} + +interface OCRReadPara { + STWAIN: WebTwain; + AjaxFunctionUrl: string; + FunctionName: string; + ImageIndex: number; + FileNames: string; + Type: string; + AryZone: number[]; + JsonString: string; + OnSuccess(): void; + OnFailure(): void; +} + +interface OCRError { + responseText: string; + errorString: string; +} + +interface Settings { + RecognitionModule: string; + Languages: string; + OutputFormat: EnumDWT_OCRProOutputFormat; + PDFVersion: EnumDWT_OCRProPDFVersion; + PDFAVersion: EnumDWT_OCRProPDFAVersion; + LicenseChecker: string; + Redaction: Redaction; +} + +interface DynamsoftLib { + NewRedaction(): Redaction; + NewOCRReadPara(): OCRReadPara; + NewOCRZone(): OCRZone; +} + +interface OCRProAddon { + NewOCRError(): OCRError; + NewOCRReadPara(): OCRReadPara; + NewOCRZone(): OCRZone; + NewSettings(): Settings; +} + +declare enum EnumDWT_OCRFindTextFlags { + OCRFT_WHOLEWORD = 1, + OCRFT_MATCHCASE = 2, + OCRFT_FUZZYMATCH = 4 +} +declare enum EnumDWT_OCRFindTextAction { + OCRFT_HIGHLIGHT = 0, + OCRFT_STRIKEOUT = 1, + OCRFT_MARKFORREDACT = 2 +} + +declare enum EnumDWT_OCRProOutputFormat { + OCRPFT_IOTPDF = "IOTPDF", + OCRPFT_IOTPDF_MRC = "IOTPDF_MRC", + OCRPFT_TXTCSV = "TXTCSV", + OCRPFT_TXTF = "TXTF", + OCRPFT_TXTS = "TXTS", + OCRPFT_XML = "XML" +} + +declare enum EnumDWT_OCRProPDFAVersion { + OCRPPDFAV_1A = "pdf/a-1a", + OCRPPDFAV_1B = "pdf/a-1b", + OCRPPDFAV_2A = "pdf/a-2a", + OCRPPDFAV_2B = "pdf/a-2b", + OCRPPDFAV_2U = "pdf/a-2u", + OCRPPDFAV_3A = "pdf/a-3a", + OCRPPDFAV_3B = "pdf/a-3b", + OCRPPDFAV_3U = "pdf/a-3u" +} + +declare enum EnumDWT_OCRProPDFVersion { + OCRPPDFV_0 = "1.0", + OCRPPDFV_1 = "1.1", + OCRPPDFV_2 = "1.2", + OCRPPDFV_3 = "1.3", + OCRPPDFV_4 = "1.4", + OCRPPDFV_5 = "1.5", + OCRPPDFV_6 = "1.6", + OCRPPDFV_7 = "1.7" +} + +declare enum EnumDWT_OCRProRecognitionModule { + OCRPM_AUTO = "AUTO", + OCRPM_MOSTACCURATE = "MOSTACCURATE", + OCRPM_BALANCED = "BALANCED", + OCRPM_FASTEST = "FASTEST" +} + +declare enum EnumDWT_OCRProType { + OCRDT_File = 0, + OCRDT_Index = 1 +} + +interface OCRPro { + /** + * Returns whether OCR Pro addon is installed + * @return {boolean} + */ + IsModuleInstalled(): boolean; + + /** + * Downloads and installs the ocr add-on on the local system. + * @param {string} remoteFile specifies the URL to download a ZIP which contains the OCR Pro addon + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. + * @return {void} + */ + Download(remoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void; + + /** + * Performs OCR on a given image. + * @param {number} sImageIndex Specifies the index of the image. + * @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess. + * @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure. + * @return {void} + */ + Recognize(sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void; + + /** + * Performs OCR on one or multiple specified local file(s) directly. + * @param {string} fileNames Specifies the local paths of the target files. If multiple files are given, they should be separated by the '|' character. + * @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess. + * @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure. + * @return {void} + */ + RecognizeFile(fileNames: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void; + + /** + * Peforms OCR on the given rectangle on a specified image. + * @param {number} sImageIndex Specifies the index of the image. + * @param {number[]} aryZone specifies the coordinates of the rectangle. + * @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess. + * @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure. + * @return {void} + */ + RecognizeRect(sImageIndex: number, aryZone: number[], optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void; + + /** + * Performs OCR on the currently selected images in the buffer. + * @param {function} AsyncSuccessFunc The function to call when OCR operation succeeds. Please refer to the function prototype OnOCRSuccess. + * @param {function} AsyncFailureFunc The function to call when OCR operation fails. Please refer to the function prototype OnOCRFailure. + * @return {void} + */ + RecognizeSelectedImages(optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void; +} + +interface WebTwainAddon { + OCRPro: OCRPro; +} diff --git a/types/dwt/addon.pdf.d.ts b/types/dwt/addon.pdf.d.ts index 6a2a8636ee..6f9ad5cec1 100644 --- a/types/dwt/addon.pdf.d.ts +++ b/types/dwt/addon.pdf.d.ts @@ -1,14 +1,3 @@ -/*! -* Dynamsoft WebTwain PDF Addon -* Based on Dynamsoft WebTwain JavaScript Intellisense -* Product: Dynamsoft Web Twain -* Web Site: http://www.dynamsoft.com -* -* Copyright 2018, Dynamsoft Corporation -* Author: Dynamsoft Support Team -* Version: 14.2 -*/ - declare enum EnumDWT_ConvertMode { CM_DEFAULT = 0, CM_RENDERALL = 1 @@ -73,7 +62,3 @@ interface PDF { interface WebTwainAddon { PDF: PDF; } - -interface WebTwain { - Addon: WebTwainAddon; -} diff --git a/types/dwt/addon.webcam.d.ts b/types/dwt/addon.webcam.d.ts new file mode 100644 index 0000000000..efb31cda3e --- /dev/null +++ b/types/dwt/addon.webcam.d.ts @@ -0,0 +1,334 @@ +/** -2400 to -2499 is webcam error code */ +declare enum EnumDWT_ErrorCode { + /** All error from directshow sdk */ + WCERR_SYSTEM = -2400, + /** Create ICreateDevEnum interface failed. */ + WCERR_FAIL_ICREATEDEVENUM = -2401, + /** Create IEnumMoniker interface failed. */ + WCERR_FAIL_IENUMMONIKER = -2402, + /** The camera doesn't support IAMVideoProcAmp interface. */ + WCERR_NOT_IAMVIDEOPROPERTY = -2403, + /** The camera doesn't support IAMCameraControl interface. */ + WCERR_NOT_IAMCAMERACONTROL = -2404, + /** The property doesn't support auto capability. */ + WCERR_NOT_AUTOPROPERTY = -2405, + /** No webcam device is found. */ + WCERR_NO_DEVICE = -2406, + /** Could not get video window interface */ + WCERR_FAIL_VIDEOWINDOW = -2407, + /** Could not create filter graph. */ + WCERR_FAIL_FILTERGRAPH = -2408, + /** Could not create SampleGrabber (isqedit.all registered?). */ + WCERR_FAIL_SAMPLEGRABBER = -2409, + /** Unable to make NULL renderer */ + WCERR_NULLRENDER = -2410, + /** Can't add the filter to graph */ + WCERR_FAIL_ADDFILTER = -2411, + /** Can't build the graph */ + WCERR_FAIL_BUILDGRAPH = -2412, + /** Failed to register filter graph with ROT. */ + WCERR_FAIL_REGFILTERGRAPH = -2413, + /** Time out */ + WCERR_GRAB_TIMEOUT = -2414 +} + +/** Specifies the video rotate mode on a video capture device. */ +declare enum EnumDWT_VideoRotateMode { + /** Don't rotate */ + VRM_NONE = 0, + /** 90 deg Clockwise */ + VRM_90_DEGREES_CLOCKWISE = 1, + /** 180 deg Clockwise */ + VRM_180_DEGREES_CLOCKWISE = 2, + /** 270 deg Clockwise */ + VRM_270_DEGREES_CLOCKWISE = 3, + /** Flip */ + VRM_FLIP_VERTICAL = 4, + /** Mirror */ + VRM_FLIP_HORIZONTAL = 5 +} + +/** Specifies video properties on a video capture device. */ +declare enum EnumDWT_VideoProperty { + /** Specifies the brightness, also called the black level. For NTSC, the value is expressed in IRE units * 100. + * For non-NTSC sources, the units are arbitrary, with zero representing blanking and 10,000 representing pure white. + * Values range from -10,000 to 10,000. + */ + VP_BRIGHTNESS = 0, + /** Specifies the contrast, expressed as gain factor * 100. Values range from zero to 10,000. */ + VP_CONTRAST = 1, + /** Specifies the hue, in degrees * 100. Values range from -180,000 to 180,000 (-180 to +180 degrees). */ + VP_HUE = 2, + /** Specifies the saturation. Values range from 0 to 10,000. */ + VP_SATURATION = 3, + /** Specifies the sharpness. Values range from 0 to 100. */ + VP_SHARPNESS = 4, + /** Specifies the gamma, as gamma * 100. Values range from 1 to 500. */ + VP_GAMMA = 5, + /** Specifies the color enable setting. The possible values are 0 (off) and 1 (on). */ + VP_COLORENABLE = 6, + /** Specifies the white balance, as a color temperature in degrees Kelvin. The range of values depends on the device. */ + VP_WHITEBALANCE = 7, + /** Specifies the backlight compensation setting. Possible values are 0 (off) and 1 (on). */ + VP_BACKLIGHTCOMPENSATION = 8, + /** Specifies the gain adjustment. Zero is normal. Positive values are brighter and negative values are darker. + * The range of values depends on the device. + */ + VP_GAIN = 9 +} + +/** Specifies a setting on a camera. */ +declare enum EnumDWT_CameraControlProperty { + /** Specifies the camera's pan setting, in degrees. Values range from -180 to +180, with the default set to zero. + * Positive values are clockwise from the origin (the camera rotates clockwise when viewed from above), + * and negative values are counterclockwise from the origin. + */ + CCP_PAN = 0, + /** Specifies the camera's tilt setting, in degrees. Values range from -180 to +180, with the default set to zero. + * Positive values point the imaging plane up, and negative values point the imaging plane down. + */ + CCP_TILT = 1, + /** Specifies the camera's roll setting, in degrees. Values range from -180 to +180, with the default set to zero. + * Positive values cause a clockwise rotation of the camera along the image-viewing axis, and negative values cause a counterclockwise rotation of the camera. + */ + CCP_ROLL = 2, + /** Specifies the camera's zoom setting, in millimeters. Values range from 10 to 600, and the default is specific to the device. */ + CCP_ZOOM = 3, + /** Specifies the exposure setting, in log base 2 seconds. In other words, for values less than zero, the exposure time is 1/2^n seconds, + * and for values zero or above, the exposure time is 2^n seconds. For example: + * Value Seconds + * -3 1/8 + * -2 1/4 + * -1 1/2 + * 0 1 + * 1 2 + * 2 4 + */ + CCP_EXPOSURE = 4, + /** Specifies the camera's iris setting, in units of fstop* 10. */ + CCP_IRIS = 5, + /** Specifies the camera's focus setting, as the distance to the optimally focused target, in millimeters. + * The range and default value are specific to the device. + */ + CCP_FOCUS = 6 +} + +interface WebcamMediaType { + GetCount(): number; + Get(index: number): string; + GetCurrent(): string; +} + +interface WebcamResolution { + GetCount(): number; + Get(index: number): string; + GetCurrent(): string; +} + +interface WebcamFrameRate { + GetCount(): number; + Get(index: number): string; + GetCurrent(): string; +} + +interface CameraControlMoreSetting { + GetMinValue(): number; + GetMaxValue(): number; + GetSteppingDelta(): number; + GetDefaultValue(): number; + GetIfAuto(): boolean; +} + +interface CameraControlSetting { + GetValue(): number; + GetIfAuto(): boolean; +} + +interface VideoPropertyMoreSetting { + GetMinValue(): number; + GetMaxValue(): number; + GetSteppingDelta(): number; + GetDefaultValue(): number; + GetIfAuto(): boolean; +} + +interface VideoPropertySetting { + GetValue(): number; + GetIfAuto(): boolean; +} + +/** + * @class + */ +interface Webcam { + IsModuleInstalled(): boolean; + GetFramePartURL(): string; + GetFrameURL(): string; + + /** + * Download and install webcam add-on on the local system. + * @method Dynamsoft.WebTwain#Download + * @param {string} remoteFile:string specifies the value of which frame to get. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + Download(remoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: () => void): void; + + /** + * Return supported webcam source names. + * @method Dynamsoft.WebTwain#GetSourceList + * @return {string array} + */ + GetSourceList(): string[]; + + /** + * Select the source with the specified name. + * @method Dynamsoft.WebTwain#SelectSource + * @param {string} strSourceName The source name. + * @return {boolean} + */ + SelectSource(strSourceName: string): boolean; + + /** + * Close the selected source and release the webcam. + * @method Dynamsoft.WebTwain#CloseSource + * @return {boolean} + */ + CloseSource(): boolean; + + /** + * Show video stream in a specified container + * @method Dynamsoft.WebTwain#StopVideo + * @param {WebTwain} DWObject Specifies the WebTwain Object. + * @param {number} quality Specifies the quality of each frame in the video stream. Only valid for the HTML5 edition. + * @param {function} onFrameCaptured callback of the operation to capture + * @return {void} + */ + PlayVideo(DWObject: WebTwain, quality: number, onFrameCaptured: () => void): void; + + /** + * Stop the video stream in the specified container + * @method Dynamsoft.WebTwain#StopVideo + * @return {boolean} + */ + StopVideo(): boolean; + + /** + * Capture image from the specified webcam. + * @method Dynamsoft.WebTwain#CaptureImage + * @param {function} OnCaptureSuccess he function to call when the capture succeeds. Please refer to the function prototype OnCaptureSuccess. + * @param {function} OnCaptureError The function to call when the capture fails. Please refer to the function prototype OnCaptureError. + * @return {void} + */ + CaptureImage(OnCaptureSuccess: () => void, OnCaptureError: () => void): void; + + /** + * Returns the media type for a camera. + * @method Dynamsoft.WebTwain#GetMediaType + * @return {class MediaType} + */ + GetMediaType(): WebcamMediaType; + + /** + * Returns the count in the media type list. + * @method Dynamsoft.WebTwain#GetResolution + * @return {class Resolution} + */ + GetResolution(): WebcamResolution; + + /** + * Returns the frame rate for a camera. + * @method Dynamsoft.WebTwain#GetFrameRate + * @return {class FrameRate} + */ + GetFrameRate(): WebcamFrameRate; + + /** + * Set the media type of the current selected source by the value. + * @method Dynamsoft.WebTwain#SetMediaType + * @param {string} value The new media type value. + * @return {boolean} + */ + SetMediaType(value: string): boolean; + + /** + * Set the resolution of the current camera source. + * @method Dynamsoft.WebTwain#SetResolution + * @param {string} value The new resolution value. + * @return {boolean} + */ + SetResolution(value: string): boolean; + + /** + * Set current frame rate. + * @method Dynamsoft.WebTwain#SetFrameRate + * @param {number} value The new frame rate value. + * @return {boolean} + */ + SetFrameRate(value: number): boolean; + + /** + * Gets the current setting of a video property. + * @method Dynamsoft.WebTwain#GetVideoPropertySetting + * @param {EnumDWT_VideoProperty} property The property. + * @return {class VideoPropertySetting} + */ + GetVideoPropertySetting(property: EnumDWT_VideoProperty): VideoPropertySetting; + + /** + * Gets the range and default value of a specified video property. + * @method Dynamsoft.WebTwain#GetVideoPropertyMoreSetting + * @param {EnumDWT_VideoProperty} property The property. + * @return {class VideoPropertyMoreSetting} + */ + GetVideoPropertyMoreSetting(property: EnumDWT_VideoProperty): VideoPropertyMoreSetting; + + /** + * Gets the current setting of a camera property. + * @method Dynamsoft.WebTwain#GetCameraControlPropertySetting + * @param {EnumDWT_CameraControlProperty} property The property. + * @return {class CameraControlPropertySetting} + */ + GetCameraControlPropertySetting(property: EnumDWT_CameraControlProperty): CameraControlSetting; + + /** + * Gets the range and default value of a specified camera property. + * @method Dynamsoft.WebTwain#GetVideoPropertyMoreSetting + * @param {EnumDWT_CameraControlProperty} property The property. + * @return {class CameraControlPropertyMoreSetting} + */ + GetCameraControlPropertyMoreSetting(property: EnumDWT_CameraControlProperty): CameraControlMoreSetting; + + /** + * Sets video quality for a specified property. + * @method Dynamsoft.WebTwain#SetVideoPropertySetting + * @param {EnumDWT_VideoProperty} property The property. + * @param {number} value The new value of the property. + * @param {boolean} auto The desired control setting, whether the setting is controlled manually or automatically. + * @return {boolean} + */ + SetVideoPropertySetting(property: EnumDWT_VideoProperty, value: number, auto: boolean): boolean; + + /** + * Sets video rotate mode. + * @method Dynamsoft.WebTwain#SetVideoRotateMode + * @param {EnumDWT_VideoRotateMode} enumAngle The rotate angle. + * @return {boolean} + */ + SetVideoRotateMode(enumAngle: EnumDWT_VideoRotateMode): boolean; + + /** + * Sets a specified property on the camera. + * @method Dynamsoft.WebTwain#SetCameraControlPropertySetting + * @param {EnumDWT_CameraControlProperty} property The property. + * @param {number} value The new value of the property. + * @param {boolean} auto The desired control setting, whether the setting is controlled manually or automatically. + * @return {boolean} + */ + SetCameraControlPropertySetting(property: EnumDWT_CameraControlProperty, value: number, auto: boolean): boolean; +} + +interface WebTwainAddon { + Webcam: Webcam; +} diff --git a/types/dwt/dbr.d.ts b/types/dwt/dbr.d.ts new file mode 100644 index 0000000000..e8d8f6addc --- /dev/null +++ b/types/dwt/dbr.d.ts @@ -0,0 +1,192 @@ +interface RunTimeSetting { + mAntiDamageLevel: number; + mBarcodeFormatIds: number; + mBarcodeInvertMode: number; + mBinarizationBlockSize: number; + mColourImageConvertMode: number; + mDeblurLevel: number; + mEnableFillBinaryVacancy: number; + mExpectedBarcodesCount: number; + mGrayEqualizationSensitivity: number; + mLocalizationAlgorithmPriority: string; + mMaxAlgorithmThreadCount: number; + mMaxBarcodesCount: number; + mMaxDimOfFullImageAsBarcodeZone: number; + mPDFRasterDPI: number; + mRegionPredetectionMode: number; + mReserved: string; + mScaleDownThreshold: number; + mTextFilterMode: number; + mTextureDetectionSensitivity: number; + mTimeout: number; +} + +interface dbrEnv { + bAutoConnectService: boolean; + logLevel: number; + productKey: string; + resourcesPath: string; + onAutoConnectServiceSuccess(): void; + onAutoConnectServiceError(status: any): void; +} + +declare namespace dynamsoft { + let TaskQueue: TaskQueue; + let dbrEnv: dbrEnv; + /**dbrMasterPage20170526 */ + let dcp: { + ifCheck64bitServiceFirst: boolean; + }; + /**dwtDbrDemo20170613 */ + let initOrder: any; + let lib: any; + let managerEnv: any; + let navInfo: any; + namespace BarcodeReader { + /** Barcode Formats */ + enum EnumBarcodeFormat { + All = 503317503, + OneD = 0x3FF, + CODE_39 = 0x1, + CODE_128 = 0x2, + CODE_93 = 0x4, + CODABAR = 0x8, + ITF = 0x10, + EAN_13 = 0x20, + EAN_8 = 0x40, + UPC_A = 0x80, + UPC_E = 0x100, + INDUSTRIAL_25 = 0x200, + PDF417 = 0x2000000, + QR_CODE = 0x4000000, + DATAMATRIX = 0x8000000, + AZTEC = 0x10000000 + } + + enum EnumErrorCode { + DBR_SYSTEM_EXCEPTION = 1, + DBR_SUCCESS = 0, + DBR_UNKNOWN = -10000, + DBR_NO_MEMORY = -10001, + DBR_NULL_REFERENCE = -10002, + DBR_LICENSE_INVALID = -10003, + DBR_LICENSE_EXPIRED = -10004, + DBR_FILE_NOT_FOUND = -10005, + DBR_FILETYPE_NOT_SUPPORTED = -10006, + DBR_BPP_NOT_SUPPORTED = -10007, + DBR_INDEX_INVALID = -10008, + DBR_BARCODE_FORMAT_INVALID = -10009, + DBR_CUSTOM_REGION_INVALID = -10010, + DBR_MAX_BARCODE_NUMBER_INVALID = -10011, + DBR_IMAGE_READ_FAILED = -10012, + DBR_TIFF_READ_FAILED = -10013, + DBR_QR_LICENSE_INVALID = -10016, + DBR_1D_LICENSE_INVALID = -10017, + DBR_DIB_BUFFER_INVALID = -10018, + DBR_PDF417_LICENSE_INVALID = 10019, + DBR_DATAMATRIX_LICENSE_INVALID = -10020, + DBR_PDF_READ_FAILED = -10021, + DBR_PDF_DLL_MISSING = -10022, + DBR_PAGE_NUMBER_INVALID = -10023, + DBR_CUSTOM_SIZE_INVALID = -10024, + DBR_CUSTOM_MODULESIZE_INVALID = -10025, + DBR_RECOGNITION_TIMEOUT = -10026, + DBR_JSON_PARSE_FAILED = -10030, + DBR_JSON_TYPE_INVALID = -10031, + DBR_JSON_KEY_INVALID = -10032, + DBR_JSON_VALUE_INVALID = -10033, + DBR_JSON_NAME_KEY_MISSING = -10034, + DBR_JSON_NAME_VALUE_DUPLICATED = -10035, + DBR_TEMPLATE_NAME_INVALID = -10036, + DBR_JSON_NAME_REFERENCE_INVALID = -10037, + DBR_PARAMETER_VALUE_INVALID = 10038, + DBR_DOMAIN_NOT_MATCHED = -10039, + DBR_RESERVEDINFO_NOT_MATCHED = -10040, + DBR_DBRERR_AZTEC_LICENSE_INVALID = -10041 + } + enum EnumConflictMode { + ECM_Ignore = 1, + ECM_Overwrite = 2 + } + enum EnumImagePixelFormat { + IPF_Binary = 0, + IPF_BinaryInverted = 1, + IPF_GrayScaled = 2, + IPF_NV21 = 3, + IPF_RGB_565 = 4, + IPF_RGB_555 = 5, + IPF_RGB_888 = 6, + IPF_ARGB_8888 = 7 + } + enum EnumResultType { + EDT_CandidateText = 2, + EDT_PartialText = 3, + EDT_RawText = 1, + EDT_StandardText = 0 + } + enum EnumTerminateStage { + ETS_Localized = 1, + ETS_Prelocalized = 0, + ETS_Recognized = 2 + } + } + + class BarcodeReader { + static BarcodeReaderException(): any; + static initServiceConnection(): Promise; + static name: string; + static length: number; + static version: string; + // appendTplStringToRuntimeSettings(b, d): + /** + * Read barcode from the source image. + * @method BarcodeReader#decode + * @param {string} source specifies the image to read on + * @return {Promise} + * @example + ```javascript + // dwtUrl: HTML5 Edition only + reader.decode('dwt://dwt_trial_13000404/img?id=306159652&index=0&t=1502184632022').then( + results=>{ + for(var i = 0; i < results.length; ++i){ + console.log(results[i].BarcodeText); + // Confidence >= 30 is reliable + console.log(results[i].LocalizationResult.ExtendedResultArray[0].Confidence); + } + }); + // dcsUrl + reader.decode('dcs://dcs_trial_6110531/img?id=306159652&index=0&t=1502184632022').then( + function(results){ + // ie6-7 does not support console.log + var messageArr = []; + for(var i = 0; i < results.length; ++i){ + messageArr.push(results[i].BarcodeText); + // Confidence >= 30 is reliable + messageArr.push(results[i].LocalizationResult.ExtendedResultArray[0].Confidence); + } + alert(messageArr.join('')); + })['catch'](function(ex){ + // ie6-9 does not support '.catch(function(ex){...})' + if(ex){alert(ex.message||ex);} + }); + ``` + */ + decode(source: string): Promise; + + /** + * Read barcode from base64 string + */ + decodeBase64String(base64String: string): Promise; + getAllLocalizationResults(): any; + getAllParameterTemplateNames(): any; + getRuntimeSettings(): RunTimeSetting; + initRuntimeSettingsWithString(): any; + outputSettingsToString(): any; + resetRuntimeSettings(): void; + updateRuntimeSettings(setting: RunTimeSetting): void; + /** + * Constructs a new barcode reader + */ + constructor(dbrKey?: string); + } +} diff --git a/types/dwt/v12/index.d.ts b/types/dwt/dwt.d.ts similarity index 77% rename from types/dwt/v12/index.d.ts rename to types/dwt/dwt.d.ts index cc0d1f8079..28f7bf567e 100644 --- a/types/dwt/v12/index.d.ts +++ b/types/dwt/dwt.d.ts @@ -1,64 +1,2397 @@ -// Type definitions for dwt 12.3 -// Project: http://www.dynamsoft.com/Products/WebTWAIN_Overview.aspx -// Definitions by: Xiao Ling -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// properties (get/set) / sync functions +interface WebTwain { + Addon: WebTwainAddon; -/*! -* Dynamsoft WebTwain JavaScript Intellisense -* Product: Dynamsoft Web Twain -* Web Site: http://www.dynamsoft.com -* -* Copyright 2017, Dynamsoft Corporation -* Author: Dynamsoft Support Team -* Version: 12.3 -*/ + /** + * Returns whether the instance of a DWT is initialized + * @type {boolean} + */ + bReady: boolean; -/** - * @namespace Dynamsoft - */ -declare namespace Dynamsoft { - namespace WebTwainEnv { - function GetWebTwain (cid: string): WebTwain; - function RegisterEvent(event: string, fn: () => void): void; - } -} - -/** ICAP_PIXELTYPE values (PT_ means Pixel Type) */ -declare enum EnumDWT_PixelType { - TWPT_BW = 0, - TWPT_GRAY = 1, - TWPT_RGB = 2, - TWPT_PALLETE = 3, - TWPT_CMY = 4, - TWPT_CMYK = 5, - TWPT_YUV = 6, - TWPT_YUVK = 7, - TWPT_CIEXYZ = 8, - TWPT_LAB = 9, - TWPT_SRGB = 10, - TWPT_SCRGB = 11, - TWPT_INFRARED = 16 + /** + * Returns the runtime id of the dwt object + * @type {string} + */ + readonly clientId: string; + + /** + * Returns the runtime class for the dwt container DIV + * @type {string} + */ + containerClass: string; + + /*ignored + httpUrl + objectName + + ...other internal ones + */ + + /* + * Properties + */ + + /** + * Returns or sets whether multi-page selection is supported. + * @type {boolean} + */ + AllowMultiSelect: boolean; + + /** + * [Deprecated.] Returns or sets whether allowing the plugin to send authentication request. The default value of this property is TRUE. + * @type {boolean} + */ + AllowPluginAuthentication: boolean; + + /** + * [Deprecated.] Returns or sets whether the async mode is activated. With this mode, Dynamic Web TWAIN is able to upload/download files via HTTP/FTP asynchronously. The default value is false. + * @type {boolean} + */ + AsyncMode: boolean; + + /** + * Returns or sets the background color of the main control. It is a value specifying the 24-bit RGB value. + * @type {number} + */ + BackgroundColor: number; + + /** + * Returns or sets the fill color of the selected area of an image when it is cut, erased or rotated. It is a value specifying the 24-bit RGB value. + * @type {number} + */ + BackgroundFillColor: number; + + /** + * Returns or sets the pixel bit depths for the current value of PixelType property. This is a runtime property. + * @type {number} + */ + BitDepth: number; + + /** + * Returns the current deviation of the pixels in the image. + * @type {number} + */ + readonly BlankImageCurrentStdDev: number; + + /** + * Returns or sets the standard deviation of the pixels in the image. + * @type {number} + */ + BlankImageMaxStdDev: number; + + /** + * Returns or sets the dividing line between black and white. The default value is 128. + * @type {number} + */ + BlankImageThreshold: number; + + /** + * [Deprecated.] Returns or sets the border style. + * @type {EnumDWT_BorderStyle} + */ + BorderStyle: EnumDWT_BorderStyle; + + /** + * Returns or sets the brightness values available within the Source. This is a runtime property. + * @type {number} + */ + Brightness: number; + + /** + * [Deprecated.] Sets or returns whether brokerprocess is enabled for scanning. + * @type {number} + */ + BrokerProcessType: number; + + /** + * Sets or returns how much physical memory is allowed for storing images currently loaded in Dynamic Web TWAIN. Once the limit is reached, images will be cached on the hard disk. + * @type {number} + */ + BufferMemoryLimit: number; + + /** + * Sets or returns the index (0-based) of a list to indicate the Current Value when the value of the CapType property is TWON_ENUMERATION. If the data type of the capability is String, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime property. + * @type {number} + */ + CapCurrentIndex: number; + + /** + * Sets or returns the current value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. + * @type {number} + */ + CapCurrentValue: number; + + /** + * Returns the index (0-based) of a list to indicate the Default Value when the value of the CapType property is TWON_ENUMERATION. If the data type of the capability is String, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime, read-only property. + * @type {number} + */ + readonly CapDefaultIndex: number; + + /** + * Returns the default value in a range when the value of the CapType property is TWON_RANGE. This is a runtime, read-only property. + * @type {number} + */ + CapDefaultValue: number; + + /** + * Retruns the description for a capability + * @type {string} + */ + CapDescription: string; + + /** + * Sets or returns the maximum value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. + * @type {number} + */ + CapMaxValue: number; + + /** + * Sets or returns the minimum value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. + * @type {number} + */ + CapMinValue: number; + + /** + * [Deprecated.] Sets or returns how many items are in the list when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. For String data type, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime property. + * @type {number} + */ + CapNumItems: number; + + /** + * Sets or returns the step size in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. + * @type {number} + */ + CapStepSize: number; + + /** + * Sets or returns the type of capability container used to exchange capability information between application and source. This is a runtime property. + * @type {EnumDWT_CapType} + */ + CapType: EnumDWT_CapType; + + /** + * Returns or sets the value of the capability specified by Capability property when the value of the CapType property is TWON_ONEVALUE. This is a runtime property. + * @type {number} + */ + CapValue: number; + + /** + * Sets or returns the string value for a capability when the value of the CapType property is TWON_ONEVALUE. This is a runtime property. + * @type {string} + */ + CapValueString: string; + + /** + * Sets or returns the value type for reading the value of a capability. This is a runtime property. + * @type {number} + */ + CapValueType: number; + + /** + * Specifies the capabiltiy to be negotiated. This is a runtime property. + * @type {EnumDWT_Cap} + */ + Capability: EnumDWT_Cap; + + /** + * Returns or sets the contrast values available within the Source. This is a runtime property. + * @type {number} + */ + Contrast: number; + + /** + * Returns or sets current index of image in buffer. This is a runtime property. + * @type {number} + */ + CurrentImageIndexInBuffer: number; + + /** + * Returns the device name of current source. This is a runtime, read-only property. + * @type {string} + */ + readonly CurrentSourceName: string; + + /** + * Returns the value indicating the data source status. This is a runtime, read-only property. + * @type {number} + */ + readonly DataSourceStatus: number; + + /** + * Returns the device name of default source. This is a runtime, read-only property. + * @type {string} + */ + readonly DefaultSourceName: string; + + /** + * Returns whether the source supports duplex. If so, it further returns the level of duplex the Source supports (one pass or two pass duplex). This is a runtime, read-only property. + * @type {EnumDWT_DUPLEX} + */ + readonly Duplex: EnumDWT_DUPLEX; + + /** + * [Deprecated.] Returns or sets whether the user can zoom image using hot key. + * @type {boolean} + */ + EnableInteractiveZoom: boolean; + + /** + * Returns the error code. This is a runtime, read-only property. + * @type {number} + */ + readonly ErrorCode: number; + + /** + * Returns the error string. This is a runtime, read-only property. + * @type {string} + */ + readonly ErrorString: string; + + /** + * Returns or sets the password used to log into the FTP server. + * @type {string} + */ + FTPPassword: string; + + /** + * Returns or sets the port number of the FTP server. + * @type {number} + */ + FTPPort: number; + + /** + * Returns or sets the user name used to log into the FTP server. + * @type {string} + */ + FTPUserName: string; + + /** + * Returns or sets whether to resize the image to fit the image to the width or height of the window. To use the property, the view mode should be set to -1 by -1. You can use SetViewMode method to set the view mode. + * @type {EnumDWT_FitWindowType} + */ + FitWindowType: EnumDWT_FitWindowType; + + /** + * Returns the response string from the HTTP server if an error occurs for HTTPUploadThroughPost() method. This is a runtime, read-only property. + * @type {string} + */ + readonly HTTPPostResponseString: string; + + /** + * Returns whether a HTTP request has credentials + * @type {boolean} + */ + HTTPRequestswithCredentials: boolean; + + /** + * Returns or sets the height of the dwt viewer object + * @type {string|number} + */ + Height: string | number; + + /** + * Returns how many images are in buffer. This is a runtime, read-only property. + * @type {number} + */ + readonly HowManyImagesInBuffer: number; + + /** + * Specifies the content type of a http upload. + * @type {string} + */ + HttpContentTypeFieldValue: string; + + /** + * Specifies the field name of uploaded image through POST. + * @type {string} + */ + HttpFieldNameOfUploadedImage: string; + + /** + * [Deprecated.] Sets or returns the password used to log into the HTTP server. + * @type {string} + */ + HTTPPassword: string; + + /** + * Returns or sets the port number of the HTTP server. + * @type {number|string} + */ + HTTPPort: number | string; + + /** + * [Deprecated.] Returns or sets the user name used to log into the HTTP server. + * @type {string} + */ + HTTPUserName: string; + + /** + * Returns or sets whether the feature of disk caching is enabled. + * @type {boolean} + */ + IfAllowLocalCache: boolean; + + /** + * Returns or sets whether insert or append new scanned images. + * @type {boolean} + */ + IfAppendImage: boolean; + + /** + * Returns or sets whether the Source's Auto-brightness function is enabled. This is a runtime property. + * @type {boolean} + */ + IfAutoBright: boolean; + + /** + * Returns or sets whether the data source (scanner) will discard blank images during scanning. The property works only if the device and its driver support discarding blank pages. You can find whether your device supports this capbility from its user manual. Or, you can use the built-in methods of Dynamic Web TWAIN to detect blank images: IsBlankImage, IsBlankImageEx. + * @type {boolean} + */ + IfAutoDiscardBlankpages: boolean; + + /** + * Returns or sets whether the Source enable automatic document feeding process. This is a runtime property. + * @type {boolean} + */ + IfAutoFeed: boolean; + + /** + * Returns or sets whether the Source enables the automatic document scanning process. This is a runtime property. + * @type {boolean} + */ + IfAutoScan: boolean; + + /** + * Specifies whether or not to automatically scroll to the last image or stay on the current image when loading or acquiring images + * @type {boolean} + */ + IfAutoScroll: boolean; + + /** + * Turns automatic border detection on and off. The property works only if the device and its driver support detecting the border automatically. You can find whether your device supports this capbility from its user manual. + * @type {boolean} + */ + IfAutomaticBorderDetection: boolean; + + /** + * Turns automatic skew correction on and off. + * @type {boolean} + */ + IfAutomaticDeskew: boolean; + + /** + * Returns or sets whether close the Data Source User Interface after acquire all images. Default value of this property is FALSE. + * @type {boolean} + */ + IfDisableSourceAfterAcquire: boolean; + + /** + * Returns or sets whether the Source supports duplex. If TRUE, the scanner scans both sides of a paper; otherwise, the scanner will scan only one side of the image. This is a runtime property. + * @type {boolean} + */ + IfDuplexEnabled: boolean; + + /** + * Returns or sets whether the Automatic Document Feeder (ADF) is enabled. This is a runtime property. + * @type {boolean} + */ + IfFeederEnabled: boolean; + + /** + * Returns whether or not there are documents loaded in the Source's feeder when IfFeederEnabled and IfPaperDetectable are TRUE. This is a runtime, read-only property. + * @type {boolean} + */ + readonly IfFeederLoaded: boolean; + + /** + * Returns or sets whether to resize the image to fit the size of window when the view mode is set to -1 by -1. You can use SetViewMode method to set the view mode. + * @type {boolean} + */ + IfFitWindow: boolean; + + /** + * [Deprecated.] Returns or sets whether the UI (User Interface) of Source runs in modal state. Default value of this property is TRUE. + * @type {boolean} + */ + IfModalUI: boolean; + + /** + * Sets or returns whether Dynamic Web TWAIN uses Graphics Device Interface (GDI) when decoding images. + * @type {boolean} + */ + IfOpenImageWithGDIPlus: boolean; + + /** + * Returns or sets whether FTP passive mode is enabled. + * @type {boolean} + */ + IfPASVMode: boolean; + + /** + * Returns the value whether the Source has a paper sensor that can detect documents on the ADF or Flatbed. This is a runtime, read-only property. + * @type {boolean} + */ + readonly IfPaperDetectable: boolean; + + /** + * Returns or sets whether SSL is used when uploading or downloading images. + * @type {boolean} + */ + IfSSL: boolean; + + /** + * [Deprecated.] Returns or sets whether communicate with device in a separate thread. Default value of this property is FALSE. + * @type {boolean} + */ + IfScanInNewThread: boolean; + + /** + * Sets or returns whether to show the cancel dialog when uploading images to server. + * @type {boolean} + */ + IfShowCancelDialogWhenImageTransfer: boolean; + + /** + * Returns or sets whether to show the file dialog box when saving scanned images or loading images from local folder. + * @type {boolean} + */ + IfShowFileDialog: boolean; + + /** + * Returns or sets whether the Source displays a progress indicator during acquisition and transfer, regardless of whether the Source's user interface is active. This is a runtime property. + * @type {boolean} + */ + IfShowIndicator: boolean; + + /** + * [Deprecated.] Returns or sets whether the driver of the printer displays the User Interface. + * @type {boolean} + */ + IfShowPrintUI: boolean; + + /** + * Returns or sets whether the progress bar will be displayed during the transaction. This is a runtime property. + * @type {boolean} + */ + IfShowProgressBar: boolean; + + /** + * Returns or sets whether the Source displays the User Interface. + * @type {boolean} + */ + IfShowUI: boolean; + + /** + * Returns or sets whether to throw exceptions + * @type {boolean} + */ + IfThrowException: boolean; + + /** + * Return or sets whether the Source allows to save many images in one TIFF file. The default value is FALSE. + * @type {boolean} + */ + IfTiffMultiPage: boolean; + + /** + * Returns whether the Source supports acquisition with the UI (User Interface) disabled. If FALSE, indicates that this Source can only support acquisition with the UI enabled. This is a runtime, read-only property. + * @type {boolean} + */ + readonly IfUIControllable: boolean; + + /** + * Sets or returns whether Dynamic Web TWAIN uses the new TWAIN Data Source Manager (TWAINDSM.dll) when acquiring images from TWAIN devices. + * @type {boolean} + */ + IfUseTwainDSM: boolean; + + /** + * [Deprecated.] The number of bits in each image pixel (or bit depth). This is a runtime, read-only property. + * @type {number} + */ + ImageBitsPerPixel: number; + + /** + * Returns or sets whether a TWAIN driver or Native Scan of Mac OS X is used for document scanning. This property works for Mac edition only. + * @type {number} + */ + ImageCaptureDriverType: number; + + /** + * [Deprecated.] Returns or sets whether the image enumerator is enabled in Image Editor. + * @type {boolean} + */ + ImageEditorIfEnableEnumerator: boolean; + + /** + * [Deprecated.] Returns or sets whether the Image Editor is a modal window. + * @type {boolean} + */ + ImageEditorIfModal: boolean; + + /** + * [Deprecated.] Returns or sets whether the Image Editor is read-only. + * @type {boolean} + */ + ImageEditorIfReadonly: boolean; + + /** + * [Deprecated.] Returns or sets the title of Image Editor window. + * @type {string} + */ + ImageEditorWindowTitle: string; + + /** + * Returns the document number of the current image. This is a runtime, read-only property. + * @type {number} + */ + readonly ImageLayoutDocumentNumber: number; + + /** + * Returns the value of the bottom-most edge of the current image frame (in Unit). This is a read-only runtime property. + * @type {number} + */ + readonly ImageLayoutFrameBottom: number; + + /** + * Returns the value of the left-most edge of the current image frame (in Unit). This is a runtime, read-only property. + * @type {number} + */ + readonly ImageLayoutFrameLeft: number; + + /** + * Returns the frame number of the current image. This is a runtime, read-only property. + * @type {number} + */ + readonly ImageLayoutFrameNumber: number; + + /** + * Returns the value of the right-most edge of the current image frame (in Unit). This is a runtime, read-only property. + * @type {number} + */ + readonly ImageLayoutFrameRight: number; + + /** + * Returns the value of the top-most edge of the current image frame (in Unit). This is a runtime, read-only property. + * @type {number} + */ + readonly ImageLayoutFrameTop: number; + + /** + * Returns the page number of the current image. This is a runtime, read-only property. + * @type {Long} + */ + readonly ImageLayoutPageNumber: number; + + /** + * [Deprecated.] Returns how tall/long, in pixels, the image is. This is a runtime, read-only property. + * @type {number} + */ + ImageLength: number; + + /** + * Returns or sets the margin between images when multiple images are displayed in Dynamic Web TWAIN. + * @type {number} + */ + ImageMargin: number; + + /** + * Returns the pixel type of the current image. This is a runtime, read-only property. Please note the property is only valid in OnPreTransfer and OnPostTransfer event. + * @type {EnumDWT_PixelType} + */ + readonly ImagePixelType: EnumDWT_PixelType; + + /** + * [Deprecated.] Returns how width, in pixels, the image is. This is a runtime, read-only property. + * @type {number} + */ + ImageWidth: number; + + /** + * [Deprecated.] Returns the X resolution of the current image. X resolution is the number of pixels per Unit in the horizontal direction. This is a runtime, read-only property. + * @type {number} + */ + ImageXResolution: number; + + /** + * [Deprecated.] Returns the Y resolution of the current image. Y resolution is the number of pixels per Unit in the vertical direction. This is a runtime, read-only property. + * @type {number} + */ + ImageYResolution: number; + + /** + * Returns or sets the quality of JPEG files and PDF files using JPEG compression. + * @type {number} + */ + JPEGQuality: number; + + /** + * Returns or sets the log level for debugging. + * @type {number} + */ + LogLevel: number; + + /** + * Return the magnetic data if the scanner support magnetic data recognition. + * @type {string} + */ + readonly MagData: string; + + /** + * Return the magnetic type if the scanner support magnetic data recognition. + * @type {number} + */ + readonly MagType: number; + + /** + * Sets or returns the manufacture string for the application identity. + * @type {string} + */ + Manufacturer: string; + + /** + * Returns or sets the maximum number of images can be held in buffer. + * @type {number} + */ + MaxImagesInBuffer: number; + + /** + * [Deprecated.] Returns or sets how many threads can be used when you upload files through POST. + * @type {number} + */ + MaxInternetTransferThreads: number; + + /** + * Sets or returns the maximum allowed size when Dynamic Web TWAIN uploads a document. + * @type {number} + */ + MaxUploadImageSize: number; + + /** + * Returns or sets the shape of the mouse. + * @type {boolean} + */ + MouseShape: boolean; + + /** + * Returns the X co-ordinate of the mouse. This is a runtime property. + * @type {number} + */ + readonly MouseX: number; + + /** + * Returns the Y co-ordinate of the mouse. This is a runtime property. + * @type {number} + */ + readonly MouseY: number; + + /** + * Returns or sets the name of the person who creates the PDF document. + * @type {string} + */ + PDFAuthor: string; + + /** + * Returns or sets the compression type of PDF files. This is a runtime property. + * @type {EnumDWT_PDFCompressionType} + */ + PDFCompressionType: EnumDWT_PDFCompressionType; + + /** + * Returns or sets the date when the PDF document is created. + * @type {string} + */ + PDFCreationDate: string; + + /** + * Returns or sets the name of the application that created the original document, if the PDF document is converted from another form. + * @type {string} + */ + PDFCreator: string; + + /** + * Returns or sets the keywords associated with the PDF document. + * @type {string} + */ + PDFKeywords: string; + + /** + * Returns or sets the date when the PDF document is last modified. + * @type {string} + */ + PDFModifiedDate: string; + + /** + * Returns or sets the name of the application that converted the PDF document from its native. + * @type {string} + */ + PDFProducer: string; + + /** + * Returns or sets the subject of the PDF document. + * @type {string} + */ + PDFSubject: string; + + /** + * Returns or sets the title of the PDF document. + * @type {string} + */ + PDFTitle: string; + + /** + * Returns or sets the value of the PDF version. + * @type {string} + */ + PDFVersion: string; + + /** + * Returns or sets the page size(s) the Source can/should use to acquire image data. This is a runtime property. + * @type {EnumDWT_CapSupportedSizes} + */ + PageSize: EnumDWT_CapSupportedSizes; + + /** + * Returns the number of transfers the Source is ready to supply, upon demand. This is a runtime, read-only property. + * @type {number} + */ + readonly PendingXfers: number; + + /** + * Returns or sets the pixel flavor for acquired images. This is a runtime property. + * @type {number} + */ + PixelFlavor: number; + + /** + * Returns or sets the pixel type of current data source. This is a runtime property. Using this property after calling OpenSource() method and before calling AcquireImage(). + * @type {EnumDWT_PixelType} + */ + PixelType: EnumDWT_PixelType; + + /** + * Sets or returns the product family string for the application identity. + * @type {string} + */ + ProductFamily: string; + + /** + * Sets the product key. A product key is generated in Licensing Tool which is intalled with Dynamic Web TWAIN. Each product key corresponds with a license. + * @type {string} + */ + ProductKey: string; + + /** + * Sets or returns the product name string for the application identity. + * @type {string} + */ + ProductName: string; + + /** + * [Deprecated.] Returns or sets the name of the proxy server. + * @type {string} + */ + ProxyServer: string; + + /** + * Returns or sets the current resolution for acquired images. This is a runtime property. + * @type {number} + */ + Resolution: number; + + /** + * Returns or sets how many scanned images are selected. + * @type {number} + */ + SelectedImagesCount: number; + + /** + * Returns or sets the border color of the selected image. It is a value specifying the 24-bit RGB value. + * @type {number} + */ + SelectionImageBorderColor: number; + + /** + * Specifies a fixed aspect ratio to be used for selecting an area. + * @type {number} + */ + SelectionRectAspectRatio: number; + + /** + * Specifies whether to show the page number + * @type {boolean} + */ + ShowPageNumber: boolean; + + /** + * Returns how many sources are installed in the system. This is a runtime, read-only property. + * @type {number} + */ + readonly SourceCount: number; + + /** + * Returns or sets the compression type of TIFF files. This is a runtime property. + * @type {EnumDWT_TIFFCompressionType} + */ + TIFFCompressionType: EnumDWT_TIFFCompressionType; + + /** + * Sets or returns the transfer mode. + * @type {EnumDWT_TransferMode} + */ + TransferMode: EnumDWT_TransferMode; + + /** + * Returns or sets the unit of measure. This is a runtime property. + * @type {EnumDWT_UnitType} + */ + Unit: EnumDWT_UnitType; + + /** + * Specifies whether to show the vertical scroll bar + * @type {boolean} + */ + VScrollBar: boolean; + + /** + * Sets or returns the version info string for the application identity. + * @type {string} + */ + readonly VersionInfo: string; + + /** + * Returns or sets the width of the dwt object viewer + * @type {string|number} + */ + Width: string | number; + + /** + * Returns and sets the number of images you are willing to transfer per session. This is a runtime property. + * @type {number} + */ + XferCount: number; + + /** + * Returns or sets zoom factor for the image, only valid When the view mode is set to -1 by -1. + * @type {number} + */ + Zoom: number; + + /* ignored + style + _AutoCropMethod + */ + + /* + *Methods + */ + + /** + * Displays the source's built-in interface to acquire image. + * @method WebTwain#AcquireImage + * @param {object} optionalDeviceConfig a JS object used to set up the device for image acquisition. + * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + AcquireImage(optionalDeviceConfig?: object, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Add text on an image. + * @method WebTwain#AddText + * @param {number} sImageIndex the index of the image that you want to add text to. + * @param {number} x the x coordinate for the text. + * @param {number} y the y coordinate for the text. + * @param {string} text the content of the text that you want to add. + * @param {number} txtColor the color for the text. + * @param {number} backgroundColor the background color. + * @param {number} backgroundRoundRadius ranging from 0 to 0.5. Please NOTE that MAC version does not support this parameter. + * @param {number} backgroundOpacity specifies the opacity of the background of the added text, it ranges from 0 to 1.0. Please NOTE that Mac version only supports value 0 and 1 + * @return {boolean} + */ + AddText(sImageIndex: number, x: number, y: number, text: string, txtColor: number, backgroundColor: number, backgroundRoundRadius: number, backgroundOpacity: number): boolean; + + /** + * Cancels all pending transfers. + * @method WebTwain#CancelAllPendingTransfers + * @return {boolean} + */ + CancelAllPendingTransfers(): boolean; + + /** + * Gets information of the capability specified by the Capability property. + * @method WebTwain#CapGet + * @return {boolean} + */ + CapGet(): boolean; + + /** + * Returns the Source's current Value for the specified capability. + * @method WebTwain#CapGetCurrent + * @return {boolean} + */ + CapGetCurrent(): boolean; + + /** + * Returns the Source's Default Value for the specified capability. This is the Source's preferred default value. + * @method WebTwain#CapGetDefault + * @return {boolean} + */ + CapGetDefault(): boolean; + + /** + * Returns the value of the bottom-most edge of the specified frame. + * @method WebTwain#CapGetFrameBottom + * @param {number} index specifies the value of which frame to get. The index is 0-based. + * @return {number} + */ + CapGetFrameBottom(index: number): number; + + /** + * Returns the value (in Unit) of the left-most edge of the specified frame. + * @method WebTwain#CapGetFrameLeft + * @param {number} index specifies the value of which frame to get. The index is 0-based. + * @return {number} + */ + CapGetFrameLeft(index: number): number; + + /** + * Returns the value (in Unit) of the left-most edge of the specified frame. + * @method WebTwain#CapGetFrameRight + * @param {number} index specifies the value of which frame to get. The index is 0-based. + * @return {number} + */ + CapGetFrameRight(index: number): number; + + /** + * Returns the value (in Unit) of the top-most edge of the specified frame. + * @method WebTwain#CapGetFrameTop + * @param {number} index specifies the value of which frame to get. The index is 0-based. + * @return {number} + */ + CapGetFrameTop(index: number): number; + + /* ignored + * CapGetHelp + * CapGetLabel + * CapGetLabels + */ + + /** + * Queries whether the Source supports a particular operation on the capability. + * @method WebTwain#CapIfSupported + * @param {EnumDWT_MessageType} messageType specifies the type of capability operation. + * @return {boolean} + */ + CapIfSupported(messageType: EnumDWT_MessageType): boolean; + + /** + * Changes the Current Value of the capability specified by Capability property back to its power-on value. + * @method WebTwain#CapReset + * @return {boolean} + */ + CapReset(): boolean; + + /** + * Sets the current capability using the container type specified by CapType property. The current capability is specified by Capability property. + * @method WebTwain#CapSet + * @return {boolean} + */ + CapSet(): boolean; + + /** + * Sets the values of the specified frame. + * @method WebTwain#CapSetFrame + * @param {number} index specifies the values of which frame to set. The index is 0-based. + * @param {number} left the value (in Unit) of the left-most edge of the specified frame. + * @param {number} top the value (in Unit) of the top-most edge of the specified frame. + * @param {number} right the value (in Unit) of the right-most edge of the specified frame. + * @param {number} bottom the value (in Unit) of the bottom-most edge of the specified frame. + * @return {boolean} + */ + CapSetFrame(index: number, left: number, top: number, right: number, bottom: number): boolean; + + /** + * Changes the bitdepth of a specified image. + * @method WebTwain#ChangeBitDepth + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {number} sBitDepth specifies the target bit depth. + * @param {boolean} bHighQuality specifies whether or not to keep high quality while changing the bit depth. When it's true, it takes more time. + * @return {boolean} + */ + ChangeBitDepth(sImageIndex: number, sBitDepth: number, bHighQuality: boolean): boolean; + + /** + * Changes width and height of the image of a specified index in the buffer. Please note the file size of the image will be changed proportionately. + * @method WebTwain#ChangeImageSize + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {number} iNewWidth specifies the pixel width of the new image. + * @param {number} iNewHeight specifies the pixel height of the new image. + * @param {EnumDWT_InterpolationMethod} newVal specifies the method to do interpolation. + * @return {boolean} + */ + ChangeImageSize(sImageIndex: number, iNewWidth: number, iNewHeight: number, newVal: EnumDWT_InterpolationMethod): boolean; + + /** + * Clears all the web forms which are used for image uploading. + * @method WebTwain#ClearAllHTTPFormField + * @return {boolean} + */ + ClearAllHTTPFormField(): boolean; + + /** + * Clears the content of all custom tiff tags. + * @method WebTwain#ClearTiffCustomTag + * @return {void} + */ + ClearTiffCustomTag(): void; + + /** + * Closes Data Source. + * @method WebTwain#CloseSource + * @return {boolean} + */ + CloseSource(): boolean; + + /** + * Closes and unloads Data Source Manager. + * @method WebTwain#CloseSourceManager + * @return {boolean} + */ + CloseSourceManager(): boolean; + + /** + * Closes the current process used to scan + * @method WebTwain#CloseWorkingProcess + * @return {boolean} + */ + CloseWorkingProcess(): boolean; + + /** + * Converts the images specified by the indices to base64 synchronously. + * @method WebTwain#ConvertToBase64 + * @param {Array} indices indices specifies which images are to be converted to base64. + * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64. + * @return {Base64Result} + + ConvertToBase64(indices: number[], enumImageType: EnumDWT_ImageType): Base64Result; + */ + + /** + * Converts the images specified by the indices to base64 asynchronously. + * @method WebTwain#ConvertToBase64 + * @param {Array} indices indices specifies which images are to be converted to base64. + * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64. + * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + ConvertToBase64(indices: number[], enumImageType: EnumDWT_ImageType, asyncSuccessFunc: (result: Base64Result) => void, asyncFailureFunc: (errorCode: number, errorString: string) => void): boolean; + + /** + * Converts the images specified by the indices to blob synchronously. + * @method WebTwain#ConvertToBlob + * @param {Array} indices indices specifies which images are to be converted to base64. + * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64. + * @return {Blob} + */ + ConvertToBlob(indices: number[], enumImageType: EnumDWT_ImageType): Blob; + + /** + * Converts the images specified by the indices to blob asynchronously. + * @method WebTwain#ConvertToBlob + * @param {Array} indices indices specifies which images are to be converted to base64. + * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64. + * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + ConvertToBlob(indices: number[], enumImageType: EnumDWT_ImageType, asyncSuccessFunc: (result: any) => void, asyncFailureFunc: (errorCode: number, errorString: string) => void): boolean; + + /** + * Changes a specified image to gray scale. + * @method WebTwain#ConvertToGrayScale + * @param {number} sIndex specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + ConvertToGrayScale(sIndex: number): boolean; + + /** + * Copies the image of a specified index in buffer to clipboard in DIB format. + * @method WebTwain#CopyToClipboard + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + CopyToClipboard(sImageIndex: number): boolean; + + /** + * Create the font for adding text using the method AddText. + * @method WebTwain#CreateTextFont + * @param {number} height Specifies the desired height (in logical units) of the font.The absolute value of nHeight must not exceed 16,384 device units after it is converted.For all height comparisons, the font mapper looks for the largest font that does not exceed the requested size or the smallest font if all the fonts exceed the requested size. + * @param {number} width Specifies the average width (in logical units) of characters in the font. If Width is 0, the aspect ratio of the device will be matched against the digitization aspect ratio of the available fonts to find the closest match, which is determined by the absolute value of the difference. + * @param {number} escapement Specifies the angle (in 0.1-degree units) between the escapement vector and the x-axis of the display surface. The escapement vector is the line through the origins of the first and last characters on a line. The angle is measured counterclockwise from the x-axis. + * @param {number} orientation Specifies the angle (in 0.1-degree units) between the baseline of a character and the x-axis.The angle is measured counterclockwise from the x-axis for coordinate systems in which the y-direction is down and clockwise from the x-axis for coordinate systems in which the y-direction is up. + * @param {number} weight Specifies the font weight (in inked pixels per 1000). The described valuesare approximate; the actual appearance depends on the typeface. Some fonts haveonly FW_NORMAL, FW_REGULAR, and FW_BOLD weights. If FW_DONTCARE is specified, a default weight is used. + * @param {number} italic Specifies an italic font if set to TRUE. + * @param {number} underline Specifies an underlined font if set to TRUE. + * @param {number} strikeOut A strikeout font if set to TRUE. + * @param {number} charSet Specifies the font's character set. The OEM character set is system-dependent. Fonts with other character sets may exist in the system. An application that uses a font with an unknown character set must not attempt to translate or interpret strings that are to be rendered with that font. + * @param {number} outputPrecision Specifies the desired output precision. The output precision defines how closely the output must match the requested font's height, width, character orientation, escapement, and pitch. + * @param {number} clipPrecision Specifies the desired clipping precision. The clipping precision defines how to clip characters that are partially outside the clipping region. + * @param {number} quality Specifies the font's output quality, which defines how carefully the GDI must attempt to match the logical-font attributes to those of an actual physical font. + * @param {number} pitchAndFamily The pitch and family of the font. + * @param {string} faceName the typeface name, the length of this string must not exceed 32 characters, including the terminating null character. + * @return {boolean} + */ + CreateTextFont(height: number, width: number, escapement: number, orientation: number, weight: number, italic: number, underline: number, strikeOut: number, charSet: number, outputPrecision: number, clipPrecision: number, quality: number, pitchAndFamily: number, faceName: string): boolean; + + /** + * Crops the image of a specified index in buffer. + * @method WebTwain#Crop + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. + * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. + * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. + * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. + * @return {boolean} + */ + Crop(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; + + /** + * Crops the image of a specified index in buffer to clipboard in DIB format. + * @method WebTwain#CropToClipboard + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. + * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. + * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. + * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. + * @return {boolean} + */ + CropToClipboard(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; + + /** + * Cuts the image data in the specified area to the system clipboard in DIB format. + * @method WebTwain#CutFrameToClipboard + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. + * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. + * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. + * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. + * @return {boolean} + */ + CutFrameToClipboard(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; + + /** + * Cuts the image of a specified index in buffer to clipboard in DIB format. + * @method WebTwain#CutToClipboard + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + CutToClipboard(sImageIndex: number): boolean; + + /** + * Disable the source. If the source's user interface is displayed when the source is enabled, it will be closed. + * @method WebTwain#DisableSource + * @return {boolean} + */ + DisableSource(): boolean; + + /** + * Enables the source to accept image. + * @method WebTwain#EnableSource + * @return {boolean} + */ + EnableSource(): boolean; + + /** + * Clears the specified area of a specified image, and fill the area with the fill color. + * @method WebTwain#Erase + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. + * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. + * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. + * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. + * @return {boolean} + */ + Erase(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; + + /** + * Downloads an image from the FTP server. + * @method WebTwain#FTPDownload + * @param {string} FTPServer the name of the FTP server. + * @param {string} FTPRemoteFile the name of the file to be downloaded. It should be the relative path of the file on the FTP server. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + FTPDownload(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Directly download a file from the FTP server to local disk without loading it into Dynamic Web TWAIN. + * @method WebTwain#FTPDownloadDirectly + * @param {string} FTPServer the name of the FTP server. + * @param {string} FTPRemoteFile the name of the file to be downloaded. It should be the relative path of the file on the FTP server. + * @param {string} localFile specify a full path to store the file. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + FTPDownloadDirectly(FTPServer: string, FTPRemoteFile: string, localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Downloads an image from the FTP server. + * @method WebTwain#FTPDownloadEx + * @param {string} FTPServer the name of the FTP server. + * @param {string} FTPRemoteFile the name of the file to be downloaded. It should be the relative path of the file on the FTP server. + * @param {EnumDWT_ImageType} lImageType simage format of the file to be downloaded. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + FTPDownloadEx(FTPServer: string, FTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Uploads the image of a specified index in the buffer to the FTP server. + * @method WebTwain#FTPUpload + * @param {string} FTPServer the name of the FTP server. + * @param {number} sImageIndex specifies the index of the image in the buffer. The index is 0-based. + * @param {string} FTPRemoteFile the name of the file to be created on the FTP server. It should be a relative path on the FTP server. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + FTPUpload(FTPServer: string, sImageIndex: number, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Directly upload a specific file to the FTP server without loading it into Dynamic Web TWAIN. + * @method WebTwain#FTPUploadDirectly + * @param {string} FTPServer the name of the FTP server. + * @param {string} localFile specify the the full path of a local file. + * @param {string} FTPRemoteFile the name of the file to be created on the FTP server. It should be a relative path on the FTP server. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + FTPUploadDirectly(FTPServer: string, localFile: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Uploads the image of a specified index in the buffer to the FTP server as a specified image format. + * @method WebTwain#FTPUploadEx + * @param {string} FTPServer the name of the FTP server. + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {string} FTPRemoteFile the name of the file to be created on the FTP server. It should be a relative path on the FTP server. + * @param {EnumDWT_ImageType} lImageType the image format of the file to be created on the FTP server. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + FTPUploadEx(FTPServer: string, sImageIndex: number, FTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Uploads all images in buffer to the FTP server as Multi-Page TIFF. + * @method WebTwain#FTPUploadAllAsMultiPageTIFF + * @param {string} FTPServer the name of the FTP server. + * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + FTPUploadAllAsMultiPageTIFF(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Uploads all images in buffer to the FTP server as Multi-Page PDF. + * @method WebTwain#FTPUploadAllAsPDF + * @param {string} FTPServer the name of the FTP server. + * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + FTPUploadAllAsPDF(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Uploads the selected images in buffer to the FTP server as Multi-Page PDF. + * @method WebTwain#FTPUploadAsMultiPagePDF + * @param {string} FTPServer the name of the FTP server. + * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + FTPUploadAsMultiPagePDF(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Uploads the selected images in buffer to the FTP server as Multi-Page TIFF. + * @method WebTwain#FTPUploadAsMultiPageTIFF + * @param {string} FTPServer the name of the FTP server. + * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + FTPUploadAsMultiPageTIFF(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Sets the Source to eject the current page and advance the next page in the document feeder into the feeder acquire area when IfFeederEnabled is TRUE. + * @method WebTwain#FeedPage + * @return {boolean} + */ + FeedPage(): boolean; + + /** + * Check whether a certain file exists on the local disk. + * @method WebTwain#FileExists + * @param {string} localFile specifies the absolute path of the local file. + * @return {boolean} + */ + FileExists(localFile: string): boolean; + + /** + * Flips the image of a specified index in buffer. + * @method WebTwain#Flip + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + Flip(sImageIndex: number): boolean; + + /** + * Get the cap item value of the capability specified by Capability property, when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. + * @method WebTwain#GetCapItems + * @param {number} index Index is 0-based. It is the index of the cap item. + * @return {number} + */ + GetCapItems(index: number): number; + + /** + * Returns the cap item value of the capability specified by Capability property, when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. + * @method WebTwain#GetCapItemsString + * @param {number} index Index is 0-based. It is the index of the cap item. + * @return {string} + */ + GetCapItemsString(index: number): string; + + // Get custom DS data, and returned string is encoded with base64 + /** + * Gets custom DS data, the returned string is base64 encoded. + * @method WebTwain#GetCustomDSDataEx + * @return {string | boolean} + */ + GetCustomDSDataEx(): string | boolean; + + // Get custom DS data, and save the data to the specified file + /** + * Gets custom DS data and save the data in a specified file. + * @method WebTwain#GetCustomDSData + * @param {string} fileName the path of the file used for storing custom DS data. + * @return {boolean} + */ + GetCustomDSData(fileName: string): boolean; + + /** + * Retrieve the device type of the currently selected data source, it might be a scanner, a web camera, etc. + * @method WebTwain#GetDeviceType + * @return {number | boolean} + */ + GetDeviceType(): number | boolean; + + /** + * Returns the pixel bit depth of the selected image. + * @method WebTwain#GetImageBitDepth + * @param {number} sImageIndex specifies the index of image. The index is 0-based. + * @return {number} + */ + GetImageBitDepth(sImageIndex: number): number; + + /** + * Returns the height (pixels) of the selected image. This is a read-only property. + * @method WebTwain#GetImageHeight + * @param {number} sImageIndex specifies the index of image. The index is 0-based. + * @return {number} + */ + GetImageHeight(sImageIndex: number): number; + + /** + * Returns the direct URL of an image specified by index, if iWidth and iHeight are not specified, you get the original image, otherwise you get the image with specified iWidth or iHeight while keeping the same aspect ratio. The returned string is like this 'dwt://dwt_trial_13000404/img?id=306159652&index=0&t=1502184632022' + * @method WebTwain#GetImagePartURL + * @param {number} index the index of the image. + * @param {number} iWidth the width of the image, it must be 150 or bigger + * @param {number} iHeight the height of the image, it must be 150 or bigger + * @return {string} + */ + GetImagePartURL(index: number, iWidth?: number, iHeight?: number): string; + + /** + * Returns the file size of the new image resized from the image of a specified index in buffer. + * @method WebTwain#GetImageSize + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {number} iWidth specifies the pixel width of the new image. + * @param {number} iHeight specifies the pixel height of the new image. + * @return {number} + */ + GetImageSize(sImageIndex: number, iWidth: number, iHeight: number): number; + + /** + * Pre-calculate the file size of the local image file that is saved from an image of a specified index in buffer. + * @method WebTwain#GetImageSizeWithSpecifiedType + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {EnumDWT_ImageType} sImageType specifies the type of an image file.. + * @return {number} + */ + GetImageSizeWithSpecifiedType(sImageIndex: number, sImageType: EnumDWT_ImageType): number; + + /** + * Returns the direct URL of an image specified by index, if iWidth or iHeight is set to -1, you get the original image, otherwise you get the image with specified iWidth or iHeight while keeping the same aspect ratio. + * @method WebTwain#GetImageURL + * @param {number} index the index of the image. + * @param {number} iWidth the width of the image. + * @param {number} iHeight the height of the image. + * @return {string} + */ + GetImageURL(index: number, iWidth: number, iHeight: number): string; + + /** + * Returns the width (pixels) of the selected image. This is a read-only property. + * @method WebTwain#GetImageWidth + * @param {number} sImageIndex specifies the index of image. The index is 0-based. + * @return {number} + */ + GetImageWidth(sImageIndex: number): number; + + /** + * Return the horizontal resolution of the specified image. + * @method WebTwain#GetImageXResolution + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {number} + */ + GetImageXResolution(sImageIndex: number): number; + + /** + * Return the vertical resolution of the specified image. + * @method WebTwain#GetImageYResolution + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {number} + */ + GetImageYResolution(sImageIndex: number): number; + + /** + * Return the runtime license info. + * @method WebTwain#GetLicenseInfo + */ + GetLicenseInfo(optionalAsyncSuccessFunc?: (result: any) => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Returns the index of the selected image. + * @method WebTwain#GetSelectedImageIndex + * @param {number} sSelectedIndex specifies the index of the selected image. + * @return {number} + */ + GetSelectedImageIndex(sSelectedIndex: number): number; + + /** + * Pre-calculate the file size of the local image file that is saved from the selected images in buffer. + * @method WebTwain#GetSelectedImagesSize + * @param {EnumDWT_ImageType} iImageType specifies the type of an image file. + * @return {number} + */ + GetSelectedImagesSize(iImageType: EnumDWT_ImageType): number; + + /** + * Check the skew angle of an image by its index in buffer. + * @method WebTwain#GetSkewAngle + * @param {number} sImageIndex the index of the image in the buffer. + * @return {number} + */ + GetSkewAngle(sImageIndex: number): number; + + /** + * Check the skew angle of a rectangular part of an image by its index in buffer. + * @method WebTwain#GetSkewAngleEx + * @param {number} sImageIndex the index of the image in the buffer. + * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. + * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. + * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. + * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. + * @return {number} + */ + GetSkewAngleEx(sImageIndex: number, left: number, top: number, right: number, bottom: number): number; + + /** + * Get the source name according to the source index. + * @method WebTwain#GetSourceNameItems + * @param {number} index number index. Index is 0-based and can not be greater than SourceCount property. + * @return {string} + */ + GetSourceNameItems(index: number): string; + + /*ignored + GetSourceNames + GetSourceType + GetVersionInfoAsync + */ + + /** + * Downloads an image from the HTTP server. + * @method WebTwain#HTTPDownload + * @param {string} HTTPServer the name of the HTTP server. + * @param {string} HTTPRemoteFile the name of the image to be downloaded. It should be the relative path of the file on the HTTP server. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPDownload(HTTPServer: string, HTTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Directly downloads a file from the HTTP server to a local disk without loading it into Dynamic Web TWAIN. + * @method WebTwain#HTTPDownloadDirectly + * @param {string} HTTPServer the name of the HTTP server. + * @param {string} HTTPRemoteFile The relative path of the file on the HTTP server. + * @param {string} localFile specify the location to store the downloaded file. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPDownloadDirectly(HTTPServer: string, HTTPRemoteFile: string, localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Downloads an image from the HTTP server. + * @method WebTwain#HTTPDownloadEx + * @param {string} HTTPServer the name of the HTTP server. + * @param {string} HTTPRemoteFile the relative path of the file on the HTTP server, or path to an action page (with necessary parameters) which gets and sends back the image stream to the client (please check the sample for more info) + * @param {EnumDWT_ImageType} lImageType the image format of the file to be downloaded. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPDownloadEx(HTTPServer: string, HTTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /*ignored + HTTPDownloadStreamThroughPost + HTTPDownloadThroughGet + */ + + /** + * Download an image from the server using a HTTP Post call. + * @method WebTwain#HTTPDownloadThroughPost + * @param {string} HTTPServer the name of the HTTP server. + * @param {string} HTTPRemoteFile the relative path of the file on the HTTP server, or path to an action page (with necessary parameters) which gets and sends back the image stream to the client (please check the sample for more info) + * @param {EnumDWT_ImageType} lImageType the image format of the file to be downloaded. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPDownloadThroughPost(HTTPServer: string, HTTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; + + /** + * Uploads just a form created by SetHTTPFormField and SetHTTPHeader + * @method WebTwain#HTTPUpload + * @param {string} url the url where the images are sent in a POST request. + * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPUpload(url: string, asyncSuccessFunc: (httppostresponsestring: string) => void, asyncFailureFunc: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; + + /** + * Uploads the images specified by the indices to the HTTP server. + * @method WebTwain#HTTPUpload + * @param {string} url the url where the images are sent in a POST request. + * @param {Array} indices indices specifies which images are to be uploaded. + * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be uploaded. + * @param {EnumDWT_UploadDataFormat} dataFormat whether to upload the images as binary or a base64-based string. + * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPUpload(url: string, indices: number[], enumImageType: EnumDWT_ImageType, dataFormat: EnumDWT_UploadDataFormat, asyncSuccessFunc: (httppostresponsestring: string) => void, asyncFailureFunc: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; + + /** + * Uploads the images specified by the indices to the HTTP server. + * @method WebTwain#HTTPUpload + * @param {string} url the url where the images are sent in a POST request. + * @param {Array} indices indices specifies which images are to be uploaded. + * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be uploaded. + * @param {EnumDWT_UploadDataFormat} dataFormat whether to upload the images as binary or a base64-based string. + * @param {string} fileName the file name + * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPUpload(url: string, indices: number[], enumImageType: EnumDWT_ImageType, dataFormat: EnumDWT_UploadDataFormat, fileName: string, asyncSuccessFunc: (httppostresponsestring: string) => void, asyncFailureFunc: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; + + /** + * Uploads all images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. + * @method WebTwain#HTTPUploadAllThroughPostAsMultiPageTIFF + * @param {string} HTTPServer the name of the HTTP server. + * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". + * @param {string} fileName the name of the image to be uploaded. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. + * @return {boolean} + */ + HTTPUploadAllThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; + + /** + * Uploads all images in the buffer to the HTTP server through HTTP Post method as a Multi-Page PDF. + * @method WebTwain#HTTPUploadAllThroughPostAsPDF + * @param {string} HTTPServer the name of the HTTP server. + * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". + * @param {string} fileName the name of the image to be uploaded. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. + * @return {boolean} + */ + HTTPUploadAllThroughPostAsPDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; + + /** + * [Deprecated.] Uploads all images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page TIFF. + * @method WebTwain#HTTPUploadAllThroughPutAsMultiPageTIFF + * @param {string} HTTPServer the name of the HTTP server. + * @param {string} RemoteFileName the name of the image to be uploaded. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPUploadAllThroughPutAsMultiPageTIFF(HTTPServer: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * [Deprecated.] Uploads all images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page PDF. + * @method WebTwain#HTTPUploadAllThroughPutAsPDF + * @param {string} HTTPServer the name of the HTTP server. + * @param {string} RemoteFileName the name of the image to be uploaded. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPUploadAllThroughPutAsPDF(HTTPServer: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /*ignored + HTTPUploadStreamThroughPost + */ + + /** + * Uploads the image of a specified index in the buffer to the HTTP server through the HTTP POST method. + * @method WebTwain#HTTPUploadThroughPost + * @param {string} HTTPServer the name of the HTTP server. + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". + * @param {string} fileName the name of the image to be uploaded. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. + * @return {boolean} + */ + HTTPUploadThroughPost(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; + + /** + * Uploads the selected images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. + * @method WebTwain#HTTPUploadThroughPostAsMultiPageTIFF + * @param {string} HTTPServer the name of the HTTP server. + * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". + * @param {string} fileName the name of the image to be uploaded. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. + * @return {boolean} + */ + HTTPUploadThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; + + /** + * Uploads the selected images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page PDF. + * @method WebTwain#HTTPUploadThroughPostAsMultiPagePDF + * @param {string} HTTPServer the name of the HTTP server. + * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". + * @param {string} fileName the name of the image to be uploaded. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. + * @return {boolean} + */ + HTTPUploadThroughPostAsMultiPagePDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; + + /** + * Directly upload a specific local file to the HTTP server through the HTTP POST method without loading it into Dynamic Web TWAIN. + * @method WebTwain#HTTPUploadThroughPostDirectly + * @param {string} HTTPServer the name of the HTTP server. + * @param {string} localFile specifies the path of a local file . + * @param {string} ActionPage the specified page for posting files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". + * @param {string} fileName the name of the file to be uploaded. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. + * @return {boolean} + */ + HTTPUploadThroughPostDirectly(HTTPServer: string, localFile: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; + + /** + * Uploads the image of a specified index in the buffer to the HTTP server as a specified image format through the HTTP POST method. + * @method WebTwain#HTTPUploadThroughPostEx + * @param {string} HTTPServer the name of the HTTP server. + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". + * @param {string} fileName the name of the image to be uploaded. + * @param {EnumDWT_ImageType} lImageType the image format of the file to be created on the HTTP server.s + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadFailure. + * @return {boolean} + */ + HTTPUploadThroughPostEx(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; + + /** + * [Deprecated.] Uploads the image of a specified index in the buffer to the HTTP server through the HTTP PUT method. + * @method WebTwain#HTTPUploadThroughPut + * @param {string} HTTPServer the name of the HTTP server. + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {string} RemoteFileName the name of the image to be created on the HTTP server. It should a relative path on the web server. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPUploadThroughPut(HTTPServer: string, sImageIndex: number, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * [Deprecated.] Uploads the selected images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page TIFF. + * @method WebTwain#HTTPUploadThroughPutAsMultiPageTIFF + * @param {string} HTTPServer the name of the HTTP server. + * @param {string} RemoteFileName the name of the image to be uploaded. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPUploadThroughPutAsMultiPageTIFF(HTTPServer: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * [Deprecated.] Uploads the selected images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page PDF. + * @method WebTwain#HTTPUploadThroughPutAsMultiPagePDF + * @param {string} HTTPServer the name of the HTTP server. + * @param {string} RemoteFileName the name of the image to be uploaded. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPUploadThroughPutAsMultiPagePDF(HTTPServer: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * [Deprecated.] Directly uploads a specific local file to the HTTP server through the HTTP PUT method without loading it into Dynamic Web TWAIN. + * @method WebTwain#HTTPUploadThroughPutDirectly + * @param {string} HTTPServer the name of the HTTP server. + * @param {string} localFile specifies the path of a local file. + * @param {string} RemoteFileName the name of the file to be created on the HTTP server. It should a relative path on the web server. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPUploadThroughPutDirectly(HTTPServer: string, localFile: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * [Deprecated.] Uploads the image of a specified index in the buffer to the HTTP server as a specified image format through the HTTP PUT method. + * @method WebTwain#HTTPUploadThroughPutEx + * @param {string} HTTPServer the name of the HTTP server. + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {string} RemoteFileName the name of the file to be created on the HTTP server. It should a relative path on the web server. + * @param {EnumDWT_ImageType} lImageType the image format of the file to be created on the HTTP server. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + HTTPUploadThroughPutEx(HTTPServer: string, sImageIndex: number, RemoteFileName: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * [Deprecated.] Detects whether an image is blank. + * @method WebTwain#IsBlankImage + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + IsBlankImage(sImageIndex: number): boolean; + + /** + * [Deprecated.] Detects whether a certain area on an image is blank. + * @method WebTwain#IsBlankImageEx + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. + * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. + * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. + * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. + * @param {boolean} bFuzzyMatch specifies whether use fuzzy matching when detecting. + * @return {boolean} + */ + IsBlankImageEx(sImageIndex: number, left: number, top: number, right: number, bottom: number, bFuzzyMatch: boolean): boolean; + + /** + * Detects whether a specific image is blank. + * @method WebTwain#IsBlankImageExpress + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + IsBlankImageExpress(sImageIndex: number): boolean; + + /** + * Loads a DIB format image from Clipboard into the Dynamic Web TWAIN. + * @method WebTwain#LoadDibFromClipboard + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the loading succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the loading fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + LoadDibFromClipboard(optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Loads an image into the Dynamic Web TWAIN. + * @method WebTwain#LoadImage + * @param {string} localFile the name of the image to be loaded. It should be the absolute path of the image file on the local disk. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the loading succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the loading fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + LoadImage(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Loads an image into the Dynamic Web TWAIN. + * @method WebTwain#LoadImageEx + * @param {string} localFile the name of the image to be loaded. It should be the absolute path of the image file on the local disk. + * @param {EnumDWT_ImageType} lImageType the image format of the file to be loaded. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the loading succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the loading fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + LoadImageEx(localFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Loads image from a base64 byte array with the specified file format. + * @method WebTwain#LoadImageFromBase64Binary + * @param {string} bry specifies the base64 string data. + * @param {EnumDWT_ImageType} lImageType specifies the file format. + * @return {boolean} + */ + LoadImageFromBase64Binary(bry: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * [Deprecated.] Loads image from a byte array with the specified file format. + * @method WebTwain#LoadImageFromBytes + * @param {number} lBufferSize Specifies the buffer size. + * @param {Array} buffer A byte array of the image data. + * @param {EnumDWT_ImageType} lImageType Specifies the file format. + * @return {boolean} + */ + LoadImageFromBytes(lBufferSize: number, buffer: number[], lImageType: EnumDWT_ImageType): boolean; + + /** + * Mirrors the image of a specified index in buffer. + * @method WebTwain#Mirror + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + Mirror(sImageIndex: number): boolean; + + /** + * Moves a specified image. + * @method WebTwain#MoveImage + * @param {number} sSourceImageIndex Specifies the source index of image in buffer. The index is 0-based. + * @param {number} sTargetImageIndex Specifies the target index of image in buffer. The index is 0-based. + * @return {boolean} + */ + MoveImage(sSourceImageIndex: number, sTargetImageIndex: number): boolean; + + /*ignored + OnRefreshUI + */ + + /** + * Loads the specified Source into main memory and causes its initialization, + * placing Dynamic Web TWAIN into Capability Negotiation state. If no source is + * specified (no SelectSource() or SelectSourceByIndex() is called), opens the default source. + * @method WebTwain#OpenSource + * @return {boolean} + */ + OpenSource(): boolean; + + /** + * Loads and opens Data Source Manager. + * @method WebTwain#OpenSourceManager + * @return {boolean} + */ + OpenSourceManager(): boolean; + + /** + * Decorates image of a specified index in buffer with rectangles of transparent color. + * @method WebTwain#OverlayRectangle + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. + * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. + * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. + * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. + * @param {number} color Specifies the fill color of the rectangle. The byte-ordering of the RGB value is 0xBBGGRR. BB represents blue, GG represents green, RR represents red. + * @param {number} fOpacity Specifies the opacity of the rectangle. The value represents opacity. 1.0 is 100% opaque and 0.0 is totally transparent. + * @return {boolean} + */ + OverlayRectangle(sImageIndex: number, left: number, top: number, right: number, bottom: number, color: number, fOpacity: number): boolean; + + /** + * Shows the GUI of Image Printer. + * @method WebTwain#Print + * @param {boolean} bUseSystemDefaultPrintUI specifies whether to use the system Print UI or not. + * @return {boolean} + */ + Print(bUseSystemDefaultPrintUI: boolean): boolean; + + /** + * Binds a specified function to an event, so that the function gets called whenever the event fires. + * @method WebTwain#RegisterEvent + * @param {string} name the name of the event that the function is bound to. + * @param {any} evt specifies the function to call when event fires. + * @return {boolean} + */ + RegisterEvent(name: string, evt: any): boolean; + + /** + * Removes all images in buffer. + * @method WebTwain#RemoveAllImages + * @return {boolean} + */ + RemoveAllImages(): boolean; + + /** + * Removes selected images in buffer. + * @method WebTwain#RemoveAllSelectedImages + * @return {boolean} + */ + RemoveAllSelectedImages(): boolean; + + /** + * Removes the image of a specified index in buffer. + * @method WebTwain#RemoveImage + * @param {number} sImageIndexToBeDeleted specifies the index of the image to be deleted in buffer. The index is 0-based. + * @return {boolean} + */ + RemoveImage(sImageIndexToBeDeleted: number): boolean; + + /** + * Reverts the current image layout to the Data Source's default. + * @method WebTwain#ResetImageLayout + * @return {boolean} + */ + ResetImageLayout(): boolean; + + /** + * Sets the Source to return the current page to the input side of the document feeder and + * feed the last page from the outside of the feeder back into the acquisition area if IfFeederEnabled is TRUE. + * @method WebTwain#RewindPage + * @return {boolean} + */ + RewindPage(): boolean; + + /** + * Rotates the image of a specified index in buffer by specified angle. + * @method WebTwain#Rotate + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {number} fAngle Specifies the rotation angle. + * @param {boolean} bKeepSize Keep size or not. + * @return {boolean} + */ + Rotate(sImageIndex: number, fAngle: number, bKeepSize: boolean): boolean; + + /** + * Rotates the image of a specified index in buffer by specified angle. + * @method WebTwain#RotateEx + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {number} fAngle Specifies the rotation angle. + * @param {boolean} bKeepSize Keep size or not. + * @param {EnumDWT_InterpolationMethod} newVal specifies the method to do interpolation. + * @return {boolean} + */ + RotateEx(sImageIndex: number, fAngle: number, bKeepSize: boolean, newVal: EnumDWT_InterpolationMethod): boolean; + + /** + * Rotates the image of a specified index in buffer by 90 degrees counter-clockwise. + * @method WebTwain#RotateLeft + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + RotateLeft(sImageIndex: number): boolean; + + /** + * Rotates the image of a specified index in buffer by 90 degrees clockwise. + * @method WebTwain#RotateRight + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + RotateRight(sImageIndex: number): boolean; + + /** + * Saves all images in buffer as a MultiPage TIFF file. + * @method WebTwain#SaveAllAsMultiPageTIFF + * @param {string} localFile the name of the MultiPage TIFF file to be saved. It should be an absolute path on the local disk. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + SaveAllAsMultiPageTIFF(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Saves all images in buffer as a Multi-Page PDF file. + * @method WebTwain#SaveAllAsPDF + * @param {string} localFile the name of the Multi-Page PDF file to be saved. It should be an absolute path on the local disk. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + SaveAllAsPDF(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Saves the image of a specified index in buffer as a BMP file. + * @method WebTwain#SaveAsBMP + * @param {string} localFile the name of the BMP file to be saved. It should be an absolute path on the local disk. + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + SaveAsBMP(localFile: string, sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /*ignored + SaveAsGIF + */ + + /** + * Saves the image of a specified index in buffer as a JPEG file. + * @method WebTwain#SaveAsJPEG + * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + SaveAsJPEG(localFile: string, sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Saves the image of a specified index in buffer as a PDF file. + * @method WebTwain#SaveAsPDF + * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + SaveAsPDF(localFile: string, sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Saves the image of a specified index in buffer as a PNG file. + * @method WebTwain#SaveAsPNG + * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + SaveAsPNG(localFile: string, sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Saves the image of a specified index in buffer as a TIFF file. + * @method WebTwain#SaveAsTIFF + * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + SaveAsTIFF(localFile: string, sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Saves the selected images in buffer as a Multipage PDF file. + * @method WebTwain#SaveSelectedImagesAsMultiPagePDF + * @param {string} localFile the name of the MultiPage PDF file to be saved. It should be an absolute path on the local disk. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + SaveSelectedImagesAsMultiPagePDF(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Saves the selected images in buffer as a Multipage TIFF file. + * @method WebTwain#SaveSelectedImagesAsMultiPageTIFF + * @param {string} localFile the name of the MultiPage TIFF file to be saved. It should be an absolute path on the local disk. + * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. + * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. + * @return {boolean} + */ + SaveSelectedImagesAsMultiPageTIFF(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + + /** + * Saves the selected images in buffer to base64 string. + * @method WebTwain#SaveSelectedImagesToBase64Binary + * @return {string|boolean} + */ + SaveSelectedImagesToBase64Binary(optionalAsyncSuccessFunc?: (result: string[]) => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): string | boolean; + + /** + * [Deprecated.] Saves the selected images in buffer to a byte array in the specified file format. + * @method WebTwain#SaveSelectedImagesToBytes + * @param {number} bufferSize specified the buffer size. + * @param {Array} buffer A byte array of the image data. + * @return {number} + */ + SaveSelectedImagesToBytes(bufferSize: number, buffer: number[]): number; + + /** + * Brings up the TWAIN Data Source Manager's Source Selection User Interface (UI) + * so that user can choose which Data Source to be the current Source. + * @method WebTwain#SelectSource + * @return {boolean} + */ + SelectSource(): boolean; + + /** + * Selects the index-the source in SourceNameItems property as the current source. + * @method WebTwain#SelectSourceByIndex + * @param {number} index It is the index of SourceNameItems property. + * @return {boolean} + */ + SelectSourceByIndex(index: number): boolean; + + /*ignored + SetCancel + */ + + /** + * Set the value of the specified cap item. + * @method WebTwain#SetCapItems + * @param {number} index Index is 0-based. It is the index of the cap item. + * @param {number} newVal For string type, please use CapItemsstring property. + * @return {void} + */ + SetCapItems(index: number, newVal: number): void; + + /** + * Set the cap item value of the capability specified by Capability property, when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. + * @method WebTwain#SetCapItemsString + * @param {number} index Index is 0-based. It is the index of the cap item. + * @param {string} newVal The new value to be set. + * @return {void} + */ + SetCapItemsString(index: number, newVal: string): void; + + /** + * [Deprecated.] Sets current cookie into the Http Header to be used when uploading scanned images through POST. + * @method WebTwain#SetCookie + * @param {string} cookie the cookie on current page. + * @return {void} + */ + SetCookie(cookie: string): void; + + // Set custom DS data (DAT_CUSTOMDSDATA), the input string is encoded with base64 + /** + * Sets custom DS data to be used for scanning, the input string is encoded with base64. Custom DS data means a specific scanning profile. + * @method WebTwain#SetCustomDSDataEx + * @param {string} value the input string which is encoded with base64. + * @return {boolean} + */ + SetCustomDSDataEx(value: string): boolean; + + // Set custom DS data, load data from the specified file + /** + * Sets custom DS data to be used for scanning, the data is stored in a file. Custom DS data means a specific scanning profile. + * @method WebTwain#SetCustomDSData + * @param {string} fileName the absolute path of the file where the custom data source data is stored. + * @return {boolean} + */ + SetCustomDSData(fileName: string): boolean; + + /** + * Change the DPI (dots per inch) for the specified image. + * @method WebTwain#SetDPI + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {number} xResolution The horizontal resolution. + * @param {number} yResolution The vertical resolution. + * @param {boolean} bResampleImage Whether to resample the image. (The image size will be changed if this is set to true). + * @param {EnumDWT_InterpolationMethod} newVal specifies the method to do interpolation. + * @return {boolean} + */ + SetDPI(sImageIndex: number, xResolution: number, yResolution: number, bResampleImage: boolean, newVal: EnumDWT_InterpolationMethod): boolean; + + /** + * Sets file name and file format information used in File Transfer Mode. + * @method WebTwain#SetFileXferInfo + * @param {string} fileName the name of the file to be used in transfer. + * @param {EnumDWT_FileFormat} fileFormat an enumerated value indicates the format of the image. + * @return {boolean} + */ + SetFileXferInfo(fileName: string, fileFormat: EnumDWT_FileFormat): boolean; + + /** + * Sets a text parameter as a filed in a web form. This form is maintained by the component itself (meaning it's not on the page). All fields in this form will be passed to the server when uploading images. + * @method WebTwain#SetHTTPFormField + * @param {string} FieldName specifies the name of a text field in web form. + * @param {string} FieldValue specifies the value of a text field in web form. + * @return {boolean} + */ + SetHTTPFormField(FieldName: string, FieldValue: string): boolean; + + /** + * Sets a text parameter as a filed in a web form. This form is maintained by the component itself (meaning it's not on the page). All fields in this form will be passed to the server when uploading images. + * @method WebTwain#SetHTTPFormField + * @param {string} FieldName specifies the name of the field which could later be used to retrieve the blob + * @param {Blob} blobValue specifies the blob to be put in the form. + * @param {string} optionalFileName specifies the file name for the blob + * @return {boolean} + */ + SetHTTPFormField(FieldName: string, blobValue: Blob, optionalFileName?: string): boolean; + + /** + * Sets a header for the current HTTP Post request. + * @method WebTwain#SetHTTPHeader + * @param {string} key the key of the header. + * @param {string} value the value of the header. + * @return {boolean} + */ + SetHTTPHeader(key: string, value: string): boolean; + + /** + * Sets the left, top, right, and bottom sides of the image layout rectangle for the current Data Source. + * @method WebTwain#SetImageLayout + * @param {number} left specifies the floating point number for the left side of the image layout rectangle. + * @param {number} top specifies the floating point number for the top side of the image layout rectangle. + * @param {number} right specifies the floating point number for the right side of the image layout rectangle. + * @param {number} bottom specifies the floating point number for the bottom side of the image layout rectangle. + * @return {boolean} + */ + SetImageLayout(left: number, top: number, right: number, bottom: number): boolean; + + /** + * Change the width of an image in buffer. + * @method WebTwain#SetImageWidth + * @param {number} sImageIndex specifies which image you'd like to change. + * @param {number} iNewWidth specifies how wide you'd like to change the image. + * @return {boolean} + */ + SetImageWidth(sImageIndex: number, iNewWidth: number): boolean; + + /** + * Set the language for the authorization dialogs. + * @method WebTwain#SetLanguage + * @param {EnumDWT_Language} language specify the language + * @return {boolean} + */ + SetLanguage(language: EnumDWT_Language): boolean; + + /** + * Sets the time-out used to open a specified Data Source. + * @method WebTwain#SetOpenSourceTimeout + * @param {number} iMilliseconds specifies the number of milliseconds. + * @return {boolean} + */ + SetOpenSourceTimeout(iMilliseconds: number): boolean; + + /** + * Draws a rectangle on the viewer which represents the selected area. + * @method WebTwain#SetSelectedImageArea + * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. + * @param {number} left The X axis of the left border. + * @param {number} top The Y axis of the top border. + * @param {number} right The X axis of the right border. + * @param {number} bottom The Y axis of the bottom border. + * @return {boolean} + */ + SetSelectedImageArea(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; + + /** + * You can use the method to select images programatically which is ususally done by mouse clicking. + * @method WebTwain#SetSelectedImageIndex + * @param {number} sSelectedIndex this is the index of an array that holds the indices of selected images. + * @param {number} newVal specifies the index of an image that you want to select. + * @return {boolean} + */ + SetSelectedImageIndex(selectedIndex: number, newVal: number): boolean; + + /** + * Sets a custom tiff tag. Currently you can set up to 32 tags. The string to be set in a tag can be encoded with base64. + * @method WebTwain#SetTiffCustomTag + * @param {number} tag specifies the tag identifier. The value should be between 600 and 700. + * @param {string} content the string to be set for this tag. The string will be written to the .tiff file when you save/upload it. If the string is base64 encoded, we'll decode it before writing it. + * @param {boolean} base64Str if you'd like to encode the string with base64, set this to true. Otherwise, the string will be plin text. + * @return {boolean} + */ + SetTiffCustomTag(tag: number, content: string, base64Str: boolean): boolean; + + /** + * Configures how segmented upload is done. + * @method WebTwain#SetUploadSegment + * @param {number} segmentUploadThreshold specifies the threshold (in MB) over which segmented upload will be invoked. + * @param {number} moduleSize specifies the size of each segment (in KB). + * @return {boolean} + */ + SetUploadSegment(segmentUploadThreshold: number, moduleSize: number): boolean; + + /** + * Sets the view mode that images are displayed in Dynamic Web TWAIN. You can use this method to display multiple images in Dynamic Web TWAIN. + * @method WebTwain#SetViewMode + * @param {number} sHorizontalImageCount specifies how many columns can be displayed in Dynamic Web TWAIN. + * @param {number} sVerticalImageCount specifies how many rows can be displayed in Dynamic Web TWAIN.. + * @return {void} + */ + SetViewMode(sHorizontalImageCount: number, sVerticalImageCount: number): void; + + /** + * Show save file dialog or show open file dialog. + * @method WebTwain#ShowFileDialog + * @param {boolean} SaveDialog True -- show save file dialog, False -- show open file dialog. + * @param {string} Filter The filter name specifies the filter pattern (for example, "*.TXT"). To specify multiple filter patterns for a single display string, use a semicolon to separate the patterns (for example, "*.TXT;*.DOC;*.BAK"). A pattern string can be a combination of valid file name characters and the asterisk (*) wildcard character. Do not include spaces in the pattern string. To retrieve a shortcut's target without filtering, use the string "All Files\0*.*\0\0", but the program will replace "\0" with "|" automatically. + * @param {number} FilterIndex The index of the currently selected filter in the File Types control. The buffer pointed to by Filter contains pairs of strings that define the filters. The index is 0-based. + * @param {string} DefExtension Define the default extension. GetOpenFileName and GetSaveFileName append this extension to the file name only if the user fails to type an extension. If this member is NULL and the user fails to type an extension, no extension is appended. + * @param {string} InitialDir The initial directory. The algorithm for selecting the initial directory varies on different platforms. + * @param {boolean} AllowMultiSelect True -- allows users to select more than one file, False -- only allows to select one file. + * @param {boolean} OverwritePrompt True -- If a file already exists with the same name, the old file will be simply overwritten, False -- not allows to save and overwrite a same name file. + * @param {number} Flags If this parameter equals 0, the program will be initiated with the default flags, otherwise initiated with the cumstom value and parameters "AllowMultiSelect" and "OverwritePrompt" will be useless. + * @return {boolean} + */ + ShowFileDialog(SaveDialog: boolean, Filter: string, FilterIndex: number, DefExtension: string, InitialDir: string, AllowMultiSelect: boolean, OverwritePrompt: boolean, Flags: number): boolean; + + /** + * Shows the GUI of Image Editor. + * @method WebTwain#ShowImageEditor + * @return {boolean} + */ + ShowImageEditor(divID?: string, divWidth?: number, divHeight?: number): boolean; + + /** + * [Deprecated.] Shows the GUI of Image Editor with custom settings. + * @method WebTwain#ShowImageEditorEx + * @param {number} x specifies the new position of the left top corner of the window. + * @param {number} y specifies the new position of the left top corner of the window. + * @param {number} cx specifies the width of the window. + * @param {number} cy specifies the height of the window. + * @param {number} nCmdShow specifices how the window should be shown. + * @return {boolean} + */ + ShowImageEditorEx(x: number, y: number, cx: number, cy: number, nCmdShow: number): boolean; + + /*ingored + SourceNameItems + */ + + /** + * Switchs two images of specified indices in buffer. + * @method WebTwain#SwitchImage + * @param {number} sImageIndex1 specifies the index of image in buffer. The index is 0-based. + * @param {number} sImageIndex2 specifies the index of image in buffer. The index is 0-based. + * @return {boolean} + */ + SwitchImage(sImageIndex1: number, sImageIndex2: number): boolean; + + /** + * Unbinds an event from the specified function, so that the function stops receiving notifications when the event fires. + * @method WebTwain#UnregisterEvent + * @param {string} name the name of the event. + * @param {object} evt specified the function to be unbound. + * @return {boolean} + */ + UnregisterEvent(name: string, evt: object): boolean; + + /*ignored + checkErrorString + first + getInstance + last + next + on + onEvent + previous + + ...other internal ones + */ } +/** Border Styles */ declare enum EnumDWT_BorderStyle { - /** No border. */ - TWBS_NONE = 0, - /** Flat border. */ - TWBS_SINGLEFLAT = 1, - /** 3D border. */ - TWBS_SINGLE3D = 2 -} - -/** For query the operation that are supported by the data source on a capability . - * Application gets these through DG_CONTROL/DAT_CAPABILITY/MSG_QUERYSUPPORT - */ -declare enum EnumDWT_MessageType { - TWQC_GET = 1, - TWQC_SET = 2, - TWQC_GETDEFAULT = 4, - TWQC_GETCURRENT = 8, - TWQC_RESET = 16 + /** No border. */ + TWBS_NONE = 0, + /** Flat border. */ + TWBS_SINGLEFLAT = 1, + /** 3D border. */ + TWBS_SINGLE3D = 2 } /** Capabilities */ @@ -266,45 +2599,45 @@ declare enum EnumDWT_Cap { * any frames with a left offset of zero. * TWFA_RIGHT: The alignment is to the right. */ - CAP_FEEDERALIGNMENT = 4141, + CAP_FEEDERALIGNMENT = 4141, /** TWFO_FIRSTPAGEFIRST if the feeder starts with the top of the first page. * TWFO_LASTPAGEFIRST is the feeder starts with the top of the last page. */ - CAP_FEEDERORDER = 4142, + CAP_FEEDERORDER = 4142, /** Indicates whether the physical hardware (e.g. scanner, digital camera) is capable of acquiring * multiple images of the same page without changes to the physical registration of that page. */ - CAP_REACQUIREALLOWED = 4144, + CAP_REACQUIREALLOWED = 4144, /** The minutes of battery power remaining to the device. */ - CAP_BATTERYMINUTES = 4146, + CAP_BATTERYMINUTES = 4146, /** When used with CapGet(), return the percentage of battery power level on camera. If -1 is returned, it indicates that the battery is not present. */ - CAP_BATTERYPERCENTAGE = 4147, + CAP_BATTERYPERCENTAGE = 4147, /** Added 1.91 */ - CAP_CAMERASIDE = 4148, + CAP_CAMERASIDE = 4148, /** Added 1.91 */ - CAP_SEGMENTED = 4149, + CAP_SEGMENTED = 4149, /** Added 2.0 */ - CAP_CAMERAENABLED = 4150, + CAP_CAMERAENABLED = 4150, /** Added 2.0 */ - CAP_CAMERAORDER = 4151, + CAP_CAMERAORDER = 4151, /** Added 2.0 */ - CAP_MICRENABLED = 4152, + CAP_MICRENABLED = 4152, /** Added 2.0 */ - CAP_FEEDERPREP = 4153, + CAP_FEEDERPREP = 4153, /** Added 2.0 */ - CAP_FEEDERPOCKET = 4154, + CAP_FEEDERPOCKET = 4154, /** Added 2.1 */ - CAP_AUTOMATICSENSEMEDIUM = 4155, + CAP_AUTOMATICSENSEMEDIUM = 4155, /** Added 2.1 */ - CAP_CUSTOMINTERFACEGUID = 4156, + CAP_CUSTOMINTERFACEGUID = 4156, /** TRUE enables and FALSE disables the Source's Auto-brightness function (if any). */ - ICAP_AUTOBRIGHT = 4352, + ICAP_AUTOBRIGHT = 4352, /** The brightness values available within the Source. */ - ICAP_BRIGHTNESS = 4353, + ICAP_BRIGHTNESS = 4353, /** The contrast values available within the Source. */ - ICAP_CONTRAST = 4355, + ICAP_CONTRAST = 4355, /** Specifies the square-cell halftone (dithering) matrix the Source should use to halftone the image. */ - ICAP_CUSTHALFTONE = 4356, + ICAP_CUSTHALFTONE = 4356, /** Specifies the exposure time used to capture the image, in seconds. */ ICAP_EXPOSURETIME = 4357, /** Describes the color characteristic of the subtractive filter applied to the image data. Multiple @@ -561,204 +2894,85 @@ declare enum EnumDWT_Cap { ICAP_SUPPORTEDEXTIMAGEINFO = 4446 } -/** Capabilities exist in many varieties but all have a Default Value, Current Value, and may have other values available that can be supported if selected. - * To help categorize the supported values into clear structures, TWAIN defines four types of containers for capabilities = - * TW_ONEVALUE, TW_ARRAY, TW_RANGE and TW_ENUMERATION. - */ -declare enum EnumDWT_CapType { - /** Nothing. */ - TWON_NONE = 0, - /** A rectangular array of values that describe a logical item. It is similar to the TW_ONEVALUE because the current and default values are the same and - * there are no other values to select from. For example, a list of the names, such as the supported capabilities list returned by the CAP_SUPPORTEDCAPS - * capability, would use this type of container. +/** ICAP_BITORDER values. */ +declare enum EnumDWT_CapBitOrder { + TWBO_LSBFIRST = 0, + /** Indicates that the leftmost bit in the byte (usually bit 7) is the byte's Most Significant Bit. */ + TWBO_MSBFIRST = 1 +} + +/** ICAP_BITDEPTHREDUCTION values. */ +declare enum EnumDWT_CapBitdepthReduction { + TWBR_THRESHOLD = 0, + TWBR_HALFTONE = 1, + TWBR_CUSTHALFTONE = 2, + TWBR_DIFFUSION = 3 +} + +/** CAP_FEEDERALIGNMENT values. */ +declare enum EnumDWT_CapFeederAlignment { + /** The alignment is free-floating. Applications should assume that the origin for frames is on the left. */ + TWFA_NONE = 0, + /** The alignment is to the left. */ + TWFA_LEFT = 1, + /** The alignment is centered. This means that the paper will be fed in the middle of the ICAP_PHYSICALWIDTH of the + * device. If this is set, then the Application should calculate any frames with a left offset of zero. */ - TWON_ARRAY = 3, - /** This is the most general type because it defines a list of values from which the Current Value can be chosen. - * The values do not progress uniformly through a range and there is not a consistent step size between the values. - * For example, if a Source's resolution options do not occur in even step sizes then an enumeration would be used (for example, 150, 400, and 600). - */ - TWON_ENUMERATION = 4, - /** A single value whose current and default values are coincident. The range of available values for this type of capability is simply this single value. - * For example, a capability that indicates the presence of a document feeder could be of this type. - */ - TWON_ONEVALUE = 5, - /** Many capabilities allow users to select their current value from a range of regularly spaced values. - * The capability can specify the minimum and maximum acceptable values and the incremental step size between the values. - * For example, resolution might be supported from 100 to 600 in steps of 50 (100, 150, 200, ..., 550, 600). - */ - TWON_RANGE = 6 + TWFA_CENTER = 2, + /** The alignment is to the right. */ + TWFA_RIGHT = 3 } -/** ICAP_XFERMECH values. */ -declare enum EnumDWT_TransferMode { - /** Native transfers require the data to be transferred to a single large block of RAM. Therefore, - * they always face the risk of having an inadequate amount of RAM available to perform the transfer successfully. - */ - TWSX_NATIVE = 0, - /** Disk File Mode Transfers. */ - TWSX_FILE = 1, - /** Buffered Memory Mode Transfers. */ - TWSX_MEMORY = 2, - /** added 1.91 */ - TWSX_MEMFILE = 4 +/** CAP_FEEDERORDER values. */ +declare enum EnumDWT_CapFeederOrder { + /** The feeder starts with the top of the first page. */ + TWFO_FIRSTPAGEFIRST = 0, + /** The feeder starts with the top of the last page. */ + TWFO_LASTPAGEFIRST = 1 } -/** ICAP_IMAGEFILEFORMAT values. */ -declare enum EnumDWT_FileFormat { - /** Used for document imaging. Tagged Image File Format */ - TWFF_TIFF = 0, - /** Native Macintosh format. Macintosh PICT */ - TWFF_PICT = 1, - /** Native Microsoft format. Windows Bitmap */ - TWFF_BMP = 2, - /** Used for document imaging. X-Windows Bitmap */ - TWFF_XBM = 3, - /** Wrapper for JPEG images. JPEG File Interchange Format */ - TWFF_JFIF = 4, - /** FlashPix, used with digital cameras. Flash Pix */ - TWFF_FPX = 5, - /** Multi-page TIFF files. Multi-page tiff file */ - TWFF_TIFFMULTI = 6, - /** An image format standard intended for use on the web, replaces GIF. */ - TWFF_PNG = 7, - /** A standard from JPEG, intended to replace JFIF, also supports JBIG. */ - TWFF_SPIFF = 8, - /** File format for use with digital cameras. */ - TWFF_EXIF = 9, - /** A file format from Adobe. 1.91 NB: this is not PDF/A */ - TWFF_PDF = 10, - /** A file format from the Joint Photographic Experts Group. 1.91 */ - TWFF_JP2 = 11, - /** 1.91 */ - TWFF_JPN = 12, - /** 1.91 */ - TWFF_JPX = 13, - /** A file format from LizardTech. 1.91 */ - TWFF_DEJAVU = 14, - /** A file format from Adobe. 2.0 */ - TWFF_PDFA = 15, - /** 2.1 Adobe PDF/A, Version 2 */ - TWFF_PDFA2 = 16 +/** ICAP_FILTER values. */ +declare enum EnumDWT_CapFilterType { + TWFT_RED = 0, + TWFT_GREEN = 1, + TWFT_BLUE = 2, + TWFT_NONE = 3, + TWFT_WHITE = 4, + TWFT_CYAN = 5, + TWFT_MAGENTA = 6, + TWFT_YELLOW = 7, + TWFT_BLACK = 8 } -/** TIFF file compression type. */ -declare enum EnumDWT_TIFFCompressionType { - /** Auto mode. */ - TIFF_AUTO = 0, - /** Dump mode. */ - TIFF_NONE = 1, - /** CCITT modified Huffman RLE. */ - TIFF_RLE = 2, - /** CCITT Group 3 fax encoding. */ - TIFF_FAX3 = 3, - /** CCITT T.4 (TIFF 6 name). */ - TIFF_T4 = 3, - /** CCITT Group 4 fax encoding */ - TIFF_FAX4 = 4, - /** CCITT T.6 (TIFF 6 name). */ - TIFF_T6 = 4, - /** Lempel Ziv and Welch */ - TIFF_LZW = 5, - TIFF_JPEG = 7, - TIFF_PACKBITS = 32773 +/** ICAP_FLASHUSED2 values. */ +declare enum EnumDWT_CapFlash { + TWFL_NONE = 0, + TWFL_OFF = 1, + TWFL_ON = 2, + TWFL_AUTO = 3, + TWFL_REDEYE = 4 } -/** The method to do interpolation. */ -declare enum EnumDWT_InterpolationMethod { - IM_NEARESTNEIGHBOUR = 1, - IM_BILINEAR = 2, - IM_BICUBIC = 3, - IM_BESTQUALITY = 5 +/** ICAP_FLIPROTATION values. */ +declare enum EnumDWT_CapFlipRotation { + /** The images to be scanned are viewed in book form, flipping each page from left to right or right to left. */ + TWFR_BOOK = 0, + /** The images to be scanned are viewed in fanfold paper style, flipping each page up or down. */ + TWFR_FANFOLD = 1 } -/** Image type */ -declare enum EnumDWT_ImageType { - /** Native Microsoft format. */ - IT_BMP = 0, - /** JPEG format. */ - IT_JPG = 1, - /** Tagged Image File Format. */ - IT_TIF = 2, - /** An image format standard intended for use on the web, replaces GIF. */ - IT_PNG = 3, - /** A file format from Adobe. */ - IT_PDF = 4, - IT_ALL = 5 -} - -/** PDF file compression type. */ -declare enum EnumDWT_PDFCompressionType { - /** Auto mode. */ - PDF_AUTO = 0, - /** CCITT Group 3 fax encoding. */ - PDF_FAX3 = 1, - /** CCITT Group 4 fax encoding */ - PDF_FAX4 = 2, - /** Lempel Ziv and Welch */ - PDF_LZW = 3, - /** CCITT modified Huffman RLE. */ - PDF_RLE = 4, - PDF_JPEG = 5 -} - -declare enum EnumDWT_ShowMode { - /** Activates the window and displays it in its current size and position. */ - SW_ACTIVE = 0, - /** Maximizes the window */ - SW_MAX = 1, - /** Minimize the window */ - SW_MIN = 2, - /** Close the latest opened editor window */ - SW_CLOSE = 3, - /** Check whether a window exists */ - SW_IFLIVE = 4 -} - -/** The kind of data stored in the container. */ -declare enum EnumDWT_CapValueType { - TWTY_INT8 = 0, - /** Means Item is a TW_INT16 */ - TWTY_INT16 = 1, - /** Means Item is a TW_INT32 */ - TWTY_INT32 = 2, - /** Means Item is a TW_UINT8 */ - TWTY_UINT8 = 3, - /** Means Item is a TW_UINT16 */ - TWTY_UINT16 = 4, - /** Means Item is a TW_int */ - TWTY_int = 5, - /** Means Item is a TW_BOOL */ - TWTY_BOOL = 6, - /** Means Item is a TW_FIX32 */ - TWTY_FIX32 = 7, - /** Means Item is a TW_FRAME */ - TWTY_FRAME = 8, - /** Means Item is a TW_STR32 */ - TWTY_STR32 = 9, - /** Means Item is a TW_STR64 */ - TWTY_STR64 = 10, - /** Means Item is a TW_STR128 */ - TWTY_STR128 = 11, - /** Means Item is a TW_STR255 */ - TWTY_STR255 = 12 -} - -/** ICAP_UNITS values. */ -declare enum EnumDWT_UnitType { - TWUN_INCHES = 0, - TWUN_CENTIMETERS = 1, - TWUN_PICAS = 2, - TWUN_POINTS = 3, - TWUN_TWIPS = 4, - TWUN_PIXELS = 5, - TWUN_MILLIMETERS = 6 -} - -/** ICAP_DUPLEX values. */ -declare enum EnumDWT_DUPLEX { - TWDX_NONE = 0, - TWDX_1PASSDUPLEX = 1, - TWDX_2PASSDUPLEX = 2 +/** ICAP_IMAGEFILTER values. */ +declare enum EnumDWT_CapImageFilter { + TWIF_NONE = 0, + TWIF_AUTO = 1, + /** Good for halftone images. */ + TWIF_LOWPASS = 2, + /** Good for improving text. */ + TWIF_BANDPASS = 3, + /** Good for improving fine lines. */ + TWIF_HIGHPASS = 4, + TWIF_TEXT = 3, + TWIF_FINELINE = 4 } /** CAP_LANGUAGE values. */ @@ -912,6 +3126,92 @@ declare enum EnumDWT_CapLanguage { TWLG_VIETNAMESE = 113 } +/** ICAP_LIGHTPATH values. */ +declare enum EnumDWT_CapLightPath { + TWLP_REFLECTIVE = 0, + TWLP_TRANSMISSIVE = 1 +} + +/** ICAP_LIGHTSOURCE values. */ +declare enum EnumDWT_CapLightSource { + TWLS_RED = 0, + TWLS_GREEN = 1, + TWLS_BLUE = 2, + TWLS_NONE = 3, + TWLS_WHITE = 4, + TWLS_UV = 5, + TWLS_IR = 6 +} + +/** ICAP_NOISEFILTER values. */ +declare enum EnumDWT_CapNoiseFilter { + TWNF_NONE = 0, + TWNF_AUTO = 1, + TWNF_LONEPIXEL = 2, + TWNF_MAJORITYRULE = 3 +} + +/** ICAP_ORIENTATION values. */ +declare enum EnumDWT_CapORientation { + TWOR_ROT0 = 0, + TWOR_ROT90 = 1, + TWOR_ROT180 = 2, + TWOR_ROT270 = 3, + TWOR_PORTRAIT = 0, + TWOR_LANDSCAPE = 3, + /** 2.0 */ + TWOR_AUTO = 4, + /** 2.0 */ + TWOR_AUTOTEXT = 5, + /** 2.0 */ + TWOR_AUTOPICTURE = 6 +} + +/** ICAP_OVERSCAN values. */ +declare enum EnumDWT_CapOverscan { + TWOV_NONE = 0, + TWOV_AUTO = 1, + TWOV_TOPBOTTOM = 2, + TWOV_LEFTRIGHT = 3, + TWOV_ALL = 4 +} + +/** ICAP_PIXELFLAVOR values. */ +declare enum EnumDWT_CapPixelFlavor { + /** Zero pixel represents darkest shade. zero pixel represents darkest shade */ + TWPF_CHOCOLATE = 0, + /** Zero pixel represents lightest shade. zero pixel represents lightest shade */ + TWPF_VANILLA = 1 +} + +/** ICAP_PLANARCHUNKY values. */ +declare enum EnumDWT_CapPlanarChunky { + TWPC_CHUNKY = 0, + TWPC_PLANAR = 1 +} + +/** CAP_PRINTER values. */ +declare enum EnumDWT_CapPrinter { + TWPR_IMPRINTERTOPBEFORE = 0, + TWPR_IMPRINTERTOPAFTER = 1, + TWPR_IMPRINTERBOTTOMBEFORE = 2, + TWPR_IMPRINTERBOTTOMAFTER = 3, + TWPR_ENDORSERTOPBEFORE = 4, + TWPR_ENDORSERTOPAFTER = 5, + TWPR_ENDORSERBOTTOMBEFORE = 6, + TWPR_ENDORSERBOTTOMAFTER = 7 +} + +/** CAP_PRINTERMODE values. */ +declare enum EnumDWT_CapPrinterMode { + /** Specifies that the printed text will consist of a single string. */ + TWPM_SINGLESTRING = 0, + /** Specifies that the printed text will consist of an enumerated list of strings to be printed in order. */ + TWPM_MULTISTRING = 1, + /** Specifies that the printed string will consist of a compound of a String followed by a value followed by a suffix string. */ + TWPM_COMPOUNDSTRING = 2 +} + /** TWAIN Supported sizes. */ declare enum EnumDWT_CapSupportedSizes { /** 0 */ @@ -1040,180 +3340,68 @@ declare enum EnumDWT_CapSupportedSizes { TWSS_MAXSIZE = 54 } -/** CAP_FEEDERALIGNMENT values. */ -declare enum EnumDWT_CapFeederAlignment { - /** The alignment is free-floating. Applications should assume that the origin for frames is on the left. */ - TWFA_NONE = 0, - /** The alignment is to the left. */ - TWFA_LEFT = 1, - /** The alignment is centered. This means that the paper will be fed in the middle of the ICAP_PHYSICALWIDTH of the - * device. If this is set, then the Application should calculate any frames with a left offset of zero. +/** Capabilities exist in many varieties but all have a Default Value, Current Value, and may have other values available that can be supported if selected. + * To help categorize the supported values into clear structures, TWAIN defines four types of containers for capabilities = + * TW_ONEVALUE, TW_ARRAY, TW_RANGE and TW_ENUMERATION. + */ +declare enum EnumDWT_CapType { + /** Nothing. */ + TWON_NONE = 0, + /** A rectangular array of values that describe a logical item. It is similar to the TW_ONEVALUE because the current and default values are the same and + * there are no other values to select from. For example, a list of the names, such as the supported capabilities list returned by the CAP_SUPPORTEDCAPS + * capability, would use this type of container. */ - TWFA_CENTER = 2, - /** The alignment is to the right. */ - TWFA_RIGHT = 3 -} -/** CAP_FEEDERORDER values. */ -declare enum EnumDWT_CapFeederOrder { - /** The feeder starts with the top of the first page. */ - TWFO_FIRSTPAGEFIRST = 0, - /** The feeder starts with the top of the last page. */ - TWFO_LASTPAGEFIRST = 1 + TWON_ARRAY = 3, + /** This is the most general type because it defines a list of values from which the Current Value can be chosen. + * The values do not progress uniformly through a range and there is not a consistent step size between the values. + * For example, if a Source's resolution options do not occur in even step sizes then an enumeration would be used (for example, 150, 400, and 600). + */ + TWON_ENUMERATION = 4, + /** A single value whose current and default values are coincident. The range of available values for this type of capability is simply this single value. + * For example, a capability that indicates the presence of a document feeder could be of this type. + */ + TWON_ONEVALUE = 5, + /** Many capabilities allow users to select their current value from a range of regularly spaced values. + * The capability can specify the minimum and maximum acceptable values and the incremental step size between the values. + * For example, resolution might be supported from 100 to 600 in steps of 50 (100, 150, 200, ..., 550, 600). + */ + TWON_RANGE = 6 } -/** CAP_PRINTER values. */ -declare enum EnumDWT_CapPrinter { - TWPR_IMPRINTERTOPBEFORE = 0, - TWPR_IMPRINTERTOPAFTER = 1, - TWPR_IMPRINTERBOTTOMBEFORE = 2, - TWPR_IMPRINTERBOTTOMAFTER = 3, - TWPR_ENDORSERTOPBEFORE = 4, - TWPR_ENDORSERTOPAFTER = 5, - TWPR_ENDORSERBOTTOMBEFORE = 6, - TWPR_ENDORSERBOTTOMAFTER = 7 +/** The kind of data stored in the container. */ +declare enum EnumDWT_CapValueType { + TWTY_INT8 = 0, + /** Means Item is a TW_INT16 */ + TWTY_INT16 = 1, + /** Means Item is a TW_INT32 */ + TWTY_INT32 = 2, + /** Means Item is a TW_UINT8 */ + TWTY_UINT8 = 3, + /** Means Item is a TW_UINT16 */ + TWTY_UINT16 = 4, + /** Means Item is a TW_int */ + TWTY_int = 5, + /** Means Item is a TW_BOOL */ + TWTY_BOOL = 6, + /** Means Item is a TW_FIX32 */ + TWTY_FIX32 = 7, + /** Means Item is a TW_FRAME */ + TWTY_FRAME = 8, + /** Means Item is a TW_STR32 */ + TWTY_STR32 = 9, + /** Means Item is a TW_STR64 */ + TWTY_STR64 = 10, + /** Means Item is a TW_STR128 */ + TWTY_STR128 = 11, + /** Means Item is a TW_STR255 */ + TWTY_STR255 = 12 } -/** CAP_PRINTERMODE values. */ -declare enum EnumDWT_CapPrinterMode { - /** Specifies that the printed text will consist of a single string. */ - TWPM_SINGLESTRING = 0, - /** Specifies that the printed text will consist of an enumerated list of strings to be printed in order. */ - TWPM_MULTISTRING = 1, - /** Specifies that the printed string will consist of a compound of a String followed by a value followed by a suffix string. */ - TWPM_COMPOUNDSTRING = 2 -} - -/** ICAP_BITDEPTHREDUCTION values. */ -declare enum EnumDWT_CapBitdepthReduction { - TWBR_THRESHOLD = 0, - TWBR_HALFTONE = 1, - TWBR_CUSTHALFTONE = 2, - TWBR_DIFFUSION = 3 -} - -/** ICAP_BITORDER values. */ -declare enum EnumDWT_CapBitOrder { - TWBO_LSBFIRST = 0, - /** Indicates that the leftmost bit in the byte (usually bit 7) is the byte's Most Significant Bit. */ - TWBO_MSBFIRST = 1 -} - -/** ICAP_FILTER values. */ -declare enum EnumDWT_CapFilterType { - TWFT_RED = 0, - TWFT_GREEN = 1, - TWFT_BLUE = 2, - TWFT_NONE = 3, - TWFT_WHITE = 4, - TWFT_CYAN = 5, - TWFT_MAGENTA = 6, - TWFT_YELLOW = 7, - TWFT_BLACK = 8 -} - -/** ICAP_FLASHUSED2 values. */ -declare enum EnumDWT_CapFlash { - TWFL_NONE = 0, - TWFL_OFF = 1, - TWFL_ON = 2, - TWFL_AUTO = 3, - TWFL_REDEYE = 4 -} - -/** ICAP_FLIPROTATION values. */ -declare enum EnumDWT_CapFlipRotation { - /** The images to be scanned are viewed in book form, flipping each page from left to right or right to left. */ - TWFR_BOOK = 0, - /** The images to be scanned are viewed in fanfold paper style, flipping each page up or down. */ - TWFR_FANFOLD = 1 -} - -/** ICAP_IMAGEFILTER values. */ -declare enum EnumDWT_CapImageFilter { - TWIF_NONE = 0, - TWIF_AUTO = 1, - /** Good for halftone images. */ - TWIF_LOWPASS = 2, - /** Good for improving text. */ - TWIF_BANDPASS = 3, - /** Good for improving fine lines. */ - TWIF_HIGHPASS = 4, - TWIF_TEXT = 3, - TWIF_FINELINE = 4 -} - -/** ICAP_LIGHTPATH values. */ -declare enum EnumDWT_CapLightPath { - TWLP_REFLECTIVE = 0, - TWLP_TRANSMISSIVE = 1 -} - -/** ICAP_LIGHTSOURCE values. */ -declare enum EnumDWT_CapLightSource { - TWLS_RED = 0, - TWLS_GREEN = 1, - TWLS_BLUE = 2, - TWLS_NONE = 3, - TWLS_WHITE = 4, - TWLS_UV = 5, - TWLS_IR = 6 -} - -/** TWEI_MAGTYPE values. (MD_ means Mag Type) Added 2.0 */ -declare enum EnumDWT_MagType { - /** Added 2.0 */ - TWMD_MICR = 0, - /** added 2.1 */ - TWMD_RAW = 1, - /** added 2.1 */ - TWMD_INVALID = 2 -} - -/** ICAP_NOISEFILTER values. */ -declare enum EnumDWT_CapNoiseFilter { - TWNF_NONE = 0, - TWNF_AUTO = 1, - TWNF_LONEPIXEL = 2, - TWNF_MAJORITYRULE = 3 -} - -/** ICAP_ORIENTATION values. */ -declare enum EnumDWT_CapORientation { - TWOR_ROT0 = 0, - TWOR_ROT90 = 1, - TWOR_ROT180 = 2, - TWOR_ROT270 = 3, - TWOR_PORTRAIT = 0, - TWOR_LANDSCAPE = 3, - /** 2.0 */ - TWOR_AUTO = 4, - /** 2.0 */ - TWOR_AUTOTEXT = 5, - /** 2.0 */ - TWOR_AUTOPICTURE = 6 -} - -/** ICAP_OVERSCAN values. */ -declare enum EnumDWT_CapOverscan { - TWOV_NONE = 0, - TWOV_AUTO = 1, - TWOV_TOPBOTTOM = 2, - TWOV_LEFTRIGHT = 3, - TWOV_ALL = 4 -} - -/** ICAP_PIXELFLAVOR values. */ -declare enum EnumDWT_CapPixelFlavor { - /** Zero pixel represents darkest shade. zero pixel represents darkest shade */ - TWPF_CHOCOLATE = 0, - /** Zero pixel represents lightest shade. zero pixel represents lightest shade */ - TWPF_VANILLA = 1 -} - -/** ICAP_PLANARCHUNKY values. */ -declare enum EnumDWT_CapPlanarChunky { - TWPC_CHUNKY = 0, - TWPC_PLANAR = 1 +/** ICAP_DUPLEX values. */ +declare enum EnumDWT_DUPLEX { + TWDX_NONE = 0, + TWDX_1PASSDUPLEX = 1, + TWDX_2PASSDUPLEX = 2 } /** Data source status. */ @@ -1228,6 +3416,48 @@ declare enum EnumDWT_DataSourceStatus { TWDSS_ACQUIRING = 3 } +declare enum EnumDWT_Error { + ModuleNotExists = -2371 +} + +/** ICAP_IMAGEFILEFORMAT values. */ +declare enum EnumDWT_FileFormat { + /** Used for document imaging. Tagged Image File Format */ + TWFF_TIFF = 0, + /** Native Macintosh format. Macintosh PICT */ + TWFF_PICT = 1, + /** Native Microsoft format. Windows Bitmap */ + TWFF_BMP = 2, + /** Used for document imaging. X-Windows Bitmap */ + TWFF_XBM = 3, + /** Wrapper for JPEG images. JPEG File Interchange Format */ + TWFF_JFIF = 4, + /** FlashPix, used with digital cameras. Flash Pix */ + TWFF_FPX = 5, + /** Multi-page TIFF files. Multi-page tiff file */ + TWFF_TIFFMULTI = 6, + /** An image format standard intended for use on the web, replaces GIF. */ + TWFF_PNG = 7, + /** A standard from JPEG, intended to replace JFIF, also supports JBIG. */ + TWFF_SPIFF = 8, + /** File format for use with digital cameras. */ + TWFF_EXIF = 9, + /** A file format from Adobe. 1.91 NB: this is not PDF/A */ + TWFF_PDF = 10, + /** A file format from the Joint Photographic Experts Group. 1.91 */ + TWFF_JP2 = 11, + /** 1.91 */ + TWFF_JPN = 12, + /** 1.91 */ + TWFF_JPX = 13, + /** A file format from LizardTech. 1.91 */ + TWFF_DEJAVU = 14, + /** A file format from Adobe. 2.0 */ + TWFF_PDFA = 15, + /** 2.1 Adobe PDF/A, Version 2 */ + TWFF_PDFA2 = 16 +} + /** Fit window type */ declare enum EnumDWT_FitWindowType { /** Fit the image to the width and height of the window */ @@ -1238,2222 +3468,214 @@ declare enum EnumDWT_FitWindowType { enumFitWindowWidth = 2 } -declare enum EnumDWT_UploadDataFormat { - Binary = 0, - Base64 = 1 +/** Image type */ +declare enum EnumDWT_ImageType { + /** Native Microsoft format. */ + IT_BMP = 0, + /** JPEG format. */ + IT_JPG = 1, + /** Tagged Image File Format. */ + IT_TIF = 2, + /** An image format standard intended for use on the web, replaces GIF. */ + IT_PNG = 3, + /** A file format from Adobe. */ + IT_PDF = 4, + /** All supported formats which are bmp, jpg, tif, png and pdf */ + IT_ALL = 5 +} + +declare enum EnumDWT_InitMsg { + Info = 1, + Error = 2, + NotInstalledError = 3, + DownloadError = 4, + DownloadNotRestartError = 5 +} + +/** The method to do interpolation. */ +declare enum EnumDWT_InterpolationMethod { + IM_NEARESTNEIGHBOUR = 1, + IM_BILINEAR = 2, + IM_BICUBIC = 3, + IM_BESTQUALITY = 5 +} + +declare enum EnumDWT_Language { + English = 0, + French = 1, + Arabic = 2, + Spanish = 3, + Portuguese = 4, + German = 5, + Italian = 6, + Russian = 7, + Chinese = 8 +} + +/** TWEI_MAGTYPE values. (MD_ means Mag Type) Added 2.0 */ +declare enum EnumDWT_MagType { + /** Added 2.0 */ + TWMD_MICR = 0, + /** added 2.1 */ + TWMD_RAW = 1, + /** added 2.1 */ + TWMD_INVALID = 2 +} + +/** For query the operation that are supported by the data source on a capability . + * Application gets these through DG_CONTROL/DAT_CAPABILITY/MSG_QUERYSUPPORT + */ +declare enum EnumDWT_MessageType { + TWQC_GET = 1, + TWQC_SET = 2, + TWQC_GETDEFAULT = 4, + TWQC_GETCURRENT = 8, + TWQC_RESET = 16 } declare enum EnumDWT_MouseShape { - Default = 0, - Hand = 1, - Crosshair = 2, - Zoom = 3 + Default = 0, + Hand = 1, + Crosshair = 2, + Zoom = 3 +} + +/** PDF file compression type. */ +declare enum EnumDWT_PDFCompressionType { + /** Auto mode. */ + PDF_AUTO = 0, + /** CCITT Group 3 fax encoding. */ + PDF_FAX3 = 1, + /** CCITT Group 4 fax encoding */ + PDF_FAX4 = 2, + /** Lempel Ziv and Welch */ + PDF_LZW = 3, + /** CCITT modified Huffman RLE. */ + PDF_RLE = 4, + /** JPEG compression. */ + PDF_JPEG = 5 +} + +/** ICAP_PIXELTYPE values (PT_ means Pixel Type) */ +declare enum EnumDWT_PixelType { + TWPT_BW = 0, + TWPT_GRAY = 1, + TWPT_RGB = 2, + TWPT_PALLETE = 3, + TWPT_CMY = 4, + TWPT_CMYK = 5, + TWPT_YUV = 6, + TWPT_YUVK = 7, + TWPT_CIEXYZ = 8, + TWPT_LAB = 9, + TWPT_SRGB = 10, + TWPT_SCRGB = 11, + TWPT_INFRARED = 16 +} + +declare enum EnumDWT_PlatformType { + /// Fit the image to the width and height of the window + enumWindow = 0, + /// Fit the image to the height of the window + enumMac = 1, + /// Fit the image to the width of the window + enumLinux = 2 +} + +declare enum EnumDWT_ShowMode { + /** Activates the window and displays it in its current size and position. */ + SW_ACTIVE = 0, + /** Maximizes the window */ + SW_MAX = 1, + /** Minimize the window */ + SW_MIN = 2, + /** Close the latest opened editor window */ + SW_CLOSE = 3, + /** Check whether a window exists */ + SW_IFLIVE = 4 +} + +/** TIFF file compression type. */ +declare enum EnumDWT_TIFFCompressionType { + /** Auto mode. */ + TIFF_AUTO = 0, + /** Dump mode. */ + TIFF_NONE = 1, + /** CCITT modified Huffman RLE. */ + TIFF_RLE = 2, + /** CCITT Group 3 fax encoding. */ + TIFF_FAX3 = 3, + /** CCITT T.4 (TIFF 6 name). */ + TIFF_T4 = 3, + /** CCITT Group 4 fax encoding */ + TIFF_FAX4 = 4, + /** CCITT T.6 (TIFF 6 name). */ + TIFF_T6 = 4, + /** Lempel Ziv and Welch */ + TIFF_LZW = 5, + TIFF_JPEG = 7, + TIFF_PACKBITS = 32773 +} + +/** ICAP_XFERMECH values. */ +declare enum EnumDWT_TransferMode { + /** Native transfers require the data to be transferred to a single large block of RAM. Therefore, + * they always face the risk of having an inadequate amount of RAM available to perform the transfer successfully. + */ + TWSX_NATIVE = 0, + /** Disk File Mode Transfers. */ + TWSX_FILE = 1, + /** Buffered Memory Mode Transfers. */ + TWSX_MEMORY = 2/*,*/ + /** added 1.91 , not supported in DWT yet*/ + /** TWSX_MEMFILE = 4*/ +} + +/** ICAP_UNITS values. */ +declare enum EnumDWT_UnitType { + TWUN_INCHES = 0, + TWUN_CENTIMETERS = 1, + TWUN_PICAS = 2, + TWUN_POINTS = 3, + TWUN_TWIPS = 4, + TWUN_PIXELS = 5, + TWUN_MILLIMETERS = 6 +} + +declare enum EnumDWT_UploadDataFormat { + Binary = 0, + Base64 = 1 } /** - * @class + * interface for a base64 result */ -// properties (get/set) / sync functions -interface WebTwain { - /** - * Returns or sets whether multi-page selection is supported. - * @type {bool} - */ - AllowMultiSelect: boolean; - - /** - * [Deprecated.] Returns or sets whether allowing the plugin to send authentication request. The default value of this property is TRUE. - * @type {bool} - */ - AllowPluginAuthentication: boolean; - - /** - * [Deprecated.] Returns or sets whether the async mode is activated. With this mode, Dynamic Web TWAIN is able to upload/download files via HTTP/FTP asynchronously. The default value is false. - * @type {bool} - */ - AsyncMode: boolean; - - /** - * Returns or sets the background color of the main control. It is a value specifying the 24-bit RGB value. - * @type {int} - */ - BackgroundColor: number; - - /** - * Returns or sets the fill color of the selected area of an image when it is cut, erased or rotated. It is a value specifying the 24-bit RGB value. - * @type {int} - */ - BackgroundFillColor: number; - - /** - * [Deprecated.] Returns the number of barcode detected in an image. - * @type {int} - */ - BarcodeCount: number; - - /** - * Returns or sets the pixel bit depths for the current value of PixelType property. This is a runtime property. - * @type {short} - */ - BitDepth: number; - - /** - * Returns the current deviation of the pixels in the image. - * @type {float} - */ - BlankImageCurrentStdDev: number; - - /** - * Returns or sets the standard deviation of the pixels in the image. - * @type {float} - */ - BlankImageMaxStdDev: number; - - /** - * Returns or sets the dividing line between black and white. The default value is 128. - * @type {int} - */ - BlankImageThreshold: number; - - /** - * [Deprecated.] Returns or sets the border style. - * @type {EnumDWT_BorderStyle} - */ - BorderStyle: EnumDWT_BorderStyle; - - /** - * Returns or sets the brightness values available within the Source. This is a runtime property. - * @type {float} - */ - Brightness: number; - - /** - * [Deprecated.] Sets or returns whether brokerprocess is enabled for scanning. - * @type {int} - */ - BrokerProcessType: number; - - /** - * Sets or returns how much physical memory is allowed for storing images currently loaded in Dynamic Web TWAIN. Once the limit is reached, images will be cached on the hard disk. - * @type {int} - */ - BufferMemoryLimit: number; - - /** - * Specifies the capabiltiy to be negotiated. This is a runtime property. - * @type {EnumDWT_Cap} - */ - Capability: EnumDWT_Cap; - - /** - * Sets or returns the index (0-based) of a list to indicate the Current Value when the value of the CapType property is TWON_ENUMERATION. If the data type of the capability is String, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime property. - * @type {int} - */ - CapCurrentIndex: number; - - /** - * Sets or returns the current value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. - * @type {double} - */ - CapCurrentValue: number; - - /** - * Returns the index (0-based) of a list to indicate the Default Value when the value of the CapType property is TWON_ENUMERATION. If the data type of the capability is String, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime, read-only property. - * @type {int} - */ - CapDefaultIndex: number; - - /** - * Returns the default value in a range when the value of the CapType property is TWON_RANGE. This is a runtime, read-only property. - * @type {double} - */ - CapDefaultValue: number; - - /** - * Sets or returns the maximum value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. - * @type {double} - */ - CapMaxValue: number; - - /** - * Sets or returns the minimum value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. - * @type {double} - */ - CapMinValue: number; - - /** - * [Deprecated.] Sets or returns how many items are in the list when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. For String data type, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime property. - * @type {int} - */ - CapNumItems: number; - - /** - * [Deprecated.] Replaced by GetCapItemsString method and SetCapItemsString method. - * @type {string} - */ - CapItemsString: string; - - /** - * Sets or returns the step size in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. - * @type {double} - */ - CapStepSize: number; - - /** - * Sets or returns the type of capability container used to exchange capability information between application and source. This is a runtime property. - * @type {EnumDWT_CapType} - */ - CapType: EnumDWT_CapType; - - /** - * Returns or sets the value of the capability specified by Capability property when the value of the CapType property is TWON_ONEVALUE. This is a runtime property. - * @type {double} - */ - CapValue: number; - - /** - * Sets or returns the string value for a capability when the value of the CapType property is TWON_ONEVALUE. This is a runtime property. - * @type {string} - */ - CapValueString: string; - - /** - * Sets or returns the value type for reading the value of a capability. This is a runtime property. - * @type {short} - */ - CapValueType: number; - - /** - * Returns or sets the contrast values available within the Source. This is a runtime property. - * @type {float} - */ - Contrast: number; - - /** - * Sets or returns the product name string for the application identity. - * @type {string} - */ - ProductName: string; - - /** - * Returns or sets current index of image in buffer. This is a runtime property. - * @type {short} - */ - CurrentImageIndexInBuffer: number; - - /** - * Returns the device name of current source. This is a runtime, read-only property. - * @type {string} - */ - CurrentSourceName: string; - - /** - * Returns the value indicating the data source status. This is a runtime, read-only property. - * @type {int} - */ - DataSourceStatus: number; - - /** - * Returns the device name of default source. This is a runtime, read-only property. - * @type {string} - */ - DefaultSourceName: string; - - /** - * Returns whether the source supports duplex. If so, it further returns the level of duplex the Source supports (one pass or two pass duplex). This is a runtime, read-only property. - * @type {int} - */ - Duplex: number; - - /** - * [Deprecated.] Returns or sets whether the user can zoom image using hot key. - * @type {bool} - */ - EnableInteractiveZoom: boolean; - - /** - * Returns the error code. This is a runtime, read-only property. - * @type {int} - */ - ErrorCode: number; - - /** - * Returns the error string. This is a runtime, read-only property. - * @type {string} - */ - ErrorString: string; - - /** - * Returns or sets whether to resize the image to fit the image to the width or height of the window. To use the property, the view mode should be set to -1 by -1. You can use SetViewMode method to set the view mode. - * @type {EnumDWT_FitWindowType} - */ - FitWindowType: EnumDWT_FitWindowType; - - /** - * Returns or sets the password used to log into the FTP server. - * @type {string} - */ - FTPPassword: string; - - /** - * Returns or sets the port number of the FTP server. - * @type {int} - */ - FTPPort: number; - - /** - * Returns or sets the user name used to log into the FTP server. - * @type {string} - */ - FTPUserName: string; - - /** - * Returns how many images are in buffer. This is a runtime, read-only property. - * @type {short} - */ - HowManyImagesInBuffer: number; - - /** - * Specifies the field name of uploaded image through POST. - * @type {string} - */ - HttpFieldNameOfUploadedImage: string; - - /** - * [Deprecated.] Sets or returns the password used to log into the HTTP server. - * @type {string} - */ - HTTPPassword: string; - - /** - * Returns or sets the port number of the HTTP server. - * @type {int} - */ - HTTPPort: number; - - /** - * Returns the response string from the HTTP server if an error occurs for HTTPUploadThroughPost() method. This is a runtime, read-only property. - * @type {string} - */ - HTTPPostResponseString: string; - - /** - * [Deprecated.] Returns or sets the user name used to log into the HTTP server. - * @type {string} - */ - HTTPUserName: string; - - /** - * Returns or sets whether the feature of disk caching is enabled. - * @type {bool} - */ - IfAllowLocalCache: boolean; - - /** - * Returns or sets whether insert or append new scanned images. - * @type {bool} - */ - IfAppendImage: boolean; - - /** - * Returns or sets whether the Source's Auto-brightness function is enabled. This is a runtime property. - * @type {bool} - */ - IfAutoBright: boolean; - - /** - * Returns or sets whether the data source (scanner) will discard blank images during scanning. The property works only if the device and its driver support discarding blank pages. You can find whether your device supports this capbility from its user manual. Or, you can use the built-in methods of Dynamic Web TWAIN to detect blank images: IsBlankImage, IsBlankImageEx. - * @type {bool} - */ - IfAutoDiscardBlankpages: boolean; - - /** - * Returns or sets whether the Source enable automatic document feeding process. This is a runtime property. - * @type {bool} - */ - IfAutoFeed: boolean; - - /** - * Turns automatic border detection on and off. The property works only if the device and its driver support detecting the border automatically. You can find whether your device supports this capbility from its user manual. - * @type {bool} - */ - IfAutomaticBorderDetection: boolean; - - /** - * Turns automatic skew correction on and off. - * @type {bool} - */ - IfAutomaticDeskew: boolean; - - /** - * Returns or sets whether the Source enables the automatic document scanning process. This is a runtime property. - * @type {bool} - */ - IfAutoScan: boolean; - - /** - * Returns or sets whether close the Data Source User Interface after acquire all images. Default value of this property is FALSE. - * @type {bool} - */ - IfDisableSourceAfterAcquire: boolean; - - /** - * Returns or sets whether the Source supports duplex. If TRUE, the scanner scans both sides of a paper; otherwise, the scanner will scan only one side of the image. This is a runtime property. - * @type {bool} - */ - IfDuplexEnabled: boolean; - - /** - * Returns or sets whether the Automatic Document Feeder (ADF) is enabled. This is a runtime property. - * @type {bool} - */ - IfFeederEnabled: boolean; - - /** - * Returns whether or not there are documents loaded in the Source's feeder when IfFeederEnabled and IfPaperDetectable are TRUE. This is a runtime, read-only property. - * @type {bool} - */ - IfFeederLoaded: boolean; - - /** - * Returns or sets whether to resize the image to fit the size of window when the view mode is set to -1 by -1. You can use SetViewMode method to set the view mode. - * @type {bool} - */ - IfFitWindow: boolean; - - /** - * [Deprecated.] Returns or sets whether the UI (User Interface) of Source runs in modal state. Default value of this property is TRUE. - * @type {bool} - */ - IfModalUI: boolean; - - /** - * Sets or returns whether Dynamic Web TWAIN uses Graphics Device Interface (GDI) when decoding images. - * @type {bool} - */ - IfOpenImageWithGDIPlus: boolean; - - /** - * Returns the value whether the Source has a paper sensor that can detect documents on the ADF or Flatbed. This is a runtime, read-only property. - * @type {bool} - */ - IfPaperDetectable: boolean; - - /** - * Returns or sets whether FTP passive mode is enabled. - * @type {bool} - */ - IfPASVMode: boolean; - - /** - * [Deprecated.] Returns or sets whether communicate with device in a separate thread. Default value of this property is FALSE. - * @type {bool} - */ - IfScanInNewThread: boolean; - - /** - * Sets or returns whether to show the cancel dialog when uploading images to server. - * @type {bool} - */ - IfShowCancelDialogWhenImageTransfer: boolean; - - /** - * Returns or sets whether to show the file dialog box when saving scanned images or loading images from local folder. - * @type {bool} - */ - IfShowFileDialog: boolean; - - /** - * Returns or sets whether the Source displays a progress indicator during acquisition and transfer, regardless of whether the Source's user interface is active. This is a runtime property. - * @type {bool} - */ - IfShowIndicator: boolean; - - /** - * [Deprecated.] Returns or sets whether the driver of the printer displays the User Interface. - * @type {bool} - */ - IfShowPrintUI: boolean; - - /** - * Returns or sets whether the progress bar will be displayed during the transaction. This is a runtime property. - * @type {bool} - */ - IfShowProgressBar: boolean; - - /** - * Returns or sets whether the Source displays the User Interface. - * @type {bool} - */ - IfShowUI: boolean; - - /** - * Returns or sets whether SSL is used when uploading or downloading images. - * @type {bool} - */ - IfSSL: boolean; - - /** - * Return or sets whether the Source allows to save many images in one TIFF file. The default value is FALSE. - * @type {bool} - */ - IfTiffMultiPage: boolean; - - /** - * Returns whether the Source supports acquisition with the UI (User Interface) disabled. If FALSE, indicates that this Source can only support acquisition with the UI enabled. This is a runtime, read-only property. - * @type {bool} - */ - IfUIControllable: boolean; - - /** - * Sets or returns whether Dynamic Web TWAIN uses the new TWAIN Data Source Manager (TWAINDSM.dll) when acquiring images from TWAIN devices. - * @type {bool} - */ - IfUseTwainDSM: boolean; - - /** - * Specifies whether or not to automatically scroll to the last image or stay on the current image when loading or acquiring images - * @type {bool} - */ - IfAutoScroll: boolean; - - /** - * [Deprecated.] The number of bits in each image pixel (or bit depth). This is a runtime, read-only property. - * @type {short} - */ - ImageBitsPerPixel: number; - - /** - * Returns or sets whether a TWAIN driver or Native Scan of Mac OS X is used for document scanning. This property works for Mac edition only. - * @type {int} - */ - ImageCaptureDriverType: number; - - /** - * [Deprecated.] Returns or sets whether the image enumerator is enabled in Image Editor. - * @type {bool} - */ - ImageEditorIfEnableEnumerator: boolean; - - /** - * [Deprecated.] Returns or sets whether the Image Editor is a modal window. - * @type {bool} - */ - ImageEditorIfModal: boolean; - - /** - * [Deprecated.] Returns or sets whether the Image Editor is read-only. - * @type {bool} - */ - ImageEditorIfReadonly: boolean; - - /** - * [Deprecated.] Returns or sets the title of Image Editor window. - * @type {string} - */ - ImageEditorWindowTitle: string; - - /** - * Returns the document number of the current image. This is a runtime, read-only property. - * @type {int} - */ - ImageLayoutDocumentNumber: number; - - /** - * Returns the value of the bottom-most edge of the current image frame (in Unit). This is a read-only runtime property. - * @type {float} - */ - ImageLayoutFrameBottom: number; - - /** - * Returns the value of the left-most edge of the current image frame (in Unit). This is a runtime, read-only property. - * @type {float} - */ - ImageLayoutFrameLeft: number; - - /** - * Returns the frame number of the current image. This is a runtime, read-only property. - * @type {int} - */ - ImageLayoutFrameNumber: number; - - /** - * Returns the value of the right-most edge of the current image frame (in Unit). This is a runtime, read-only property. - * @type {float} - */ - ImageLayoutFrameRight: number; - - /** - * Returns the value of the top-most edge of the current image frame (in Unit). This is a runtime, read-only property. - * @type {float} - */ - ImageLayoutFrameTop: number; - - /** - * Returns the page number of the current image. This is a runtime, read-only property. - * @type {Long} - */ - ImageLayoutPageNumber: number; - - /** - * [Deprecated.] Returns how tall/long, in pixels, the image is. This is a runtime, read-only property. - * @type {int} - */ - ImageLength: number; - - /** - * Returns or sets the margin between images when multiple images are displayed in Dynamic Web TWAIN. - * @type {short} - */ - ImageMargin: number; - - /** - * Returns the pixel type of the current image. This is a runtime, read-only property. Please note the property is only valid in OnPreTransfer and OnPostTransfer event. - * @type {EnumDWT_PixelType} - */ - ImagePixelType: EnumDWT_PixelType; - - /** - * [Deprecated.] Returns how width, in pixels, the image is. This is a runtime, read-only property. - * @type {int} - */ - ImageWidth: number; - - /** - * [Deprecated.] Returns the X resolution of the current image. X resolution is the number of pixels per Unit in the horizontal direction. This is a runtime, read-only property. - * @type {float} - */ - ImageXResolution: number; - - /** - * [Deprecated.] Returns the Y resolution of the current image. Y resolution is the number of pixels per Unit in the vertical direction. This is a runtime, read-only property. - * @type {float} - */ - ImageYResolution: number; - - /** - * Returns or sets the quality of JPEG files and PDF files using JPEG compression. - * @type {short} - */ - JPEGQuality: number; - - /** - * Returns or sets the log level for debugging. - * @type {short} - */ - LogLevel: number; - - /** - * Return the magnetic data if the scanner support magnetic data recognition. - * @type {string} - */ - MagData: string; - - /** - * Return the magnetic type if the scanner support magnetic data recognition. - * @type {short} - */ - MagType: number; - - /** - * Sets or returns the manufacture string for the application identity. - * @type {string} - */ - Manufacturer: string; - - /** - * Returns or sets the maximum number of images can be held in buffer. - * @type {short} - */ - MaxImagesInBuffer: number; - - /** - * [Deprecated.] Returns or sets how many threads can be used when you upload files through POST. - * @type {int} - */ - MaxInternetTransferThreads: number; - - /** - * Sets or returns the maximum allowed size when Dynamic Web TWAIN uploads a document. - * @type {int} - */ - MaxUploadImageSize: number; - - /** - * Returns or sets the shape of the mouse. - * @type {bool} - */ - MouseShape: boolean; - - /** - * Returns the X co-ordinate of the mouse. This is a runtime property. - * @type {int} - */ - MouseX: number; - - /** - * Returns the Y co-ordinate of the mouse. This is a runtime property. - * @type {int} - */ - MouseY: number; - - /** - * Returns or sets the page size(s) the Source can/should use to acquire image data. This is a runtime property. - * @type {short} - */ - PageSize: number; - - /** - * Returns or sets the name of the person who creates the PDF document. - * @type {string} - */ - PDFAuthor: string; - - /** - * Returns or sets the compression type of PDF files. This is a runtime property. - * @type {EnumDWT_PDFCompressionType} - */ - PDFCompressionType: EnumDWT_PDFCompressionType; - - /** - * Returns or sets the date when the PDF document is created. - * @type {string} - */ - PDFCreationDate: string; - - /** - * Returns or sets the name of the application that created the original document, if the PDF document is converted from another form. - * @type {string} - */ - PDFCreator: string; - - /** - * Returns or sets the keywords associated with the PDF document. - * @type {string} - */ - PDFKeywords: string; - - /** - * Returns or sets the date when the PDF document is last modified. - * @type {string} - */ - PDFModifiedDate: string; - - /** - * Returns or sets the name of the application that converted the PDF document from its native. - * @type {string} - */ - PDFProducer: string; - - /** - * Returns or sets the subject of the PDF document. - * @type {string} - */ - PDFSubject: string; - - /** - * Returns or sets the title of the PDF document. - * @type {string} - */ - PDFTitle: string; - - /** - * Returns or sets the value of the PDF version. - * @type {string} - */ - PDFVersion: string; - - /** - * Returns the number of transfers the Source is ready to supply, upon demand. This is a runtime, read-only property. - * @type {short} - */ - PendingXfers: number; - - /** - * Returns or sets the pixel flavor for acquired images. This is a runtime property. - * @type {short} - */ - PixelFlavor: number; - - /** - * Returns or sets the pixel type of current data source. This is a runtime property. Using this property after calling OpenSource() method and before calling AcquireImage(). - * @type {EnumDWT_PixelType} - */ - PixelType: EnumDWT_PixelType; - - /** - * Sets or returns the product family string for the application identity. - * @type {string} - */ - ProductFamily: string; - - /** - * Sets the product key. A product key is generated in Licensing Tool which is intalled with Dynamic Web TWAIN. Each product key corresponds with a license. - * @type {string} - */ - ProductKey: string; - - /** - * [Deprecated.] Returns or sets the name of the proxy server. - * @type {string} - */ - ProxyServer: string; - - /** - * Returns or sets the current resolution for acquired images. This is a runtime property. - * @type {float} - */ - Resolution: number; - - /** - * Returns or sets how many scanned images are selected. - * @type {short} - */ - SelectedImagesCount: number; - - /** - * Returns or sets the border color of the selected image. It is a value specifying the 24-bit RGB value. - * @type {int} - */ - SelectionImageBorderColor: number; - - /** - * Specifies a fixed aspect ratio to be used for selecting an area. - * @type {float} - */ - SelectionRectAspectRatio: number; - - /** - * Returns how many sources are installed in the system. This is a runtime, read-only property. - * @type {int} - */ - SourceCount: number; - - /** - * [Deprecated.] Replaced by GetSourceNameItems method. - * @type {string} - */ - SourceNameItems: string; - - /** - * [Deprecated.] - * @type {string} - */ - GetSourceNames: string; - - /** - * Returns or sets the compression type of TIFF files. This is a runtime property. - * @type {EnumDWT_TIFFCompressionType} - */ - TIFFCompressionType: EnumDWT_TIFFCompressionType; - - /** - * Sets or returns the transfer mode. - * @type {EnumDWT_TransferMode} - */ - TransferMode: EnumDWT_TransferMode; - - /** - * Returns or sets the unit of measure. This is a runtime property. - * @type {short} - */ - Unit: number; - - /** - * Sets or returns the version info string for the application identity. - * @type {string} - */ - VersionInfo: string; - - /** - * Returns and sets the number of images you are willing to transfer per session. This is a runtime property. - * @type {short} - */ - XferCount: number; - - /** - * Returns or sets zoom factor for the image, only valid When the view mode is set to -1 by -1. - * @type {float} - */ - Zoom: number; - - /** - * Binds a specified function to an event, so that the function gets called whenever the event fires. - * @method WebTwain#RegisterEvent - * @param {string} name the name of the event that the function is bound to. - * @param {object} evt specifies the function to call when event fires. - * @return {bool} - */ - RegisterEvent(name: string, evt: object): boolean; - - // --- SCAN start -- - - /** - * Cancels all pending transfers. - * @method WebTwain#CancelAllPendingTransfers - * @return {bool} - */ - CancelAllPendingTransfers(): boolean; - - /** - * Closes Data Source. - * @method WebTwain#CloseSource - * @return {bool} - */ - CloseSource(): boolean; - - /** - * Closes and unloads Data Source Manager. - * @method WebTwain#CloseSourceManager - * @return {bool} - */ - CloseSourceManager(): boolean; - - /** - * Disable the source. If the source's user interface is displayed when the source is enabled, it will be closed. - * @method WebTwain#DisableSource - * @return {bool} - */ - DisableSource(): boolean; - - /** - * Sets the Source to eject the current page and advance the next page in the document feeder into the feeder acquire area when IfFeederEnabled is TRUE. - * @method WebTwain#FeedPage - * @return {bool} - */ - FeedPage(): boolean; - - /** - * Retrieve the device type of the currently selected data source, it might be a scanner, a web camera, etc. - * @method WebTwain#GetDeviceType - * @return {int} - */ - GetDeviceType(): number; - - /** - * Get the source name according to the source index. - * @method WebTwain#GetSourceNameItems - * @param {short} index int index. Index is 0-based and can not be greater than SourceCount property. - * @return {string} - */ - GetSourceNameItems(index: number): string; - - /** - * Loads the specified Source into main memory and causes its initialization, - * placing Dynamic Web TWAIN into Capability Negotiation state. If no source is - * specified (no SelectSource() or SelectSourceByIndex() is called), opens the default source. - * @method WebTwain#OpenSource - * @return {bool} - */ - OpenSource(): boolean; - - /** - * Loads and opens Data Source Manager. - * @method WebTwain#OpenSourceManager - * @return {bool} - */ - OpenSourceManager(): boolean; - - /** - * Reverts the current image layout to the Data Source's default. - * @method WebTwain#ResetImageLayout - * @return {bool} - */ - ResetImageLayout(): boolean; - - /** - * Sets the Source to return the current page to the input side of the document feeder and - * feed the last page from the outside of the feeder back into the acquisition area if IfFeederEnabled is TRUE. - * @method WebTwain#RewindPage - * @return {bool} - */ - RewindPage(): boolean; - - /** - * Brings up the TWAIN Data Source Manager's Source Selection User Interface (UI) - * so that user can choose which Data Source to be the current Source. - * @method WebTwain#SelectSource - * @return {bool} - */ - SelectSource(): boolean; - - /** - * Selects the index-the source in SourceNameItems property as the current source. - * @method WebTwain#SelectSourceByIndex - * @param {short} index It is the index of SourceNameItems property. - * @return {bool} - */ - SelectSourceByIndex(index: number): boolean; - - /** - * Sets file name and file format information used in File Transfer Mode. - * @method WebTwain#SetFileXferInfo - * @param {string} fileName the name of the file to be used in transfer. - * @param {EnumDWT_FileFormat} fileFormat an enumerated value indicates the format of the image. - * @return {bool} - */ - SetFileXferInfo(fileName: string, fileFormat: EnumDWT_FileFormat): boolean; - - /** - * Sets the left, top, right, and bottom sides of the image layout rectangle for the current Data Source. - * @method WebTwain#SetImageLayout - * @param {float} left specifies the floating point number for the left side of the image layout rectangle. - * @param {float} top specifies the floating point number for the top side of the image layout rectangle. - * @param {float} right specifies the floating point number for the right side of the image layout rectangle. - * @param {float} bottom specifies the floating point number for the bottom side of the image layout rectangle. - * @return {bool} - */ - SetImageLayout(left: number, top: number, right: number, bottom: number): boolean; - - /** - * Clears all the web forms which are used for image uploading. - * @method WebTwain#ClearAllHTTPFormField - * @return {bool} - */ - ClearAllHTTPFormField(): boolean; - - /** - * Clears the content of all custom tiff tags. - * @method WebTwain#ClearTiffCustomTag - * @return {void} - */ - ClearTiffCustomTag(): void; - - /** - * Check whether a certain file exists on the local disk. - * @method WebTwain#FileExists - * @param {string} localFile specifies the absolute path of the local file. - * @return {bool} - */ - FileExists(localFile: string): boolean; - - /** - * Downloads an image from the FTP server. - * @method WebTwain#FTPDownload - * @param {string} FTPServer the name of the FTP server. - * @param {string} FTPRemoteFile the name of the file to be downloaded. It should be the relative path of the file on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - FTPDownload(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Directly download a file from the FTP server to local disk without loading it into Dynamic Web TWAIN. - * @method WebTwain#FTPDownloadDirectly - * @param {string} FTPServer the name of the FTP server. - * @param {string} FTPRemoteFile the name of the file to be downloaded. It should be the relative path of the file on the FTP server. - * @param {string} localFile specify a full path to store the file. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - FTPDownloadDirectly(FTPServer: string, FTPRemoteFile: string, localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Downloads an image from the FTP server. - * @method WebTwain#FTPDownloadEx - * @param {string} FTPServer the name of the FTP server. - * @param {string} FTPRemoteFile the name of the file to be downloaded. It should be the relative path of the file on the FTP server. - * @param {EnumDWT_ImageType} lImageType simage format of the file to be downloaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - FTPDownloadEx(FTPServer: string, FTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads the image of a specified index in the buffer to the FTP server. - * @method WebTwain#FTPUpload - * @param {string} FTPServer the name of the FTP server. - * @param {short} sImageIndex specifies the index of the image in the buffer. The index is 0-based. - * @param {string} FTPRemoteFile the name of the file to be created on the FTP server. It should be a relative path on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - FTPUpload(FTPServer: string, sImageIndex: number, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Directly upload a specific file to the FTP server without loading it into Dynamic Web TWAIN. - * @method WebTwain#FTPUploadDirectly - * @param {string} FTPServer the name of the FTP server. - * @param {string} localFile specify the the full path of a local file. - * @param {string} FTPRemoteFile the name of the file to be created on the FTP server. It should be a relative path on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - FTPUploadDirectly(FTPServer: string, localFile: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads the image of a specified index in the buffer to the FTP server as a specified image format. - * @method WebTwain#FTPUploadEx - * @param {string} FTPServer the name of the FTP server. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {string} FTPRemoteFile the name of the file to be created on the FTP server. It should be a relative path on the FTP server. - * @param {EnumDWT_ImageType} lImageType the image format of the file to be created on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - FTPUploadEx(FTPServer: string, sImageIndex: number, FTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads all images in buffer to the FTP server as Multi-Page TIFF. - * @method WebTwain#FTPUploadAllAsMultiPageTIFF - * @param {string} FTPServer the name of the FTP server. - * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - FTPUploadAllAsMultiPageTIFF(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads all images in buffer to the FTP server as Multi-Page PDF. - * @method WebTwain#FTPUploadAllAsPDF - * @param {string} FTPServer the name of the FTP server. - * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - FTPUploadAllAsPDF(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads the selected images in buffer to the FTP server as Multi-Page PDF. - * @method WebTwain#FTPUploadAsMultiPagePDF - * @param {string} FTPServer the name of the FTP server. - * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - FTPUploadAsMultiPagePDF(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads the selected images in buffer to the FTP server as Multi-Page TIFF. - * @method WebTwain#FTPUploadAsMultiPageTIFF - * @param {string} FTPServer the name of the FTP server. - * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - FTPUploadAsMultiPageTIFF(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Downloads an image from the HTTP server. - * @method WebTwain#HTTPDownload - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} HTTPRemoteFile the name of the image to be downloaded. It should be the relative path of the file on the HTTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - HTTPDownload(HTTPServer: string, HTTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Directly downloads a file from the HTTP server to a local disk without loading it into Dynamic Web TWAIN. - * @method WebTwain#HTTPDownloadDirectly - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} HTTPRemoteFile The relative path of the file on the HTTP server. - * @param {string} localFile specify the location to store the downloaded file. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - HTTPDownloadDirectly(HTTPServer: string, HTTPRemoteFile: string, localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Downloads an image from the HTTP server. - * @method WebTwain#HTTPDownloadEx - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} HTTPRemoteFile the relative path of the file on the HTTP server, or path to an action page (with necessary parameters) which gets and sends back the image stream to the client (please check the sample for more info) - * @param {EnumDWT_ImageType} lImageType the image format of the file to be downloaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - HTTPDownloadEx(HTTPServer: string, HTTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Download an image from the server using a HTTP Post call. - * @method WebTwain#HTTPDownloadThroughPost - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} HTTPRemoteFile the relative path of the file on the HTTP server, or path to an action page (with necessary parameters) which gets and sends back the image stream to the client (please check the sample for more info) - * @param {EnumDWT_ImageType} lImageType the image format of the file to be downloaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - HTTPDownloadThroughPost(HTTPServer: string, HTTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads the image of a specified index in the buffer to the HTTP server through the HTTP POST method. - * @method WebTwain#HTTPUploadThroughPost - * @param {string} HTTPServer the name of the HTTP server. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". - * @param {string} fileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. - * @return {bool} - */ - HTTPUploadThroughPost(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Directly upload a specific local file to the HTTP server through the HTTP POST method without loading it into Dynamic Web TWAIN. - * @method WebTwain#HTTPUploadThroughPostDirectly - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} localFile specifies the path of a local file . - * @param {string} ActionPage the specified page for posting files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". - * @param {string} fileName the name of the file to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. - * @return {bool} - */ - HTTPUploadThroughPostDirectly(HTTPServer: string, localFile: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads the image of a specified index in the buffer to the HTTP server as a specified image format through the HTTP POST method. - * @method WebTwain#HTTPUploadThroughPostEx - * @param {string} HTTPServer the name of the HTTP server. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". - * @param {string} fileName the name of the image to be uploaded. - * @param {EnumDWT_ImageType} lImageType the image format of the file to be created on the HTTP server.s - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadFailure. - * @return {bool} - */ - HTTPUploadThroughPostEx(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads all images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. - * @method WebTwain#HTTPUploadAllThroughPostAsMultiPageTIFF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". - * @param {string} fileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. - * @return {bool} - */ - HTTPUploadAllThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads the selected images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. - * @method WebTwain#HTTPUploadThroughPostAsMultiPageTIFF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". - * @param {string} fileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. - * @return {bool} - */ - HTTPUploadThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads all images in the buffer to the HTTP server through HTTP Post method as a Multi-Page PDF. - * @method WebTwain#HTTPUploadAllThroughPostAsPDF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". - * @param {string} fileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. - * @return {bool} - */ - HTTPUploadAllThroughPostAsPDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads the selected images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page PDF. - * @method WebTwain#HTTPUploadThroughPostAsMultiPagePDF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". - * @param {string} fileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. - * @return {bool} - */ - HTTPUploadThroughPostAsMultiPagePDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * [Deprecated.] Directly uploads a specific local file to the HTTP server through the HTTP PUT method without loading it into Dynamic Web TWAIN. - * @method WebTwain#HTTPUploadThroughPutDirectly - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} localFile specifies the path of a local file. - * @param {string} RemoteFileName the name of the file to be created on the HTTP server. It should a relative path on the web server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - HTTPUploadThroughPutDirectly(HTTPServer: string, localFile: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * [Deprecated.] Uploads the image of a specified index in the buffer to the HTTP server through the HTTP PUT method. - * @method WebTwain#HTTPUploadThroughPut - * @param {string} HTTPServer the name of the HTTP server. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {string} RemoteFileName the name of the image to be created on the HTTP server. It should a relative path on the web server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - HTTPUploadThroughPut(HTTPServer: string, sImageIndex: number, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * [Deprecated.] Uploads the image of a specified index in the buffer to the HTTP server as a specified image format through the HTTP PUT method. - * @method WebTwain#HTTPUploadThroughPutEx - * @param {string} HTTPServer the name of the HTTP server. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {string} RemoteFileName the name of the file to be created on the HTTP server. It should a relative path on the web server. - * @param {EnumDWT_ImageType} lImageType the image format of the file to be created on the HTTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - HTTPUploadThroughPutEx(HTTPServer: string, sImageIndex: number, RemoteFileName: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * [Deprecated.] Uploads all images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page TIFF. - * @method WebTwain#HTTPUploadAllThroughPutAsMultiPageTIFF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} RemoteFileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - HTTPUploadAllThroughPutAsMultiPageTIFF(HTTPServer: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * [Deprecated.] Uploads the selected images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page TIFF. - * @method WebTwain#HTTPUploadThroughPutAsMultiPageTIFF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} RemoteFileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - HTTPUploadThroughPutAsMultiPageTIFF(HTTPServer: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * [Deprecated.] Uploads all images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page PDF. - * @method WebTwain#HTTPUploadAllThroughPutAsPDF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} RemoteFileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - HTTPUploadAllThroughPutAsPDF(HTTPServer: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * [Deprecated.] Uploads the selected images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page PDF. - * @method WebTwain#HTTPUploadThroughPutAsMultiPagePDF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} RemoteFileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - HTTPUploadThroughPutAsMultiPagePDF(HTTPServer: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Configures how segmented upload is done. - * @method WebTwain#SetUploadSegment - * @param {int} segmentUploadThreshold specifies the threshold (in MB) over which segmented upload will be invoked. - * @param {int} moduleSize specifies the size of each segment (in KB). - * @return {bool} - */ - SetUploadSegment (segmentUploadThreshold: number, moduleSize: number): boolean; - - /** - * Uploads the images specified by the indices to the HTTP server. - * @method WebTwain#HTTPUpload - * @param {string} url the url where the images are sent in a POST request. - * @param {Array} indices indices specifies which images are to be uploaded. - * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be uploaded. - * @param {EnumDWT_UploadDataFormat} dataFormat whether to upload the images as binary or a base64-based string. - * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - HTTPUpload (url: string, indices: number[], enumImageType: EnumDWT_ImageType, dataFormat: EnumDWT_UploadDataFormat, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Loads a DIB format image from Clipboard into the Dynamic Web TWAIN. - * @method WebTwain#LoadDibFromClipboard - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the loading succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the loading fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - LoadDibFromClipboard(optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Loads an image into the Dynamic Web TWAIN. - * @method WebTwain#LoadImage - * @param {string} localFile the name of the image to be loaded. It should be the absolute path of the image file on the local disk. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the loading succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the loading fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - LoadImage(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Loads an image into the Dynamic Web TWAIN. - * @method WebTwain#LoadImageEx - * @param {string} localFile the name of the image to be loaded. It should be the absolute path of the image file on the local disk. - * @param {EnumDWT_ImageType} lImageType the image format of the file to be loaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the loading succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the loading fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - LoadImageEx(localFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Loads image from a base64 byte array with the specified file format. - * @method WebTwain#LoadImageFromBase64Binary - * @param {string} bry specifies the base64 string data. - * @param {EnumDWT_ImageType} lImageType specifies the file format. - * @return {bool} - */ - LoadImageFromBase64Binary(bry: string, lImageType: EnumDWT_ImageType): boolean; - - /** - * [Deprecated.] Loads image from a byte array with the specified file format. - * @method WebTwain#LoadImageFromBytes - * @param {int} lBufferSize Specifies the buffer size. - * @param {Array} buffer A byte array of the image data. - * @param {EnumDWT_ImageType} lImageType Specifies the file format. - * @return {bool} - */ - LoadImageFromBytes(lBufferSize: number, buffer: number[], lImageType: EnumDWT_ImageType): boolean; - - /** - * Saves all images in buffer as a MultiPage TIFF file. - * @method WebTwain#SaveAllAsMultiPageTIFF - * @param {string} localFile the name of the MultiPage TIFF file to be saved. It should be an absolute path on the local disk. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - SaveAllAsMultiPageTIFF(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Saves all images in buffer as a Multi-Page PDF file. - * @method WebTwain#SaveAllAsPDF - * @param {string} localFile the name of the Multi-Page PDF file to be saved. It should be an absolute path on the local disk. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - SaveAllAsPDF(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Saves the image of a specified index in buffer as a BMP file. - * @method WebTwain#SaveAsBMP - * @param {string} localFile the name of the BMP file to be saved. It should be an absolute path on the local disk. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - SaveAsBMP(localFile: string, sImageIndex: number): boolean; - - /** - * Saves the image of a specified index in buffer as a JPEG file. - * @method WebTwain#SaveAsJPEG - * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - SaveAsJPEG(localFile: string, sImageIndex: number): boolean; - - /** - * Saves the image of a specified index in buffer as a PDF file. - * @method WebTwain#SaveAsPDF - * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - SaveAsPDF(localFile: string, sImageIndex: number): boolean; - - /** - * Saves the image of a specified index in buffer as a PNG file. - * @method WebTwain#SaveAsPNG - * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - SaveAsPNG(localFile: string, sImageIndex: number): boolean; - - /** - * Saves the image of a specified index in buffer as a TIFF file. - * @method WebTwain#SaveAsTIFF - * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - SaveAsTIFF(localFile: string, sImageIndex: number): boolean; - - /** - * Saves the selected images in buffer as a Multipage PDF file. - * @method WebTwain#SaveSelectedImagesAsMultiPagePDF - * @param {string} localFile the name of the MultiPage PDF file to be saved. It should be an absolute path on the local disk. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - SaveSelectedImagesAsMultiPagePDF(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Saves the selected images in buffer as a Multipage TIFF file. - * @method WebTwain#SaveSelectedImagesAsMultiPageTIFF - * @param {string} localFile the name of the MultiPage TIFF file to be saved. It should be an absolute path on the local disk. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - SaveSelectedImagesAsMultiPageTIFF(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Saves the selected images in buffer to base64 string. - * @method WebTwain#SaveSelectedImagesToBase64Binary - * @return {string} - */ - SaveSelectedImagesToBase64Binary(): string; - - /** - * [Deprecated.] Saves the selected images in buffer to a byte array in the specified file format. - * @method WebTwain#SaveSelectedImagesToBytes - * @param {int} bufferSize specified the buffer size. - * @param {Array} buffer A byte array of the image data. - * @return {int} - */ - SaveSelectedImagesToBytes(bufferSize: number, buffer: number[]): number; - - /** - * [Deprecated.] Sets current cookie into the Http Header to be used when uploading scanned images through POST. - * @method WebTwain#SetCookie - * @param {string} cookie the cookie on current page. - * @return {void} - */ - SetCookie(cookie: string): void; - - /** - * Sets a text parameter as a filed in a web form. This form is maintained by the component itself (meaning it's not on the page). All fields in this form will be passed to the server when uploading images. - * @method WebTwain#SetHTTPFormField - * @param {string} FieldName specifies the name of a text field in web form. - * @param {string} FieldValue specifies the value of a text field in web form. - * @return {bool} - */ - SetHTTPFormField(FieldName: string, FieldValue: string): boolean; - - /** - * Sets a custom tiff tag. Currently you can set up to 32 tags. The string to be set in a tag can be encoded with base64. - * @method WebTwain#SetTiffCustomTag - * @param {int} tag specifies the tag identifier. The value should be between 600 and 700. - * @param {string} content the string to be set for this tag. The string will be written to the .tiff file when you save/upload it. If the string is base64 encoded, we'll decode it before writing it. - * @param {bool} base64Str if you'd like to encode the string with base64, set this to true. Otherwise, the string will be plin text. - * @return {bool} - */ - SetTiffCustomTag(tag: number, content: string, base64Str: boolean): boolean; - - /** - * Show save file dialog or show open file dialog. - * @method WebTwain#ShowFileDialog - * @param {bool} SaveDialog True -- show save file dialog, False -- show open file dialog. - * @param {string} Filter The filter name specifies the filter pattern (for example, "*.TXT"). To specify multiple filter patterns for a single display string, use a semicolon to separate the patterns (for example, "*.TXT;*.DOC;*.BAK"). A pattern string can be a combination of valid file name characters and the asterisk (*) wildcard character. Do not include spaces in the pattern string. To retrieve a shortcut's target without filtering, use the string "All Files\0*.*\0\0", but the program will replace "\0" with "|" automatically. - * @param {int} FilterIndex The index of the currently selected filter in the File Types control. The buffer pointed to by Filter contains pairs of strings that define the filters. The index is 0-based. - * @param {string} DefExtension Define the default extension. GetOpenFileName and GetSaveFileName append this extension to the file name only if the user fails to type an extension. If this member is NULL and the user fails to type an extension, no extension is appended. - * @param {string} InitialDir The initial directory. The algorithm for selecting the initial directory varies on different platforms. - * @param {bool} AllowMultiSelect True -- allows users to select more than one file, False -- only allows to select one file. - * @param {bool} OverwritePrompt True -- If a file already exists with the same name, the old file will be simply overwritten, False -- not allows to save and overwrite a same name file. - * @param {int} Flags If this parameter equals 0, the program will be initiated with the default flags, otherwise initiated with the cumstom value and parameters "AllowMultiSelect" and "OverwritePrompt" will be useless. - * @return {bool} - */ - ShowFileDialog(SaveDialog: boolean, Filter: string, FilterIndex: number, DefExtension: string, InitialDir: string, AllowMultiSelect: boolean, OverwritePrompt: boolean, Flags: number): boolean; - - /** - * Gets information of the capability specified by the Capability property. - * @method WebTwain#CapGet - * @return {bool} - */ - CapGet(): boolean; - - /** - * Returns the Source's current Value for the specified capability. - * @method WebTwain#CapGetCurrent - * @return {bool} - */ - CapGetCurrent(): boolean; - - /** - * Returns the Source's Default Value for the specified capability. This is the Source's preferred default value. - * @method WebTwain#CapGetDefault - * @return {bool} - */ - CapGetDefault(): boolean; - - /** - * Returns the value of the bottom-most edge of the specified frame. - * @method WebTwain#CapGetFrameBottom - * @param {short} index specifies the value of which frame to get. The index is 0-based. - * @return {float} - */ - CapGetFrameBottom(index: number): number; - - /** - * Returns the value (in Unit) of the left-most edge of the specified frame. - * @method WebTwain#CapGetFrameLeft - * @param {short} index specifies the value of which frame to get. The index is 0-based. - * @return {float} - */ - CapGetFrameLeft(index: number): number; - - /** - * Returns the value (in Unit) of the left-most edge of the specified frame. - * @method WebTwain#CapGetFrameRight - * @param {short} index specifies the value of which frame to get. The index is 0-based. - * @return {float} - */ - CapGetFrameRight(index: number): number; - - /** - * Returns the value (in Unit) of the top-most edge of the specified frame. - * @method WebTwain#CapGetFrameTop - * @param {short} index specifies the value of which frame to get. The index is 0-based. - * @return {float} - */ - CapGetFrameTop(index: number): number; - - /** - * Queries whether the Source supports a particular operation on the capability. - * @method WebTwain#CapIfSupported - * @param {EnumDWT_MessageType} messageType specifies the type of capability operation. - * @return {bool} - */ - CapIfSupported(messageType: EnumDWT_MessageType): boolean; - - /** - * Changes the Current Value of the capability specified by Capability property back to its power-on value. - * @method WebTwain#CapReset - * @return {bool} - */ - CapReset(): boolean; - - /** - * Sets the current capability using the container type specified by CapType property. The current capability is specified by Capability property. - * @method WebTwain#CapSet - * @return {bool} - */ - CapSet(): boolean; - - /** - * Sets the values of the specified frame. - * @method WebTwain#CapSetFrame - * @param {short} index specifies the values of which frame to set. The index is 0-based. - * @param {float} left the value (in Unit) of the left-most edge of the specified frame. - * @param {float} top the value (in Unit) of the top-most edge of the specified frame. - * @param {float} right the value (in Unit) of the right-most edge of the specified frame. - * @param {float} bottom the value (in Unit) of the bottom-most edge of the specified frame. - * @return {bool} - */ - CapSetFrame(index: number, left: number, top: number, right: number, bottom: number): boolean; - - /** - * Get the cap item value of the capability specified by Capability property, when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. - * @method WebTwain#GetCapItems - * @param {int} index Index is 0-based. It is the index of the cap item. - * @return {double} - */ - GetCapItems(index: number): number; - - /** - * Returns the cap item value of the capability specified by Capability property, when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. - * @method WebTwain#GetCapItemsString - * @param {int} index Index is 0-based. It is the index of the cap item. - * @return {string} - */ - GetCapItemsString(index: number): string; - - /** - * Set the value of the specified cap item. - * @method WebTwain#SetCapItems - * @param {int} index Index is 0-based. It is the index of the cap item. - * @param {double} newVal The Double type of CapItems property is used to present Double, Single(float), Long, int and even boolean types. For string type, please use CapItemsstring property. - * @return {void} - */ - SetCapItems(index: number, newVal: number): void; - - /** - * Set the cap item value of the capability specified by Capability property, when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. - * @method WebTwain#SetCapItemsString - * @param {int} index Index is 0-based. It is the index of the cap item. - * @param {string} newVal The new value to be set. - * @return {void} - */ - SetCapItemsString(index: number, newVal: string): void; - // --- SCAN end -- - - // --- View & Edit start -- - - /** - * Add text on an image. - * @method WebTwain#AddText - * @param {short} sImageIndex the index of the image that you want to add text to. - * @param {int} x the x coordinate for the text. - * @param {int} y the y coordinate for the text. - * @param {string} text the content of the text that you want to add. - * @param {int} txtColor the color for the text. - * @param {int} backgroundColor the background color. - * @param {float} backgroundRoundRadius ranging from 0 to 0.5. Please NOTE that MAC version does not support this parameter. - * @param {float} backgroundOpacity specifies the opacity of the background of the added text, it ranges from 0 to 1.0. Please NOTE that Mac version only supports value 0 and 1 - * @return {bool} - */ - AddText(sImageIndex: number, x: number, y: number, text: string, txtColor: number, backgroundColor: number, backgroundRoundRadius: number, backgroundOpacity: number): boolean; - - /** - * Create the font for adding text using the method AddText. - * @method WebTwain#CreateTextFont - * @param {int} height Specifies the desired height (in logical units) of the font.The absolute value of nHeight must not exceed 16,384 device units after it is converted.For all height comparisons, the font mapper looks for the largest font that does not exceed the requested size or the smallest font if all the fonts exceed the requested size. - * @param {int} width Specifies the average width (in logical units) of characters in the font. If Width is 0, the aspect ratio of the device will be matched against the digitization aspect ratio of the available fonts to find the closest match, which is determined by the absolute value of the difference. - * @param {int} escapement Specifies the angle (in 0.1-degree units) between the escapement vector and the x-axis of the display surface. The escapement vector is the line through the origins of the first and last characters on a line. The angle is measured counterclockwise from the x-axis. - * @param {int} orientation Specifies the angle (in 0.1-degree units) between the baseline of a character and the x-axis.The angle is measured counterclockwise from the x-axis for coordinate systems in which the y-direction is down and clockwise from the x-axis for coordinate systems in which the y-direction is up. - * @param {int} weight Specifies the font weight (in inked pixels per 1000). The described valuesare approximate; the actual appearance depends on the typeface. Some fonts haveonly FW_NORMAL, FW_REGULAR, and FW_BOLD weights. If FW_DONTCARE is specified, a default weight is used. - * @param {short} italic Specifies an italic font if set to TRUE. - * @param {short} underline Specifies an underlined font if set to TRUE. - * @param {short} strikeOut A strikeout font if set to TRUE. - * @param {short} charSet Specifies the font's character set. The OEM character set is system-dependent. Fonts with other character sets may exist in the system. An application that uses a font with an unknown character set must not attempt to translate or interpret strings that are to be rendered with that font. - * @param {short} outputPrecision Specifies the desired output precision. The output precision defines how closely the output must match the requested font's height, width, character orientation, escapement, and pitch. - * @param {short} clipPrecision Specifies the desired clipping precision. The clipping precision defines how to clip characters that are partially outside the clipping region. - * @param {short} quality Specifies the font's output quality, which defines how carefully the GDI must attempt to match the logical-font attributes to those of an actual physical font. - * @param {short} pitchAndFamily The pitch and family of the font. - * @param {string} faceName the typeface name, the length of this string must not exceed 32 characters, including the terminating null character. - * @return {bool} - */ - CreateTextFont(height: number, width: number, escapement: number, orientation: number, weight: number, italic: number, underline: number, strikeOut: number, charSet: number, outputPrecision: number, clipPrecision: number, quality: number, pitchAndFamily: number, faceName: string): boolean; - - /** - * Copies the image of a specified index in buffer to clipboard in DIB format. - * @method WebTwain#CopyToClipboard - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - CopyToClipboard(sImageIndex: number): boolean; - - /** - * Clears the specified area of a specified image, and fill the area with the fill color. - * @method WebTwain#Erase - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {int} left specifies the x-coordinate of the upper-left corner of the rectangle. - * @param {int} top specifies the y-coordinate of the upper-left corner of the rectangle. - * @param {int} right specifies the x-coordinate of the lower-right corner of the rectangle. - * @param {int} bottom specifies the y-coordinate of the lower-right corner of the rectangle. - * @return {bool} - */ - Erase(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; - - /** - * Returns the pixel bit depth of the selected image. - * @method WebTwain#GetImageBitDepth - * @param {short} sImageIndex specifies the index of image. The index is 0-based. - * @return {short} - */ - GetImageBitDepth(sImageIndex: number): number; - - /** - * Returns the width (pixels) of the selected image. This is a read-only property. - * @method WebTwain#GetImageWidth - * @param {short} sImageIndex specifies the index of image. The index is 0-based. - * @return {int} - */ - GetImageWidth(sImageIndex: number): number; - - /** - * Returns the height (pixels) of the selected image. This is a read-only property. - * @method WebTwain#GetImageHeight - * @param {short} sImageIndex specifies the index of image. The index is 0-based. - * @return {int} - */ - GetImageHeight(sImageIndex: number): number; - - /** - * Returns the file size of the new image resized from the image of a specified index in buffer. - * @method WebTwain#GetImageSize - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {int} iWidth specifies the pixel width of the new image. - * @param {int} iHeight specifies the pixel height of the new image. - * @return {double} - */ - GetImageSize(sImageIndex: number, iWidth: number, iHeight: number): number; - - /** - * Pre-calculate the file size of the local image file that is saved from an image of a specified index in buffer. - * @method WebTwain#GetImageSizeWithSpecifiedType - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {short} sImageType specifies the type of an image file.. - * @return {int} - */ - GetImageSizeWithSpecifiedType(sImageIndex: number, sImageType: number): number; - - /** - * Return the horizontal resolution of the specified image. - * @method WebTwain#GetImageXResolution - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {int} - */ - GetImageXResolution(sImageIndex: number): number; - - /** - * Return the vertical resolution of the specified image. - * @method WebTwain#GetImageYResolution - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {int} - */ - GetImageYResolution(sImageIndex: number): number; - - /** - * Returns the index of the selected image. - * @method WebTwain#GetSelectedImageIndex - * @param {short} sSelectedIndex specifies the index of the selected image. - * @return {short} - */ - GetSelectedImageIndex(sSelectedIndex: number): number; - - /** - * You can use the method to select images programatically which is ususally done by mouse clicking. - * @method WebTwain#SetSelectedImageIndex - * @param {short} sSelectedIndex this is the index of an array that holds the indices of selected images. - * @param {short} newVal specifies the index of an image that you want to select. - * @return {void} - */ - SetSelectedImageIndex(selectedIndex: number, newVal: number): void; - - /** - * Pre-calculate the file size of the local image file that is saved from the selected images in buffer. - * @method WebTwain#GetSelectedImagesSize - * @param {int} iImageType specifies the type of an image file. - * @return {int} - */ - GetSelectedImagesSize(iImageType: number): number; - - /** - * Check the skew angle of an image by its index in buffer. - * @method WebTwain#GetSkewAngle - * @param {short} sImageIndex the index of the image in the buffer. - * @return {double} - */ - GetSkewAngle(sImageIndex: number): number; - - /** - * Check the skew angle of a rectangular part of an image by its index in buffer. - * @method WebTwain#GetSkewAngleEx - * @param {short} sImageIndex the index of the image in the buffer. - * @param {int} left specifies the x-coordinate of the upper-left corner of the rectangle. - * @param {int} top specifies the y-coordinate of the upper-left corner of the rectangle. - * @param {int} right specifies the x-coordinate of the lower-right corner of the rectangle. - * @param {int} bottom specifies the y-coordinate of the lower-right corner of the rectangle. - * @return {double} - */ - GetSkewAngleEx(sImageIndex: number, left: number, top: number, right: number, bottom: number): number; - - /** - * [Deprecated.] Detects whether a certain area on an image is blank. - * @method WebTwain#IsBlankImageEx - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {int} left specifies the x-coordinate of the upper-left corner of the rectangle. - * @param {int} top specifies the y-coordinate of the upper-left corner of the rectangle. - * @param {int} right specifies the x-coordinate of the lower-right corner of the rectangle. - * @param {int} bottom specifies the y-coordinate of the lower-right corner of the rectangle. - * @param {bool} bFuzzyMatch specifies whether use fuzzy matching when detecting. - * @return {bool} - */ - IsBlankImageEx(sImageIndex: number, left: number, top: number, right: number, bottom: number, bFuzzyMatch: boolean): boolean; - - /** - * Mirrors the image of a specified index in buffer. - * @method WebTwain#Mirror - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - Mirror(sImageIndex: number): boolean; - - /** - * Decorates image of a specified index in buffer with rectangles of transparent color. - * @method WebTwain#OverlayRectangle - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {int} left specifies the x-coordinate of the upper-left corner of the rectangle. - * @param {int} top specifies the y-coordinate of the upper-left corner of the rectangle. - * @param {int} right specifies the x-coordinate of the lower-right corner of the rectangle. - * @param {int} bottom specifies the y-coordinate of the lower-right corner of the rectangle. - * @param {int} color Specifies the fill color of the rectangle. The byte-ordering of the RGB value is 0xBBGGRR. BB represents blue, GG represents green, RR represents red. - * @param {float} fOpacity Specifies the opacity of the rectangle. The value represents opacity. 1.0 is 100% opaque and 0.0 is totally transparent. - * @return {bool} - */ - OverlayRectangle(sImageIndex: number, left: number, top: number, right: number, bottom: number, color: number, fOpacity: number): boolean; - - /** - * Removes all images in buffer. - * @method WebTwain#RemoveAllImages - * @return {void} - */ - RemoveAllImages(): void; - - /** - * Removes selected images in buffer. - * @method WebTwain#RemoveAllSelectedImages - * @return {bool} - */ - RemoveAllSelectedImages(): boolean; - - /** - * Removes the image of a specified index in buffer. - * @method WebTwain#RemoveImage - * @param {short} sImageIndexToBeDeleted specifies the index of the image to be deleted in buffer. The index is 0-based. - * @return {bool} - */ - RemoveImage(sImageIndexToBeDeleted: number): boolean; - - // Image Operate - /** - * Rotates the image of a specified index in buffer by specified angle. - * @method WebTwain#Rotate - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {float} fAngle Specifies the rotation angle. - * @param {bool} bKeepSize Keep size or not. - * @return {bool} - */ - Rotate(sImageIndex: number, fAngle: number, bKeepSize: boolean): boolean; - - /** - * Rotates the image of a specified index in buffer by specified angle. - * @method WebTwain#RotateEx - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {float} fAngle Specifies the rotation angle. - * @param {bool} bKeepSize Keep size or not. - * @param {EnumDWT_InterpolationMethod} newVal specifies the method to do interpolation. - * @return {bool} - */ - RotateEx(sImageIndex: number, fAngle: number, bKeepSize: boolean, newVal: EnumDWT_InterpolationMethod): boolean; - - /** - * Rotates the image of a specified index in buffer by 90 degrees counter-clockwise. - * @method WebTwain#RotateLeft - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - RotateLeft(sImageIndex: number): boolean; - - /** - * Rotates the image of a specified index in buffer by 90 degrees clockwise. - * @method WebTwain#RotateRight - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - RotateRight(sImageIndex: number): boolean; - - /** - * Changes width and height of the image of a specified index in the buffer. Please note the file size of the image will be changed proportionately. - * @method WebTwain#ChangeImageSize - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {int} iNewWidth specifies the pixel width of the new image. - * @param {int} iNewHeight specifies the pixel height of the new image. - * @param {EnumDWT_InterpolationMethod} newVal specifies the method to do interpolation. - * @return {bool} - */ - ChangeImageSize(sImageIndex: number, iNewWidth: number, iNewHeight: number, newVal: EnumDWT_InterpolationMethod): boolean; - - /** - * Flips the image of a specified index in buffer. - * @method WebTwain#Flip - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - Flip(sImageIndex: number): boolean; - - /** - * Crops the image of a specified index in buffer. - * @method WebTwain#Crop - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {int} left specifies the x-coordinate of the upper-left corner of the rectangle. - * @param {int} top specifies the y-coordinate of the upper-left corner of the rectangle. - * @param {int} right specifies the x-coordinate of the lower-right corner of the rectangle. - * @param {int} bottom specifies the y-coordinate of the lower-right corner of the rectangle. - * @return {bool} - */ - Crop(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; - - /** - * Crops the image of a specified index in buffer to clipboard in DIB format. - * @method WebTwain#CropToClipboard - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {int} left specifies the x-coordinate of the upper-left corner of the rectangle. - * @param {int} top specifies the y-coordinate of the upper-left corner of the rectangle. - * @param {int} right specifies the x-coordinate of the lower-right corner of the rectangle. - * @param {int} bottom specifies the y-coordinate of the lower-right corner of the rectangle. - * @return {bool} - */ - CropToClipboard(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; - - /** - * Cuts the image data in the specified area to the system clipboard in DIB format. - * @method WebTwain#CutFrameToClipboard - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {int} left specifies the x-coordinate of the upper-left corner of the rectangle. - * @param {int} top specifies the y-coordinate of the upper-left corner of the rectangle. - * @param {int} right specifies the x-coordinate of the lower-right corner of the rectangle. - * @param {int} bottom specifies the y-coordinate of the lower-right corner of the rectangle. - * @return {bool} - */ - CutFrameToClipboard(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; - - /** - * Cuts the image of a specified index in buffer to clipboard in DIB format. - * @method WebTwain#CutToClipboard - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - CutToClipboard(sImageIndex: number): boolean; - - /** - * Change the DPI (dots per inch) for the specified image. - * @method WebTwain#SetDPI - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {int} xResolution The horizontal resolution. - * @param {int} yResolution The vertical resolution. - * @param {bool} bResampleImage Whether to resample the image. (The image size will be changed if this is set to true). - * @param {EnumDWT_InterpolationMethod} newVal specifies the method to do interpolation. - * @return {bool} - */ - SetDPI(sImageIndex: number, xResolution: number, yResolution: number, bResampleImage: boolean, newVal: EnumDWT_InterpolationMethod): boolean; - - /** - * Sets the view mode that images are displayed in Dynamic Web TWAIN. You can use this method to display multiple images in Dynamic Web TWAIN. - * @method WebTwain#SetViewMode - * @param {short} sHorizontalImageCount specifies how many columns can be displayed in Dynamic Web TWAIN. - * @param {short} sVerticalImageCount specifies how many rows can be displayed in Dynamic Web TWAIN.. - * @return {void} - */ - SetViewMode(sHorizontalImageCount: number, sVerticalImageCount: number): void; - - /** - * Moves a specified image. - * @method WebTwain#MoveImage - * @param {short} sSourceImageIndex Specifies the source index of image in buffer. The index is 0-based. - * @param {short} sTargetImageIndex Specifies the target index of image in buffer. The index is 0-based. - * @return {bool} - */ - MoveImage(sSourceImageIndex: number, sTargetImageIndex: number): boolean; - - /** - * Switchs two images of specified indices in buffer. - * @method WebTwain#SwitchImage - * @param {short} sImageIndex1 specifies the index of image in buffer. The index is 0-based. - * @param {short} sImageIndex2 specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - SwitchImage(sImageIndex1: number, sImageIndex2: number): boolean; - - /** - * Shows the GUI of Image Printer. - * @method WebTwain#Print - * @return {bool} - */ - Print(): boolean; - // --- View & Edit end -- - - // --- Upload & Save end -- - - // --- Others --- - /** - * Shows the GUI of Image Editor. - * @method WebTwain#ShowImageEditor - * @return {bool} - */ - ShowImageEditor(): boolean; - - /** - * Unbinds an event from the specified function, so that the function stops receiving notifications when the event fires. - * @method WebTwain#UnregisterEvent - * @param {string} name the name of the event. - * @param {object} evt specified the function to be unbound. - * @return {bool} - */ - UnregisterEvent(name: string, evt: object): boolean; - // --- Others end --- - - /** - * Enables the source to accept image. - * @method WebTwain#EnableSource - * @return {bool} - */ - EnableSource(): boolean; - - /** - * Displays the source's built-in interface to acquire image. - * @method WebTwain#AcquireImage - * @param {object} optionalDeviceConfig a JS object used to set up the device for image acquisition. - * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - AcquireImage(optionalDeviceConfig?: object, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - // start from 10.0 - /** - * Change the width of an image in buffer. - * @method WebTwain#SetImageWidth - * @param {short} sImageIndex specifies which image you'd like to change. - * @param {int} iNewWidth specifies how wide you'd like to change the image. - * @return {bool} - */ - SetImageWidth(sImageIndex: number, iNewWidth: number): boolean; - - // Set custom DS data (DAT_CUSTOMDSDATA), the input string is encoded with base64 - /** - * Sets custom DS data to be used for scanning, the input string is encoded with base64. Custom DS data means a specific scanning profile. - * @method WebTwain#SetCustomDSDataEx - * @param {string} value the input string which is encoded with base64. - * @return {bool} - */ - SetCustomDSDataEx(value: string): boolean; - - // Set custom DS data, load data from the specified file - /** - * Sets custom DS data to be used for scanning, the data is stored in a file. Custom DS data means a specific scanning profile. - * @method WebTwain#SetCustomDSData - * @param {string} fileName the absolute path of the file where the custom data source data is stored. - * @return {bool} - */ - SetCustomDSData(fileName: string): boolean; - - // Get custom DS data, and returned string is encoded with base64 - /** - * Gets custom DS data, the returned string is base64 encoded. - * @method WebTwain#GetCustomDSDataEx - * @return {string} - */ - GetCustomDSDataEx(): string; - - // Get custom DS data, and save the data to the specified file - /** - * Gets custom DS data and save the data in a specified file. - * @method WebTwain#GetCustomDSData - * @param {string} fileName the path of the file used for storing custom DS data. - * @return {bool} - */ - GetCustomDSData(fileName: string): boolean; - - /** - * Changes the bitdepth of a specified image. - * @method WebTwain#ChangeBitDepth - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {short} sBitDepth specifies the target bit depth. - * @param {bool} bHighQuality specifies whether or not to keep high quality while changing the bit depth. When it's true, it takes more time. - * @return {bool} - */ - ChangeBitDepth(sImageIndex: number, sBitDepth: number, bHighQuality: boolean): boolean; - - /** - * Changes a specified image to gray scale. - * @method WebTwain#ConvertToGrayScale - * @param {short} sIndex specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - ConvertToGrayScale(sIndex: number): boolean; - - /** - * [Deprecated.] Shows the GUI of Image Editor with custom settings. - * @method WebTwain#ShowImageEditorEx - * @param {int} x specifies the new position of the left top corner of the window. - * @param {int} y specifies the new position of the left top corner of the window. - * @param {int} cx specifies the width of the window. - * @param {int} cy specifies the height of the window. - * @param {int} nCmdShow specifices how the window should be shown. - * @return {bool} - */ - ShowImageEditorEx(x: number, y: number, cx: number, cy: number, nCmdShow: number): boolean; - - /** - * [Deprecated.] Detects whether an image is blank. - * @method WebTwain#IsBlankImage - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - IsBlankImage(sImageIndex: number): boolean; - - /** - * Detects whether a specific image is blank. - * @method WebTwain#IsBlankImageExpress - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {bool} - */ - IsBlankImageExpress(sImageIndex: number): boolean; - - /** - * [Deprecated.] Detects whether a specific image is blank. - * @method WebTwain#GetBarcodeInfo - * @param {int} barcodeInfoType Defined in TWAIN Specification. - * @param {int} barcodeIndex Specifies which barcode to check. The index is 0-based. - * @return {object} - */ - GetBarcodeInfo(barcodeInfoType: number, barcodeIndex: number): object; - - /** - * [Deprecated.] Gets the content from a specified barcode. - * @method WebTwain#GetBarcodeText - * @param {int} barcodeIndex Specifies which barcode to check. The index is 0-based. - * @return {bool} - */ - GetBarcodeText(barcodeIndex: number): boolean; - - /** - * Sets the default source to use. It's only valid when IfUseTWAINDSM is set to true. - * @method WebTwain#SetDefaultSource - * @param {short} sImageIndex specifies the index of the default source. The index is 0-based. - * @return {bool} - */ - SetDefaultSource(sImageIndex: number): boolean; - - /** - * Draws a rectangle on the viewer which represents the selected area. - * @method WebTwain#SetSelectedImageArea - * @param {short} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {int} left The X axis of the left border. - * @param {int} top The Y axis of the top border. - * @param {int} right The X axis of the right border. - * @param {int} bottom The Y axis of the bottom border. - * @return {bool} - */ - SetSelectedImageArea(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; - - /** - * Converts the images specified by the indices to base64. - * @method WebTwain#ConvertToBase64 - * @param {Array} indices indices specifies which images are to be converted to base64. - * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64. - * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {bool} - */ - ConvertToBase64(indices: number[], enumImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Returns the direct URL of an image specified by index, if iWidth or iHeight is set to -1, you get the original image, otherwise you get the image with specified iWidth or iHeight while keeping the same aspect ratio. - * @method WebTwain#GetImageURL - * @param {short} index the index of the image. - * @param {int} iWidth the width of the image. - * @param {int} iHeight the height of the image. - * @return {string} - */ - GetImageURL(index: number, iWidth: number, iHeight: number): string; - - /** - * Sets a header for the current HTTP Post request. - * @method WebTwain#SetHTTPHeader - * @param {string} key the key of the header. - * @param {string} value the value of the header. - * @return {bool} - */ - SetHTTPHeader(key: string, value: string): boolean; +interface Base64Result { + getLength(): number; + getData(offset: number, length: number): string; + getMD5(): string; +} + +/** + * Copied from lib.d.ts (Typescript) + */ +interface Blob { + readonly size: number; + readonly type: string; + msClose(): void; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; +} + +/** + * Details for each license + */ +interface LicenseDetailItem { + readonly Browser: string; + readonly EnumLicenseType: string; + readonly ExpireDate: string; + readonly LicenseType: string; + readonly OS: string; + readonly Trial: string; + readonly Version: string; } diff --git a/types/dwt/index.d.ts b/types/dwt/index.d.ts index 12e4ac0521..78b0846eb7 100644 --- a/types/dwt/index.d.ts +++ b/types/dwt/index.d.ts @@ -1,3788 +1,17 @@ -// Type definitions for dwt 14.2 +// Type definitions for dwt 14.4 // Project: http://www.dynamsoft.com/Products/WebTWAIN_Overview.aspx // Definitions by: Xiao Ling // Josh Hall // Lincoln Hu // Tom Kent // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 - -/*! -* Based on Dynamsoft WebTwain JavaScript Intellisense -* Product: Dynamsoft Web Twain -* Web Site: http://www.dynamsoft.com -* -* Copyright 2018, Dynamsoft Corporation -* Author: Dynamsoft Support Team -* Version: 14.2 -*/ - -/** - * @namespace Dynamsoft - */ -declare namespace Dynamsoft { - namespace Lib { - /*ignored - Addon_Events Addon_Sendback_Events AttachAndShowImage BIO DOM DynamicLoadAddonFuns DynamicWebTwain EnumMouseButton - Errors Events IntToColorStr LS OnGetImageByURL OnGetImageFromServer Path ProgressBar UI Uri - addEventListener ajax all appendMessage appendRichMessage aryControlLoadImage attachAddon attachProperty - base64 bio cancelFrome clearMessage closeAll closeProgress colorStrToInt config css currentStyle - debug*/ - - let detect: { - /*ignored - OnCreatWS OnDetectNext OnWebTwainPostExecute OnWebTwainPreExecute StartWSByIPTimeoutId StartWSTimeoutId - aryReconnectSTwains arySTwains arySTwainsByIP bFirst bNeedUpgradeEvent bNoControlEvent bOK bPromptJSOrServerOutdated - cUrlIndex dcpCallbackType dcpStatus detectType getVersionArray global_dlg hideMask isDWTVersionLatest onNoControl - onNotAllowedForChrome ports scriptLoaded showMask starting tryTimes*/ - ssl: boolean; - }; - - /*ignored - detectButton dialog dialogShowStatus dlgProgress dlgRef drawBoxBorder drawImageWithHermite - each empty endsWith - */ - - let env: { - WSSession: number, WSVersion: string, - bChrome: boolean, bEdge: boolean, bFileSystem: boolean, bFirefox: boolean, - bIE: boolean, bLinux: boolean, bMac: boolean, bSafari: boolean, bWin: boolean, bWin64: boolean, - basePath: string, iPluginLength: number, isX64: boolean, pathType: number, - strChromeVersion: string, strFirefoxVersion: string, strIEVersion: string - }; - - /*ignored - error escapeHtml escapeRegExp extend filter fireEvent fromUnicode get getColor getCss - getElDimensions getHex getHexColor getHttpUrl getLogger getOffset getRandom getRealPath getScript - getWS getWSUrl getWheelDelta globalEval guid hide html5 imageControlCount indexOf install - io isArray isBoolean isDef isFunction isLocalIP isNaN isNull isNumber isObject - isPlainObject isString isUndef isUndefined isWindow keys log main makeArray mix - needShowTwiceShowDialog nil noop now obj one page param parse parseHTML parser - product progressMessage ready removeEventListener replaceAll replaceControl show showProgress startWS - startWSByIP startsWith stopPropagation stringify style support switchEvent tmp toggle trim - type unEscapeHtml unparam upperCaseFirst urlDecode urlEncode utf8 win - ...other internal ones - */ - } - namespace WebTwainEnv { - let ActiveXInstallWithCAB: boolean; - let ActiveXVersion: string; - let AutoLoad: boolean; - function CloseDialog(): void; - let ContainerMap: {}; - let Containers: Container[]; - function CreateDWTObject(newObjID: string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void; - function CreateDWTObject(newObjID: string, ip: number | string, port: number | string, portSSL: number | string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void; - let Debug: boolean; - function DeleteDWTObject(objID: string): void; - let DynamicContainers: string[]; - let DynamicDWTMap: {}; - function GetWebTwain(cid: string): WebTwain; - let IfUpdateService: boolean; - let IfUseActiveXForIE10Plus: boolean; - let JSVersion: string; - function Load(): void; - - /*ignored - OnWebTwainInitMessage OnWebTwainNeedUpgrade OnWebTwainNeedUpgradeWebJavascript OnWebTwainNotFound OnWebTwainOldPluginNotAllowed - */ - - function OnWebTwainPostExecute(): void; - function OnWebTwainPreExecute(): void; - - /*ignored - OnWebTwainReady - */ - - let PluginVersion: string; - let ProductKey: string; - function RegisterEvent(event: string, fn: (...args: any[]) => void): void; - function RemoveAllAuthorizations(): void; - let ResourcesPath: string; - let ServerVersionInfo: string; - function ShowDialog(_dialogWidth: number, _dialogHeight: number, _strDialogMessageWithHtmlFormat: string, _bChangeImage: boolean, bHideCloseButton: boolean): void; - let Trial: boolean; - function Unload(): void; - let UseDefaultInstallUI: boolean; - let initQueue: any[]; - let inited: boolean; - } -} - -/** Border Styles */ -declare enum EnumDWT_BorderStyle { - /** No border. */ - TWBS_NONE = 0, - /** Flat border. */ - TWBS_SINGLEFLAT = 1, - /** 3D border. */ - TWBS_SINGLE3D = 2 -} - -/** Capabilities */ -declare enum EnumDWT_Cap { - /** Nothing. */ - CAP_NONE = 0, - /** The application is willing to accept this number of images. */ - CAP_XFERCOUNT = 1, - /** Allows the application and Source to identify which compression schemes they have in - * common for Buffered Memory and File transfers. - * Note for File transfers: - * Since only certain file formats support compression, this capability must be negotiated after - * setting the desired file format with ICAP_IMAGEFILEFORMAT. - */ - ICAP_COMPRESSION = 256, - /** The type of pixel data that a Source is capable of acquiring (for example, black and white, gray, RGB, etc.). */ - ICAP_PIXELTYPE = 257, - /** Unless a quantity is dimensionless or uses a specified unit of measure, ICAP_UNITS determines - * the unit of measure for all quantities. - */ - ICAP_UNITS = 258, - /** Allows the application and Source to identify which transfer mechanisms the source supports. */ - ICAP_XFERMECH = 259, - /** The name or other identifying information about the Author of the image. It may include a copyright string. */ - CAP_AUTHOR = 4096, - /** A general note about the acquired image. */ - CAP_CAPTION = 4097, - /** If TRUE, Source must acquire data from the document feeder acquire area and other feeder - * capabilities can be used. If FALSE, Source must acquire data from the non-feeder acquire area - * and no other feeder capabilities can be used. - */ - CAP_FEEDERENABLED = 4098, - /** Reflect whether there are documents loaded in the Source's feeder. */ - CAP_FEEDERLOADED = 4099, - /** The date and time the image was acquired. - * Stored in the form "YYYY/MM/DD HH:mm:SS.sss" where YYYY is the year, MM is the - * numerical month, DD is the numerical day, HH is the hour, mm is the minute, SS is the second, - * and sss is the millisecond. - */ - CAP_TIMEDATE = 4100, - /** Returns a list of all the capabilities for which the Source will answer inquiries. Does not indicate - * which capabilities the Source will allow to be set by the application. Some capabilities can only - * be set if certain setup work has been done so the Source cannot globally answer which - * capabilities are "set-able." - */ - CAP_SUPPORTEDCAPS = 4101, - /** Allows the application and Source to negotiate capabilities to be used in States 5 and 6. */ - CAP_EXTENDEDCAPS = 4102, - /** If TRUE, the Source will automatically feed the next page from the document feeder after the - * number of frames negotiated for capture from each page are acquired. CAP_FEEDERENABLED - * must be TRUE to use this capability. - */ - CAP_AUTOFEED = 4103, - /** If TRUE, the Source will eject the current page being acquired from and will leave the feeder - * acquire area empty. - * If CAP_AUTOFEED is TRUE, a fresh page will be advanced. - * CAP_FEEDERENABLED must equal TRUE to use this capability. - * This capability must have been negotiated as an extended capability to be used in States 5 and 6. - */ - CAP_CLEARPAGE = 4104, - /** If TRUE, the Source will eject the current page and advance the next page in the document feeder - * into the feeder acquire area. - * If CAP_AUTOFEED is TRUE, the same action just described will occur and CAP_AUTOFEED will - * remain active. - * CAP_FEEDERENABLED must equal TRUE to use this capability. - * This capability must have been negotiated as an extended capability to be used in States 5 and 6. - */ - CAP_FEEDPAGE = 4105, - /** If TRUE, the Source will return the current page to the input side of the document feeder and - * feed the last page from the output side of the feeder back into the acquisition area. - * If CAP_AUTOFEED is TRUE, automatic feeding will continue after all negotiated frames from this - * page are acquired. - * CAP_FEEDERENABLED must equal TRUE to use this capability. - * This capability must have been negotiated as an extended capability to be used in States 5 and 6. - */ - CAP_REWINDPAGE = 4106, - /** If TRUE, the Source will display a progress indicator during acquisition and transfer, regardless - * of whether the Source's user interface is active. If FALSE, the progress indicator will be - * suppressed if the Source's user interface is inactive. - * The Source will continue to display device-specific instructions and error messages even with - * the Source user interface and progress indicators turned off. - */ - CAP_INDICATORS = 4107, - /** Returns a list of all the capabilities for which the Source will answer inquiries. Does not indicate - * which capabilities the Source will allow to be set by the application. Some capabilities can only - * be set if certain setup work has been done so the Source cannot globally answer which - * capabilities are "set-able." - */ - CAP_SUPPORTEDCAPSEXT = 4108, - /** This capability determines whether the device has a paper sensor that can detect documents on the ADF or Flatbed. */ - CAP_PAPERDETECTABLE = 4109, - /** If TRUE, indicates that this Source supports acquisition with the UI disabled; i.e., - * TW_USERINTERFACE's ShowUI field can be set to FALSE. If FALSE, indicates that this Source - * can only support acquisition with the UI enabled. - */ - CAP_UICONTROLLABLE = 4110, - /** If TRUE, the physical hardware (e.g., scanner, digital camera, image database, etc.) that - * represents the image source is attached, powered on, and communicating. - */ - CAP_DEVICEONLINE = 4111, - /** This capability is intended to boost the performance of a Source. The fundamental assumption - * behind AutoScan is that the device is able to capture the number of images indicated by the - * value of CAP_XFERCOUNT without waiting for the Application to request the image transfers. - * This is only possible if the device has internal buffers capable of caching the images it captures. - * The default behavior is undefined, because some high volume devices are incapable of anything - * but CAP_AUTOSCAN being equal to TRUE. However, if a Source supports FALSE, it should use it - * as the mandatory default, since this best describes the behavior of pre-1.8 TWAIN Applications. - */ - CAP_AUTOSCAN = 4112, - /** Allows an application to request the delivery of thumbnail representations for the set of images - * that are to be delivered. - * Setting CAP_THUMBNAILSENABLED to TRUE turns on thumbnail mode. Images transferred - * thereafter will be sent at thumbnail size (exact thumbnail size is determined by the Data Source). - * Setting this capability to FALSE turns thumbnail mode off and returns full size images. - */ - CAP_THUMBNAILSENABLED = 4113, - /** This indicates whether the scanner supports duplex. If so, it further indicates whether one-path - * or two-path duplex is supported. - */ - CAP_DUPLEX = 4114, - /** The user can set the duplex option to be TRUE or FALSE. If TRUE, the scanner scans both sides - * of a paper; otherwise, the scanner will scan only one side of the image. - */ - CAP_DUPLEXENABLED = 4115, - /** Allows an application to query a source to see if it implements the new user interface settings dialog. */ - CAP_ENABLEDSUIONLY = 4116, - CAP_CUSTOMDSDATA = 4117, - /** Allows the application to specify the starting endorser / imprinter number. All other endorser/ - * imprinter properties should be handled through the data source's user interface. - * The user can set the starting number for the endorser. - */ - CAP_ENDORSER = 4118, - /** Turns specific audible alarms on and off. */ - CAP_ALARMS = 4120, - /** The volume of a device's audible alarm. Note that this control affects the volume of all alarms; - * no specific volume control for individual types of alarms is provided. - */ - CAP_ALARMVOLUME = 4121, - /** The number of images to automatically capture. This does not refer to the number of images to - * be sent to the Application, use CAP_XFERCOUNT for that. - */ - CAP_AUTOMATICCAPTURE = 4122, - /** For automatic capture, this value selects the number of milliseconds before the first picture is to - * be taken, or the first image is to be scanned. - */ - CAP_TIMEBEFOREFIRSTCAPTURE = 4123, - /** For automatic capture, this value selects the milliseconds to wait between pictures taken, or images scanned. */ - CAP_TIMEBETWEENCAPTURES = 4124, - /** CapGet() reports the presence of data in the scanner's buffers. CapSet() with a value of TWCB_CLEAR immediately clears the buffers. */ - CAP_CLEARBUFFERS = 4125, - /** Describes the number of pages that the scanner can buffer when CAP_AUTOSCAN is enabled. */ - CAP_MAXBATCHBUFFERS = 4126, - /** The date and time of the device's clock. - * Managed in the form "YYYY/MM/DD HH:mm:SS:sss" where YYYY is the year, MM is the - * numerical month, DD is the numerical day, HH is the hour, mm is the minute, SS is the second, - * and sss is the millisecond. - */ - CAP_DEVICETIMEDATE = 4127, - /** CapGet() reports the kinds of power available to the device. CapGetCurrent() reports the current power supply in use. */ - CAP_POWERSUPPLY = 4128, - /** This capability queries the Source for UI support for preview mode. If TRUE, the Source supports preview UI. */ - CAP_CAMERAPREVIEWUI = 4129, - /** A string containing the serial number of the currently selected device in the Source. Multiple - * devices may all report the same serial number. - */ - CAP_SERIALNUMBER = 4132, - /** CapGet() returns the current list of available printer devices, along with the one currently being used for negotiation. - * CapSet() selects the current device for negotiation, and optionally constrains the list. - * Top/Bottom refers to duplex devices, and indicates if the printer is writing on the top or the bottom of the sheet of paper. - * Simplex devices use the top settings. Before/After indicates whether printing occurs before or after the sheet of paper has been scanned. - */ - CAP_PRINTER = 4134, - /** Turns the current CAP_PRINTER device on or off. */ - CAP_PRINTERENABLED = 4135, - /** The User can set the starting number for the current CAP_PRINTER device. */ - CAP_PRINTERINDEX = 4136, - /** Specifies the appropriate current CAP_PRINTER device mode. - * Note: - * • TWPM_SINGLESTRING specifies that the printed text will consist of a single string. - * • TWPM _MULTISTRING specifies that the printed text will consist of an enumerated list of - * strings to be printed in order. - * • TWPM _COMPOUNDSTRING specifies that the printed string will consist of a compound of a - * String followed by a value followed by a suffix string. - */ - CAP_PRINTERMODE = 4137, - /** Specifies the string(s) that are to be used in the string component when the current - * CAP_PRINTER device is enabled. - */ - CAP_PRINTERSTRING = 4138, - /** Specifies the string that shall be used as the current CAP_PRINTER device's suffix. */ - CAP_PRINTERSUFFIX = 4139, - /** Allows Application and Source to identify which languages they have in common for the exchange of string data, - * and to select the language of the internal UI. Since the TWLG_xxxx codes include language and country data, there is no separate - * capability for selecting the country. - */ - CAP_LANGUAGE = 4140, - /** Helps the Application determine any special actions it may need to take when negotiating - * frames with the Source. Allowed values are listed in . - * TWFA_NONE: The alignment is free-floating. Applications should assume - * that the origin for frames is on the left. - * TWFA_LEFT: The alignment is to the left. - * TWFA_CENTER: The alignment is centered. This means that the paper will - * be fed in the middle of the ICAP_PHYSICALWIDTH of the - * device. If this is set, then the Application should calculate - * any frames with a left offset of zero. - * TWFA_RIGHT: The alignment is to the right. - */ - CAP_FEEDERALIGNMENT = 4141, - /** TWFO_FIRSTPAGEFIRST if the feeder starts with the top of the first page. - * TWFO_LASTPAGEFIRST is the feeder starts with the top of the last page. - */ - CAP_FEEDERORDER = 4142, - /** Indicates whether the physical hardware (e.g. scanner, digital camera) is capable of acquiring - * multiple images of the same page without changes to the physical registration of that page. - */ - CAP_REACQUIREALLOWED = 4144, - /** The minutes of battery power remaining to the device. */ - CAP_BATTERYMINUTES = 4146, - /** When used with CapGet(), return the percentage of battery power level on camera. If -1 is returned, it indicates that the battery is not present. */ - CAP_BATTERYPERCENTAGE = 4147, - /** Added 1.91 */ - CAP_CAMERASIDE = 4148, - /** Added 1.91 */ - CAP_SEGMENTED = 4149, - /** Added 2.0 */ - CAP_CAMERAENABLED = 4150, - /** Added 2.0 */ - CAP_CAMERAORDER = 4151, - /** Added 2.0 */ - CAP_MICRENABLED = 4152, - /** Added 2.0 */ - CAP_FEEDERPREP = 4153, - /** Added 2.0 */ - CAP_FEEDERPOCKET = 4154, - /** Added 2.1 */ - CAP_AUTOMATICSENSEMEDIUM = 4155, - /** Added 2.1 */ - CAP_CUSTOMINTERFACEGUID = 4156, - /** TRUE enables and FALSE disables the Source's Auto-brightness function (if any). */ - ICAP_AUTOBRIGHT = 4352, - /** The brightness values available within the Source. */ - ICAP_BRIGHTNESS = 4353, - /** The contrast values available within the Source. */ - ICAP_CONTRAST = 4355, - /** Specifies the square-cell halftone (dithering) matrix the Source should use to halftone the image. */ - ICAP_CUSTHALFTONE = 4356, - /** Specifies the exposure time used to capture the image, in seconds. */ - ICAP_EXPOSURETIME = 4357, - /** Describes the color characteristic of the subtractive filter applied to the image data. Multiple - * filters may be applied to a single acquisition. - */ - ICAP_FILTER = 4358, - /** Specifies whether or not the image was acquired using a flash. */ - ICAP_FLASHUSED = 4359, - /** Gamma correction value for the image data. */ - ICAP_GAMMA = 4360, - /** A list of names of the halftone patterns available within the Source. */ - ICAP_HALFTONES = 4361, - /** Specifies which value in an image should be interpreted as the lightest "highlight." All values - * "lighter" than this value will be clipped to this value. Whether lighter values are smaller or - * larger can be determined by examining the Current value of ICAP_PIXELFLAVOR. - */ - ICAP_HIGHLIGHT = 4362, - /** Informs the application which file formats the Source can generate (CapGet()). Tells the Source which file formats the application can handle (CapSet()). - * TWFF_TIFF Used for document - * TWFF_PICT Native Macintosh - * TWFF_BMP Native Microsoft - * TWFF_XBM Used for document - * TWFF_JFIF Wrapper for JPEG - * TWFF_FPX FlashPix, used with digital - * TWFF_TIFFMULTI Multi-page TIFF files - * TWFF_PNG An image format standard intended for use on the web, replaces GIF - * TWFF_SPIFF A standard from JPEG, intended to replace JFIF, also supports JBIG - * TWFF_EXIF File format for use with digital cameras. - */ - ICAP_IMAGEFILEFORMAT = 4364, - /** TRUE means the lamp is currently, or should be set to ON. Sources may not support CapSet() operations. */ - ICAP_LAMPSTATE = 4365, - /** Describes the general color characteristic of the light source used to acquire the image. */ - ICAP_LIGHTSOURCE = 4366, - /** Defines which edge of the "paper" the image's "top" is aligned with. This information is used to adjust the frames to match the - * scanning orientation of the paper. For instance, if an ICAP_SUPPORTEDSIZE of TWSS_ISOA4 has been negotiated, - * and ICAP_ORIENTATION is set to TWOR_LANDSCAPE, then the Source must rotate the frame it downloads to the scanner to reflect the - * orientation of the paper. Please note that setting ICAP_ORIENTATION does not affect the values reported by ICAP_FRAMES; - * it just causes the Source to use them in a different way. The upper-left of the image is defined as the location where both the primary and - * secondary scans originate. (The X axis is the primary scan direction and the Y axis is the secondary scan direction.) - * For a flatbed scanner, the light bar moves in the secondary scan direction. For a handheld scanner, the scanner is drug in the - * secondary scan direction. For a digital camera, the secondary direction is the vertical axis when the viewed image is considered upright. - */ - ICAP_ORIENTATION = 4368, - /** The maximum physical width (X-axis) the Source can acquire (measured in units of ICAP_UNITS). */ - ICAP_PHYSICALWIDTH = 4369, - /** The maximum physical height (Y-axis) the Source can acquire (measured in units of ICAP_UNITS). */ - ICAP_PHYSICALHEIGHT = 4370, - /** Specifies which value in an image should be interpreted as the darkest "shadow." All values - * "darker" than this value will be clipped to this value. - */ - ICAP_SHADOW = 4371, - /** The list of frames the Source will acquire on each page. */ - ICAP_FRAMES = 4372, - /** The native optical resolution along the X-axis of the device being controlled by the Source. Most - * devices will respond with a single value (TW_ONEVALUE). - * This is NOT a list of all resolutions that can be generated by the device. Rather, this is the - * resolution of the device's optics. Measured in units of pixels per unit as defined by - * ICAP_UNITS (pixels per TWUN_PIXELS yields dimensionless data). - */ - ICAP_XNATIVERESOLUTION = 4374, - /** The native optical resolution along the Y-axis of the device being controlled by the Source. - * Measured in units of pixels per unit as defined by ICAP_UNITS (pixels per TWUN_PIXELS - * yields dimensionless data). - */ - ICAP_YNATIVERESOLUTION = 4375, - /** All the X-axis resolutions the Source can provide. - * Measured in units of pixels per unit as defined by ICAP_UNITS (pixels per TWUN_PIXELS - * yields dimensionless data). That is, when the units are TWUN_PIXELS, both - * ICAP_XRESOLUTION and ICAP_YRESOLUTION shall report 1 pixel/pixel. Some data sources - * like to report the actual number of pixels that the device reports, but that response is more - * appropriate in ICAP_PHYSICALHEIGHT and ICAP_PHYSICALWIDTH. - */ - ICAP_XRESOLUTION = 4376, - /** All the Y-axis resolutions the Source can provide. - * Measured in units of pixels per unit as defined by ICAP_UNITS (pixels per TWUN_PIXELS - * yields dimensionless data). That is, when the units are TWUN_PIXELS, both - * ICAP_XRESOLUTION and ICAP_YRESOLUTION shall report 1 pixel/pixel. Some data sources - * like to report the actual number of pixels that the device reports, but that response is more - * appropriate in ICAP_PHYSICALHEIGHT and ICAP_PHYSICALWIDTH. - */ - ICAP_YRESOLUTION = 4377, - /** The maximum number of frames the Source can provide or the application can accept per page. - * This is a bounding capability only. It does not establish current or future behavior. - */ - ICAP_MAXFRAMES = 4378, - /** This is used with buffered memory transfers. If TRUE, Source can provide application with tiled image data. */ - ICAP_TILES = 4379, - /** Specifies how the bytes in an image are filled by the Source. TWBO_MSBFIRST indicates that the leftmost bit in the byte (usually bit 7) is - * the byte's Most Significant Bit. - */ - ICAP_BITORDER = 4380, - /** Used for CCITT Group 3 2-dimensional compression. The 'K' factor indicates how often the - * new compression baseline should be re-established. A value of 2 or 4 is common in facsimile - * communication. A value of zero in this field will indicate an infinite K factor—the baseline is - * only calculated at the beginning of the transfer. - */ - ICAP_CCITTKFACTOR = 4381, - /** Describes whether the image was captured transmissively or reflectively. */ - ICAP_LIGHTPATH = 4382, - /** Sense of the pixel whose numeric value is zero (minimum data value). */ - ICAP_PIXELFLAVOR = 4383, - /** Allows the application and Source to identify which color data formats are available. There are - * two options, "planar" and "chunky." - */ - ICAP_PLANARCHUNKY = 4384, - /** How the Source can/should rotate the scanned image data prior to transfer. This doesn't use - * ICAP_UNITS. It is always measured in degrees. Any applied value is additive with any - * rotation specified in ICAP_ORIENTATION. - */ - ICAP_ROTATION = 4385, - /** For devices that support fixed frame sizes. - * Defined sizes match typical page sizes. This specifies the size(s) the Source can/should use to acquire image data. - */ - ICAP_SUPPORTEDSIZES = 4386, - /** Specifies the dividing line between black and white. This is the value the Source will use to - * threshold, if needed, when ICAP_PIXELTYPE:TWPT_BW. - * The value is normalized so there are no units of measure associated with this ICAP. - */ - ICAP_THRESHOLD = 4387, - /** All the X-axis scaling values available. A value of '1.0' is equivalent to 100% scaling. Do not use values less than or equal to zero. */ - ICAP_XSCALING = 4388, - /** All the Y-axis scaling values available. A value of '1.0' is equivalent to 100% scaling. Do not use values less than or equal to zero. - * There are no units inherent with this data as it is normalized to 1.0 being "unscaled." - */ - ICAP_YSCALING = 4389, - /** Used for CCITT data compression only. Indicates the bit order representation of the stored compressed codes. */ - ICAP_BITORDERCODES = 4390, - /** Used only for CCITT data compression. Specifies whether the compressed codes' pixel "sense" - * will be inverted from the Current value of ICAP_PIXELFLAVOR prior to transfer. - */ - ICAP_PIXELFLAVORCODES = 4391, - /** Allows the application and Source to agree upon a common set of color descriptors that are - * made available by the Source. This ICAP is only useful for JPEG-compressed buffered memory image transfers. - */ - ICAP_JPEGPIXELTYPE = 4392, - /** Used only with CCITT data compression. Specifies the minimum number of words of compressed codes (compressed data) to be transmitted per line. */ - ICAP_TIMEFILL = 4394, - /** Specifies the pixel bit depths for the Current value of ICAP_PIXELTYPE. For example, when - * using ICAP_PIXELTYPE:TWPT_GRAY, this capability specifies whether this is 8-bit gray or 4-bit gray. - * This depth applies to all the data channels (for instance, the R, G, and B channels will all have - * this same bit depth for RGB data). - */ - ICAP_BITDEPTH = 4395, - /** Specifies the Reduction Method the Source should use to reduce the bit depth of the data. Most - * commonly used with ICAP_PIXELTYPE:TWPT_BW to reduce gray data to black and white. - */ - ICAP_BITDEPTHREDUCTION = 4396, - /** If TRUE the Source will issue a MSG_XFERREADY before starting the scan. - * Note: The Source may need to scan the image before initiating the transfer. This is the case if - * the scanned image is rotated or merged with another scanned image. - */ - ICAP_UNDEFINEDIMAGESIZE = 4397, - /** Allows the application to query the data source to see if it supports extended image attribute capabilities, - * such as Barcode Recognition, Shaded Area Detection and Removal, Skew detection and Removal, and so on. - */ - ICAP_EXTIMAGEINFO = 4399, - /** Allows the source to define the minimum height (Y-axis) that the source can acquire. */ - ICAP_MINIMUMHEIGHT = 4400, - /** Allows the source to define theminimum width (X-axis) that the source can acquire. */ - ICAP_MINIMUMWIDTH = 4401, - /** Use this capability to have the Source discard blank images. The Application never sees these - * images during the scanning session. - * TWBP_DISABLE – this must be the default state for the Source. It indicates that all images will - * be delivered to the Application, none of them will be discarded. - * TWBP_AUTO – if this is used, then the Source will decide if an image is blank or not and discard - * as appropriate. - * If the specified value is a positive number in the range 0 to 231–1, then this capability will use it - * as the byte size cutoff point to identify which images are to be discarded. If the size of the image - * is less than or equal to this value, then it will be discarded. If the size of the image is greater - * than this value, then it will be kept so that it can be transferred to the Application. - */ - ICAP_AUTODISCARDBLANKPAGES = 4404, - /** Flip rotation is used to properly orient images that flip orientation every other image. - * TWFR_BOOK The images to be scanned are viewed in book form, flipping each page from left to right or right to left. - * TWFR_FANFOLD The images to be scanned are viewed in fanfold paper style, flipping each page up or down. - */ - ICAP_FLIPROTATION = 4406, - /** Turns bar code detection on and off. */ - ICAP_BARCODEDETECTIONENABLED = 4407, - /** Provides a list of bar code types that can be detected by the current Data Source. */ - ICAP_SUPPORTEDBARCODETYPES = 4408, - /** The maximum number of supported search priorities. */ - ICAP_BARCODEMAXSEARCHPRIORITIES = 4409, - /** A prioritized list of bar code types dictating the order in which bar codes will be sought. */ - ICAP_BARCODESEARCHPRIORITIES = 4410, - /** Restricts bar code searching to certain orientations, or prioritizes one orientation over the other. */ - ICAP_BARCODESEARCHMODE = 4411, - /** Restricts the number of times a search will be retried if none are found on each page. */ - ICAP_BARCODEMAXRETRIES = 4412, - /** Restricts the total time spent on searching for a bar code on each page. */ - ICAP_BARCODETIMEOUT = 4413, - /** When used with CapGet(), returns all camera supported lens zooming range. */ - ICAP_ZOOMFACTOR = 4414, - /** Turns patch code detection on and off. */ - ICAP_PATCHCODEDETECTIONENABLED = 4415, - /** A list of patch code types that may be detected by the current Data Source. */ - ICAP_SUPPORTEDPATCHCODETYPES = 4416, - /** The maximum number of supported search priorities. */ - ICAP_PATCHCODEMAXSEARCHPRIORITIES = 4417, - /** A prioritized list of patch code types dictating the order in which patch codes will be sought. */ - ICAP_PATCHCODESEARCHPRIORITIES = 4418, - /** Restricts patch code searching to certain orientations, or prioritizes one orientation over the other. */ - ICAP_PATCHCODESEARCHMODE = 4419, - /** Restricts the number of times a search will be retried if none are found on each page. */ - ICAP_PATCHCODEMAXRETRIES = 4420, - /** Restricts the total time spent on searching for a patch code on each page. */ - ICAP_PATCHCODETIMEOUT = 4421, - /** For devices that support flash. CapSet() selects the flash to be used (if any). CapGet() reports the current setting. - * This capability replaces ICAP_FLASHUSED, which is only able to negotiate the flash being on or off. - */ - ICAP_FLASHUSED2 = 4422, - /** For devices that support image enhancement filtering. This capability selects the algorithm used to improve the quality of the image. */ - ICAP_IMAGEFILTER = 4423, - /** For devices that support noise filtering. This capability selects the algorithm used to remove noise. */ - ICAP_NOISEFILTER = 4424, - /** Overscan is used to scan outside of the boundaries described by ICAP_FRAMES, and is used to help acquire image data that - * may be lost because of skewing. - * This is primarily of use for transport scanners which rely on edge detection to begin scanning. - * If overscan is supported, then the device is capable of scanning in the inter-document gap to get the skewed image information. - */ - ICAP_OVERSCAN = 4425, - /** Turns automatic border detection on and off. */ - ICAP_AUTOMATICBORDERDETECTION = 4432, - /** Turns automatic deskew correction on and off. */ - ICAP_AUTOMATICDESKEW = 4433, - /** When TRUE this capability depends on intelligent features within the Source to automatically - * rotate the image to the correct position. - */ - ICAP_AUTOMATICROTATE = 4434, - /** Added 1.9 */ - ICAP_JPEGQUALITY = 4435, - /** Added 1.91 */ - ICAP_FEEDERTYPE = 4436, - /** Added 1.91 */ - ICAP_ICCPROFILE = 4437, - /** Added 2.0 */ - ICAP_AUTOSIZE = 4438, - /** Added 2.1 */ - ICAP_AUTOMATICCROPUSESFRAME = 4439, - /** Added 2.1 */ - ICAP_AUTOMATICLENGTHDETECTION = 4440, - /** Added 2.1 */ - ICAP_AUTOMATICCOLORENABLED = 4441, - /** Added 2.1 */ - ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE = 4442, - /** Added 2.1 */ - ICAP_COLORMANAGEMENTENABLED = 4443, - /** Added 2.1 */ - ICAP_IMAGEMERGE = 4444, - /** Added 2.1 */ - ICAP_IMAGEMERGEHEIGHTTHRESHOLD = 4445, - /** Added 2.1 */ - ICAP_SUPPORTEDEXTIMAGEINFO = 4446 -} - -/** ICAP_BITORDER values. */ -declare enum EnumDWT_CapBitOrder { - TWBO_LSBFIRST = 0, - /** Indicates that the leftmost bit in the byte (usually bit 7) is the byte's Most Significant Bit. */ - TWBO_MSBFIRST = 1 -} - -/** ICAP_BITDEPTHREDUCTION values. */ -declare enum EnumDWT_CapBitdepthReduction { - TWBR_THRESHOLD = 0, - TWBR_HALFTONE = 1, - TWBR_CUSTHALFTONE = 2, - TWBR_DIFFUSION = 3 -} - -/** CAP_FEEDERALIGNMENT values. */ -declare enum EnumDWT_CapFeederAlignment { - /** The alignment is free-floating. Applications should assume that the origin for frames is on the left. */ - TWFA_NONE = 0, - /** The alignment is to the left. */ - TWFA_LEFT = 1, - /** The alignment is centered. This means that the paper will be fed in the middle of the ICAP_PHYSICALWIDTH of the - * device. If this is set, then the Application should calculate any frames with a left offset of zero. - */ - TWFA_CENTER = 2, - /** The alignment is to the right. */ - TWFA_RIGHT = 3 -} - -/** CAP_FEEDERORDER values. */ -declare enum EnumDWT_CapFeederOrder { - /** The feeder starts with the top of the first page. */ - TWFO_FIRSTPAGEFIRST = 0, - /** The feeder starts with the top of the last page. */ - TWFO_LASTPAGEFIRST = 1 -} - -/** ICAP_FILTER values. */ -declare enum EnumDWT_CapFilterType { - TWFT_RED = 0, - TWFT_GREEN = 1, - TWFT_BLUE = 2, - TWFT_NONE = 3, - TWFT_WHITE = 4, - TWFT_CYAN = 5, - TWFT_MAGENTA = 6, - TWFT_YELLOW = 7, - TWFT_BLACK = 8 -} - -/** ICAP_FLASHUSED2 values. */ -declare enum EnumDWT_CapFlash { - TWFL_NONE = 0, - TWFL_OFF = 1, - TWFL_ON = 2, - TWFL_AUTO = 3, - TWFL_REDEYE = 4 -} - -/** ICAP_FLIPROTATION values. */ -declare enum EnumDWT_CapFlipRotation { - /** The images to be scanned are viewed in book form, flipping each page from left to right or right to left. */ - TWFR_BOOK = 0, - /** The images to be scanned are viewed in fanfold paper style, flipping each page up or down. */ - TWFR_FANFOLD = 1 -} - -/** ICAP_IMAGEFILTER values. */ -declare enum EnumDWT_CapImageFilter { - TWIF_NONE = 0, - TWIF_AUTO = 1, - /** Good for halftone images. */ - TWIF_LOWPASS = 2, - /** Good for improving text. */ - TWIF_BANDPASS = 3, - /** Good for improving fine lines. */ - TWIF_HIGHPASS = 4, - TWIF_TEXT = 3, - TWIF_FINELINE = 4 -} - -/** CAP_LANGUAGE values. */ -declare enum EnumDWT_CapLanguage { - /** Danish */ - TWLG_DAN = 0, - /** Dutch */ - TWLG_DUT = 1, - /** International English */ - TWLG_ENG = 2, - /** French Canadian */ - TWLG_FCF = 3, - /** Finnish */ - TWLG_FIN = 4, - /** French */ - TWLG_FRN = 5, - /** German */ - TWLG_GER = 6, - /** Icelandic */ - TWLG_ICE = 7, - /** Italian */ - TWLG_ITN = 8, - /** Norwegian */ - TWLG_NOR = 9, - /** Portuguese */ - TWLG_POR = 10, - /** Spanish */ - TWLG_SPA = 11, - /** Swedish */ - TWLG_SWE = 12, - /** U.S. English */ - TWLG_USA = 13, - /** Added for 1.8 */ - TWLG_USERLOCALE = -1, - TWLG_AFRIKAANS = 14, - TWLG_ALBANIA = 15, - TWLG_ARABIC = 16, - TWLG_ARABIC_ALGERIA = 17, - TWLG_ARABIC_BAHRAIN = 18, - TWLG_ARABIC_EGYPT = 19, - TWLG_ARABIC_IRAQ = 20, - TWLG_ARABIC_JORDAN = 21, - TWLG_ARABIC_KUWAIT = 22, - TWLG_ARABIC_LEBANON = 23, - TWLG_ARABIC_LIBYA = 24, - TWLG_ARABIC_MOROCCO = 25, - TWLG_ARABIC_OMAN = 26, - TWLG_ARABIC_QATAR = 27, - TWLG_ARABIC_SAUDIARABIA = 28, - TWLG_ARABIC_SYRIA = 29, - TWLG_ARABIC_TUNISIA = 30, - /** United Arabic Emirates */ - TWLG_ARABIC_UAE = 31, - TWLG_ARABIC_YEMEN = 32, - TWLG_BASQUE = 33, - TWLG_BYELORUSSIAN = 34, - TWLG_BULGARIAN = 35, - TWLG_CATALAN = 36, - TWLG_CHINESE = 37, - TWLG_CHINESE_HONGKONG = 38, - /** People's Republic of China */ - TWLG_CHINESE_PRC = 39, - TWLG_CHINESE_SINGAPORE = 40, - TWLG_CHINESE_SIMPLIFIED = 41, - TWLG_CHINESE_TAIWAN = 42, - TWLG_CHINESE_TRADITIONAL = 43, - TWLG_CROATIA = 44, - TWLG_CZECH = 45, - TWLG_DANISH = 0, - TWLG_DUTCH = 1, - TWLG_DUTCH_BELGIAN = 46, - TWLG_ENGLISH = 2, - TWLG_ENGLISH_AUSTRALIAN = 47, - TWLG_ENGLISH_CANADIAN = 48, - TWLG_ENGLISH_IRELAND = 49, - TWLG_ENGLISH_NEWZEALAND = 50, - TWLG_ENGLISH_SOUTHAFRICA = 51, - TWLG_ENGLISH_UK = 52, - TWLG_ENGLISH_USA = 13, - TWLG_ESTONIAN = 53, - TWLG_FAEROESE = 54, - TWLG_FARSI = 55, - TWLG_FINNISH = 4, - TWLG_FRENCH = 5, - TWLG_FRENCH_BELGIAN = 56, - TWLG_FRENCH_CANADIAN = 3, - TWLG_FRENCH_LUXEMBOURG = 57, - TWLG_FRENCH_SWISS = 58, - TWLG_GERMAN = 6, - TWLG_GERMAN_AUSTRIAN = 59, - TWLG_GERMAN_LUXEMBOURG = 60, - TWLG_GERMAN_LIECHTENSTEIN = 61, - TWLG_GERMAN_SWISS = 62, - TWLG_GREEK = 63, - TWLG_HEBREW = 64, - TWLG_HUNGARIAN = 65, - TWLG_ICELANDIC = 7, - TWLG_INDONESIAN = 66, - TWLG_ITALIAN = 8, - TWLG_ITALIAN_SWISS = 67, - TWLG_JAPANESE = 68, - TWLG_KOREAN = 69, - TWLG_KOREAN_JOHAB = 70, - TWLG_LATVIAN = 71, - TWLG_LITHUANIAN = 72, - TWLG_NORWEGIAN = 9, - TWLG_NORWEGIAN_BOKMAL = 73, - TWLG_NORWEGIAN_NYNORSK = 74, - TWLG_POLISH = 75, - TWLG_PORTUGUESE = 10, - TWLG_PORTUGUESE_BRAZIL = 76, - TWLG_ROMANIAN = 77, - TWLG_RUSSIAN = 78, - TWLG_SERBIAN_LATIN = 79, - TWLG_SLOVAK = 80, - TWLG_SLOVENIAN = 81, - TWLG_SPANISH = 11, - TWLG_SPANISH_MEXICAN = 82, - TWLG_SPANISH_MODERN = 83, - TWLG_SWEDISH = 12, - TWLG_THAI = 84, - TWLG_TURKISH = 85, - TWLG_UKRANIAN = 86, - /** More stuff added for 1.8 */ - TWLG_ASSAMESE = 87, - TWLG_BENGALI = 88, - TWLG_BIHARI = 89, - TWLG_BODO = 90, - TWLG_DOGRI = 91, - TWLG_GUJARATI = 92, - TWLG_HARYANVI = 93, - TWLG_HINDI = 94, - TWLG_KANNADA = 95, - TWLG_KASHMIRI = 96, - TWLG_MALAYALAM = 97, - TWLG_MARATHI = 98, - TWLG_MARWARI = 99, - TWLG_MEGHALAYAN = 100, - TWLG_MIZO = 101, - TWLG_NAGA = 102, - TWLG_ORISSI = 103, - TWLG_PUNJABI = 104, - TWLG_PUSHTU = 105, - TWLG_SERBIAN_CYRILLIC = 106, - TWLG_SIKKIMI = 107, - TWLG_SWEDISH_FINLAND = 108, - TWLG_TAMIL = 109, - TWLG_TELUGU = 110, - TWLG_TRIPURI = 111, - TWLG_URDU = 112, - TWLG_VIETNAMESE = 113 -} - -/** ICAP_LIGHTPATH values. */ -declare enum EnumDWT_CapLightPath { - TWLP_REFLECTIVE = 0, - TWLP_TRANSMISSIVE = 1 -} - -/** ICAP_LIGHTSOURCE values. */ -declare enum EnumDWT_CapLightSource { - TWLS_RED = 0, - TWLS_GREEN = 1, - TWLS_BLUE = 2, - TWLS_NONE = 3, - TWLS_WHITE = 4, - TWLS_UV = 5, - TWLS_IR = 6 -} - -/** ICAP_NOISEFILTER values. */ -declare enum EnumDWT_CapNoiseFilter { - TWNF_NONE = 0, - TWNF_AUTO = 1, - TWNF_LONEPIXEL = 2, - TWNF_MAJORITYRULE = 3 -} - -/** ICAP_ORIENTATION values. */ -declare enum EnumDWT_CapORientation { - TWOR_ROT0 = 0, - TWOR_ROT90 = 1, - TWOR_ROT180 = 2, - TWOR_ROT270 = 3, - TWOR_PORTRAIT = 0, - TWOR_LANDSCAPE = 3, - /** 2.0 */ - TWOR_AUTO = 4, - /** 2.0 */ - TWOR_AUTOTEXT = 5, - /** 2.0 */ - TWOR_AUTOPICTURE = 6 -} - -/** ICAP_OVERSCAN values. */ -declare enum EnumDWT_CapOverscan { - TWOV_NONE = 0, - TWOV_AUTO = 1, - TWOV_TOPBOTTOM = 2, - TWOV_LEFTRIGHT = 3, - TWOV_ALL = 4 -} - -/** ICAP_PIXELFLAVOR values. */ -declare enum EnumDWT_CapPixelFlavor { - /** Zero pixel represents darkest shade. zero pixel represents darkest shade */ - TWPF_CHOCOLATE = 0, - /** Zero pixel represents lightest shade. zero pixel represents lightest shade */ - TWPF_VANILLA = 1 -} - -/** ICAP_PLANARCHUNKY values. */ -declare enum EnumDWT_CapPlanarChunky { - TWPC_CHUNKY = 0, - TWPC_PLANAR = 1 -} - -/** CAP_PRINTER values. */ -declare enum EnumDWT_CapPrinter { - TWPR_IMPRINTERTOPBEFORE = 0, - TWPR_IMPRINTERTOPAFTER = 1, - TWPR_IMPRINTERBOTTOMBEFORE = 2, - TWPR_IMPRINTERBOTTOMAFTER = 3, - TWPR_ENDORSERTOPBEFORE = 4, - TWPR_ENDORSERTOPAFTER = 5, - TWPR_ENDORSERBOTTOMBEFORE = 6, - TWPR_ENDORSERBOTTOMAFTER = 7 -} - -/** CAP_PRINTERMODE values. */ -declare enum EnumDWT_CapPrinterMode { - /** Specifies that the printed text will consist of a single string. */ - TWPM_SINGLESTRING = 0, - /** Specifies that the printed text will consist of an enumerated list of strings to be printed in order. */ - TWPM_MULTISTRING = 1, - /** Specifies that the printed string will consist of a compound of a String followed by a value followed by a suffix string. */ - TWPM_COMPOUNDSTRING = 2 -} - -/** TWAIN Supported sizes. */ -declare enum EnumDWT_CapSupportedSizes { - /** 0 */ - TWSS_NONE = 0, - /** 1 */ - TWSS_A4LETTER = 1, - /** 2 */ - TWSS_B5LETTER = 2, - /** 3 */ - TWSS_USLETTER = 3, - /** 4 */ - TWSS_USLEGAL = 4, - /** Added 1.5 - * 5 - */ - TWSS_A5 = 5, - /** 6 */ - TWSS_B4 = 6, - /** 7 */ - TWSS_B6 = 7, - /** Added 1.7 - * 9 - */ - TWSS_USLEDGER = 9, - /** 10 */ - TWSS_USEXECUTIVE = 10, - /** 11 */ - TWSS_A3 = 11, - /** 12 */ - TWSS_B3 = 12, - /** 13 */ - TWSS_A6 = 13, - /** 14 */ - TWSS_C4 = 14, - /** 15 */ - TWSS_C5 = 15, - /** 16 */ - TWSS_C6 = 16, - /** Added 1.8 - * 17 - */ - TWSS_4A0 = 17, - /** 18 */ - TWSS_2A0 = 18, - /** 19 */ - TWSS_A0 = 19, - /** 20 */ - TWSS_A1 = 20, - /** 21 */ - TWSS_A2 = 21, - /** 1 */ - TWSS_A4 = 1, - /** 22 */ - TWSS_A7 = 22, - /** 23 */ - TWSS_A8 = 23, - /** 24 */ - TWSS_A9 = 24, - /** 25 */ - TWSS_A10 = 25, - /** 26 */ - TWSS_ISOB0 = 26, - /** 27 */ - TWSS_ISOB1 = 27, - /** 28 */ - TWSS_ISOB2 = 28, - /** 12 */ - TWSS_ISOB3 = 12, - /** 6 */ - TWSS_ISOB4 = 6, - /** 29 */ - TWSS_ISOB5 = 29, - /** 7 */ - TWSS_ISOB6 = 7, - /** 30 */ - TWSS_ISOB7 = 30, - /** 31 */ - TWSS_ISOB8 = 31, - /** 32 */ - TWSS_ISOB9 = 32, - /** 33 */ - TWSS_ISOB10 = 33, - /** 34 */ - TWSS_JISB0 = 34, - /** 35 */ - TWSS_JISB1 = 35, - /** 36 */ - TWSS_JISB2 = 36, - /** 37 */ - TWSS_JISB3 = 37, - /** 38 */ - TWSS_JISB4 = 38, - /** 2 */ - TWSS_JISB5 = 2, - /** 39 */ - TWSS_JISB6 = 39, - /** 40 */ - TWSS_JISB7 = 40, - /** 41 */ - TWSS_JISB8 = 41, - /** 41 */ - TWSS_JISB9 = 42, - /** 43 */ - TWSS_JISB10 = 43, - /** 44 */ - TWSS_C0 = 44, - /** 45 */ - TWSS_C1 = 45, - /** 46 */ - TWSS_C2 = 46, - /** 47 */ - TWSS_C3 = 47, - /** 48 */ - TWSS_C7 = 48, - /** 49 */ - TWSS_C8 = 49, - /** 50 */ - TWSS_C9 = 50, - /** 51 */ - TWSS_C10 = 51, - /** 52 */ - TWSS_USSTATEMENT = 52, - /** 53 */ - TWSS_BUSINESSCARD = 53, - /** 54. Added 2.1 */ - TWSS_MAXSIZE = 54 -} - -/** Capabilities exist in many varieties but all have a Default Value, Current Value, and may have other values available that can be supported if selected. - * To help categorize the supported values into clear structures, TWAIN defines four types of containers for capabilities = - * TW_ONEVALUE, TW_ARRAY, TW_RANGE and TW_ENUMERATION. - */ -declare enum EnumDWT_CapType { - /** Nothing. */ - TWON_NONE = 0, - /** A rectangular array of values that describe a logical item. It is similar to the TW_ONEVALUE because the current and default values are the same and - * there are no other values to select from. For example, a list of the names, such as the supported capabilities list returned by the CAP_SUPPORTEDCAPS - * capability, would use this type of container. - */ - TWON_ARRAY = 3, - /** This is the most general type because it defines a list of values from which the Current Value can be chosen. - * The values do not progress uniformly through a range and there is not a consistent step size between the values. - * For example, if a Source's resolution options do not occur in even step sizes then an enumeration would be used (for example, 150, 400, and 600). - */ - TWON_ENUMERATION = 4, - /** A single value whose current and default values are coincident. The range of available values for this type of capability is simply this single value. - * For example, a capability that indicates the presence of a document feeder could be of this type. - */ - TWON_ONEVALUE = 5, - /** Many capabilities allow users to select their current value from a range of regularly spaced values. - * The capability can specify the minimum and maximum acceptable values and the incremental step size between the values. - * For example, resolution might be supported from 100 to 600 in steps of 50 (100, 150, 200, ..., 550, 600). - */ - TWON_RANGE = 6 -} - -/** The kind of data stored in the container. */ -declare enum EnumDWT_CapValueType { - TWTY_INT8 = 0, - /** Means Item is a TW_INT16 */ - TWTY_INT16 = 1, - /** Means Item is a TW_INT32 */ - TWTY_INT32 = 2, - /** Means Item is a TW_UINT8 */ - TWTY_UINT8 = 3, - /** Means Item is a TW_UINT16 */ - TWTY_UINT16 = 4, - /** Means Item is a TW_int */ - TWTY_int = 5, - /** Means Item is a TW_BOOL */ - TWTY_BOOL = 6, - /** Means Item is a TW_FIX32 */ - TWTY_FIX32 = 7, - /** Means Item is a TW_FRAME */ - TWTY_FRAME = 8, - /** Means Item is a TW_STR32 */ - TWTY_STR32 = 9, - /** Means Item is a TW_STR64 */ - TWTY_STR64 = 10, - /** Means Item is a TW_STR128 */ - TWTY_STR128 = 11, - /** Means Item is a TW_STR255 */ - TWTY_STR255 = 12 -} - -/** ICAP_DUPLEX values. */ -declare enum EnumDWT_DUPLEX { - TWDX_NONE = 0, - TWDX_1PASSDUPLEX = 1, - TWDX_2PASSDUPLEX = 2 -} - -/** Data source status. */ -declare enum EnumDWT_DataSourceStatus { - /** Indicate the data source is closed. */ - TWDSS_CLOSED = 0, - /** Indicate the data source is opened. */ - TWDSS_OPENED = 1, - /** Indicate the data source is enabled. */ - TWDSS_ENABLED = 2, - /** Indicate the data source is acquiring image. */ - TWDSS_ACQUIRING = 3 -} - -declare enum EnumDWT_Error { - ModuleNotExists = -2371 -} - -/** ICAP_IMAGEFILEFORMAT values. */ -declare enum EnumDWT_FileFormat { - /** Used for document imaging. Tagged Image File Format */ - TWFF_TIFF = 0, - /** Native Macintosh format. Macintosh PICT */ - TWFF_PICT = 1, - /** Native Microsoft format. Windows Bitmap */ - TWFF_BMP = 2, - /** Used for document imaging. X-Windows Bitmap */ - TWFF_XBM = 3, - /** Wrapper for JPEG images. JPEG File Interchange Format */ - TWFF_JFIF = 4, - /** FlashPix, used with digital cameras. Flash Pix */ - TWFF_FPX = 5, - /** Multi-page TIFF files. Multi-page tiff file */ - TWFF_TIFFMULTI = 6, - /** An image format standard intended for use on the web, replaces GIF. */ - TWFF_PNG = 7, - /** A standard from JPEG, intended to replace JFIF, also supports JBIG. */ - TWFF_SPIFF = 8, - /** File format for use with digital cameras. */ - TWFF_EXIF = 9, - /** A file format from Adobe. 1.91 NB: this is not PDF/A */ - TWFF_PDF = 10, - /** A file format from the Joint Photographic Experts Group. 1.91 */ - TWFF_JP2 = 11, - /** 1.91 */ - TWFF_JPN = 12, - /** 1.91 */ - TWFF_JPX = 13, - /** A file format from LizardTech. 1.91 */ - TWFF_DEJAVU = 14, - /** A file format from Adobe. 2.0 */ - TWFF_PDFA = 15, - /** 2.1 Adobe PDF/A, Version 2 */ - TWFF_PDFA2 = 16 -} - -/** Fit window type */ -declare enum EnumDWT_FitWindowType { - /** Fit the image to the width and height of the window */ - enumFitWindow = 0, - /** Fit the image to the height of the window */ - enumFitWindowHeight = 1, - /** Fit the image to the width of the window */ - enumFitWindowWidth = 2 -} - -/** Image type */ -declare enum EnumDWT_ImageType { - /** Native Microsoft format. */ - IT_BMP = 0, - /** JPEG format. */ - IT_JPG = 1, - /** Tagged Image File Format. */ - IT_TIF = 2, - /** An image format standard intended for use on the web, replaces GIF. */ - IT_PNG = 3, - /** A file format from Adobe. */ - IT_PDF = 4, - /** All supported formats which are bmp, jpg, tif, png and pdf */ - IT_ALL = 5 -} - -declare enum EnumDWT_InitMsg { - Info = 1, - Error = 2, - NotInstalledError = 3, - DownloadError = 4, - DownloadNotRestartError = 5 -} - -/** The method to do interpolation. */ -declare enum EnumDWT_InterpolationMethod { - IM_NEARESTNEIGHBOUR = 1, - IM_BILINEAR = 2, - IM_BICUBIC = 3, - IM_BESTQUALITY = 5 -} - -declare enum EnumDWT_Language { - English = 0, - French = 1, - Arabic = 2, - Spanish = 3, - Portuguese = 4, - German = 5, - Italian = 6, - Russian = 7, - Chinese = 8 -} - -/** TWEI_MAGTYPE values. (MD_ means Mag Type) Added 2.0 */ -declare enum EnumDWT_MagType { - /** Added 2.0 */ - TWMD_MICR = 0, - /** added 2.1 */ - TWMD_RAW = 1, - /** added 2.1 */ - TWMD_INVALID = 2 -} - -/** For query the operation that are supported by the data source on a capability . - * Application gets these through DG_CONTROL/DAT_CAPABILITY/MSG_QUERYSUPPORT - */ -declare enum EnumDWT_MessageType { - TWQC_GET = 1, - TWQC_SET = 2, - TWQC_GETDEFAULT = 4, - TWQC_GETCURRENT = 8, - TWQC_RESET = 16 -} - -declare enum EnumDWT_MouseShape { - Default = 0, - Hand = 1, - Crosshair = 2, - Zoom = 3 -} - -/** PDF file compression type. */ -declare enum EnumDWT_PDFCompressionType { - /** Auto mode. */ - PDF_AUTO = 0, - /** CCITT Group 3 fax encoding. */ - PDF_FAX3 = 1, - /** CCITT Group 4 fax encoding */ - PDF_FAX4 = 2, - /** Lempel Ziv and Welch */ - PDF_LZW = 3, - /** CCITT modified Huffman RLE. */ - PDF_RLE = 4, - /** JPEG compression. */ - PDF_JPEG = 5 -} - -/** ICAP_PIXELTYPE values (PT_ means Pixel Type) */ -declare enum EnumDWT_PixelType { - TWPT_BW = 0, - TWPT_GRAY = 1, - TWPT_RGB = 2, - TWPT_PALLETE = 3, - TWPT_CMY = 4, - TWPT_CMYK = 5, - TWPT_YUV = 6, - TWPT_YUVK = 7, - TWPT_CIEXYZ = 8, - TWPT_LAB = 9, - TWPT_SRGB = 10, - TWPT_SCRGB = 11, - TWPT_INFRARED = 16 -} - -declare enum EnumDWT_PlatformType { - /// Fit the image to the width and height of the window - enumWindow = 0, - /// Fit the image to the height of the window - enumMac = 1, - /// Fit the image to the width of the window - enumLinux = 2 -} - -declare enum EnumDWT_ShowMode { - /** Activates the window and displays it in its current size and position. */ - SW_ACTIVE = 0, - /** Maximizes the window */ - SW_MAX = 1, - /** Minimize the window */ - SW_MIN = 2, - /** Close the latest opened editor window */ - SW_CLOSE = 3, - /** Check whether a window exists */ - SW_IFLIVE = 4 -} - -/** TIFF file compression type. */ -declare enum EnumDWT_TIFFCompressionType { - /** Auto mode. */ - TIFF_AUTO = 0, - /** Dump mode. */ - TIFF_NONE = 1, - /** CCITT modified Huffman RLE. */ - TIFF_RLE = 2, - /** CCITT Group 3 fax encoding. */ - TIFF_FAX3 = 3, - /** CCITT T.4 (TIFF 6 name). */ - TIFF_T4 = 3, - /** CCITT Group 4 fax encoding */ - TIFF_FAX4 = 4, - /** CCITT T.6 (TIFF 6 name). */ - TIFF_T6 = 4, - /** Lempel Ziv and Welch */ - TIFF_LZW = 5, - TIFF_JPEG = 7, - TIFF_PACKBITS = 32773 -} - -/** ICAP_XFERMECH values. */ -declare enum EnumDWT_TransferMode { - /** Native transfers require the data to be transferred to a single large block of RAM. Therefore, - * they always face the risk of having an inadequate amount of RAM available to perform the transfer successfully. - */ - TWSX_NATIVE = 0, - /** Disk File Mode Transfers. */ - TWSX_FILE = 1, - /** Buffered Memory Mode Transfers. */ - TWSX_MEMORY = 2/*,*/ - /** added 1.91 , not supported in DWT yet*/ - /** TWSX_MEMFILE = 4*/ -} - -/** ICAP_UNITS values. */ -declare enum EnumDWT_UnitType { - TWUN_INCHES = 0, - TWUN_CENTIMETERS = 1, - TWUN_PICAS = 2, - TWUN_POINTS = 3, - TWUN_TWIPS = 4, - TWUN_PIXELS = 5, - TWUN_MILLIMETERS = 6 -} - -declare enum EnumDWT_UploadDataFormat { - Binary = 0, - Base64 = 1 -} - -/** - * interface for a DWT container which basically defines a DIV on the page - */ -interface Container { - ContainerId: string; - Width: string | number; - Height: string | number; -} - -/** - * interface for a base64 result - */ -interface Base64Result { - getLength(): number; - getData(offset: number, length: number): string; - getMD5(): string; -} - -/** - * Copied from lib.d.ts (Typescript) - */ -interface Blob { - readonly size: number; - readonly type: string; - msClose(): void; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; -} - -/** - * Details for each license - */ -interface LicenseDetailItem { - readonly Browser: string; - readonly EnumLicenseType: string; - readonly ExpireDate: string; - readonly LicenseType: string; - readonly OS: string; - readonly Trial: string; - readonly Version: string; -} - -/** - * @class - */ -// properties (get/set) / sync functions -interface WebTwain { - /** - * Returns whether the instance of a DWT is initialized - * @type {boolean} - */ - bReady: boolean; - - /** - * Returns the runtime id of the dwt object - * @type {string} - */ - readonly clientId: string; - - /** - * Returns the runtime class for the dwt container DIV - * @type {string} - */ - containerClass: string; - - /*ignored - httpUrl - objectName - - ...other internal ones - */ - - /* - * Properties - */ - - /** - * Returns or sets whether multi-page selection is supported. - * @type {boolean} - */ - AllowMultiSelect: boolean; - - /** - * [Deprecated.] Returns or sets whether allowing the plugin to send authentication request. The default value of this property is TRUE. - * @type {boolean} - */ - AllowPluginAuthentication: boolean; - - /** - * [Deprecated.] Returns or sets whether the async mode is activated. With this mode, Dynamic Web TWAIN is able to upload/download files via HTTP/FTP asynchronously. The default value is false. - * @type {boolean} - */ - AsyncMode: boolean; - - /** - * Returns or sets the background color of the main control. It is a value specifying the 24-bit RGB value. - * @type {number} - */ - BackgroundColor: number; - - /** - * Returns or sets the fill color of the selected area of an image when it is cut, erased or rotated. It is a value specifying the 24-bit RGB value. - * @type {number} - */ - BackgroundFillColor: number; - - /** - * Returns or sets the pixel bit depths for the current value of PixelType property. This is a runtime property. - * @type {number} - */ - BitDepth: number; - - /** - * Returns the current deviation of the pixels in the image. - * @type {number} - */ - readonly BlankImageCurrentStdDev: number; - - /** - * Returns or sets the standard deviation of the pixels in the image. - * @type {number} - */ - BlankImageMaxStdDev: number; - - /** - * Returns or sets the dividing line between black and white. The default value is 128. - * @type {number} - */ - BlankImageThreshold: number; - - /** - * [Deprecated.] Returns or sets the border style. - * @type {EnumDWT_BorderStyle} - */ - BorderStyle: EnumDWT_BorderStyle; - - /** - * Returns or sets the brightness values available within the Source. This is a runtime property. - * @type {number} - */ - Brightness: number; - - /** - * [Deprecated.] Sets or returns whether brokerprocess is enabled for scanning. - * @type {number} - */ - BrokerProcessType: number; - - /** - * Sets or returns how much physical memory is allowed for storing images currently loaded in Dynamic Web TWAIN. Once the limit is reached, images will be cached on the hard disk. - * @type {number} - */ - BufferMemoryLimit: number; - - /** - * Sets or returns the index (0-based) of a list to indicate the Current Value when the value of the CapType property is TWON_ENUMERATION. If the data type of the capability is String, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime property. - * @type {number} - */ - CapCurrentIndex: number; - - /** - * Sets or returns the current value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. - * @type {number} - */ - CapCurrentValue: number; - - /** - * Returns the index (0-based) of a list to indicate the Default Value when the value of the CapType property is TWON_ENUMERATION. If the data type of the capability is String, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime, read-only property. - * @type {number} - */ - readonly CapDefaultIndex: number; - - /** - * Returns the default value in a range when the value of the CapType property is TWON_RANGE. This is a runtime, read-only property. - * @type {number} - */ - CapDefaultValue: number; - - /** - * Retruns the description for a capability - * @type {string} - */ - CapDescription: string; - - /** - * Sets or returns the maximum value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. - * @type {number} - */ - CapMaxValue: number; - - /** - * Sets or returns the minimum value in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. - * @type {number} - */ - CapMinValue: number; - - /** - * [Deprecated.] Sets or returns how many items are in the list when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. For String data type, the list is in CapItemsString property. For other data types, the list is in CapItems property. This is a runtime property. - * @type {number} - */ - CapNumItems: number; - - /** - * Sets or returns the step size in a range when the value of the CapType property is TWON_RANGE. This is a runtime property. - * @type {number} - */ - CapStepSize: number; - - /** - * Sets or returns the type of capability container used to exchange capability information between application and source. This is a runtime property. - * @type {EnumDWT_CapType} - */ - CapType: EnumDWT_CapType; - - /** - * Returns or sets the value of the capability specified by Capability property when the value of the CapType property is TWON_ONEVALUE. This is a runtime property. - * @type {number} - */ - CapValue: number; - - /** - * Sets or returns the string value for a capability when the value of the CapType property is TWON_ONEVALUE. This is a runtime property. - * @type {string} - */ - CapValueString: string; - - /** - * Sets or returns the value type for reading the value of a capability. This is a runtime property. - * @type {number} - */ - CapValueType: number; - - /** - * Specifies the capabiltiy to be negotiated. This is a runtime property. - * @type {EnumDWT_Cap} - */ - Capability: EnumDWT_Cap; - - /** - * Returns or sets the contrast values available within the Source. This is a runtime property. - * @type {number} - */ - Contrast: number; - - /** - * Returns or sets current index of image in buffer. This is a runtime property. - * @type {number} - */ - CurrentImageIndexInBuffer: number; - - /** - * Returns the device name of current source. This is a runtime, read-only property. - * @type {string} - */ - readonly CurrentSourceName: string; - - /** - * Returns the value indicating the data source status. This is a runtime, read-only property. - * @type {number} - */ - readonly DataSourceStatus: number; - - /** - * Returns the device name of default source. This is a runtime, read-only property. - * @type {string} - */ - readonly DefaultSourceName: string; - - /** - * Returns whether the source supports duplex. If so, it further returns the level of duplex the Source supports (one pass or two pass duplex). This is a runtime, read-only property. - * @type {EnumDWT_DUPLEX} - */ - readonly Duplex: EnumDWT_DUPLEX; - - /** - * [Deprecated.] Returns or sets whether the user can zoom image using hot key. - * @type {boolean} - */ - EnableInteractiveZoom: boolean; - - /** - * Returns the error code. This is a runtime, read-only property. - * @type {number} - */ - readonly ErrorCode: number; - - /** - * Returns the error string. This is a runtime, read-only property. - * @type {string} - */ - readonly ErrorString: string; - - /** - * Returns or sets the password used to log into the FTP server. - * @type {string} - */ - FTPPassword: string; - - /** - * Returns or sets the port number of the FTP server. - * @type {number} - */ - FTPPort: number; - - /** - * Returns or sets the user name used to log into the FTP server. - * @type {string} - */ - FTPUserName: string; - - /** - * Returns or sets whether to resize the image to fit the image to the width or height of the window. To use the property, the view mode should be set to -1 by -1. You can use SetViewMode method to set the view mode. - * @type {EnumDWT_FitWindowType} - */ - FitWindowType: EnumDWT_FitWindowType; - - /** - * Returns the response string from the HTTP server if an error occurs for HTTPUploadThroughPost() method. This is a runtime, read-only property. - * @type {string} - */ - readonly HTTPPostResponseString: string; - - /** - * Returns whether a HTTP request has credentials - * @type {boolean} - */ - HTTPRequestswithCredentials: boolean; - - /** - * Returns or sets the height of the dwt viewer object - * @type {string|number} - */ - Height: string | number; - - /** - * Returns how many images are in buffer. This is a runtime, read-only property. - * @type {number} - */ - readonly HowManyImagesInBuffer: number; - - /** - * Specifies the content type of a http upload. - * @type {string} - */ - HttpContentTypeFieldValue: string; - - /** - * Specifies the field name of uploaded image through POST. - * @type {string} - */ - HttpFieldNameOfUploadedImage: string; - - /** - * [Deprecated.] Sets or returns the password used to log into the HTTP server. - * @type {string} - */ - HTTPPassword: string; - - /** - * Returns or sets the port number of the HTTP server. - * @type {number|string} - */ - HTTPPort: number | string; - - /** - * [Deprecated.] Returns or sets the user name used to log into the HTTP server. - * @type {string} - */ - HTTPUserName: string; - - /** - * Returns or sets whether the feature of disk caching is enabled. - * @type {boolean} - */ - IfAllowLocalCache: boolean; - - /** - * Returns or sets whether insert or append new scanned images. - * @type {boolean} - */ - IfAppendImage: boolean; - - /** - * Returns or sets whether the Source's Auto-brightness function is enabled. This is a runtime property. - * @type {boolean} - */ - IfAutoBright: boolean; - - /** - * Returns or sets whether the data source (scanner) will discard blank images during scanning. The property works only if the device and its driver support discarding blank pages. You can find whether your device supports this capbility from its user manual. Or, you can use the built-in methods of Dynamic Web TWAIN to detect blank images: IsBlankImage, IsBlankImageEx. - * @type {boolean} - */ - IfAutoDiscardBlankpages: boolean; - - /** - * Returns or sets whether the Source enable automatic document feeding process. This is a runtime property. - * @type {boolean} - */ - IfAutoFeed: boolean; - - /** - * Returns or sets whether the Source enables the automatic document scanning process. This is a runtime property. - * @type {boolean} - */ - IfAutoScan: boolean; - - /** - * Specifies whether or not to automatically scroll to the last image or stay on the current image when loading or acquiring images - * @type {boolean} - */ - IfAutoScroll: boolean; - - /** - * Turns automatic border detection on and off. The property works only if the device and its driver support detecting the border automatically. You can find whether your device supports this capbility from its user manual. - * @type {boolean} - */ - IfAutomaticBorderDetection: boolean; - - /** - * Turns automatic skew correction on and off. - * @type {boolean} - */ - IfAutomaticDeskew: boolean; - - /** - * Returns or sets whether close the Data Source User Interface after acquire all images. Default value of this property is FALSE. - * @type {boolean} - */ - IfDisableSourceAfterAcquire: boolean; - - /** - * Returns or sets whether the Source supports duplex. If TRUE, the scanner scans both sides of a paper; otherwise, the scanner will scan only one side of the image. This is a runtime property. - * @type {boolean} - */ - IfDuplexEnabled: boolean; - - /** - * Returns or sets whether the Automatic Document Feeder (ADF) is enabled. This is a runtime property. - * @type {boolean} - */ - IfFeederEnabled: boolean; - - /** - * Returns whether or not there are documents loaded in the Source's feeder when IfFeederEnabled and IfPaperDetectable are TRUE. This is a runtime, read-only property. - * @type {boolean} - */ - readonly IfFeederLoaded: boolean; - - /** - * Returns or sets whether to resize the image to fit the size of window when the view mode is set to -1 by -1. You can use SetViewMode method to set the view mode. - * @type {boolean} - */ - IfFitWindow: boolean; - - /** - * [Deprecated.] Returns or sets whether the UI (User Interface) of Source runs in modal state. Default value of this property is TRUE. - * @type {boolean} - */ - IfModalUI: boolean; - - /** - * Sets or returns whether Dynamic Web TWAIN uses Graphics Device Interface (GDI) when decoding images. - * @type {boolean} - */ - IfOpenImageWithGDIPlus: boolean; - - /** - * Returns or sets whether FTP passive mode is enabled. - * @type {boolean} - */ - IfPASVMode: boolean; - - /** - * Returns the value whether the Source has a paper sensor that can detect documents on the ADF or Flatbed. This is a runtime, read-only property. - * @type {boolean} - */ - readonly IfPaperDetectable: boolean; - - /** - * Returns or sets whether SSL is used when uploading or downloading images. - * @type {boolean} - */ - IfSSL: boolean; - - /** - * [Deprecated.] Returns or sets whether communicate with device in a separate thread. Default value of this property is FALSE. - * @type {boolean} - */ - IfScanInNewThread: boolean; - - /** - * Sets or returns whether to show the cancel dialog when uploading images to server. - * @type {boolean} - */ - IfShowCancelDialogWhenImageTransfer: boolean; - - /** - * Returns or sets whether to show the file dialog box when saving scanned images or loading images from local folder. - * @type {boolean} - */ - IfShowFileDialog: boolean; - - /** - * Returns or sets whether the Source displays a progress indicator during acquisition and transfer, regardless of whether the Source's user interface is active. This is a runtime property. - * @type {boolean} - */ - IfShowIndicator: boolean; - - /** - * [Deprecated.] Returns or sets whether the driver of the printer displays the User Interface. - * @type {boolean} - */ - IfShowPrintUI: boolean; - - /** - * Returns or sets whether the progress bar will be displayed during the transaction. This is a runtime property. - * @type {boolean} - */ - IfShowProgressBar: boolean; - - /** - * Returns or sets whether the Source displays the User Interface. - * @type {boolean} - */ - IfShowUI: boolean; - - /** - * Returns or sets whether to throw exceptions - * @type {boolean} - */ - IfThrowException: boolean; - - /** - * Return or sets whether the Source allows to save many images in one TIFF file. The default value is FALSE. - * @type {boolean} - */ - IfTiffMultiPage: boolean; - - /** - * Returns whether the Source supports acquisition with the UI (User Interface) disabled. If FALSE, indicates that this Source can only support acquisition with the UI enabled. This is a runtime, read-only property. - * @type {boolean} - */ - readonly IfUIControllable: boolean; - - /** - * Sets or returns whether Dynamic Web TWAIN uses the new TWAIN Data Source Manager (TWAINDSM.dll) when acquiring images from TWAIN devices. - * @type {boolean} - */ - IfUseTwainDSM: boolean; - - /** - * [Deprecated.] The number of bits in each image pixel (or bit depth). This is a runtime, read-only property. - * @type {number} - */ - ImageBitsPerPixel: number; - - /** - * Returns or sets whether a TWAIN driver or Native Scan of Mac OS X is used for document scanning. This property works for Mac edition only. - * @type {number} - */ - ImageCaptureDriverType: number; - - /** - * [Deprecated.] Returns or sets whether the image enumerator is enabled in Image Editor. - * @type {boolean} - */ - ImageEditorIfEnableEnumerator: boolean; - - /** - * [Deprecated.] Returns or sets whether the Image Editor is a modal window. - * @type {boolean} - */ - ImageEditorIfModal: boolean; - - /** - * [Deprecated.] Returns or sets whether the Image Editor is read-only. - * @type {boolean} - */ - ImageEditorIfReadonly: boolean; - - /** - * [Deprecated.] Returns or sets the title of Image Editor window. - * @type {string} - */ - ImageEditorWindowTitle: string; - - /** - * Returns the document number of the current image. This is a runtime, read-only property. - * @type {number} - */ - readonly ImageLayoutDocumentNumber: number; - - /** - * Returns the value of the bottom-most edge of the current image frame (in Unit). This is a read-only runtime property. - * @type {number} - */ - readonly ImageLayoutFrameBottom: number; - - /** - * Returns the value of the left-most edge of the current image frame (in Unit). This is a runtime, read-only property. - * @type {number} - */ - readonly ImageLayoutFrameLeft: number; - - /** - * Returns the frame number of the current image. This is a runtime, read-only property. - * @type {number} - */ - readonly ImageLayoutFrameNumber: number; - - /** - * Returns the value of the right-most edge of the current image frame (in Unit). This is a runtime, read-only property. - * @type {number} - */ - readonly ImageLayoutFrameRight: number; - - /** - * Returns the value of the top-most edge of the current image frame (in Unit). This is a runtime, read-only property. - * @type {number} - */ - readonly ImageLayoutFrameTop: number; - - /** - * Returns the page number of the current image. This is a runtime, read-only property. - * @type {Long} - */ - readonly ImageLayoutPageNumber: number; - - /** - * [Deprecated.] Returns how tall/long, in pixels, the image is. This is a runtime, read-only property. - * @type {number} - */ - ImageLength: number; - - /** - * Returns or sets the margin between images when multiple images are displayed in Dynamic Web TWAIN. - * @type {number} - */ - ImageMargin: number; - - /** - * Returns the pixel type of the current image. This is a runtime, read-only property. Please note the property is only valid in OnPreTransfer and OnPostTransfer event. - * @type {EnumDWT_PixelType} - */ - readonly ImagePixelType: EnumDWT_PixelType; - - /** - * [Deprecated.] Returns how width, in pixels, the image is. This is a runtime, read-only property. - * @type {number} - */ - ImageWidth: number; - - /** - * [Deprecated.] Returns the X resolution of the current image. X resolution is the number of pixels per Unit in the horizontal direction. This is a runtime, read-only property. - * @type {number} - */ - ImageXResolution: number; - - /** - * [Deprecated.] Returns the Y resolution of the current image. Y resolution is the number of pixels per Unit in the vertical direction. This is a runtime, read-only property. - * @type {number} - */ - ImageYResolution: number; - - /** - * Returns or sets the quality of JPEG files and PDF files using JPEG compression. - * @type {number} - */ - JPEGQuality: number; - - /** - * Returns or sets the log level for debugging. - * @type {number} - */ - LogLevel: number; - - /** - * Return the magnetic data if the scanner support magnetic data recognition. - * @type {string} - */ - readonly MagData: string; - - /** - * Return the magnetic type if the scanner support magnetic data recognition. - * @type {number} - */ - readonly MagType: number; - - /** - * Sets or returns the manufacture string for the application identity. - * @type {string} - */ - Manufacturer: string; - - /** - * Returns or sets the maximum number of images can be held in buffer. - * @type {number} - */ - MaxImagesInBuffer: number; - - /** - * [Deprecated.] Returns or sets how many threads can be used when you upload files through POST. - * @type {number} - */ - MaxInternetTransferThreads: number; - - /** - * Sets or returns the maximum allowed size when Dynamic Web TWAIN uploads a document. - * @type {number} - */ - MaxUploadImageSize: number; - - /** - * Returns or sets the shape of the mouse. - * @type {boolean} - */ - MouseShape: boolean; - - /** - * Returns the X co-ordinate of the mouse. This is a runtime property. - * @type {number} - */ - readonly MouseX: number; - - /** - * Returns the Y co-ordinate of the mouse. This is a runtime property. - * @type {number} - */ - readonly MouseY: number; - - /** - * Returns or sets the name of the person who creates the PDF document. - * @type {string} - */ - PDFAuthor: string; - - /** - * Returns or sets the compression type of PDF files. This is a runtime property. - * @type {EnumDWT_PDFCompressionType} - */ - PDFCompressionType: EnumDWT_PDFCompressionType; - - /** - * Returns or sets the date when the PDF document is created. - * @type {string} - */ - PDFCreationDate: string; - - /** - * Returns or sets the name of the application that created the original document, if the PDF document is converted from another form. - * @type {string} - */ - PDFCreator: string; - - /** - * Returns or sets the keywords associated with the PDF document. - * @type {string} - */ - PDFKeywords: string; - - /** - * Returns or sets the date when the PDF document is last modified. - * @type {string} - */ - PDFModifiedDate: string; - - /** - * Returns or sets the name of the application that converted the PDF document from its native. - * @type {string} - */ - PDFProducer: string; - - /** - * Returns or sets the subject of the PDF document. - * @type {string} - */ - PDFSubject: string; - - /** - * Returns or sets the title of the PDF document. - * @type {string} - */ - PDFTitle: string; - - /** - * Returns or sets the value of the PDF version. - * @type {string} - */ - PDFVersion: string; - - /** - * Returns or sets the page size(s) the Source can/should use to acquire image data. This is a runtime property. - * @type {EnumDWT_CapSupportedSizes} - */ - PageSize: EnumDWT_CapSupportedSizes; - - /** - * Returns the number of transfers the Source is ready to supply, upon demand. This is a runtime, read-only property. - * @type {number} - */ - readonly PendingXfers: number; - - /** - * Returns or sets the pixel flavor for acquired images. This is a runtime property. - * @type {number} - */ - PixelFlavor: number; - - /** - * Returns or sets the pixel type of current data source. This is a runtime property. Using this property after calling OpenSource() method and before calling AcquireImage(). - * @type {EnumDWT_PixelType} - */ - PixelType: EnumDWT_PixelType; - - /** - * Sets or returns the product family string for the application identity. - * @type {string} - */ - ProductFamily: string; - - /** - * Sets the product key. A product key is generated in Licensing Tool which is intalled with Dynamic Web TWAIN. Each product key corresponds with a license. - * @type {string} - */ - ProductKey: string; - - /** - * Sets or returns the product name string for the application identity. - * @type {string} - */ - ProductName: string; - - /** - * [Deprecated.] Returns or sets the name of the proxy server. - * @type {string} - */ - ProxyServer: string; - - /** - * Returns or sets the current resolution for acquired images. This is a runtime property. - * @type {number} - */ - Resolution: number; - - /** - * Returns or sets how many scanned images are selected. - * @type {number} - */ - SelectedImagesCount: number; - - /** - * Returns or sets the border color of the selected image. It is a value specifying the 24-bit RGB value. - * @type {number} - */ - SelectionImageBorderColor: number; - - /** - * Specifies a fixed aspect ratio to be used for selecting an area. - * @type {number} - */ - SelectionRectAspectRatio: number; - - /** - * Specifies whether to show the page number - * @type {boolean} - */ - ShowPageNumber: boolean; - - /** - * Returns how many sources are installed in the system. This is a runtime, read-only property. - * @type {number} - */ - readonly SourceCount: number; - - /** - * Returns or sets the compression type of TIFF files. This is a runtime property. - * @type {EnumDWT_TIFFCompressionType} - */ - TIFFCompressionType: EnumDWT_TIFFCompressionType; - - /** - * Sets or returns the transfer mode. - * @type {EnumDWT_TransferMode} - */ - TransferMode: EnumDWT_TransferMode; - - /** - * Returns or sets the unit of measure. This is a runtime property. - * @type {EnumDWT_UnitType} - */ - Unit: EnumDWT_UnitType; - - /** - * Specifies whether to show the vertical scroll bar - * @type {boolean} - */ - VScrollBar: boolean; - - /** - * Sets or returns the version info string for the application identity. - * @type {string} - */ - readonly VersionInfo: string; - - /** - * Returns or sets the width of the dwt object viewer - * @type {string|number} - */ - Width: string | number; - - /** - * Returns and sets the number of images you are willing to transfer per session. This is a runtime property. - * @type {number} - */ - XferCount: number; - - /** - * Returns or sets zoom factor for the image, only valid When the view mode is set to -1 by -1. - * @type {number} - */ - Zoom: number; - - /* ignored - style - _AutoCropMethod - */ - - /* - *Methods - */ - - /** - * Displays the source's built-in interface to acquire image. - * @method WebTwain#AcquireImage - * @param {object} optionalDeviceConfig a JS object used to set up the device for image acquisition. - * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - AcquireImage(optionalDeviceConfig?: object, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Add text on an image. - * @method WebTwain#AddText - * @param {number} sImageIndex the index of the image that you want to add text to. - * @param {number} x the x coordinate for the text. - * @param {number} y the y coordinate for the text. - * @param {string} text the content of the text that you want to add. - * @param {number} txtColor the color for the text. - * @param {number} backgroundColor the background color. - * @param {number} backgroundRoundRadius ranging from 0 to 0.5. Please NOTE that MAC version does not support this parameter. - * @param {number} backgroundOpacity specifies the opacity of the background of the added text, it ranges from 0 to 1.0. Please NOTE that Mac version only supports value 0 and 1 - * @return {boolean} - */ - AddText(sImageIndex: number, x: number, y: number, text: string, txtColor: number, backgroundColor: number, backgroundRoundRadius: number, backgroundOpacity: number): boolean; - - /** - * Cancels all pending transfers. - * @method WebTwain#CancelAllPendingTransfers - * @return {boolean} - */ - CancelAllPendingTransfers(): boolean; - - /** - * Gets information of the capability specified by the Capability property. - * @method WebTwain#CapGet - * @return {boolean} - */ - CapGet(): boolean; - - /** - * Returns the Source's current Value for the specified capability. - * @method WebTwain#CapGetCurrent - * @return {boolean} - */ - CapGetCurrent(): boolean; - - /** - * Returns the Source's Default Value for the specified capability. This is the Source's preferred default value. - * @method WebTwain#CapGetDefault - * @return {boolean} - */ - CapGetDefault(): boolean; - - /** - * Returns the value of the bottom-most edge of the specified frame. - * @method WebTwain#CapGetFrameBottom - * @param {number} index specifies the value of which frame to get. The index is 0-based. - * @return {number} - */ - CapGetFrameBottom(index: number): number; - - /** - * Returns the value (in Unit) of the left-most edge of the specified frame. - * @method WebTwain#CapGetFrameLeft - * @param {number} index specifies the value of which frame to get. The index is 0-based. - * @return {number} - */ - CapGetFrameLeft(index: number): number; - - /** - * Returns the value (in Unit) of the left-most edge of the specified frame. - * @method WebTwain#CapGetFrameRight - * @param {number} index specifies the value of which frame to get. The index is 0-based. - * @return {number} - */ - CapGetFrameRight(index: number): number; - - /** - * Returns the value (in Unit) of the top-most edge of the specified frame. - * @method WebTwain#CapGetFrameTop - * @param {number} index specifies the value of which frame to get. The index is 0-based. - * @return {number} - */ - CapGetFrameTop(index: number): number; - - /* ignored - * CapGetHelp - * CapGetLabel - * CapGetLabels - */ - - /** - * Queries whether the Source supports a particular operation on the capability. - * @method WebTwain#CapIfSupported - * @param {EnumDWT_MessageType} messageType specifies the type of capability operation. - * @return {boolean} - */ - CapIfSupported(messageType: EnumDWT_MessageType): boolean; - - /** - * Changes the Current Value of the capability specified by Capability property back to its power-on value. - * @method WebTwain#CapReset - * @return {boolean} - */ - CapReset(): boolean; - - /** - * Sets the current capability using the container type specified by CapType property. The current capability is specified by Capability property. - * @method WebTwain#CapSet - * @return {boolean} - */ - CapSet(): boolean; - - /** - * Sets the values of the specified frame. - * @method WebTwain#CapSetFrame - * @param {number} index specifies the values of which frame to set. The index is 0-based. - * @param {number} left the value (in Unit) of the left-most edge of the specified frame. - * @param {number} top the value (in Unit) of the top-most edge of the specified frame. - * @param {number} right the value (in Unit) of the right-most edge of the specified frame. - * @param {number} bottom the value (in Unit) of the bottom-most edge of the specified frame. - * @return {boolean} - */ - CapSetFrame(index: number, left: number, top: number, right: number, bottom: number): boolean; - - /** - * Changes the bitdepth of a specified image. - * @method WebTwain#ChangeBitDepth - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {number} sBitDepth specifies the target bit depth. - * @param {boolean} bHighQuality specifies whether or not to keep high quality while changing the bit depth. When it's true, it takes more time. - * @return {boolean} - */ - ChangeBitDepth(sImageIndex: number, sBitDepth: number, bHighQuality: boolean): boolean; - - /** - * Changes width and height of the image of a specified index in the buffer. Please note the file size of the image will be changed proportionately. - * @method WebTwain#ChangeImageSize - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {number} iNewWidth specifies the pixel width of the new image. - * @param {number} iNewHeight specifies the pixel height of the new image. - * @param {EnumDWT_InterpolationMethod} newVal specifies the method to do interpolation. - * @return {boolean} - */ - ChangeImageSize(sImageIndex: number, iNewWidth: number, iNewHeight: number, newVal: EnumDWT_InterpolationMethod): boolean; - - /** - * Clears all the web forms which are used for image uploading. - * @method WebTwain#ClearAllHTTPFormField - * @return {boolean} - */ - ClearAllHTTPFormField(): boolean; - - /** - * Clears the content of all custom tiff tags. - * @method WebTwain#ClearTiffCustomTag - * @return {void} - */ - ClearTiffCustomTag(): void; - - /** - * Closes Data Source. - * @method WebTwain#CloseSource - * @return {boolean} - */ - CloseSource(): boolean; - - /** - * Closes and unloads Data Source Manager. - * @method WebTwain#CloseSourceManager - * @return {boolean} - */ - CloseSourceManager(): boolean; - - /** - * Closes the current process used to scan - * @method WebTwain#CloseWorkingProcess - * @return {boolean} - */ - CloseWorkingProcess(): boolean; - - /** - * Converts the images specified by the indices to base64 synchronously. - * @method WebTwain#ConvertToBase64 - * @param {Array} indices indices specifies which images are to be converted to base64. - * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64. - * @return {Base64Result} - - ConvertToBase64(indices: number[], enumImageType: EnumDWT_ImageType): Base64Result; - */ - - /** - * Converts the images specified by the indices to base64 asynchronously. - * @method WebTwain#ConvertToBase64 - * @param {Array} indices indices specifies which images are to be converted to base64. - * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64. - * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - ConvertToBase64(indices: number[], enumImageType: EnumDWT_ImageType, asyncSuccessFunc: (result: Base64Result) => void, asyncFailureFunc: (errorCode: number, errorString: string) => void): boolean; - - /** - * Converts the images specified by the indices to blob synchronously. - * @method WebTwain#ConvertToBlob - * @param {Array} indices indices specifies which images are to be converted to base64. - * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64. - * @return {Blob} - */ - ConvertToBlob(indices: number[], enumImageType: EnumDWT_ImageType): Blob; - - /** - * Converts the images specified by the indices to blob asynchronously. - * @method WebTwain#ConvertToBlob - * @param {Array} indices indices specifies which images are to be converted to base64. - * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be converted to base64. - * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - ConvertToBlob(indices: number[], enumImageType: EnumDWT_ImageType, asyncSuccessFunc: (result: any) => void, asyncFailureFunc: (errorCode: number, errorString: string) => void): boolean; - - /** - * Changes a specified image to gray scale. - * @method WebTwain#ConvertToGrayScale - * @param {number} sIndex specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - ConvertToGrayScale(sIndex: number): boolean; - - /** - * Copies the image of a specified index in buffer to clipboard in DIB format. - * @method WebTwain#CopyToClipboard - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - CopyToClipboard(sImageIndex: number): boolean; - - /** - * Create the font for adding text using the method AddText. - * @method WebTwain#CreateTextFont - * @param {number} height Specifies the desired height (in logical units) of the font.The absolute value of nHeight must not exceed 16,384 device units after it is converted.For all height comparisons, the font mapper looks for the largest font that does not exceed the requested size or the smallest font if all the fonts exceed the requested size. - * @param {number} width Specifies the average width (in logical units) of characters in the font. If Width is 0, the aspect ratio of the device will be matched against the digitization aspect ratio of the available fonts to find the closest match, which is determined by the absolute value of the difference. - * @param {number} escapement Specifies the angle (in 0.1-degree units) between the escapement vector and the x-axis of the display surface. The escapement vector is the line through the origins of the first and last characters on a line. The angle is measured counterclockwise from the x-axis. - * @param {number} orientation Specifies the angle (in 0.1-degree units) between the baseline of a character and the x-axis.The angle is measured counterclockwise from the x-axis for coordinate systems in which the y-direction is down and clockwise from the x-axis for coordinate systems in which the y-direction is up. - * @param {number} weight Specifies the font weight (in inked pixels per 1000). The described valuesare approximate; the actual appearance depends on the typeface. Some fonts haveonly FW_NORMAL, FW_REGULAR, and FW_BOLD weights. If FW_DONTCARE is specified, a default weight is used. - * @param {number} italic Specifies an italic font if set to TRUE. - * @param {number} underline Specifies an underlined font if set to TRUE. - * @param {number} strikeOut A strikeout font if set to TRUE. - * @param {number} charSet Specifies the font's character set. The OEM character set is system-dependent. Fonts with other character sets may exist in the system. An application that uses a font with an unknown character set must not attempt to translate or interpret strings that are to be rendered with that font. - * @param {number} outputPrecision Specifies the desired output precision. The output precision defines how closely the output must match the requested font's height, width, character orientation, escapement, and pitch. - * @param {number} clipPrecision Specifies the desired clipping precision. The clipping precision defines how to clip characters that are partially outside the clipping region. - * @param {number} quality Specifies the font's output quality, which defines how carefully the GDI must attempt to match the logical-font attributes to those of an actual physical font. - * @param {number} pitchAndFamily The pitch and family of the font. - * @param {string} faceName the typeface name, the length of this string must not exceed 32 characters, including the terminating null character. - * @return {boolean} - */ - CreateTextFont(height: number, width: number, escapement: number, orientation: number, weight: number, italic: number, underline: number, strikeOut: number, charSet: number, outputPrecision: number, clipPrecision: number, quality: number, pitchAndFamily: number, faceName: string): boolean; - - /** - * Crops the image of a specified index in buffer. - * @method WebTwain#Crop - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. - * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. - * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. - * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. - * @return {boolean} - */ - Crop(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; - - /** - * Crops the image of a specified index in buffer to clipboard in DIB format. - * @method WebTwain#CropToClipboard - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. - * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. - * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. - * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. - * @return {boolean} - */ - CropToClipboard(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; - - /** - * Cuts the image data in the specified area to the system clipboard in DIB format. - * @method WebTwain#CutFrameToClipboard - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. - * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. - * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. - * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. - * @return {boolean} - */ - CutFrameToClipboard(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; - - /** - * Cuts the image of a specified index in buffer to clipboard in DIB format. - * @method WebTwain#CutToClipboard - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - CutToClipboard(sImageIndex: number): boolean; - - /** - * Disable the source. If the source's user interface is displayed when the source is enabled, it will be closed. - * @method WebTwain#DisableSource - * @return {boolean} - */ - DisableSource(): boolean; - - /** - * Enables the source to accept image. - * @method WebTwain#EnableSource - * @return {boolean} - */ - EnableSource(): boolean; - - /** - * Clears the specified area of a specified image, and fill the area with the fill color. - * @method WebTwain#Erase - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. - * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. - * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. - * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. - * @return {boolean} - */ - Erase(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; - - /** - * Downloads an image from the FTP server. - * @method WebTwain#FTPDownload - * @param {string} FTPServer the name of the FTP server. - * @param {string} FTPRemoteFile the name of the file to be downloaded. It should be the relative path of the file on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - FTPDownload(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Directly download a file from the FTP server to local disk without loading it into Dynamic Web TWAIN. - * @method WebTwain#FTPDownloadDirectly - * @param {string} FTPServer the name of the FTP server. - * @param {string} FTPRemoteFile the name of the file to be downloaded. It should be the relative path of the file on the FTP server. - * @param {string} localFile specify a full path to store the file. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - FTPDownloadDirectly(FTPServer: string, FTPRemoteFile: string, localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Downloads an image from the FTP server. - * @method WebTwain#FTPDownloadEx - * @param {string} FTPServer the name of the FTP server. - * @param {string} FTPRemoteFile the name of the file to be downloaded. It should be the relative path of the file on the FTP server. - * @param {EnumDWT_ImageType} lImageType simage format of the file to be downloaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - FTPDownloadEx(FTPServer: string, FTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads the image of a specified index in the buffer to the FTP server. - * @method WebTwain#FTPUpload - * @param {string} FTPServer the name of the FTP server. - * @param {number} sImageIndex specifies the index of the image in the buffer. The index is 0-based. - * @param {string} FTPRemoteFile the name of the file to be created on the FTP server. It should be a relative path on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - FTPUpload(FTPServer: string, sImageIndex: number, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Directly upload a specific file to the FTP server without loading it into Dynamic Web TWAIN. - * @method WebTwain#FTPUploadDirectly - * @param {string} FTPServer the name of the FTP server. - * @param {string} localFile specify the the full path of a local file. - * @param {string} FTPRemoteFile the name of the file to be created on the FTP server. It should be a relative path on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - FTPUploadDirectly(FTPServer: string, localFile: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads the image of a specified index in the buffer to the FTP server as a specified image format. - * @method WebTwain#FTPUploadEx - * @param {string} FTPServer the name of the FTP server. - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {string} FTPRemoteFile the name of the file to be created on the FTP server. It should be a relative path on the FTP server. - * @param {EnumDWT_ImageType} lImageType the image format of the file to be created on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - FTPUploadEx(FTPServer: string, sImageIndex: number, FTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads all images in buffer to the FTP server as Multi-Page TIFF. - * @method WebTwain#FTPUploadAllAsMultiPageTIFF - * @param {string} FTPServer the name of the FTP server. - * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - FTPUploadAllAsMultiPageTIFF(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads all images in buffer to the FTP server as Multi-Page PDF. - * @method WebTwain#FTPUploadAllAsPDF - * @param {string} FTPServer the name of the FTP server. - * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - FTPUploadAllAsPDF(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads the selected images in buffer to the FTP server as Multi-Page PDF. - * @method WebTwain#FTPUploadAsMultiPagePDF - * @param {string} FTPServer the name of the FTP server. - * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - FTPUploadAsMultiPagePDF(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Uploads the selected images in buffer to the FTP server as Multi-Page TIFF. - * @method WebTwain#FTPUploadAsMultiPageTIFF - * @param {string} FTPServer the name of the FTP server. - * @param {string} FTPRemoteFile the name of the image to be uploaded. It should be a relative path on the FTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - FTPUploadAsMultiPageTIFF(FTPServer: string, FTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Sets the Source to eject the current page and advance the next page in the document feeder into the feeder acquire area when IfFeederEnabled is TRUE. - * @method WebTwain#FeedPage - * @return {boolean} - */ - FeedPage(): boolean; - - /** - * Check whether a certain file exists on the local disk. - * @method WebTwain#FileExists - * @param {string} localFile specifies the absolute path of the local file. - * @return {boolean} - */ - FileExists(localFile: string): boolean; - - /** - * Flips the image of a specified index in buffer. - * @method WebTwain#Flip - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - Flip(sImageIndex: number): boolean; - - /** - * Get the cap item value of the capability specified by Capability property, when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. - * @method WebTwain#GetCapItems - * @param {number} index Index is 0-based. It is the index of the cap item. - * @return {number} - */ - GetCapItems(index: number): number; - - /** - * Returns the cap item value of the capability specified by Capability property, when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. - * @method WebTwain#GetCapItemsString - * @param {number} index Index is 0-based. It is the index of the cap item. - * @return {string} - */ - GetCapItemsString(index: number): string; - - // Get custom DS data, and returned string is encoded with base64 - /** - * Gets custom DS data, the returned string is base64 encoded. - * @method WebTwain#GetCustomDSDataEx - * @return {string | boolean} - */ - GetCustomDSDataEx(): string | boolean; - - // Get custom DS data, and save the data to the specified file - /** - * Gets custom DS data and save the data in a specified file. - * @method WebTwain#GetCustomDSData - * @param {string} fileName the path of the file used for storing custom DS data. - * @return {boolean} - */ - GetCustomDSData(fileName: string): boolean; - - /** - * Retrieve the device type of the currently selected data source, it might be a scanner, a web camera, etc. - * @method WebTwain#GetDeviceType - * @return {number | boolean} - */ - GetDeviceType(): number | boolean; - - /** - * Returns the pixel bit depth of the selected image. - * @method WebTwain#GetImageBitDepth - * @param {number} sImageIndex specifies the index of image. The index is 0-based. - * @return {number} - */ - GetImageBitDepth(sImageIndex: number): number; - - /** - * Returns the height (pixels) of the selected image. This is a read-only property. - * @method WebTwain#GetImageHeight - * @param {number} sImageIndex specifies the index of image. The index is 0-based. - * @return {number} - */ - GetImageHeight(sImageIndex: number): number; - - /** - * Returns the direct URL of an image specified by index, if iWidth and iHeight are not specified, you get the original image, otherwise you get the image with specified iWidth or iHeight while keeping the same aspect ratio. The returned string is like this 'dwt://dwt_trial_13000404/img?id=306159652&index=0&t=1502184632022' - * @method WebTwain#GetImagePartURL - * @param {number} index the index of the image. - * @param {number} iWidth the width of the image, it must be 150 or bigger - * @param {number} iHeight the height of the image, it must be 150 or bigger - * @return {string} - */ - GetImagePartURL(index: number, iWidth?: number, iHeight?: number): string; - - /** - * Returns the file size of the new image resized from the image of a specified index in buffer. - * @method WebTwain#GetImageSize - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {number} iWidth specifies the pixel width of the new image. - * @param {number} iHeight specifies the pixel height of the new image. - * @return {number} - */ - GetImageSize(sImageIndex: number, iWidth: number, iHeight: number): number; - - /** - * Pre-calculate the file size of the local image file that is saved from an image of a specified index in buffer. - * @method WebTwain#GetImageSizeWithSpecifiedType - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {EnumDWT_ImageType} sImageType specifies the type of an image file.. - * @return {number} - */ - GetImageSizeWithSpecifiedType(sImageIndex: number, sImageType: EnumDWT_ImageType): number; - - /** - * Returns the direct URL of an image specified by index, if iWidth or iHeight is set to -1, you get the original image, otherwise you get the image with specified iWidth or iHeight while keeping the same aspect ratio. - * @method WebTwain#GetImageURL - * @param {number} index the index of the image. - * @param {number} iWidth the width of the image. - * @param {number} iHeight the height of the image. - * @return {string} - */ - GetImageURL(index: number, iWidth: number, iHeight: number): string; - - /** - * Returns the width (pixels) of the selected image. This is a read-only property. - * @method WebTwain#GetImageWidth - * @param {number} sImageIndex specifies the index of image. The index is 0-based. - * @return {number} - */ - GetImageWidth(sImageIndex: number): number; - - /** - * Return the horizontal resolution of the specified image. - * @method WebTwain#GetImageXResolution - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {number} - */ - GetImageXResolution(sImageIndex: number): number; - - /** - * Return the vertical resolution of the specified image. - * @method WebTwain#GetImageYResolution - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {number} - */ - GetImageYResolution(sImageIndex: number): number; - - /** - * Return the runtime license info. - * @method WebTwain#GetLicenseInfo - */ - GetLicenseInfo(optionalAsyncSuccessFunc?: (result: any) => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Returns the index of the selected image. - * @method WebTwain#GetSelectedImageIndex - * @param {number} sSelectedIndex specifies the index of the selected image. - * @return {number} - */ - GetSelectedImageIndex(sSelectedIndex: number): number; - - /** - * Pre-calculate the file size of the local image file that is saved from the selected images in buffer. - * @method WebTwain#GetSelectedImagesSize - * @param {EnumDWT_ImageType} iImageType specifies the type of an image file. - * @return {number} - */ - GetSelectedImagesSize(iImageType: EnumDWT_ImageType): number; - - /** - * Check the skew angle of an image by its index in buffer. - * @method WebTwain#GetSkewAngle - * @param {number} sImageIndex the index of the image in the buffer. - * @return {number} - */ - GetSkewAngle(sImageIndex: number): number; - - /** - * Check the skew angle of a rectangular part of an image by its index in buffer. - * @method WebTwain#GetSkewAngleEx - * @param {number} sImageIndex the index of the image in the buffer. - * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. - * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. - * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. - * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. - * @return {number} - */ - GetSkewAngleEx(sImageIndex: number, left: number, top: number, right: number, bottom: number): number; - - /** - * Get the source name according to the source index. - * @method WebTwain#GetSourceNameItems - * @param {number} index number index. Index is 0-based and can not be greater than SourceCount property. - * @return {string} - */ - GetSourceNameItems(index: number): string; - - /*ignored - GetSourceNames - GetSourceType - GetVersionInfoAsync - */ - - /** - * Downloads an image from the HTTP server. - * @method WebTwain#HTTPDownload - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} HTTPRemoteFile the name of the image to be downloaded. It should be the relative path of the file on the HTTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - HTTPDownload(HTTPServer: string, HTTPRemoteFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Directly downloads a file from the HTTP server to a local disk without loading it into Dynamic Web TWAIN. - * @method WebTwain#HTTPDownloadDirectly - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} HTTPRemoteFile The relative path of the file on the HTTP server. - * @param {string} localFile specify the location to store the downloaded file. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - HTTPDownloadDirectly(HTTPServer: string, HTTPRemoteFile: string, localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Downloads an image from the HTTP server. - * @method WebTwain#HTTPDownloadEx - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} HTTPRemoteFile the relative path of the file on the HTTP server, or path to an action page (with necessary parameters) which gets and sends back the image stream to the client (please check the sample for more info) - * @param {EnumDWT_ImageType} lImageType the image format of the file to be downloaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - HTTPDownloadEx(HTTPServer: string, HTTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /*ignored - HTTPDownloadStreamThroughPost - HTTPDownloadThroughGet - */ - - /** - * Download an image from the server using a HTTP Post call. - * @method WebTwain#HTTPDownloadThroughPost - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} HTTPRemoteFile the relative path of the file on the HTTP server, or path to an action page (with necessary parameters) which gets and sends back the image stream to the client (please check the sample for more info) - * @param {EnumDWT_ImageType} lImageType the image format of the file to be downloaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the download succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - HTTPDownloadThroughPost(HTTPServer: string, HTTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; - - /** - * Uploads just a form created by SetHTTPFormField and SetHTTPHeader - * @method WebTwain#HTTPUpload - * @param {string} url the url where the images are sent in a POST request. - * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - HTTPUpload(url: string, asyncSuccessFunc: (httppostresponsestring: string) => void, asyncFailureFunc: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; - - /** - * Uploads the images specified by the indices to the HTTP server. - * @method WebTwain#HTTPUpload - * @param {string} url the url where the images are sent in a POST request. - * @param {Array} indices indices specifies which images are to be uploaded. - * @param {EnumDWT_ImageType} enumImageType the image format in which the images are to be uploaded. - * @param {EnumDWT_UploadDataFormat} dataFormat whether to upload the images as binary or a base64-based string. - * @param {function} asyncSuccessFunc the function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - HTTPUpload(url: string, indices: number[], enumImageType: EnumDWT_ImageType, dataFormat: EnumDWT_UploadDataFormat, asyncSuccessFunc: (httppostresponsestring: string) => void, asyncFailureFunc: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; - - /** - * Uploads all images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. - * @method WebTwain#HTTPUploadAllThroughPostAsMultiPageTIFF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". - * @param {string} fileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. - * @return {boolean} - */ - HTTPUploadAllThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; - - /** - * Uploads all images in the buffer to the HTTP server through HTTP Post method as a Multi-Page PDF. - * @method WebTwain#HTTPUploadAllThroughPostAsPDF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". - * @param {string} fileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. - * @return {boolean} - */ - HTTPUploadAllThroughPostAsPDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; - - /** - * [Deprecated.] Uploads all images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page TIFF. - * @method WebTwain#HTTPUploadAllThroughPutAsMultiPageTIFF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} RemoteFileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - HTTPUploadAllThroughPutAsMultiPageTIFF(HTTPServer: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * [Deprecated.] Uploads all images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page PDF. - * @method WebTwain#HTTPUploadAllThroughPutAsPDF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} RemoteFileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - HTTPUploadAllThroughPutAsPDF(HTTPServer: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /*ignored - HTTPUploadStreamThroughPost - */ - - /** - * Uploads the image of a specified index in the buffer to the HTTP server through the HTTP POST method. - * @method WebTwain#HTTPUploadThroughPost - * @param {string} HTTPServer the name of the HTTP server. - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". - * @param {string} fileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. - * @return {boolean} - */ - HTTPUploadThroughPost(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; - - /** - * Uploads the selected images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. - * @method WebTwain#HTTPUploadThroughPostAsMultiPageTIFF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". - * @param {string} fileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. - * @return {boolean} - */ - HTTPUploadThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; - - /** - * Uploads the selected images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page PDF. - * @method WebTwain#HTTPUploadThroughPostAsMultiPagePDF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". - * @param {string} fileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. - * @return {boolean} - */ - HTTPUploadThroughPostAsMultiPagePDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; - - /** - * Directly upload a specific local file to the HTTP server through the HTTP POST method without loading it into Dynamic Web TWAIN. - * @method WebTwain#HTTPUploadThroughPostDirectly - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} localFile specifies the path of a local file . - * @param {string} ActionPage the specified page for posting files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". - * @param {string} fileName the name of the file to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. - * @return {boolean} - */ - HTTPUploadThroughPostDirectly(HTTPServer: string, localFile: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; - - /** - * Uploads the image of a specified index in the buffer to the HTTP server as a specified image format through the HTTP POST method. - * @method WebTwain#HTTPUploadThroughPostEx - * @param {string} HTTPServer the name of the HTTP server. - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {string} ActionPage the specified page for posting image files. This is the relative path of the page, not the absolute path. For example: "upload.asp", not "http://www.webserver.com/upload.asp". - * @param {string} fileName the name of the image to be uploaded. - * @param {EnumDWT_ImageType} lImageType the image format of the file to be created on the HTTP server.s - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadFailure. - * @return {boolean} - */ - HTTPUploadThroughPostEx(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; - - /** - * [Deprecated.] Uploads the image of a specified index in the buffer to the HTTP server through the HTTP PUT method. - * @method WebTwain#HTTPUploadThroughPut - * @param {string} HTTPServer the name of the HTTP server. - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {string} RemoteFileName the name of the image to be created on the HTTP server. It should a relative path on the web server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - HTTPUploadThroughPut(HTTPServer: string, sImageIndex: number, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * [Deprecated.] Uploads the selected images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page TIFF. - * @method WebTwain#HTTPUploadThroughPutAsMultiPageTIFF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} RemoteFileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - HTTPUploadThroughPutAsMultiPageTIFF(HTTPServer: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * [Deprecated.] Uploads the selected images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page PDF. - * @method WebTwain#HTTPUploadThroughPutAsMultiPagePDF - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} RemoteFileName the name of the image to be uploaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - HTTPUploadThroughPutAsMultiPagePDF(HTTPServer: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * [Deprecated.] Directly uploads a specific local file to the HTTP server through the HTTP PUT method without loading it into Dynamic Web TWAIN. - * @method WebTwain#HTTPUploadThroughPutDirectly - * @param {string} HTTPServer the name of the HTTP server. - * @param {string} localFile specifies the path of a local file. - * @param {string} RemoteFileName the name of the file to be created on the HTTP server. It should a relative path on the web server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - HTTPUploadThroughPutDirectly(HTTPServer: string, localFile: string, RemoteFileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * [Deprecated.] Uploads the image of a specified index in the buffer to the HTTP server as a specified image format through the HTTP PUT method. - * @method WebTwain#HTTPUploadThroughPutEx - * @param {string} HTTPServer the name of the HTTP server. - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {string} RemoteFileName the name of the file to be created on the HTTP server. It should a relative path on the web server. - * @param {EnumDWT_ImageType} lImageType the image format of the file to be created on the HTTP server. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - HTTPUploadThroughPutEx(HTTPServer: string, sImageIndex: number, RemoteFileName: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * [Deprecated.] Detects whether an image is blank. - * @method WebTwain#IsBlankImage - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - IsBlankImage(sImageIndex: number): boolean; - - /** - * [Deprecated.] Detects whether a certain area on an image is blank. - * @method WebTwain#IsBlankImageEx - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. - * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. - * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. - * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. - * @param {boolean} bFuzzyMatch specifies whether use fuzzy matching when detecting. - * @return {boolean} - */ - IsBlankImageEx(sImageIndex: number, left: number, top: number, right: number, bottom: number, bFuzzyMatch: boolean): boolean; - - /** - * Detects whether a specific image is blank. - * @method WebTwain#IsBlankImageExpress - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - IsBlankImageExpress(sImageIndex: number): boolean; - - /** - * Loads a DIB format image from Clipboard into the Dynamic Web TWAIN. - * @method WebTwain#LoadDibFromClipboard - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the loading succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the loading fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - LoadDibFromClipboard(optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Loads an image into the Dynamic Web TWAIN. - * @method WebTwain#LoadImage - * @param {string} localFile the name of the image to be loaded. It should be the absolute path of the image file on the local disk. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the loading succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the loading fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - LoadImage(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Loads an image into the Dynamic Web TWAIN. - * @method WebTwain#LoadImageEx - * @param {string} localFile the name of the image to be loaded. It should be the absolute path of the image file on the local disk. - * @param {EnumDWT_ImageType} lImageType the image format of the file to be loaded. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the loading succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the loading fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - LoadImageEx(localFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Loads image from a base64 byte array with the specified file format. - * @method WebTwain#LoadImageFromBase64Binary - * @param {string} bry specifies the base64 string data. - * @param {EnumDWT_ImageType} lImageType specifies the file format. - * @return {boolean} - */ - LoadImageFromBase64Binary(bry: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * [Deprecated.] Loads image from a byte array with the specified file format. - * @method WebTwain#LoadImageFromBytes - * @param {number} lBufferSize Specifies the buffer size. - * @param {Array} buffer A byte array of the image data. - * @param {EnumDWT_ImageType} lImageType Specifies the file format. - * @return {boolean} - */ - LoadImageFromBytes(lBufferSize: number, buffer: number[], lImageType: EnumDWT_ImageType): boolean; - - /** - * Mirrors the image of a specified index in buffer. - * @method WebTwain#Mirror - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - Mirror(sImageIndex: number): boolean; - - /** - * Moves a specified image. - * @method WebTwain#MoveImage - * @param {number} sSourceImageIndex Specifies the source index of image in buffer. The index is 0-based. - * @param {number} sTargetImageIndex Specifies the target index of image in buffer. The index is 0-based. - * @return {boolean} - */ - MoveImage(sSourceImageIndex: number, sTargetImageIndex: number): boolean; - - /*ignored - OnRefreshUI - */ - - /** - * Loads the specified Source into main memory and causes its initialization, - * placing Dynamic Web TWAIN into Capability Negotiation state. If no source is - * specified (no SelectSource() or SelectSourceByIndex() is called), opens the default source. - * @method WebTwain#OpenSource - * @return {boolean} - */ - OpenSource(): boolean; - - /** - * Loads and opens Data Source Manager. - * @method WebTwain#OpenSourceManager - * @return {boolean} - */ - OpenSourceManager(): boolean; - - /** - * Decorates image of a specified index in buffer with rectangles of transparent color. - * @method WebTwain#OverlayRectangle - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {number} left specifies the x-coordinate of the upper-left corner of the rectangle. - * @param {number} top specifies the y-coordinate of the upper-left corner of the rectangle. - * @param {number} right specifies the x-coordinate of the lower-right corner of the rectangle. - * @param {number} bottom specifies the y-coordinate of the lower-right corner of the rectangle. - * @param {number} color Specifies the fill color of the rectangle. The byte-ordering of the RGB value is 0xBBGGRR. BB represents blue, GG represents green, RR represents red. - * @param {number} fOpacity Specifies the opacity of the rectangle. The value represents opacity. 1.0 is 100% opaque and 0.0 is totally transparent. - * @return {boolean} - */ - OverlayRectangle(sImageIndex: number, left: number, top: number, right: number, bottom: number, color: number, fOpacity: number): boolean; - - /** - * Shows the GUI of Image Printer. - * @method WebTwain#Print - * @param {boolean} bUseSystemDefaultPrintUI specifies whether to use the system Print UI or not. - * @return {boolean} - */ - Print(bUseSystemDefaultPrintUI: boolean): boolean; - - /** - * Binds a specified function to an event, so that the function gets called whenever the event fires. - * @method WebTwain#RegisterEvent - * @param {string} name the name of the event that the function is bound to. - * @param {any} evt specifies the function to call when event fires. - * @return {boolean} - */ - RegisterEvent(name: string, evt: any): boolean; - - /** - * Removes all images in buffer. - * @method WebTwain#RemoveAllImages - * @return {boolean} - */ - RemoveAllImages(): boolean; - - /** - * Removes selected images in buffer. - * @method WebTwain#RemoveAllSelectedImages - * @return {boolean} - */ - RemoveAllSelectedImages(): boolean; - - /** - * Removes the image of a specified index in buffer. - * @method WebTwain#RemoveImage - * @param {number} sImageIndexToBeDeleted specifies the index of the image to be deleted in buffer. The index is 0-based. - * @return {boolean} - */ - RemoveImage(sImageIndexToBeDeleted: number): boolean; - - /** - * Reverts the current image layout to the Data Source's default. - * @method WebTwain#ResetImageLayout - * @return {boolean} - */ - ResetImageLayout(): boolean; - - /** - * Sets the Source to return the current page to the input side of the document feeder and - * feed the last page from the outside of the feeder back into the acquisition area if IfFeederEnabled is TRUE. - * @method WebTwain#RewindPage - * @return {boolean} - */ - RewindPage(): boolean; - - /** - * Rotates the image of a specified index in buffer by specified angle. - * @method WebTwain#Rotate - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {number} fAngle Specifies the rotation angle. - * @param {boolean} bKeepSize Keep size or not. - * @return {boolean} - */ - Rotate(sImageIndex: number, fAngle: number, bKeepSize: boolean): boolean; - - /** - * Rotates the image of a specified index in buffer by specified angle. - * @method WebTwain#RotateEx - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {number} fAngle Specifies the rotation angle. - * @param {boolean} bKeepSize Keep size or not. - * @param {EnumDWT_InterpolationMethod} newVal specifies the method to do interpolation. - * @return {boolean} - */ - RotateEx(sImageIndex: number, fAngle: number, bKeepSize: boolean, newVal: EnumDWT_InterpolationMethod): boolean; - - /** - * Rotates the image of a specified index in buffer by 90 degrees counter-clockwise. - * @method WebTwain#RotateLeft - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - RotateLeft(sImageIndex: number): boolean; - - /** - * Rotates the image of a specified index in buffer by 90 degrees clockwise. - * @method WebTwain#RotateRight - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - RotateRight(sImageIndex: number): boolean; - - /** - * Saves all images in buffer as a MultiPage TIFF file. - * @method WebTwain#SaveAllAsMultiPageTIFF - * @param {string} localFile the name of the MultiPage TIFF file to be saved. It should be an absolute path on the local disk. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - SaveAllAsMultiPageTIFF(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Saves all images in buffer as a Multi-Page PDF file. - * @method WebTwain#SaveAllAsPDF - * @param {string} localFile the name of the Multi-Page PDF file to be saved. It should be an absolute path on the local disk. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - SaveAllAsPDF(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Saves the image of a specified index in buffer as a BMP file. - * @method WebTwain#SaveAsBMP - * @param {string} localFile the name of the BMP file to be saved. It should be an absolute path on the local disk. - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - SaveAsBMP(localFile: string, sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /*ignored - SaveAsGIF - */ - - /** - * Saves the image of a specified index in buffer as a JPEG file. - * @method WebTwain#SaveAsJPEG - * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - SaveAsJPEG(localFile: string, sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Saves the image of a specified index in buffer as a PDF file. - * @method WebTwain#SaveAsPDF - * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - SaveAsPDF(localFile: string, sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Saves the image of a specified index in buffer as a PNG file. - * @method WebTwain#SaveAsPNG - * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - SaveAsPNG(localFile: string, sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Saves the image of a specified index in buffer as a TIFF file. - * @method WebTwain#SaveAsTIFF - * @param {string} localFile the name of the JPEG file to be saved. It should be an absolute path on the local disk. - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - SaveAsTIFF(localFile: string, sImageIndex: number, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Saves the selected images in buffer as a Multipage PDF file. - * @method WebTwain#SaveSelectedImagesAsMultiPagePDF - * @param {string} localFile the name of the MultiPage PDF file to be saved. It should be an absolute path on the local disk. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - SaveSelectedImagesAsMultiPagePDF(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Saves the selected images in buffer as a Multipage TIFF file. - * @method WebTwain#SaveSelectedImagesAsMultiPageTIFF - * @param {string} localFile the name of the MultiPage TIFF file to be saved. It should be an absolute path on the local disk. - * @param {function} optionalAsyncSuccessFunc optional. The function to call when the saving succeeds. Please refer to the function prototype OnSuccess. - * @param {function} optionalAsyncFailureFunc optional. The function to call when the saving fails. Please refer to the function prototype OnFailure. - * @return {boolean} - */ - SaveSelectedImagesAsMultiPageTIFF(localFile: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; - - /** - * Saves the selected images in buffer to base64 string. - * @method WebTwain#SaveSelectedImagesToBase64Binary - * @return {string|boolean} - */ - SaveSelectedImagesToBase64Binary(optionalAsyncSuccessFunc?: (result: string[]) => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): string | boolean; - - /** - * [Deprecated.] Saves the selected images in buffer to a byte array in the specified file format. - * @method WebTwain#SaveSelectedImagesToBytes - * @param {number} bufferSize specified the buffer size. - * @param {Array} buffer A byte array of the image data. - * @return {number} - */ - SaveSelectedImagesToBytes(bufferSize: number, buffer: number[]): number; - - /** - * Brings up the TWAIN Data Source Manager's Source Selection User Interface (UI) - * so that user can choose which Data Source to be the current Source. - * @method WebTwain#SelectSource - * @return {boolean} - */ - SelectSource(): boolean; - - /** - * Selects the index-the source in SourceNameItems property as the current source. - * @method WebTwain#SelectSourceByIndex - * @param {number} index It is the index of SourceNameItems property. - * @return {boolean} - */ - SelectSourceByIndex(index: number): boolean; - - /*ignored - SetCancel - */ - - /** - * Set the value of the specified cap item. - * @method WebTwain#SetCapItems - * @param {number} index Index is 0-based. It is the index of the cap item. - * @param {number} newVal For string type, please use CapItemsstring property. - * @return {void} - */ - SetCapItems(index: number, newVal: number): void; - - /** - * Set the cap item value of the capability specified by Capability property, when the value of the CapType property is TWON_ARRAY or TWON_ENUMERATION. - * @method WebTwain#SetCapItemsString - * @param {number} index Index is 0-based. It is the index of the cap item. - * @param {string} newVal The new value to be set. - * @return {void} - */ - SetCapItemsString(index: number, newVal: string): void; - - /** - * [Deprecated.] Sets current cookie into the Http Header to be used when uploading scanned images through POST. - * @method WebTwain#SetCookie - * @param {string} cookie the cookie on current page. - * @return {void} - */ - SetCookie(cookie: string): void; - - // Set custom DS data (DAT_CUSTOMDSDATA), the input string is encoded with base64 - /** - * Sets custom DS data to be used for scanning, the input string is encoded with base64. Custom DS data means a specific scanning profile. - * @method WebTwain#SetCustomDSDataEx - * @param {string} value the input string which is encoded with base64. - * @return {boolean} - */ - SetCustomDSDataEx(value: string): boolean; - - // Set custom DS data, load data from the specified file - /** - * Sets custom DS data to be used for scanning, the data is stored in a file. Custom DS data means a specific scanning profile. - * @method WebTwain#SetCustomDSData - * @param {string} fileName the absolute path of the file where the custom data source data is stored. - * @return {boolean} - */ - SetCustomDSData(fileName: string): boolean; - - /** - * Change the DPI (dots per inch) for the specified image. - * @method WebTwain#SetDPI - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {number} xResolution The horizontal resolution. - * @param {number} yResolution The vertical resolution. - * @param {boolean} bResampleImage Whether to resample the image. (The image size will be changed if this is set to true). - * @param {EnumDWT_InterpolationMethod} newVal specifies the method to do interpolation. - * @return {boolean} - */ - SetDPI(sImageIndex: number, xResolution: number, yResolution: number, bResampleImage: boolean, newVal: EnumDWT_InterpolationMethod): boolean; - - /** - * Sets file name and file format information used in File Transfer Mode. - * @method WebTwain#SetFileXferInfo - * @param {string} fileName the name of the file to be used in transfer. - * @param {EnumDWT_FileFormat} fileFormat an enumerated value indicates the format of the image. - * @return {boolean} - */ - SetFileXferInfo(fileName: string, fileFormat: EnumDWT_FileFormat): boolean; - - /** - * Sets a text parameter as a filed in a web form. This form is maintained by the component itself (meaning it's not on the page). All fields in this form will be passed to the server when uploading images. - * @method WebTwain#SetHTTPFormField - * @param {string} FieldName specifies the name of a text field in web form. - * @param {string} FieldValue specifies the value of a text field in web form. - * @return {boolean} - */ - SetHTTPFormField(FieldName: string, FieldValue: string): boolean; - - /** - * Sets a text parameter as a filed in a web form. This form is maintained by the component itself (meaning it's not on the page). All fields in this form will be passed to the server when uploading images. - * @method WebTwain#SetHTTPFormField - * @param {string} FieldName specifies the name of the field which could later be used to retrieve the blob - * @param {Blob} blobValue specifies the blob to be put in the form. - * @param {string} optionalFileName specifies the file name for the blob - * @return {boolean} - */ - SetHTTPFormField(FieldName: string, blobValue: Blob, optionalFileName?: string): boolean; - - /** - * Sets a header for the current HTTP Post request. - * @method WebTwain#SetHTTPHeader - * @param {string} key the key of the header. - * @param {string} value the value of the header. - * @return {boolean} - */ - SetHTTPHeader(key: string, value: string): boolean; - - /** - * Sets the left, top, right, and bottom sides of the image layout rectangle for the current Data Source. - * @method WebTwain#SetImageLayout - * @param {number} left specifies the floating point number for the left side of the image layout rectangle. - * @param {number} top specifies the floating point number for the top side of the image layout rectangle. - * @param {number} right specifies the floating point number for the right side of the image layout rectangle. - * @param {number} bottom specifies the floating point number for the bottom side of the image layout rectangle. - * @return {boolean} - */ - SetImageLayout(left: number, top: number, right: number, bottom: number): boolean; - - /** - * Change the width of an image in buffer. - * @method WebTwain#SetImageWidth - * @param {number} sImageIndex specifies which image you'd like to change. - * @param {number} iNewWidth specifies how wide you'd like to change the image. - * @return {boolean} - */ - SetImageWidth(sImageIndex: number, iNewWidth: number): boolean; - - /** - * Set the language for the authorization dialogs. - * @method WebTwain#SetLanguage - * @param {EnumDWT_Language} language specify the language - * @return {boolean} - */ - SetLanguage(language: EnumDWT_Language): boolean; - - /** - * Sets the time-out used to open a specified Data Source. - * @method WebTwain#SetOpenSourceTimeout - * @param {number} iMilliseconds specifies the number of milliseconds. - * @return {boolean} - */ - SetOpenSourceTimeout(iMilliseconds: number): boolean; - - /** - * Draws a rectangle on the viewer which represents the selected area. - * @method WebTwain#SetSelectedImageArea - * @param {number} sImageIndex specifies the index of image in buffer. The index is 0-based. - * @param {number} left The X axis of the left border. - * @param {number} top The Y axis of the top border. - * @param {number} right The X axis of the right border. - * @param {number} bottom The Y axis of the bottom border. - * @return {boolean} - */ - SetSelectedImageArea(sImageIndex: number, left: number, top: number, right: number, bottom: number): boolean; - - /** - * You can use the method to select images programatically which is ususally done by mouse clicking. - * @method WebTwain#SetSelectedImageIndex - * @param {number} sSelectedIndex this is the index of an array that holds the indices of selected images. - * @param {number} newVal specifies the index of an image that you want to select. - * @return {boolean} - */ - SetSelectedImageIndex(selectedIndex: number, newVal: number): boolean; - - /** - * Sets a custom tiff tag. Currently you can set up to 32 tags. The string to be set in a tag can be encoded with base64. - * @method WebTwain#SetTiffCustomTag - * @param {number} tag specifies the tag identifier. The value should be between 600 and 700. - * @param {string} content the string to be set for this tag. The string will be written to the .tiff file when you save/upload it. If the string is base64 encoded, we'll decode it before writing it. - * @param {boolean} base64Str if you'd like to encode the string with base64, set this to true. Otherwise, the string will be plin text. - * @return {boolean} - */ - SetTiffCustomTag(tag: number, content: string, base64Str: boolean): boolean; - - /** - * Configures how segmented upload is done. - * @method WebTwain#SetUploadSegment - * @param {number} segmentUploadThreshold specifies the threshold (in MB) over which segmented upload will be invoked. - * @param {number} moduleSize specifies the size of each segment (in KB). - * @return {boolean} - */ - SetUploadSegment(segmentUploadThreshold: number, moduleSize: number): boolean; - - /** - * Sets the view mode that images are displayed in Dynamic Web TWAIN. You can use this method to display multiple images in Dynamic Web TWAIN. - * @method WebTwain#SetViewMode - * @param {number} sHorizontalImageCount specifies how many columns can be displayed in Dynamic Web TWAIN. - * @param {number} sVerticalImageCount specifies how many rows can be displayed in Dynamic Web TWAIN.. - * @return {void} - */ - SetViewMode(sHorizontalImageCount: number, sVerticalImageCount: number): void; - - /** - * Show save file dialog or show open file dialog. - * @method WebTwain#ShowFileDialog - * @param {boolean} SaveDialog True -- show save file dialog, False -- show open file dialog. - * @param {string} Filter The filter name specifies the filter pattern (for example, "*.TXT"). To specify multiple filter patterns for a single display string, use a semicolon to separate the patterns (for example, "*.TXT;*.DOC;*.BAK"). A pattern string can be a combination of valid file name characters and the asterisk (*) wildcard character. Do not include spaces in the pattern string. To retrieve a shortcut's target without filtering, use the string "All Files\0*.*\0\0", but the program will replace "\0" with "|" automatically. - * @param {number} FilterIndex The index of the currently selected filter in the File Types control. The buffer pointed to by Filter contains pairs of strings that define the filters. The index is 0-based. - * @param {string} DefExtension Define the default extension. GetOpenFileName and GetSaveFileName append this extension to the file name only if the user fails to type an extension. If this member is NULL and the user fails to type an extension, no extension is appended. - * @param {string} InitialDir The initial directory. The algorithm for selecting the initial directory varies on different platforms. - * @param {boolean} AllowMultiSelect True -- allows users to select more than one file, False -- only allows to select one file. - * @param {boolean} OverwritePrompt True -- If a file already exists with the same name, the old file will be simply overwritten, False -- not allows to save and overwrite a same name file. - * @param {number} Flags If this parameter equals 0, the program will be initiated with the default flags, otherwise initiated with the cumstom value and parameters "AllowMultiSelect" and "OverwritePrompt" will be useless. - * @return {boolean} - */ - ShowFileDialog(SaveDialog: boolean, Filter: string, FilterIndex: number, DefExtension: string, InitialDir: string, AllowMultiSelect: boolean, OverwritePrompt: boolean, Flags: number): boolean; - - /** - * Shows the GUI of Image Editor. - * @method WebTwain#ShowImageEditor - * @return {boolean} - */ - ShowImageEditor(): boolean; - - /** - * [Deprecated.] Shows the GUI of Image Editor with custom settings. - * @method WebTwain#ShowImageEditorEx - * @param {number} x specifies the new position of the left top corner of the window. - * @param {number} y specifies the new position of the left top corner of the window. - * @param {number} cx specifies the width of the window. - * @param {number} cy specifies the height of the window. - * @param {number} nCmdShow specifices how the window should be shown. - * @return {boolean} - */ - ShowImageEditorEx(x: number, y: number, cx: number, cy: number, nCmdShow: number): boolean; - - /*ingored - SourceNameItems - */ - - /** - * Switchs two images of specified indices in buffer. - * @method WebTwain#SwitchImage - * @param {number} sImageIndex1 specifies the index of image in buffer. The index is 0-based. - * @param {number} sImageIndex2 specifies the index of image in buffer. The index is 0-based. - * @return {boolean} - */ - SwitchImage(sImageIndex1: number, sImageIndex2: number): boolean; - - /** - * Unbinds an event from the specified function, so that the function stops receiving notifications when the event fires. - * @method WebTwain#UnregisterEvent - * @param {string} name the name of the event. - * @param {object} evt specified the function to be unbound. - * @return {boolean} - */ - UnregisterEvent(name: string, evt: object): boolean; - - /*ignored - checkErrorString - first - getInstance - last - next - on - onEvent - previous - - ...other internal ones - */ -} +// TypeScript Version: 2.4 + +/// +/// +/// +/// +/// +/// +/// +/// diff --git a/types/dwt/mbc.d.ts b/types/dwt/mbc.d.ts new file mode 100644 index 0000000000..3c27fd8ac0 --- /dev/null +++ b/types/dwt/mbc.d.ts @@ -0,0 +1,1047 @@ +/**`constructor` MBC() + * Syntax:* `new MBC(license)` + * | parameter | type | description | + * | | | | + * | license | `String` | | + * example:* +```javascript + // MBC without a license can be used for evaluation purposes. It is not stable for long time usage. + var painter = new MBC(); + // MBC need a license in production environments. + painter = new MBC('xxxxx'); +``` + */ +declare namespace MBC { + /** + * Tell this painter the directory where you place`cv-wasm.js` and`cv-wasm.wasm`. + + * Syntax:* `MBC.cvFolder = 'js';` + */ + let cvFolder: string; + + /** + * You should call`MBC.loadCvScriptAsync()` first before use`Free Transform` and`Brush` module. + + * Syntax:* `MBC.loadCvScriptAsync(callback)` + + | parameter | type | description | + | | | | + | callback | `function(boolean bSuccess)` | | + + @example +```javascript + MBC.loadCvScriptAsync(function(bSuccess){ + if(bSuccess){ + console.log('load cv script success.'); + painter.enterFreeTransformModeAsync(); + }else{ + console.log('load cv script fail.'); + } + }); +``` + */ + function loadCvScriptAsync(): any; +} + +interface rectangle { + left: number; + top: number; + right: number; + bottom: number; +} + +interface point { + x: number; + y: number; +} + +interface cornerPoints { + leftTop: point; + rightTop: point; + leftBottom: point; + rightBottom: point; +} + +declare class TaskQueue { + _queue: any[]; + isWorking: boolean; + timeout: number; + /** + * Constructs a new task queue + */ + constructor(); +} + +interface TaskQueue { + push(task: any, context?: any, args?: any): void; + unshift(task: any, context?: any, args?: any): void; + next(): void; +} + +declare class KPainter { + /** + * Constructs a new KPainter + */ + constructor(mbcKey?: string); + /** + * @example +```javascript + var painterDom = painter.getHtmlElement(); + painterDom.style.width = '100%'; + painterDom.style.height = '100%'; + document.getElementById('painter-container').appendChild(painterDom); +``` + * + */ + getHtmlElement(): HTMLDivElement; + + /** + * Get the current showing image index a in MBC instance. + */ + getCurIndex(): number; + + /** + * Get the image count in a MBC instance. + */ + getCount(): number; + + /** + * Identify whether the MBC instance is in `Editing` mode. + */ + isEditing(): boolean; + + /** + * +@example +```javascript + // A way to access to inner data. Don't modify it if you are not sure. + var imgOri = painter.getImage(true); + // This image can be used in any place and free to modify it. + var imgCopyed = painter.getImage(); + imgCopyed.style.width = '100px'; + imgCopyed.style.height = '100px'; + document.getElementById('image-container').appendChild(imgCopyed); +``` + */ + getImage(isOri: boolean, index: number): HTMLImageElement; + + /** + * Binding a function that would be called when starting an expensive operation. + * Syntax:* `function(){}` +@example +```javascript + painter.onStartLoading = function(){ + document.getElementById('animation').show(); + }; +``` + */ + onStartLoading: () => void; + + /** + * Binding a function that would be called when finishing an expensive operation. + + * Syntax:* `function(){}` + + @example```javascript + painter.onFinishLoading = function(){ + document.getElementById('animation').hide(); + }; + ``` + */ + onFinishLoading: () => void; + + // Image Store + + /** + * Show file choose window by click the hidden file input.Can't process during `Editing` mode. + * @example +```javascript + document.getElementById('btn-add-image').addEventListener('click', function(){ + painter.showFileChooseWindow(); + }); +``` + */ + showFileChooseWindow(): boolean; + + /** + * @example +```javascript + // warning: never redefine it if you are not sure + // painter.defaultFileInput = document.createElement('input'); + painter.defaultFileInput.accept = "image/png"; + painter.defaultFileInput.multiple = false; +``` + */ + defaultFileInput: HTMLInputElement; + + /** + * Binding a function that would be called when`defaultFileInput` change by`showFileChooseWindow()`. + + * Syntax:* `function(event, callback){}` + + @example +```javascript + painter.beforeAddImgFromFileChooseWindow = function(ev, callback){ + var files = ev.target.files; + var newBlobs = []; + var finishedIndex = 0; + for(var i = 0; i < files.length; ++i){ + var file = files[i]; + doSomeWorkToGetANewBlob(file, function(blob){ + newBlobs.push(blob); + if(files.length == ++finishedIndex){ + callback(newBlobs); + } + }); + } + }; +``` + */ + beforeAddImgFromFileChooseWindow: () => void; + + /** + * Binding a function that would be called after adding image from`defaultFileInput`. + + * Syntax:* `function(){}` + + @example +```javascript + painter.afterAddImgFromFileChooseWindow = function(bSuccess){ + if(bSuccess){console.log('The new image(s) has been added from file choose window.');} + }; +``` + */ + afterAddImgFromFileChooseWindow: () => void; + + /*** + * Syntax:* `function(event, callback){}` + @example +```javascript + painter.beforeAddImgFromDropFile = function(ev, callback){ + var files = ev.dataTransfer.files; + var newBlobs = []; + var finishedIndex = 0; + for(var i = 0; i < files.length; ++i){ + var file = files[i]; + doSomeWorkToGetANewBlob(file, function(blob){ + newBlobs.push(blob); + if(files.length == ++finishedIndex){ + callback(newBlobs); + } + }); + } + }; +``` + */ + beforeAddImgFromDropFile: () => any; + + /** + * + * Syntax:* `function(){}` + + @example +```javascript + painter.afterAddImgFromDropFile = function(bSuccess){ + if(bSuccess){console.log('The new image(s) has been added from dropping.');} + }; +``` + * + */ + afterAddImgFromDropFile: () => void; + + /** + * Syntax:* `.addImageAsync(imgData, callback)` + + | parameter | type | description | + | | | | + | imgData | `Blob`, `HTMLCanvasElement`, `HTMLImageElement`, `String` * (url) *, `Array` * (a array of source)*, `FileList` | | + | callback * (optional) * | `function(bSuccess)` | | + + @example +```javascript + painter.addImageAsync(image, function(bSuccess){ + console.log('Add success'); + }); +``` + */ + addImageAsync(imgData: Blob | HTMLCanvasElement | HTMLImageElement | string | string[], callback?: () => void): void; + + /** + The image whose width or height larger than`addedImageMaxWH` would be compressed when adding. + + * Syntax:* `.addedImageMaxWH = 4096;` + */ + addedImageMaxWH: number; + + /** + * Whether`changePage` to the new added image. + + * Syntax:* `.isShowNewImgWhenAdd = true;` + */ + isShowNewImgWhenAdd: boolean; + + /** + * Update the`htmlElement` of a MBC instance.Should call it manually when the`htmlElement` resize. + + * Syntax:* `.updateUIOnResize(isLazy, callback)` + + | parameter | type | description | + | | | | + | isLazy * (optional) *| `boolean` | Default false.Set true to avoid to update too frequently. | + | callback | `function()` | Callback of finish updating.Might abort the earlier callback when`isLazy` is true. | + + @example +```javascript + window.addEventListener('resize',function(){ + painter.updateUIOnResize(true, function(){ + console.log('painter update'); + }); + }); +``` + */ + updateUIOnResize(isLazy?: boolean, callback?: () => void): void; + + /** + * Binding a function that would be called when current image index or total length change. + + * Syntax:* `function(Number curIndex, Number length){}` + + @example +```javascript + painter.onNumChange = function(curIndex, length){ + console.log('curIndex: '+curIndex+', length:'+length); + }; +``` + */ + onNumChange: (curIndex: number, length: number) => void; + + /** + * Change index of the current page.Can only process in `Viewing` mode. + + * Syntax:* `.changePage(cmd)` + + | parameter | type | description | + | | | | + | * (return value)* | `boolean` | | + | cmd | `Number` * (index) *, `String` * ('f', 'p', 'n', 'l') * | Index number, or command string of 'f'(first), 'p'(pre), 'n'(next), 'l'(last). | + + @example +```javascript + document.getElementById('btn-first').addEventListener('click', function(){ + painter.changePage('f'); + }); + document.getElementById('btn-pre').addEventListener('click', function(){ + painter.changePage('p'); + }); + document.getElementById('btn-next').addEventListener('click', function(){ + painter.changePage('n'); + }); + document.getElementById('btn-last').addEventListener('click', function(){ + painter.changePage('l'); + }); + document.getElementById('btn-toThisPage').addEventListener('click', function(){ + painter.changePage(parseInt(document.getElementById('ipt-page').value)); + }); +``` + */ + changePage(cmd: number | string): boolean; + + /** + * Delete a image.Can only process in `Viewing` mode. + + * Syntax:* `.del(index)` + + | parameter | type | description | + | | | | + | * (return value)* | `boolean` | | + | index * (optional) * | `Number` | Default current index. | + + */ + del(index: number): boolean; + + /** + * Get width of current image in the MBC instance. + + * Syntax:* `.getWidth(index)` + + | parameter | type | description | + | | | | + | * (return value)* | `Number` | | + | index * (optional) * | `Number` | Default current index. | + */ + getWidth(index: number): number; + + /** + * Get height of current image in the MBC instance. + + * Syntax:* `.getHeight(index)` + + | parameter | type | description | + | | | | + | * (return value)* | `Number` | | + | index * (optional) * | `Number` | Default current index. | + */ + getHeight(index: number): number; + + /** + * Get the image data in `Blob` type. + + * Syntax:* `.getBlob(index)` + + | parameter | type | description | + | | | | + | * (return value)* | `Number` | | + | index * (optional) * | `Number` | Default current index. | + */ + getBlob(index: number): Blob; + + /** + * Download the image to users' local system. The function should be invoked directly by the user. Async invoking may have problems. + + * Syntax:* `.download(filename, index)` + + | parameter | type | description | + | | | | + | * (return value)* | `Number` | | + | filename * (optional) * | `String` | | + | index * (optional) * | `Number` | Default current index. | + + @example +```javascript + document.getElementById('btn-download').addEventListener('click', function(){ + for(var i = 0; i < painter.getCount(); ++i){ + painter.download(null, i); + } + }); +``` + */ + download(filename?: string, index?: number): number; + + /** + * Syntax:* `.bindThumbnailBox(container, funWrap, maxWH)` + + | parameter | type | description | + | | | | + | * (return value)* | `boolean` | | + | container | `HTMLElement` | | + | funWrap * (optional) * | `HTMLElement function(HTMLCanvasElement cvs)` | | + | maxWH * (optional) * | `Number` | Default 256. | + + @example +```javascript + painter.bindThumbnailBox(document.getElementById('div-thumbnailContainer'), function(cvs){ + console.log(cvs.className);// 'kPainterThumbnailCanvas', never remove this class + var box = document.createElement('div'); + box.className = 'div-thumbnailBox'; + box.appendChild(cvs); + box.addEventListener('click', function(){ + var idx = box.getKPainterIndex();// get index + painter.changePage(idx); + }); + return box; + }); +``` + */ + bindThumbnailBox(container: HTMLElement, funWrap?: () => HTMLElement, maxWH?: number): boolean; + + /** + * Syntax:* `.unbindThumbnailBox(container)` + + | parameter | type | description | + | | | | + | * (return value)* | `boolean` | | + | container | `HTMLElement` | | + + @example +```javascript + painter.bindThumbnailBox(document.getElementById('div-thumbnailContainer')); +``` + */ + unbindThumbnailBox(container: HTMLElement): boolean; + + // Gesture + + /** + * + Set the zoom rate when user left double click. + + * Syntax:* `.leftDoubleClickZoomRate = 2;` + + */ + leftDoubleClickZoomRate: number; + + /** + * Set the zoom rate when user right double click. + + * Syntax:* `.rightDoubleClickZoomRate = 0.5;` + */ + rightDoubleClickZoomRate: number; + + /** + * Whether allow switch from last to first or from first to last by`touchmove` gesture. + + * Syntax:* `.allowedTouchMoveSwitchImgOverBoundary = true;` + */ + allowedTouchMoveSwitchImgOverBoundary: boolean; + + /** + * Binding a function that would be called when the performence of the current image or canvas(in `Editing` mode) update. + + * Syntax:* `function(){}` + + @example +```javascript + painter.onUpdateImgPosZoom(function(){ + console.log(painter.getZoom()); + console.log(painter.getEditWidth()); + console.log(painter.getEditHeight()); + }); +``` + */ + onUpdateImgPosZoom: () => void; + + /** + * Get the zoom of current image or canvas(in `Editing` mode). + + * Syntax:* `.getZoom()` + + | parameter | type | description | + | | | | + | * (return value)* | `Number` | | + */ + getZoom(): number; + + /** + * Set the zoom of current image or canvas(in `Editing` mode). + + * Syntax:* `.setZoom(num, isRate)` + + | parameter | type | description | + | | | | + | * (return value)* | `Number` | The finally effective zoom. | + | num | `Number` | | + | isRate | `boolean` | | + */ + setZoom(num: number, isRate: boolean): number; + + // Basic Editor + + /** + * The can - not - store step(freeTransform, brush) will generate a step image.If the step images' count over `stepImgsGCThreshold`, oldest not protected one would be GC. + + * Syntax:* `.stepImgsGCThreshold = 10;` + */ + stepImgsGCThreshold: number; + + /** + * Add a protected step.Then this step would not be GC.Can only process in `Editing` mode. + + * Syntax:* `.addProtectedStep(index)` + + | parameter | type | description | + | | | | + | index | `Number` | | + + @example +```javascript + // sample code: save and give up editing about freeTransform mode + document.getElementById('btn-enterFreeTransformMode').addEventListener('click', function(){ + // pretect step when enter freeTransform mode + painter.addProtectedStep(painter.getCurStep()); + // presume that `MBC.loadCvScriptAsync(callback)` has been called and success + painter.enterFreeTransformModeAsync(); + }); + + document.getElementById('btn-saveFreeTransform').addEventListener('click', function(){ + // remove the the last pretect step + var protectedSteps = painter.getProtectedSteps(); + painter.removeProtectedStep(protectedSteps[protectedSteps.length - 1]); + // transform and exitFreeTransformMode + painter.freeTransformAsync(function(){ + painter.exitFreeTransformModeAsync(); + }); + }); + + document.getElementById('btn-giveUpFreeTransform').addEventListener('click', function(){ + // pretect step when enter freeTransform mode + var protectedSteps = painter.getProtectedSteps(); + var lastPretectedStep = protectedSteps[protectedSteps.length - 1]; + // remove the the last pretect step + painter.removeProtectedStep(lastPretectedStep); + // exitFreeTransformMode + painter.exitFreeTransformModeAsync(function(){ + // jump to the last pretect step + painter.setCurStepAsync(lastPretectedStep); + }); + }); +``` + */ + addProtectedStep(index: number): boolean; + + /** + * Remove a protected step.Then this step can be GC.Can only process in `Editing` mode. + + * Syntax:* `.removeProtectedStep(index)` + + | parameter | type | description | + | | | | + | index | `Number` | | + + */ + removeProtectedStep(index: number): boolean; + + /** + * Get All protected steps.Can only process in `Editing` mode. + + * Syntax:* `.getProtectedSteps()` + + | parameter | type | description | + | | | | + | * (return value)* | `Array` | A array of the protected numbers. | + */ + getProtectedSteps(): number[]; + + /** + * Undo an editing step.Can only process in `Editing` mode. + + * Syntax:* `.undo(callback)` + + | parameter | type | description | + | | | | + | callback | `function(boolean bSuccess)` | | + */ + undo(callback: () => void): void; + + /** + * Redo an editing step.Can only process in `Editing` mode. + + * Syntax:* `.redo(callback)` + + | parameter | type | description | + | | | | + | callback | `function(boolean bSuccess)` | | + */ + redo(callback: () => void): void; + + /** + * Get count of editing steps.Can only process in `Editing` mode. + + * Syntax:* `.getStepCount()` + + | parameter | type | description | + | | | | + | * (return value)* | `Number` | | + */ + getStepCount(): number; + + /** + * Get current editing step.Can only process in `Editing` mode. + + * Syntax:* `.getCurStep()` + + | parameter | type | description | + | | | | + | * (return value)* | `Number` | | + */ + getCurStep(): number; + + /** + * Set current editing step.Can only process in `Editing` mode. + + * Syntax:* `.setCurStepAsync(index, callback)` + + | parameter | type | description | + | | | | + | index | `Number` | | + | callback | `function(boolean bSuccess)` | | + */ + setCurStepAsync(index: number, callback: () => void): void; + + /** + * Enter the`Editing` mode. + + * Syntax:* `.enterEditAsync(callback)` + + | parameter | type | description | + | | | | + | callback | `function(boolean bSuccess)` | | + */ + enterEditAsync(callback: () => void): void; + + /** + * Leave the`Editing` mode without saving change. + + * Syntax:* `.cancelEdit(callback)` + + | parameter | type | description | + | | | | + | * (return value)* | `boolean` | | + */ + cancelEdit(callback: () => void): boolean; + + /** + * Save change and leave the`Editing` mode. + + * Syntax:* `.saveEditAsync(callback, isCover)` + + | parameter | type | description | + | | | | + | callback | `function(boolean bSuccess)` | | + | isCover | `boolean` | | + */ + saveEditAsync(callback: () => void, isCover: boolean): void; + + /** + * Rotate right.Can only process in `Editing` mode. + + * Syntax:* `.rotateRight()` + + | parameter | type | description | + | | | | + | * (return value)* | `boolean` | | + */ + rotateRight(): boolean; + + /** + * Rotate left.Can only process in `Editing` mode. + + * Syntax:* `.rotateLeft()` + + | parameter | type | description | + | | | | + | * (return value)* | `boolean` | | + */ + rotateLeft(): boolean; + + /** + * Mirror.Can only process in `Editing` mode. + + * Syntax:* `.mirror()` + + | parameter | type | description | + | | | | + | * (return value)* | `boolean` | | + */ + mirror(): boolean; + + /** + * Flip.Can only process in `Editing` mode. + + * Syntax:* `.flip()` + + | parameter | type | description | + | | | | + | * (return value)* | `boolean` | | + */ + flip(): boolean; + + /** + * Resize.Can only process in `Editing` mode. + + * Syntax:* `.resizeAsync(newWidth, newHeight, callback)` + + | parameter | type | description | + | | | | + | newWidth | `Number` | | + | newHeight | `Number` | | + | callback | `function(boolean bSuccess)` | | + */ + resizeAsync(newWidth: number, newHeight: number, callback: () => void): void; + + /** + * Get width of current editing canvas. + + * Syntax:* `.getEditWidth()` + + | parameter | type | description | + | | | | + | * (return value)* | `Number` | | + */ + getEditWidth(): number; + + /** + * Get height of current editing canvas. + + * Syntax:* `.getEditHeight()` + + | parameter | type | description | + | | | | + | * (return value)* | `Number` | | + */ + getEditHeight(): number; + + // Crop + + /** + * Whether show`Crop Rect` UI when enter`Editing` mode + + * Syntax:* `.isAutoShowCropUI = true;` + */ + isAutoShowCropUI: boolean; + + /** + Show`Crop Rect`.Can only process in `Editing` mode. + + * Syntax:* `.showCropRect()` + */ + showCropRect(): void; + + /** + * Hide`Crop Rect`.Can only process in `Editing` mode. + + * Syntax:* `.hideCropRect()` + */ + hideCropRect(): void; + + /** + * Default 0. + 0: touch / click moving inside`Crop Rect` will move the back canvas. + 1: touch / click moving inside`Crop Rect` will move the`Crop Rect`. + + * Syntax:* `.setCropRectStyle(styleNo)` + + | parameter | type | description | + | | | | + | * (return value)* | `boolean` | | + | styleNo | `Number` | 0, 1 | + */ + setCropRectStyle(styleNo: number): boolean; + + /** + * `Crop Rect` min width. + + * Syntax:* `.cropRectMinW = 50;` + */ + cropRectMinW: number; + + /** + `Crop Rect` min height. + + * Syntax:* `.cropRectMinH = 50;` + */ + cropRectMinH: number; + + /** + * Binding a function that would be called when the`Crop Rect` change. + + * Syntax:* `function(){}` + + @example +```javascript + painter.onCropRectChange = function(){ + var cropArea = painter.getCropRectArea(true); + document.getElementById('cropWidth').innerText = cropArea[2] - cropArea[0]; + document.getElementById('cropHeight').innerText = cropArea[3] - cropArea[1]; + }; +``` + */ + onCropRectChange: () => void; + + /** + * + * Syntax:* `.setCropRectArea(left, top, right, bottom)` + `Crop Rect` select an area. + + | parameter | type | description | + | | | | + | * (return value)* | `boolean` | | + | left * (optional) * | `Number` | -0.5 ~0.5, default -0.5. | + | top * (optional) * | `Number` | -0.5 ~0.5, default -0.5. | + | right * (optional) * | `Number` | -0.5 ~0.5, default 0.5. | + | bottom * (optional) * | `Number` | -0.5 ~0.5, default 0.5. | + */ + setCropRectArea(left: number, top: number, right: number, bottom: number): boolean; + + /** + * Syntax:* `.getCropRectArea(isAbsolute)` + + | parameter | type | description | + | | | | + | * (return value)* | `Array` | A array of[left, top, right, bottom]. | + | isAbsolute | `boolean` | Default`false`, get precentage(-50 % ~50 %) array. | + + */ + getCropRectArea(isAbsolute: boolean): rectangle[]; + + /** + * Crop the selected area.Can only process in `Editing` mode. + + * Syntax:* `.cropAsync(callback, array)` + + | parameter | type | description | + | | | | + | callback * (optional) * | `function([left, top, right, bottom])` | | + | array * (optional) * | `Array` | A array of[left, top, right, bottom]\(each - 0.5 ~0.5\).Default use an area accroding to`Crop Rect`. | + + */ + cropAsync(callback?: () => void, array?: rectangle[]): void; + + // Free Transform + + /** + * You should call`KPainter.loadCvScriptAsync()` first before use`FreeTransform` mode. + */ + + /** + * Detect a document.Would auto call`setFreeTransformCornerPos()` after detected.Can only process in `FreeTransform` mode. + + * Syntax:* `.documentDetectAsync(callback, importSrc)` + + | parameter | type | description | + | | | | + | callback * (optional) * | `function([[x0,y0], [x1,y1], [x2,y2], [x3,y3]])` | x0, y0...is from - 0.5 to 0.5. | + | importSrc * (optional) * | | TUDO.Not easy enough to use now. | + */ + documentDetectAsync(callback?: () => void, importSrc?: any): void; + + /** + * Set the`FreeTransform` corner position.Can only process in `FreeTransform` mode. + + * Syntax:* `.setFreeTransformCornerPos(cornerPoints)` + + | parameter | type | description | + | | | | + | cornerPoints | `Array` | A array of[[x0, y0], [x1, y1], [x2, y2], [x3, y3]].x0, y0...is from - 0.5 to 0.5. | + + */ + setFreeTransformCornerPos(cornerPoints: cornerPoints): any; + + /** + * Get the`FreeTransform` corner position. + + * Syntax:* `.getFreeTransformCornerPos()` + + | parameter | type | description | + | | | | + | * (return value)* | `Array` | A array of[[x0, y0], [x1, y1], [x2, y2], [x3, y3]].x0, y0...is from - 0.5 to 0.5.| + + */ + getFreeTransformCornerPos(): cornerPoints[]; + + /** + * Binding a function that would be called when the`FreeTransform` corner position change. + + * Syntax:* `function()` + + @example +```javascript + painter.onFreeTransformCornerPosChange = function(){ + console.log(painter.getFreeTransformCornerPos()); + }; +``` + */ + onFreeTransformCornerPosChange: () => void; + + /** + * + * `freeTransformAsync()` is a really expensive operation. `freeTransformMaxWH` would limit the max width and height of the result. + + * Syntax:* `.freeTransformMaxWH = 2048;` + */ + freeTransformMaxWH: number; + + /** + * + Transform the quadrilateral surround by the`FreeTransform` corner into a rectangle.Can only process in `FreeTransform` mode. + + * Syntax:* `.freeTransformAsync(callback, cornerPoints, importSrc)` + + | parameter | type | description | + | | | | + | callback * (optional) * | `function(boolean bSuccess)` | | + | cornerPoints * (optional) * | `Array` | A array of[[x0, y0], [x1, y1], [x2, y2], [x3, y3]].x0, y0...is from - 0.5 to 0.5. | + | importSrc * (optional) * | | TUDO.Not show for user. | + */ + freeTransformAsync(callback?: () => void, cornerPoints?: cornerPoints[], importSrc?: any): any; + + /** + * + Enter`FreeTransform` mode.Can only process in `Editing` mode. + + * Syntax:* `.enterFreeTransformModeAsync(callback)` + + | parameter | type | description | + | | | | + | callback * (optional) * | `function(boolean bSuccess)` | | + */ + enterFreeTransformModeAsync(callback: () => void): any; + + /** + * Exist`FreeTransform` mode. + + * Syntax:* `.exitFreeTransformModeAsync(callback)` + + | parameter | type | description | + | | | | + | callback * (optional) * | `function(boolean bSuccess)` | | + */ + exitFreeTransformModeAsync(callback?: () => void): any; + + // Video + + videoSettings: MediaStreamConstraints; + + // `MediaStreamConstraints`.videoSettings + /** + A[MediaStreamConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints). + + * reference:* [getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) + + * Syntax:* `.showVideo(callback, videoSettings)` + + | parameter | type | description | + | | | | + | callback * (optional) * | `function(boolean bSuccess)` | | + | videoSettings * (optional) * | `MediaStreamConstraints` | A[MediaStreamConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints). *reference:* [getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) | + */ + showVideo(callback?: () => void, videoSettings?: MediaStreamConstraints): boolean; + + /** + * Syntax:* `.grabVideo()` + + Grab a image from the video and return the image. + + | parameter | type | description | + | | | | + | * (return value)* | `HTMLCanvasElement` | | + * Syntax:* `.grabVideo(true, callback)` + + Grab a image from the video and auto add image to the painter.Can only process in `Viewing` mode. + + | parameter | type | description | + | | | | + | callback * (optional) * | `function(boolean bSuccess)` | | + */ + grabVideo(isAutoAdd?: boolean, callback?: () => void): HTMLCanvasElement | void; + + /** + * Syntax:* `.hideVideo()` + */ + hideVideo(): boolean; + + /** + * Syntax:* `function(canvas, callback){}` + + @example +```javascript + painter.beforeAddImgFromGrabVideoBtn = function(canvas, callback){ + doSomeWorkToGetNewSrc(canvas, function(srcValidForAddImage){ + callback(srcValidForAddImage); + }); + }; +``` + */ + beforeAddImgFromGrabVideoBtn: () => void; + + /** + * Syntax:* `function(){}` + + @example +```javascript + painter.afterAddImgFromGrabVideoBtn = function(bSuccess){ + if(bSuccess){console.log('The new image(s) has been added from video.');} + }; +``` + */ + afterAddImgFromGrabVideoBtn: () => void; +} diff --git a/types/dwt/tsconfig.json b/types/dwt/tsconfig.json index 13f35fcfbf..60686cd69f 100644 --- a/types/dwt/tsconfig.json +++ b/types/dwt/tsconfig.json @@ -2,11 +2,12 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -17,8 +18,15 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts", + "addon.ocr.d.ts", + "addon.ocrp.d.ts", "addon.pdf.d.ts", - "dwt-tests.ts" + "addon.webcam.d.ts", + "dbr.d.ts", + "dwt-tests.ts", + "dwt.d.ts", + "index.d.ts", + "Dynamsoft.d.ts", + "mbc.d.ts" ] -} \ No newline at end of file +} diff --git a/types/dwt/v12/dwt-tests.ts b/types/dwt/v12/dwt-tests.ts deleted file mode 100644 index b1a5cc6b09..0000000000 --- a/types/dwt/v12/dwt-tests.ts +++ /dev/null @@ -1,101 +0,0 @@ -function dwtOnReady() { - const DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); // Get the Dynamic Web TWAIN object that is embeded in the div with id 'dwtcontrolContainer' - if (DWObject) { - let count = DWObject.SourceCount; - if (count === 0) { - DWObject.CloseSourceManager(); - DWObject.ImageCaptureDriverType = 0; - DWObject.OpenSourceManager(); - count = DWObject.SourceCount; - } - } -} - -function acquireImage() { - const DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); - if (DWObject) { - DWObject.SelectSourceByIndex(0); // Use method SelectSourceByIndex to avoid the 'Select Source' dialog - DWObject.OpenSource(); - DWObject.IfDisableSourceAfterAcquire = true; // Scanner source will be disabled/closed automatically after the scan. - DWObject.AcquireImage({}, () => {}, (errorCode: number, errorString: string) => {DWObject.CloseSource(); }); - } -} - -function registerEvent() { - const DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); - if (DWObject) { - // The event OnPostTransfer fires after each image is scanned and transferred - DWObject.RegisterEvent("OnPostTransfer", function () {}); - - // The event OnPostLoad fires after the images from a local directory have been loaded into the control - DWObject.RegisterEvent("OnPostLoad", function () {}); - - // The event OnMouseClick fires when the mouse clicks on an image on Dynamic Web TWAIN viewer - DWObject.RegisterEvent("OnMouseClick", function () {}); - - // The event OnTopImageInTheViewChanged fires when the top image currently displayed in the viewer changes - DWObject.RegisterEvent("OnTopImageInTheViewChanged", function (index: number) { - DWObject.CurrentImageIndexInBuffer = index; - }); - } -} - -function editImage() { - const DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); - if (DWObject) { - if (DWObject.HowManyImagesInBuffer > 0) - DWObject.RotateLeft(DWObject.CurrentImageIndexInBuffer); - - if (DWObject.HowManyImagesInBuffer > 0) - DWObject.RotateRight(DWObject.CurrentImageIndexInBuffer); - - if (DWObject.HowManyImagesInBuffer > 0) - DWObject.Mirror(DWObject.CurrentImageIndexInBuffer); - - if (DWObject.HowManyImagesInBuffer > 0) - DWObject.Flip(DWObject.CurrentImageIndexInBuffer); - } -} - -function showImageEditor() { - const DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); - if (DWObject) { - DWObject.ShowImageEditor(); - } -} - -function saveImage() { - const DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); - if (DWObject) { - DWObject.ConvertToGrayScale(DWObject.CurrentImageIndexInBuffer); - DWObject.SaveAsJPEG("DynamicWebTWAIN.jpg", DWObject.CurrentImageIndexInBuffer); - DWObject.SaveAllAsMultiPageTIFF("DynamicWebTWAIN.tiff", () => {}, (errorCode: number, errorString: string) => {}); - DWObject.SaveAllAsPDF("DynamicWebTWAIN.pdf", () => {}, (errorCode: number, errorString: string) => {}); - } -} - -function updateLargeViewer() { - const DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); - const DWObjectLargeViewer = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainerLargeViewer'); - if (DWObject) { - DWObject.CopyToClipboard(DWObject.CurrentImageIndexInBuffer); // Copy the current image in the thumbnail to clipboard in DIB format. - DWObjectLargeViewer.LoadDibFromClipboard(); // Load the image from Clipboard into the large viewer. - } -} - -function uploadImage() { - const DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); - if (DWObject) { - DWObject.HTTPPort = 80; - DWObject.IfSSL = false; - DWObject.HTTPUploadThroughPost("www.dynamsoft.com", DWObject.CurrentImageIndexInBuffer, "upload", "tmp.jpg", () => {}, (errorCode: number, errorString: string) => {}); - } -} - -function downloadImage() { - const DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); - if (DWObject) { - DWObject.HTTPPort = 80; - DWObject.HTTPDownload("www.dynamsoft.com", "img.png", () => {}, (errorCode: number, errorString: string) => {}); - } -} diff --git a/types/dwt/v12/tslint.json b/types/dwt/v12/tslint.json deleted file mode 100644 index cb4a75513c..0000000000 --- a/types/dwt/v12/tslint.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "jsdoc-format": false, - "max-line-length": [false], - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-trailing-whitespace": false, - "space-before-function-paren": false, - "only-arrow-functions": [false] - } -} diff --git a/types/dynatrace/dynatrace-tests.ts b/types/dynatrace/dynatrace-tests.ts new file mode 100644 index 0000000000..027b924cf9 --- /dev/null +++ b/types/dynatrace/dynatrace-tests.ts @@ -0,0 +1,88 @@ +function customActions() { + const actionId = dynaTrace.enterAction("my custom action", "click"); + dynaTrace.leaveAction(actionId); +} + +function customVisit() { + dynaTrace.tagVisit("My Custom Visit"); + /** after some code execution we can end the visit early */ + dynaTrace.endVisit(); +} + +function signal() { + dynaTrace.signalLoadStart(); + dynaTrace.signalLoadEnd(); + dynaTrace.signalOnLoadStart(); + dynaTrace.signalOnLoadEnd(); + + dynaTrace.sendSignal(false, false, true); +} + +function load() { + dynaTrace.setLoadEndManually(); + dynaTrace.incrementOnLoadEndMarkers(); +} + +function automaticDetection() { + dynaTrace.setAutomaticActionDetection(false); +} + +function reporting() { + dynaTrace.reportError(" Custom error"); + const actionId = dynaTrace.enterAction("second action", "keypress"); + dynaTrace.reportError("Second custom error", actionId); + + dynaTrace.reportEvent("My Event"); + dynaTrace.reportString("My Key", "Custom value"); + dynaTrace.reportValue("Value Key", 2); + dynaTrace.reportWarning("Warning"); +} + +function thirdParty() { + const url = "http://somescript.com"; + dynaTrace.startThirdParty("s", url); + dynaTrace.stopThirdParty(url, true, Date.now() - 1000, Date.now()); +} + +function listener() { + const clickListener = (key: string) => ({}); + dynaTrace.addPageLeavingListener(clickListener); +} + +function streaming() { + dynaTrace.addStreamingNode( + "http://youtube.com", + 120, + true, + false, + 120, + 30, + 10, + 5, + "_info_" + ); +} + +function userInput() { + const userInput = dynaTrace.beginUserInput("", "click", "RETURN", 23); + dynaTrace.endUserInput(userInput); +} + +function Xhr() { + const enterActionId = dynaTrace.enterXhrAction( + "Angular Http request", + 0, + false + ); + dynaTrace.enterXhrCallback(enterActionId); + dynaTrace.leaveXhrCallback(enterActionId); + dynaTrace.leaveXhrAction(enterActionId); +} + +function appVersion() { + dynaTrace.setAppVersion("1.1.1"); +} + +function metadata() { + dynaTrace.setMetaData("some metadata", "value"); +} diff --git a/types/dynatrace/index.d.ts b/types/dynatrace/index.d.ts new file mode 100644 index 0000000000..5627e6b1db --- /dev/null +++ b/types/dynatrace/index.d.ts @@ -0,0 +1,234 @@ +// Type definitions for dynatrace 1.0 +// Project: https://www.dynatrace.com/ +// Definitions by: Alvaro Cruz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface dynaTrace { + /** + * @description disable automatic detection + * Use in conjuction with enterAction + * @example + * dynaTrace.setAutomaticActionDetection(false); + * dynaTrace.enterAction('action message', 'select', null, null); + */ + setAutomaticActionDetection(on: boolean): void; + /** + * @description capture load event manually. + * followed by a signalLoadEnd to complete the capture. + */ + setLoadEndManually(): void; + /** + * @description Signal load start. If load start can be determined more accurately + * than the automatic detection, this function can be used. + */ + signalLoadStart(): void; + /** + * @description Signals that the page has finished loading + */ + signalLoadEnd(): void; + /** + * @description Force signal sending to make certain that actions aren't lost. + * @param forceSync - Force synchronous sending of signal (if false, it'll be sent asynchronously) + * @param sendPreview - Force sending of preview signals which haven't been closed yet. + * @param killUnfinished - Kills unfinished actions and sends them immediately. Handle with care, actions might be inaccurate. + */ + sendSignal( + forceSync: boolean, + sendPreview: boolean, + killUnfinished: boolean + ): void; + /** + * @description parentAction: optional id of parent action. + * - if parameter is not passed => appended to currently running action + * - if a number is passed => action is added as subaction to action with given id + * - if false => new root action is started. + * The function returns an internal tracking object that represents the action that was started. + * This tracking object must be passed to dynaTrace.leaveAction(). + * @param name - name of the action + * @param type + * @param startTime - time in milliseconds. if null, current time is used. + * @param parentAction optional id of parent action. if parameter is not passed=> appended to + * currently running action, if false => root action, if a number is passed, action is added + * as subaction to action with given id. + * @returns id of created action + */ + enterAction( + name: string, + type: string, + time?: number, + parentAction?: number | boolean + ): number; + /** + * @description stops the action that is represented by the given tracking object. + * @param actionId - id of action to leave. must be the value returned by enterAction + * @param time - end time in milliseconds + * @param startTime - optional start time in milliseconds (necessary if start time should be modified) + */ + leaveAction(actionId: number, time?: number, startTime?: number): void; + /** + * @description Reports an error message + * @param parentAction - parent action id. if not passed or null, error is added to current action + */ + reportError(error: string | Error, parentAction?: number): void; + /** + * @description Reports a warning message + * @param parentAction - parent action id. if not passed or null, error is added to current action + */ + reportWarning(warning: string, parentAction?: number): void; + /** + * @description Reports an event + * @param parentAction - parent action id. if not passed or null, error is added to current action + */ + reportEvent(msg: string, parentAction?: number): void; + /** + * @description Reports a key value pair to the server. The data can e.g. be used to create charts. + */ + reportValue(key: string, value: number): void; + /** + * @description Reports a key value pair to the server. The data can e.g. be used to create charts. + * The difference to the reportValue function is that here the value is a string. + */ + reportString(key: string, value: string): void; + /** + * @description The JavaScript ADK enables you to tag your visits with any value you want. + * Use tagVisit(visitName) to tag the current visit with the specified value + */ + tagVisit(visitName: string): void; + /** + * @description Indicates start of a third party resource + * @param type - i = image, s = script, c = custom + */ + startThirdParty(type: "i" | "s" | "c", url: string): void; + /** + * @description Indicates stop of a third party resource + * @param url - Complete URL of resource (must match URL provided in startThirdParty). + * @param success - True if the resource was loaded successfully, false if not. + * @param start - Absolute start time in milliseconds. When parameter is not passed or <= 0, + * time of startThirdParty call is used. + * @param stop - Absolute stop time in milliseconds. When parameter is not passed or <= 0, + * time of stopThirdParty call is used. + */ + stopThirdParty( + url: string, + success: boolean, + start?: number, + stop?: number + ): void; + /** + * @description Adds a listener that is called when the user is leaving the page, + * but before the monitor signal is sent + * @param listener A function that will be called in case the user leaves the page. + */ + addPageLeavingListener(listener: (key: string) => {}): void; + /** + * @description Sends a Streaming Node to the Server + * @param source - URL of the streaming resource + * @param duration - duration of the streaming resource in seconds + * @param userTriggered - did the user trigger the playback or did it start automatically? + * @param watchedCompletely - did the streaming resource play to the end? + * @param maxPlayTime - maximum progress this streaming resource had in seconds + * @param playTime - the time this streaming resource was playing in seconds + * @param bufferingCount - amount of bufferings that occured during the playback + * @param bufferingTime - total time spent with buffering in seconds + * @param type - action type of the streaming node. Is used for classifying events + * on the serverside, e.g. _info_, _warn_, _error_ + */ + addStreamingNode( + source: string, + duration: number, + userTriggered: boolean, + watchedCompletely: boolean, + maxPlayTime: number, + playTime: number, + bufferingCount: number, + bufferingTime: number, + type: "_info_" | "_warn_" | "_error_" + ): void; + /** + * @description Indicates the start of a user input. User inputs must always + * be stopped by calling endUserInput. If an xhr call or a page load happens + * it is checked if a user input is active. If yes, the user input is set to + * have triggered the page action. + * @param domNode - Which triggered the action (button, etc) is used for determining its caption + * @param type - Type of the user input: 'click', 'keypress', 'scroll',... + * @param addInfo - Additional info for user input such as key, mouse button, etc ('F5', 'RETURN',...) + * @param validTime - How long should the user input be able to open actions? default is 30ms + */ + beginUserInput( + domNode: any, + type: string, + addInfo: string, + validTime: number + ): any; + /** + * @description the user input object returned by beginUserInput + */ + endUserInput(userInputObject: any): void; + /** + * @description Initiate ajax action. Must be closed by leaveXhrAction afterwards. + * @param type Additional info about type of xhr (eg. framework name,etc) + * @param mode - The action mode: 0 .. just extend running ajax actions 1 .. extend any running action 2 .. + * extend any running action - visible subaction 3 .. start action if user input is present + * @param webSocket - Indicates if this action is a webSocket action or not + * @returns id of action + */ + enterXhrAction(type: string, mode: number, webSocket: boolean): number; + /** + * @description Indicates the end of an xhr action. Must be started by leaveXhrAction beforehand. + * @param id - id of action (must be the value returned by enterXhrAction) + */ + leaveXhrAction(id: number): void; + /** + * @description Indicates that an xhr callback is active (eg. XMLHttpRequest onreadystatechange). + * This is necessary to automatically add actions started during a callback as subactions. + * Xhr callback must be stopped by leaveXhrCallback. + * @param actionId - id of action where callback belongs to + */ + enterXhrCallback(actionId: number): void; + /** + * @description Indicates the end of an xhr callback. Must be called after enterXhrCallback. + * @param actionId - id of action where callback belongs to + */ + leaveXhrCallback(actionId: number): void; + /** + * @description Indicates the start of a load action. Frameworks often have their own load callback functions. + * This can be used when framework starts load before "DOMContentLoaded". + */ + signalOnLoadStart(): void; + /** + * @description Tells the JavaScript agent to wait for an additional call of signalOnLoadEnd. + * When the last call of signalOnLoadEnd is performed the "onload" action is closed. + * Note: if this function is called, signalOnLoadEnd MUST be called afterwards to indicated the end of one load. + * Otherwise there will be unexpected action behaviour. + */ + incrementOnLoadEndMarkers(): void; + /** + * @description Indicates the end of a load action. needs incrementOnLoadEndMarkers to be called before. + * As soon as the last signalOnLoadEnd is called, the "onload" action is closed. + */ + signalOnLoadEnd(): void; + /** + * @description By default a visit ends after a configurable inactivity time (default is 30 min.). + * Using the ADK, a visit can be ended forcibly, for example when a user logs out from an application. + * Simply call dynaTrace.endVisit() and the visit ends without waiting for the inactivity time. + * For correlation purposes the visit shows as active in the client for about three minutes, + * but actions sent after dynaTrace.endVisit() are added to a new visit. + * End the current UEM visit. This is useful for "logout" buttons, so that, + * when the user logs out, the user's visit can also be closed by calling this method. + */ + endVisit(): void; + /** + * @description Set the application version for this visit. + * This will be read on the server side and included as part of each visit for easy splitting. + * @param appVersion - The version string to be set. + */ + setAppVersion(appVersion: string): void; + /** + * @description Set meta-data for the page via a key/value pair. + * @param key - The readable key for the value + * @param value - The value to associate with the identifier + */ + setMetaData(key: string, value: string): void; +} + +declare let dynaTrace: dynaTrace; diff --git a/types/dynatrace/tsconfig.json b/types/dynatrace/tsconfig.json new file mode 100644 index 0000000000..6c137be982 --- /dev/null +++ b/types/dynatrace/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", + "dynatrace-tests.ts" + ] +} diff --git a/types/dynatrace/tslint.json b/types/dynatrace/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dynatrace/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ee-first/ee-first-tests.ts b/types/ee-first/ee-first-tests.ts new file mode 100644 index 0000000000..9ffc03281d --- /dev/null +++ b/types/ee-first/ee-first-tests.ts @@ -0,0 +1,32 @@ +import first = require('ee-first'); +import { EventEmitter } from 'events'; + +class Foo extends EventEmitter { + foo: 'foo'; +} + +class Bar extends EventEmitter { + bar: 'bar'; +} + +const ee1 = new Foo(); +const ee2 = new Bar(); + +const thunk = first( + [[ee1, 'close', 'end', 'error'], [ee2, 'error']], + (err, ee, event, args) => { + err; // $ExpectType any + ee; // $ExpectType Foo | Bar + event; // $ExpectType string[] + args; // $ExpectType any[] + } +); + +thunk((err, ee, event, args) => { + err; // $ExpectType any + ee; // $ExpectType Foo | Bar + event; // $ExpectType string[] + args; // $ExpectType any[] +}); + +thunk.cancel(); diff --git a/types/ee-first/index.d.ts b/types/ee-first/index.d.ts new file mode 100644 index 0000000000..6898d6b664 --- /dev/null +++ b/types/ee-first/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for ee-first 1.1 +// Project: https://github.com/jonathanong/ee-first +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +/// + +import { EventEmitter } from 'events'; + +export = first; + +/** + * Get the first event in a set of event emitters and event pairs, then clean up after itself. + * Invoke `listener` on the first event from the list specified in `eventSpec`. + * + * @param eventSpec Array of arrays, with each array in the format `[ee, ...event]`. + * @param listener Will be called only once, the first time any of the given events are emitted. + * If `error` is one of the listened events, then if that fires first, the `listener` will be given the `err` argument. + * `listener`'s arguments: + * - `err`: the first argument emitted from an error event, if applicable + * - `ee`: the event emitter that fired + * - `event`: the string event name that fired + * - `args`: an array of the arguments that were emitted on the event + */ +declare function first( + eventSpec: Array<[TEmitter, ...string[]]>, + listener: first.Listener +): first.Thunk; + +declare namespace first { + type Listener = ( + err: any, + ee: TEmitter, + event: string[], + args: any[] + ) => void; + + interface Thunk { + (listener: Listener): void; + + /** + * The group of listeners can be cancelled before being invoked and have all the event listeners removed + * from the underlying event emitters. + */ + cancel(): void; + } +} diff --git a/types/ee-first/tsconfig.json b/types/ee-first/tsconfig.json new file mode 100644 index 0000000000..2de6e9baf0 --- /dev/null +++ b/types/ee-first/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", + "ee-first-tests.ts" + ] +} diff --git a/types/ee-first/tslint.json b/types/ee-first/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ee-first/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index 32b9d1a18b..776ed03a20 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ej.web.all 16.3 +// Type definitions for ej.web.all 16.4 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,7 +8,7 @@ /*! * filename: ej.web.all.d.ts -* version : 16.3.0.21 +* version : 16.4.0.42 * Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing @@ -192,9 +192,9 @@ declare namespace ej { from(tableName: any): ej.Query; addParams(key: string, value: string): ej.Query; expand(tables: any): ej.Query; - where(fieldName: string, operator: ej.FilterOperators, value: any, ignoreCase?: boolean): ej.Query; + where(fieldName: string, operator: ej.FilterOperators, value: any, ignoreCase?: boolean, ignoreAccent?: boolean): ej.Query; where(predicate: ej.Predicate): ej.Query; - search(searchKey: any, fieldNames?: any, operator?: string, ignoreCase?: boolean): ej.Query; + search(searchKey: any, fieldNames?: any, operator?: string, ignoreCase?: boolean, ignoreAccent?: boolean): ej.Query; sortBy(fieldName: string, comparer?: ej.SortOrder, isFromGroup?: boolean): ej.Query; sortByDesc(fieldName: string): ej.Query; group(fieldName: string): ej.Query; @@ -433,9 +433,9 @@ declare namespace ej { } class Predicate { constructor(); - constructor(field: string, operator: ej.FilterOperators, value: any, ignoreCase: boolean); - and(field: string, operator: any, value: any, ignoreCase: boolean): ej.Predicate; - or(field: string, operator: any, value: any, ignoreCase: boolean): ej.Predicate; + constructor(field: string, operator: ej.FilterOperators, value: any, ignoreCase: boolean, ignoreAccent?: boolean); + and(field: string, operator: any, value: any, ignoreCase: boolean, ignoreAccent?: boolean): ej.Predicate; + or(field: string, operator: any, value: any, ignoreCase: boolean, ignoreAccent?: boolean): ej.Predicate; or(predicate: any[]): any; validate(record: any): boolean; toJSON(): { @@ -590,6 +590,21 @@ declare namespace ej { */ scope?: string; + /** Used to enable auto scroll while drag and drop the element. + * @Default {'false'} + */ + autoScroll?: boolean; + + /** Represents when to start the scrolling inside the scroll container on dragging + * @Default {'20'} + */ + scrollSensitivity?: number; + + /** Specifies how much distance of scroll should move on dragging once reached scroll sensitivity area. + * @Default {'20'} + */ + scrollSpeed?: number; + /** This event is triggered when dragging element is destroyed. */ destroy?(e: DestroyEventArgs): void; @@ -6293,6 +6308,11 @@ declare namespace ej { */ getValue(): string; + /** sets the date value for the DatePicker. + * @returns {string} + */ + setValue(): string; + /** Close the DatePicker popup, if it is in opened state. * @returns {void} */ @@ -10920,7 +10940,7 @@ declare namespace ej { show(): void; /** To show item in the given index. - * @param {number} Specifies the index value to show the hided item. + * @param {number} Specifies the index value to show the hidden item. * @returns {void} */ showItem(index: number): void; @@ -11069,7 +11089,7 @@ declare namespace ej { itemRequestCount?: number; /** Specifies the maximum number of items to be fetched. Note: This will work only with Virtual scrolling - * @Default {null} + * @Default {5} */ totalItemsCount?: number; @@ -29321,6 +29341,11 @@ declare namespace ej { */ memberEditorPageSize?: number; + /** Enables/Disables sorting option in member editor dialog for the members of the respective field. + * @Default {false} + */ + enableMemberEditorSorting?: boolean; + /** Enables/disables the display of grand total for rows and columns. * @Default {true} */ @@ -31523,6 +31548,11 @@ declare namespace ej { */ memberEditorPageSize?: number; + /** Enables/Disables sorting option in member editor dialog for the members of the respective field. + * @Default {false} + */ + enableMemberEditorSorting?: boolean; + /** Sets the summary layout for the pivot grid. Following are the ways in which the summary can be positioned: normal summary (bottom), top summary, no summary, and Microsoft Excel * summary. * @Default {ej.PivotGrid.Layout.Normal} @@ -37776,6 +37806,11 @@ declare namespace ej { */ reportLoaded?(e: ReportLoadedEventArgs): void; + /** Fires when user clicks on a failed report item in the rendered report, before displaying error details dialog. If you want to show custom error detail or perform any action before + * viewing error detail, you can make use of the showError event. + */ + showError?(e: ShowErrorEventArgs): void; + /** Fires when click the View Report Button. */ viewReportClick?(e: ViewReportClickEventArgs): void; @@ -37914,6 +37949,25 @@ declare namespace ej { type?: string; } + export interface ShowErrorEventArgs { + + /** true if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** returns the error code. + */ + errorCode?: string; + + /** returns the error message. + */ + message?: string; + + /** returns the detailed error information. + */ + detail?: string; + } + export interface ViewReportClickEventArgs { /** true if the event should be canceled; otherwise, false. @@ -42902,17 +42956,22 @@ declare namespace ej { */ redo(): void; - /** This method is used to refresh the content in Spreadsheet. + /** This method is used to refresh the Spreadsheet based on the sheet model values. * @param {number} Pass the index of the sheet. * @returns {void} */ refreshContent(sheetIdx: number): void; - /** This method is used to refresh the Spreadsheet. + /** This method is used to refresh the Spreadsheet element based on the page layout. * @returns {void} */ refreshSpreadsheet(): void; + /** This method destroys and re-creates the entire Spreadsheet control. + * @returns {void} + */ + refresh(): void; + /** This method is used to remove custom formulae in Spreadsheet. * @param {string} Pass the name of the formula. * @param {string} Pass the name of the function. @@ -44335,6 +44394,11 @@ declare namespace ej { */ importSettings?: ImportSettings; + /** Gets a value that indicates whether importing or not while loading the sheets in Spreadsheet. + * @Default {false} + */ + isImport?: boolean; + /** Gets or sets a value that indicates whether to enable or disable readonly support in the Spreadsheet. * @Default {false} */ @@ -46435,6 +46499,11 @@ declare namespace ej { */ abortPrint(): void; + /** Aborts the download operation. + * @returns {void} + */ + abortDownload(): void; + /** Shows/hides the print icon in the toolbar. * @param {boolean} shows/hides print button in the toolbar * @returns {void} @@ -46508,6 +46577,12 @@ declare namespace ej { */ showMagnificationTools(show: boolean): void; + /** Shows/hides the search tool in the toolbar. + * @param {boolean} shows/hides search tool in the toolbar + * @returns {void} + */ + showTextSearchTool(show: boolean): void; + /** Scales the page to fit the page in the container in the control. * @returns {void} */ @@ -46528,6 +46603,11 @@ declare namespace ej { */ zoomOut(): void; + /** Resize the viewer based on the parent element height. + * @returns {void} + */ + updateViewerSize(): void; + /** Scales the page to the specified percentage ranging from 50 to 400. If the given zoomValue is less than 50 or greater than 400; the PDF viewer scales the page to 50 and 400 * respectively. * @param {number} zoom value for scaling the pages in the PDF Viewer @@ -46551,6 +46631,12 @@ declare namespace ej { */ searchPrevious(): void; + /** Set the JSON data that are formed for rendering the document content in PDF viewer. + * @param {any} Set the JSON data that are formed for rendering the document content. + * @returns {void} + */ + setJSONData(jsonData: any): void; + /** Searches the target text with its casing. * @param {boolean} Specifies whether the text search must be performed with match case or not. * @returns {void} @@ -46643,6 +46729,14 @@ declare namespace ej { */ signatureSettings?: SignatureSettings; + /** Enables/ disables the text selection context menu. + */ + textSelectionContextMenu?: TextSelectionContextMenu; + + /** Enables/disables the annotation context menu. + */ + annotationContextMenu?: AnnotationContextMenu; + /** Specifies the type of the annotations. */ annotationType?: ej.PdfViewer.AnnotationType|string; @@ -46667,6 +46761,10 @@ declare namespace ej { */ interactionMode?: ej.PdfViewer.InteractionMode|string; + /** Gets or sets the buffering mode of the PDF viewer control when allowClientBuffering is set to true. + */ + bufferingMode?: ej.PdfViewer.BufferingMode|string; + /** Specifies the open state of the hyperlink in the PDF document. */ hyperlinkOpenState?: ej.PdfViewer.LinkTarget|string; @@ -46711,6 +46809,10 @@ declare namespace ej { */ ajaxRequestFailure?(e: AjaxRequestFailureEventArgs): void; + /** Triggers when the ajax request is Success. + */ + ajaxRequestSuccess?(e: AjaxRequestSuccessEventArgs): void; + /** Triggers when there is change in the magnification value. */ zoomChange?(e: ZoomChangeEventArgs): void; @@ -46767,6 +46869,14 @@ declare namespace ej { */ bufferEnd?(e: BufferEndEventArgs): void; + /** Triggers when the download is started. + */ + downloadStart?(e: DownloadStartEventArgs): void; + + /** Triggers when the download is completed or aborted. + */ + downloadEnd?(e: DownloadEndEventArgs): void; + /** Triggers when PDF viewer control is destroyed successfully. */ destroy?(e: DestroyEventArgs): void; @@ -46844,6 +46954,25 @@ declare namespace ej { message?: string; } + export interface AjaxRequestSuccessEventArgs { + + /** true, if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** Returns the PDF viewer model + */ + model?: any; + + /** Returns the name of the event + */ + type?: string; + + /** Returns the response data on ajax success. + */ + responseData?: string; + } + export interface ZoomChangeEventArgs { /** Returns the cancel option value. @@ -47194,6 +47323,52 @@ declare namespace ej { isBuffering?: boolean; } + export interface DownloadStartEventArgs { + + /** true, if the event should be canceled; otherwise, false + */ + cancel?: boolean; + + /** Returns the PDF viewer model + */ + model?: any; + + /** Returns the name of the event + */ + type?: string; + + /** Returns the name of the file being displayed in the PDF viewer. + */ + fileName?: string; + + /** Returns the status about the download is started. + */ + status?: string; + } + + export interface DownloadEndEventArgs { + + /** true, if the event should be canceled; otherwise, false + */ + cancel?: boolean; + + /** Returns the PDF viewer model + */ + model?: any; + + /** Returns the name of the event + */ + type?: string; + + /** Returns the name of the file being displayed in the PDF viewer. + */ + fileName?: string; + + /** Returns the status about the download is completed or aborted. + */ + status?: string; + } + export interface DestroyEventArgs { /** Returns the cancel option value. @@ -47331,6 +47506,48 @@ declare namespace ej { opacity?: number; } + export interface TextSelectionContextMenu { + + /** Enables/ disables the text selection context menu. + */ + isEnable?: boolean; + + /** Enables/disables the copy menu in the text selection context menu. + */ + isCopyEnable?: boolean; + + /** Enables/disables the search menu in the text selection context menu. + */ + isSearchEnable?: boolean; + + /** Enables/disables the highlight annotation menu in the text selection context menu. + */ + isHighlightEnable?: boolean; + + /** Enables/disables the strikeout annotation menu in the text selection context menu. + */ + isStrikeoutEnable?: boolean; + } + + export interface AnnotationContextMenu { + + /** Enables/disables the annotation context menu. + */ + isEnable?: boolean; + + /** Enables/disables the popup menu in the annotation context menu. + */ + isPopupEnable?: boolean; + + /** Enables/disables the delete menu in the annotation context menu. + */ + isDeleteEnable?: boolean; + + /** Enables/disables the properties menu in the annotation context menu. + */ + isPropertiesEnable?: boolean; + } + enum ToolbarItems { ///Shows only magnification tools in the toolbar. @@ -47395,6 +47612,16 @@ declare namespace ej { } + enum BufferingMode { + + ///Retrieves details to render first two pages in a request and rest of the pages in other request. + Default, + + ///Retrieves complete details to render all the pages in a single request. + Complete + } + + enum LinkTarget { ///Opens the hyperlink in the same tab of the browser. @@ -47533,6 +47760,11 @@ declare namespace ej { */ enableAsync?: boolean; + /** To set either ‘Post’ or ‘Get’ for ajax request type which invokes when validate, get suggestion and dictionary action.Possible values are ‘POST’ or ‘GET’ + * @Default {GET} + */ + ajaxRequestType?: string; + /** Sets the data type for the ajax call used within the SpellCheck control, denoting the type of data that are expected to be retrieved from the server. The applicable values are * json and jsonp. * @Default {jsonp} @@ -50374,11 +50606,11 @@ declare namespace ej.datavisualization { /** returns the pointer element. */ - markerpointerelement?: any; + markerPointerElement?: any; /** returns the value of the pointer. */ - markerpointervalue?: number; + markerPointerValue?: number; /** returns the pointer style */ diff --git a/types/electron-packager/electron-packager-tests.ts b/types/electron-packager/electron-packager-tests.ts index 06cadf97f0..6b10ea4bf3 100644 --- a/types/electron-packager/electron-packager-tests.ts +++ b/types/electron-packager/electron-packager-tests.ts @@ -13,25 +13,6 @@ function ignoreFunction(path: string) { return true; } -// this is the obsolete API and will be removed in a future version - -packager({ - dir: ".", - name: "myapplication", - platform: "win32", - arch: "all", - electronVersion: "0.34.0", - win32metadata: { - CompanyName: "Acme CO", - FileDescription: "My application", - OriginalFilename: "myapp.exe", - ProductName: "Application", - InternalName: "roadrunner", - "requested-execution-level": "highestAvailable", - "application-manifest": "manifest.xml" - } -}, callback); - function onCompleted(appPaths: string | string[]) { } @@ -102,7 +83,7 @@ packager({ afterExtract: [ completeFunction ], - afterPrune: [ + afterPrune: [ completeFunction ], appCopyright: "Copyright", @@ -122,7 +103,6 @@ packager({ ignore: /ab+c/, out: "out", overwrite: true, - packageManager: false, prune: true, quiet: true, tmpdir: "/tmp", @@ -157,7 +137,6 @@ packager({ new RegExp('abc') ], overwrite: false, - packageManager: "npm", platform: "darwin", prune: false, quiet: false, @@ -184,7 +163,14 @@ packager({ strictSSL: false }, ignore: ignoreFunction, - packageManager: "cnpm", + platform: "linux" +}).then(onCompleted).catch(onError); + +packager({ + dir: ".", + arch: "mips64el", + electronVersion: "1.8.8", + prebuiltAsar: "prebuilt.asar", platform: "linux" }).then(onCompleted).catch(onError); @@ -200,11 +186,14 @@ packager({ quiet: true, strictSSL: false }, - packageManager: "yarn", platform: "mas", extendInfo: { foo: "bar" }, + osxNotarize: { + appleId: "My ID", + appleIdPassword: "Bad Password" + }, osxSign: { identity: "myidentity", entitlements: "path/to/my.entitlements", diff --git a/types/electron-packager/index.d.ts b/types/electron-packager/index.d.ts index 0e438ebc6e..04e62a28b5 100644 --- a/types/electron-packager/index.d.ts +++ b/types/electron-packager/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for electron-packager 12.0 +// Type definitions for electron-packager 13.0 // Project: https://github.com/electron-userland/electron-packager // Definitions by: Maxime LUCE // Juan Jimenez-Anca // John Kleinschmidt // Brendan Forster +// Mark Lee // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -23,20 +24,6 @@ export = electronPackager; */ declare function electronPackager(opts: electronPackager.Options): Promise; -/** - * This will: - * - Find or download the correct release of Electron - * - Use that version of electron to create a app in /-- - * - * You should be able to launch the app on the platform you built for. If not, check your settings and try again. - * - * @param opts - Options to configure packaging. - * @param callback - Callback which is called when packaging is done or an error occured. - * - * @deprecated since version 12.0 - */ -declare function electronPackager(opts: electronPackager.Options, callback: electronPackager.finalCallback): void; - declare namespace electronPackager { /** * Callback which is called when electron-packager is done. @@ -48,8 +35,7 @@ declare namespace electronPackager { type ignoreFunction = (path: string) => boolean; type onCompleteFn = (buildPath: string, electronVersion: string, platform: string, arch: string, callbackFn: () => void) => void; - type arch = "ia32" | "x64" | "armv7l" | "arm64" |"all"; - type packageManager = "npm" | "cnpm" | "yarn" | false; + type arch = "ia32" | "x64" | "armv7l" | "arm64" | "mips64el" | "all"; type platform = "linux" | "win32" | "darwin" | "mas" | "all"; interface AsarOptions { @@ -65,6 +51,11 @@ declare namespace electronPackager { strictSSL?: boolean; } + interface ElectronNotarizeOptions { + appleId: string; + appleIdPassword: string; + } + interface ElectronOsXSignOptions { identity?: string; entitlements?: string; @@ -116,6 +107,10 @@ declare namespace electronPackager { * Whether to package the application's source code into an archive, using Electron's archive format */ asar?: boolean | AsarOptions; + /** + * The path to a prebuilt ASAR file. + */ + prebuiltAsar?: string; /** * The build version of the application. Defaults to the value of appVersion. * Maps to the FileVersion metadata property on Windows, and CFBundleVersion on OS X. @@ -160,10 +155,6 @@ declare namespace electronPackager { * Whether to replace an already existing output directory for a given platform (true) or skip recreating it (false). */ overwrite?: boolean; - /** - * The package manager used to prune devDependencies modules from the outputted Electron app - */ - packageManager?: packageManager; /** * The target platform(s) to build for. Not required if the all option is set. */ @@ -202,6 +193,14 @@ declare namespace electronPackager { * The bundle identifier to use in the application helper's plist. */ helperBundleId?: string; + /** + * Forces support for Mojave (macOS 10.14) dark mode in the packaged app. + */ + darwinDarkModeSupport?: boolean; + /** + * If present, notarizes OS X target apps when the host platform is OS X and XCode is installed. + */ + osxNotarize?: ElectronNotarizeOptions; /** * If present, signs OS X target apps when the host platform is OS X and XCode is installed. */ diff --git a/types/elliptic/elliptic-tests.ts b/types/elliptic/elliptic-tests.ts index d587be5e8d..8af88b46a4 100644 --- a/types/elliptic/elliptic-tests.ts +++ b/types/elliptic/elliptic-tests.ts @@ -1,4 +1,5 @@ import elliptic = require('elliptic'); +import BN = require('bn.js'); const ec = new elliptic.ec('secp256k1'); @@ -45,3 +46,49 @@ const newKey = ec.keyFromPublic(pub, 'hex'); // Verify signature console.log(key.verify(msgHash, signature)); + +// EDDSA tests +const eddsa = new elliptic.eddsa('ed25519'); +const msg = Buffer.from('dead', 'hex'); +const priv = 'deadbeef'; + +const sig = eddsa.sign(msg, priv); +sig.toHex(); +sig.toBytes(); +eddsa.sign(msg.toString('hex'), priv).toHex(); + +const edkey = eddsa.keyFromSecret(priv); +edkey.verify(msg, sig); +edkey.verify(msg.toString('hex'), sig.toBytes()); + +const edkey2 = eddsa.keyFromPublic(key.getPublic()); +edkey2.verify(msg, sig); + +eddsa.verify(msg, sig, edkey2.getPublic('hex')); +eddsa.verify(msg.toString('hex'), sig.toBytes(), edkey2.getPublic()); +eddsa.verify(msg, sig.toHex(), edkey2.getPublic()); + +// Curves Tests +elliptic.curve.base.BasePoint; + +const c = new elliptic.curve.edwards({ + p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', + a: -1, + c: 1, + d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3', +}); + +const p = c.pointFromX(5555); +p.eq(p); +eddsa.isPoint(p); +c.validate(p.add(p).mul(new BN(3)).dbl()); + +const sc = new elliptic.curve.short({ + a: 1, + b: 0, + p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', +}); + +const p2 = sc.pointFromX(123456789); +sc.validate(p2.add(p2).mul(new BN(5)).dbl()); +sc.pointFromJSON(p2.toJSON(), false).toJSON(); diff --git a/types/elliptic/index.d.ts b/types/elliptic/index.d.ts index f819d17497..2f1ceb9aab 100644 --- a/types/elliptic/index.d.ts +++ b/types/elliptic/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for elliptic 6.4 // Project: https://github.com/indutny/elliptic // Definitions by: Daniel Byrne +// Gaylor Bosson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import BN = require('bn.js'); @@ -8,151 +9,286 @@ import BN = require('bn.js'); // incomplete typings export const utils: any; export const rand: any; -export const eddsa: any; export type BNInput = string | BN | number | Buffer | number[]; export const version: number; export namespace curve { - class BaseCurve { - constructor(type: string, conf: BaseCurve.BaseCurveOptions) - p: BN; - type: string; - red: any; // ? - zero: any; // ? - one: any; // ? - two: any; // ? - n: BN | undefined | null; - g: any; // ? - redN: any; // ? - decodePoint(bytes: any, enc: string): any; // ? - } + /** + * @description Base class for the curves + */ + class base { + p: BN; + type: string; + red: any; // ? + zero: BN; + one: BN; + two: BN; + n: BN; + g: base.BasePoint; + redN: BN; - namespace BaseCurve { - class BasePoint { - constructor(curve: any, type: string); - curve: any; - type: string; - precomputed: PrecomputedValues | null; - encode(enc: string, compact: boolean): BN; - encodeCompressed(enc: string): BN; - validate(): boolean; - precompute(power: number): BasePoint; - dblp(k: any): any; // ? - } + constructor(type: string, conf: base.BaseCurveOptions) - interface BaseCurveOptions { - p: number | string | number[] | Buffer | BN; - prime?: BN | string; - n?: number | BN | Buffer; - g?: any; // ? - gRed?: any; // ? - } + validate(point: base.BasePoint): boolean; + decodePoint(bytes: Buffer | string, enc?: 'hex'): base.BasePoint; + } - interface PrecomputedValues { - doubles: any; // ? - naf: any; // ? - beta: any; // ? - } - } + namespace base { + class BasePoint { + curve: base; + type: string; + precomputed: PrecomputedValues | null; + + constructor(curve: base, type: string); + + encode(enc: string, compact: boolean): string | Buffer; + encodeCompressed(enc: string): BN; + validate(): boolean; + precompute(power: number): BasePoint; + dblp(k: number): BasePoint; + inspect(): string; + isInfinity(): boolean; + add(p: BasePoint): BasePoint; + mul(k: BN): BasePoint; + dbl(): BasePoint; + getX(): BN; + getY(): BN; + eq(p: BasePoint): boolean; + neg(): BasePoint; + } + + interface BaseCurveOptions { + p: number | string | number[] | Buffer | BN; + prime?: BN | string; + n?: number | BN | Buffer; + g?: BasePoint; + gRed?: any; // ? + } + + interface PrecomputedValues { + doubles: any; // ? + naf: any; // ? + beta: any; // ? + } + } + + class edwards extends base { + a: BN; + c: BN; + c2: BN; + d: BN; + dd: BN; + + constructor(conf: edwards.EdwardsConf); + + point(x: BNInput, y: BNInput, z?: BNInput, t?: BNInput): edwards.EdwardsPoint; + pointFromX(x: BNInput, odd?: boolean): edwards.EdwardsPoint; + pointFromY(y: BNInput, odd?: boolean): edwards.EdwardsPoint; + pointFromJSON(obj: BNInput[]): edwards.EdwardsPoint; + } + + namespace edwards { + interface EdwardsConf extends base.BaseCurveOptions { + a: BNInput; + c: BNInput; + d: BNInput; + } + + class EdwardsPoint extends base.BasePoint { + x: BN; + y: BN; + z: BN; + t: BN; + + normalize(): EdwardsPoint; + eqXToP(x: BN): boolean; + } + } + + class short extends base { + a: BNInput; + b: BNInput; + g: short.ShortPoint; + + constructor(conf: short.ShortConf); + + point(x: BNInput, y: BNInput, isRed?: boolean): short.ShortPoint; + pointFromX(x: BNInput, odd?: boolean): short.ShortPoint; + pointFromJSON(obj: BNInput[], red: boolean): short.ShortPoint; + } + + namespace short { + interface ShortConf extends base.BaseCurveOptions { + a: BNInput; + b: BNInput; + beta?: BNInput; + lambda?: BNInput; + } + + class ShortPoint extends base.BasePoint { + x: BN; + y: BN; + inf: boolean; + + toJSON(): BNInput[]; + } + } } export namespace curves { - class PresetCurve { - constructor(options: PresetCurve.Options) - type: string; - g: any; // ? - n: BN | undefined | null; - hash: any; // ? - } + class PresetCurve { + type: string; + g: any; // ? + n: BN | undefined | null; + hash: any; // ? - namespace PresetCurve { - interface Options { - type: string; - prime: string | null; - p: string; - a: string; - b: string; - n: string; - hash: any; - gRed: boolean; - g: any; // ? - beta?: string; - lambda?: string; - basis?: any; // ? - } - } + constructor(options: PresetCurve.Options) + } + + namespace PresetCurve { + interface Options { + type: string; + prime: string | null; + p: string; + a: string; + b: string; + n: string; + hash: any; + gRed: boolean; + g: any; // ? + beta?: string; + lambda?: string; + basis?: any; // ? + } + } } export class ec { - constructor(options: string | curves.PresetCurve) - curve: any; - n: BN | undefined | null; - nh: any; - g: any; - hash: any; + curve: any; + n: BN | undefined | null; + nh: any; + g: any; + hash: any; - keyPair(options: ec.KeyPairOptions): ec.KeyPair; - keyFromPrivate(priv: Buffer | ec.KeyPair, enc?: string): ec.KeyPair; - keyFromPublic(pub: Buffer | ec.KeyPair, enc?: string): ec.KeyPair; - genKeyPair(options?: ec.GenKeyPairOptions): ec.KeyPair; - sign(msg: BNInput, key: Buffer | ec.KeyPair, enc: string, options?: ec.SignOptions): ec.Signature; - sign(msg: BNInput, key: Buffer | ec.KeyPair, options?: ec.SignOptions): ec.Signature; - verify(msg: BNInput, signature: ec.Signature | ec.SignatureOptions, key: Buffer | ec.KeyPair, enc?: string): boolean; - recoverPubKey(msg: BNInput, signature: ec.Signature | ec.SignatureOptions, j: number, enc?: string): any; - getKeyRecoveryParam(e: Error | undefined, signature: ec.Signature | ec.SignatureOptions, Q: BN, enc?: string): number; + constructor(options: string | curves.PresetCurve) + + keyPair(options: ec.KeyPairOptions): ec.KeyPair; + keyFromPrivate(priv: Buffer | ec.KeyPair, enc?: string): ec.KeyPair; + keyFromPublic(pub: Buffer | ec.KeyPair, enc?: string): ec.KeyPair; + genKeyPair(options?: ec.GenKeyPairOptions): ec.KeyPair; + sign(msg: BNInput, key: Buffer | ec.KeyPair, enc: string, options?: ec.SignOptions): ec.Signature; + sign(msg: BNInput, key: Buffer | ec.KeyPair, options?: ec.SignOptions): ec.Signature; + verify(msg: BNInput, signature: ec.Signature | ec.SignatureOptions, key: Buffer | ec.KeyPair, enc?: string): boolean; + recoverPubKey(msg: BNInput, signature: ec.Signature | ec.SignatureOptions, j: number, enc?: string): any; + getKeyRecoveryParam(e: Error | undefined, signature: ec.Signature | ec.SignatureOptions, Q: BN, enc?: string): number; } export namespace ec { - interface GenKeyPairOptions { - pers: any; - entropy: any; - persEnc?: string; - entropyEnc?: string; - } + interface GenKeyPairOptions { + pers: any; + entropy: any; + persEnc?: string; + entropyEnc?: string; + } - interface SignOptions { - pers: any; - persEnc?: string; - canonical?: boolean; - k?: BN; - } + interface SignOptions { + pers: any; + persEnc?: string; + canonical?: boolean; + k?: BN; + } - class KeyPair { - static fromPublic(ec: ec, pub: Buffer | KeyPair, enc?: string): KeyPair; - static fromPrivate(ec: ec, priv: Buffer | KeyPair, enc?: string): KeyPair; - constructor(ec: ec, options: KeyPairOptions) - ec: ec; - validate(): { readonly result: boolean, readonly reason: string }; - getPublic(compact: boolean, enc?: string): any; // ? - getPublic(enc?: string): any; // ? - getPrivate(enc?: 'hex'): Buffer | BN | string; - derive(pub: any): any; // ? - sign(msg: BNInput, enc: string, options?: SignOptions): Signature; - sign(msg: BNInput, options?: SignOptions): Signature; - verify(msg: BNInput, signature: Signature | SignatureOptions): boolean; - inspect(): string; - } + class KeyPair { + static fromPublic(ec: ec, pub: Buffer | KeyPair, enc?: string): KeyPair; + static fromPrivate(ec: ec, priv: Buffer | KeyPair, enc?: string): KeyPair; - class Signature { - constructor(options: SignatureOptions | Signature, enc?: string) - r: BN; - s: BN; - recoveryParam: number | null; - toDER(enc?: string | null): any; // ? - } + ec: ec; - interface SignatureOptions { - r: number; - s: number; - recoveryParam?: number; - } + constructor(ec: ec, options: KeyPairOptions) - interface KeyPairOptions { - priv?: Buffer; - privEnc?: string; - pub?: Buffer; - pubEnc?: string; - } + validate(): { readonly result: boolean, readonly reason: string }; + getPublic(compact: boolean, enc?: string): any; // ? + getPublic(enc?: string): any; // ? + getPrivate(enc?: 'hex'): Buffer | BN | string; + derive(pub: any): any; // ? + sign(msg: BNInput, enc: string, options?: SignOptions): Signature; + sign(msg: BNInput, options?: SignOptions): Signature; + verify(msg: BNInput, signature: Signature | SignatureOptions): boolean; + inspect(): string; + } + + class Signature { + r: BN; + s: BN; + recoveryParam: number | null; + + constructor(options: SignatureOptions | Signature, enc?: string) + + toDER(enc?: string | null): any; // ? + } + + interface SignatureOptions { + r: BNInput; + s: BNInput; + recoveryParam?: number; + } + + interface KeyPairOptions { + priv?: Buffer; + privEnc?: string; + pub?: Buffer; + pubEnc?: string; + } +} + +export class eddsa { + curve: curve.edwards; + + constructor(name: 'ed25519'); + + sign(message: eddsa.Bytes, secret: eddsa.Bytes): eddsa.Signature; + verify(message: eddsa.Bytes, sig: eddsa.Bytes | eddsa.Signature, pub: eddsa.Bytes | eddsa.Point | eddsa.KeyPair): boolean; + hashInt(): BN; + keyFromPublic(pub: eddsa.Bytes): eddsa.KeyPair; + keyFromSecret(secret: eddsa.Bytes): eddsa.KeyPair; + makeSignature(sig: eddsa.Signature | Buffer | string): eddsa.Signature; + encodePoint(point: eddsa.Point): Buffer; + decodePoint(bytes: eddsa.Bytes): eddsa.Point; + encodeInt(num: BN): Buffer; + decodeInt(bytes: BNInput): BN; + isPoint(val: any): boolean; +} + +export namespace eddsa { + type Point = curve.base.BasePoint; + type Bytes = string | Buffer; + + class Signature { + constructor(eddsa: eddsa, sig: Signature | Bytes); + + toBytes(): Buffer; + toHex(): string; + } + + class KeyPair { + constructor(eddsa: eddsa, params: KeyPairOptions); + + static fromPublic(eddsa: eddsa, pub: Bytes): KeyPair; + static fromSecret(eddsa: eddsa, secret: Bytes): KeyPair; + + secret(): Buffer; + sign(message: Bytes): Signature; + verify(message: Bytes, sig: Signature | Bytes): boolean; + getSecret(enc: 'hex'): string; + getSecret(): Buffer; + getPublic(enc: 'hex'): string; + getPublic(): Buffer; + } + + interface KeyPairOptions { + secret: Buffer; + pub: Buffer | Point; + } } diff --git a/types/ember-qunit/ember-qunit-tests.ts b/types/ember-qunit/ember-qunit-tests.ts index acd9650f98..9e85253ae9 100644 --- a/types/ember-qunit/ember-qunit-tests.ts +++ b/types/ember-qunit/ember-qunit-tests.ts @@ -139,4 +139,11 @@ module('foo service', function(hooks) { setupTest(hooks); }); +// RFC-232 equivalent of https://github.com/ember-engines/ember-engines#unitintegration-testing-for-in-repo-engines +module('engine foo component', function(hooks) { + setupTest(hooks, { + resolver: Ember.Resolver.create() + }); +}); + start(); diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index ed8ac13916..1ce6f90483 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -2,6 +2,8 @@ // Project: https://github.com/emberjs/ember-qunit#readme // Definitions by: Derek Wickern // Mike North +// Steve Calvert +// Dan Freeman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -45,6 +47,13 @@ declare module 'ember-qunit' { */ export function setResolver(resolver: Ember.Resolver): void; + interface SetupTestOptions { + /** + * The resolver to use when instantiating container-managed entities in the test. + */ + resolver?: Ember.Resolver; + } + /** * Sets up acceptance tests. * @@ -57,7 +66,7 @@ declare module 'ember-qunit' { * * `this.pauseTest` and `this.resumeTest` - allow easy pausing/resuming of tests. * * `this.element` which returns the DOM element representing the application's root element. */ - export function setupApplicationTest(hooks: NestedHooks): void; + export function setupApplicationTest(hooks: NestedHooks, options?: SetupTestOptions): void; /** * Sets up tests that need to render snippets of templates. @@ -78,7 +87,7 @@ declare module 'ember-qunit' { * * this.$(...) - When jQuery is present, executes a jQuery selector with * the current this.element as its root */ - export function setupRenderingTest(hooks: NestedHooks): void; + export function setupRenderingTest(hooks: NestedHooks, options?: SetupTestOptions): void; /** * Sets up tests that do not need to render snippets of templates. @@ -93,7 +102,7 @@ declare module 'ember-qunit' { * * this.set / this.setProperties - Allows setting values on the test context. * * this.get / this.getProperties - Retrieves values from the test context. */ - export function setupTest(hooks: NestedHooks): void; + export function setupTest(hooks: NestedHooks, options?: SetupTestOptions): void; export class QUnitAdapter extends Ember.Test.Adapter { } @@ -136,7 +145,7 @@ declare module 'ember-qunit' { /** * If `false` test isolation validation will be disabled. */ - setupTestIsolationValidatoin?: boolean; + setupTestIsolationValidation?: boolean; } export function start(options?: QUnitStartOptions): void; diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index fdb89d3823..4e2b45cd55 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -478,6 +478,7 @@ export namespace Ember { const addObserver: typeof EmberObjectObserversNs.addObserver; const removeObserver: typeof EmberObjectObserversNs.removeObserver; const get: typeof EmberObjectNs.get; + const notifyPropertyChange: typeof EmberObjectNs.notifyPropertyChange; const getWithDefault: typeof EmberObjectNs.getWithDefault; const getProperties: typeof EmberObjectNs.getProperties; const setProperties: typeof EmberObjectNs.setProperties; diff --git a/types/ember/test/object.ts b/types/ember/test/object.ts index 060bf8ca81..853ed46d46 100755 --- a/types/ember/test/object.ts +++ b/types/ember/test/object.ts @@ -65,4 +65,11 @@ export class Foo2 extends Ember.Object { name }); } + + bar() { + Ember.notifyPropertyChange(this, 'name'); + Ember.notifyPropertyChange(this); // $ExpectError + Ember.notifyPropertyChange('name'); // $ExpectError + Ember.notifyPropertyChange(this, 'name', 'bar'); // $ExpectError + } } diff --git a/types/ember__object/index.d.ts b/types/ember__object/index.d.ts index f915bdc82a..06e417999d 100644 --- a/types/ember__object/index.d.ts +++ b/types/ember__object/index.d.ts @@ -385,6 +385,8 @@ export function defineProperty( meta?: any ): void; +export function notifyPropertyChange(obj: object, keyName: string): void; + declare module '@ember/utils/-private/types' { interface TypeLookup { class: typeof EmberObject; diff --git a/types/ember__object/test/object.ts b/types/ember__object/test/object.ts index b47aa22ffb..391ac183a9 100644 --- a/types/ember__object/test/object.ts +++ b/types/ember__object/test/object.ts @@ -1,4 +1,4 @@ -import EmberObject, { computed } from "@ember/object"; +import EmberObject, { computed, notifyPropertyChange } from "@ember/object"; const LifetimeHooks = EmberObject.extend({ resource: null as {} | null, @@ -47,6 +47,12 @@ class Foo extends EmberObject { b: 11 }); } + bar() { + notifyPropertyChange(this, 'name'); + notifyPropertyChange(this); // $ExpectError + notifyPropertyChange('name'); // $ExpectError + notifyPropertyChange(this, 'name', 'bar'); // $ExpectError + } } // TODO: enable after TS 3.0 https://github.com/typed-ember/ember-cli-typescript/issues/291 diff --git a/types/ember__test-helpers/ember__test-helpers-tests.ts b/types/ember__test-helpers/ember__test-helpers-tests.ts index 9fe9e4c297..89b536e51f 100644 --- a/types/ember__test-helpers/ember__test-helpers-tests.ts +++ b/types/ember__test-helpers/ember__test-helpers-tests.ts @@ -11,6 +11,7 @@ import { blur, triggerEvent, triggerKeyEvent, + typeIn, fillIn, render, find, @@ -54,6 +55,7 @@ test('DOM interactions', async () => { await triggerEvent(messageElement, 'custom-event'); await triggerKeyEvent(messageElement, 'keydown', 'Enter', { ctrlKey: true }); await fillIn(messageElement, 'content'); + await typeIn(messageElement, 'content'); const allMessages = findAll('.message'); for (const element of allMessages) { diff --git a/types/ember__test-helpers/index.d.ts b/types/ember__test-helpers/index.d.ts index 8a3d6f0ef9..0c7dc544b9 100644 --- a/types/ember__test-helpers/index.d.ts +++ b/types/ember__test-helpers/index.d.ts @@ -22,6 +22,7 @@ declare module '@ember/test-helpers' { export { default as triggerEvent } from '@ember/test-helpers/dom/trigger-event'; export { default as triggerKeyEvent } from '@ember/test-helpers/dom/trigger-key-event'; export { default as fillIn } from '@ember/test-helpers/dom/fill-in'; + export { default as typeIn } from '@ember/test-helpers/dom/type-in'; // DOM Query Helpers @@ -117,6 +118,12 @@ declare module '@ember/test-helpers/dom/fill-in' { export default function(target: Target, text: string): Promise; } +declare module '@ember/test-helpers/dom/type-in' { + import { Target } from '@ember/test-helpers'; + + export default function(target: Target, text: string, options?: {delay: number}): Promise; +} + declare module '@ember/test-helpers/dom/find' { export default function(selector: string): Element | null; } diff --git a/types/empty-trash/empty-trash-tests.ts b/types/empty-trash/empty-trash-tests.ts new file mode 100644 index 0000000000..296ec63745 --- /dev/null +++ b/types/empty-trash/empty-trash-tests.ts @@ -0,0 +1,5 @@ +import emptyTrash = require('empty-trash'); + +(async () => { + await emptyTrash(); +})(); diff --git a/types/empty-trash/index.d.ts b/types/empty-trash/index.d.ts new file mode 100644 index 0000000000..ef3fca3040 --- /dev/null +++ b/types/empty-trash/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for empty-trash 2.1 +// Project: https://github.com/sindresorhus/empty-trash#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export = emptyTrash; + +declare function emptyTrash(): Promise; diff --git a/types/empty-trash/tsconfig.json b/types/empty-trash/tsconfig.json new file mode 100644 index 0000000000..172bf7299a --- /dev/null +++ b/types/empty-trash/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", + "empty-trash-tests.ts" + ] +} diff --git a/types/empty-trash/tslint.json b/types/empty-trash/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/empty-trash/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/encodeurl/encodeurl-tests.ts b/types/encodeurl/encodeurl-tests.ts new file mode 100644 index 0000000000..cf1b1b24f0 --- /dev/null +++ b/types/encodeurl/encodeurl-tests.ts @@ -0,0 +1,3 @@ +import encodeUrl = require('encodeurl'); + +encodeUrl('/foo'); // $ExpectType string diff --git a/types/encodeurl/index.d.ts b/types/encodeurl/index.d.ts new file mode 100644 index 0000000000..0a92159b49 --- /dev/null +++ b/types/encodeurl/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for encodeurl 1.0 +// Project: https://github.com/pillarjs/encodeurl#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = encodeUrl; + +declare function encodeUrl(url: string): string; diff --git a/types/encodeurl/tsconfig.json b/types/encodeurl/tsconfig.json new file mode 100644 index 0000000000..c597a0e21c --- /dev/null +++ b/types/encodeurl/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", + "encodeurl-tests.ts" + ] +} diff --git a/types/encodeurl/tslint.json b/types/encodeurl/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/encodeurl/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ensure-error/ensure-error-tests.ts b/types/ensure-error/ensure-error-tests.ts new file mode 100644 index 0000000000..fbc5e85d23 --- /dev/null +++ b/types/ensure-error/ensure-error-tests.ts @@ -0,0 +1,9 @@ +import ensureError = require('ensure-error'); + +const error = new TypeError('🦄'); + +// $ExpectType TypeError +ensureError(error); + +// $ExpectType NonError +ensureError(10); diff --git a/types/ensure-error/index.d.ts b/types/ensure-error/index.d.ts new file mode 100644 index 0000000000..e6bc2e5a94 --- /dev/null +++ b/types/ensure-error/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for ensure-error 1.0 +// Project: https://github.com/sindresorhus/ensure-error#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +export = ensureError; + +declare function ensureError(input: T): T extends Error ? T : ensureError.NonError; + +declare namespace ensureError { + interface NonError extends Error { + name: 'NonError'; + } +} diff --git a/types/ensure-error/tsconfig.json b/types/ensure-error/tsconfig.json new file mode 100644 index 0000000000..687a9dfd1a --- /dev/null +++ b/types/ensure-error/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", + "ensure-error-tests.ts" + ] +} diff --git a/types/ensure-error/tslint.json b/types/ensure-error/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ensure-error/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ensure-posix-path/ensure-posix-path-tests.ts b/types/ensure-posix-path/ensure-posix-path-tests.ts new file mode 100644 index 0000000000..e444e58153 --- /dev/null +++ b/types/ensure-posix-path/ensure-posix-path-tests.ts @@ -0,0 +1,3 @@ +import ensurePosixPath = require('ensure-posix-path'); + +ensurePosixPath('C:\\'); // $ExpectType string diff --git a/types/ensure-posix-path/index.d.ts b/types/ensure-posix-path/index.d.ts new file mode 100644 index 0000000000..a4c6175c1c --- /dev/null +++ b/types/ensure-posix-path/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for ensure-posix-path 1.0 +// Project: https://github.com/stefanpenner/ensure-posix-path#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = ensurePosixPath; + +declare function ensurePosixPath(path: string): string; diff --git a/types/ensure-posix-path/tsconfig.json b/types/ensure-posix-path/tsconfig.json new file mode 100644 index 0000000000..3976db4ca3 --- /dev/null +++ b/types/ensure-posix-path/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "ensure-posix-path-tests.ts" + ] +} diff --git a/types/ensure-posix-path/tslint.json b/types/ensure-posix-path/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ensure-posix-path/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/env-ci/env-ci-tests.ts b/types/env-ci/env-ci-tests.ts new file mode 100644 index 0000000000..349fb97b48 --- /dev/null +++ b/types/env-ci/env-ci-tests.ts @@ -0,0 +1,359 @@ +import envCi = require('env-ci'); + +const res = envCi(); +envCi({ env: { foo: 'bar' } }); +envCi({ cwd: '.' }); + +if (!res.isCi) { + res.name; // $ExpectError + res.service; // $ExpectError + res.commit; // $ExpectType string | undefined + res.tag; // $ExpectError + res.build; // $ExpectError + res.buildUrl; // $ExpectError + res.branch; // $ExpectType string | undefined + res.job; // $ExpectError + res.jobUrl; // $ExpectError + res.pr; // $ExpectError + res.isPr; // $ExpectError + res.prBranch; // $ExpectError + res.slug; // $ExpectError + res.root; // $ExpectError +} else { + if (res.service === 'appveyor') { + res.name; // $ExpectType "Appveyor" + res.service; // $ExpectType "appveyor" + res.commit; // $ExpectType string + res.tag; // $ExpectType string | undefined + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string + res.job; // $ExpectType string + res.jobUrl; // $ExpectType string + res.pr; // $ExpectType string | undefined + res.isPr; // $ExpectType boolean + res.prBranch; // $ExpectType string | undefined + res.slug; // $ExpectType string + res.root; // $ExpectType string + } + if (res.service === 'bamboo') { + res.name; // $ExpectType "Bamboo" + res.service; // $ExpectType "bamboo" + res.commit; // $ExpectType string + res.tag; // $ExpectError + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string + res.job; // $ExpectType string + res.jobUrl; // $ExpectError + res.pr; // $ExpectError + res.isPr; // $ExpectError + res.prBranch; // $ExpectError + res.slug; // $ExpectError + res.root; // $ExpectType string + } + if (res.service === 'bitbucket') { + res.name; // $ExpectType "Bitbucket Pipelines" + res.service; // $ExpectType "bitbucket" + res.commit; // $ExpectType string + res.tag; // $ExpectType string | undefined + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string + res.job; // $ExpectError + res.jobUrl; // $ExpectError + res.pr; // $ExpectError + res.isPr; // $ExpectError + res.prBranch; // $ExpectError + res.slug; // $ExpectType string + res.root; // $ExpectType string + } + if (res.service === 'bitrise') { + res.name; // $ExpectType "Bitrise" + res.service; // $ExpectType "bitrise" + res.commit; // $ExpectType string + res.tag; // $ExpectType string | undefined + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string + res.job; // $ExpectError + res.jobUrl; // $ExpectError + res.pr; // $ExpectType string | undefined + res.isPr; // $ExpectType boolean + res.prBranch; // $ExpectType string | undefined + res.slug; // $ExpectType string + res.root; // $ExpectError + } + if (res.service === 'buddy') { + res.name; // $ExpectType "Buddy" + res.service; // $ExpectType "buddy" + res.commit; // $ExpectType string + res.tag; // $ExpectType string | undefined + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string | undefined + res.job; // $ExpectError + res.jobUrl; // $ExpectError + res.pr; // $ExpectType string | undefined + res.isPr; // $ExpectType boolean + res.prBranch; // $ExpectError + res.slug; // $ExpectType string + res.root; // $ExpectError + } + if (res.service === 'buildkite') { + res.name; // $ExpectType "Buildkite" + res.service; // $ExpectType "buildkite" + res.commit; // $ExpectType string + res.tag; // $ExpectType string | undefined + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string + res.job; // $ExpectError + res.jobUrl; // $ExpectError + res.pr; // $ExpectType string | undefined + res.isPr; // $ExpectType boolean + res.prBranch; // $ExpectType string | undefined + res.slug; // $ExpectType string + res.root; // $ExpectType string + } + if (res.service === 'circleci') { + res.name; // $ExpectType "CircleCI" + res.service; // $ExpectType "circleci" + res.commit; // $ExpectType string + res.tag; // $ExpectType string | undefined + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string | undefined + res.job; // $ExpectType string + res.jobUrl; // $ExpectError + res.pr; // $ExpectType string | undefined + res.isPr; // $ExpectType boolean + res.prBranch; // $ExpectType string | undefined + res.slug; // $ExpectType string + res.root; // $ExpectError + } + if (res.service === 'cirrus') { + res.name; // $ExpectType "Cirrus CI" + res.service; // $ExpectType "cirrus" + res.commit; // $ExpectType string + res.tag; // $ExpectType string | undefined + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string + res.job; // $ExpectType string + res.jobUrl; // $ExpectType string + res.pr; // $ExpectType string | undefined + res.isPr; // $ExpectType boolean + res.prBranch; // $ExpectError + res.slug; // $ExpectType string + res.root; // $ExpectType string + } + if (res.service === 'codebuild') { + res.name; // $ExpectType "AWS CodeBuild" + res.service; // $ExpectType "codebuild" + res.commit; // $ExpectType string + res.tag; // $ExpectError + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string + res.job; // $ExpectError + res.jobUrl; // $ExpectError + res.pr; // $ExpectError + res.isPr; // $ExpectError + res.prBranch; // $ExpectError + res.slug; // $ExpectError + res.root; // $ExpectType string + } + if (res.service === 'codefresh') { + res.name; // $ExpectType "Codefresh" + res.service; // $ExpectType "codefresh" + res.commit; // $ExpectType string + res.tag; // $ExpectError + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string + res.job; // $ExpectError + res.jobUrl; // $ExpectError + res.pr; // $ExpectType string | undefined + res.isPr; // $ExpectType boolean + res.prBranch; // $ExpectType string | undefined + res.slug; // $ExpectType string + res.root; // $ExpectType string + } + if (res.service === 'codeship') { + res.name; // $ExpectType "Codeship" + res.service; // $ExpectType "codeship" + res.commit; // $ExpectType string + res.tag; // $ExpectError + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string + res.job; // $ExpectError + res.jobUrl; // $ExpectError + res.pr; // $ExpectError + res.isPr; // $ExpectError + res.prBranch; // $ExpectError + res.slug; // $ExpectType string + res.root; // $ExpectError + } + if (res.service === 'drone') { + res.name; // $ExpectType "Drone" + res.service; // $ExpectType "drone" + res.commit; // $ExpectType string + res.tag; // $ExpectType string | undefined + res.build; // $ExpectType string + res.buildUrl; // $ExpectError + res.branch; // $ExpectType string + res.job; // $ExpectType string + res.jobUrl; // $ExpectError + res.pr; // $ExpectType string | undefined + res.isPr; // $ExpectType boolean + res.prBranch; // $ExpectType string | undefined + res.slug; // $ExpectType string + res.root; // $ExpectError + } + if (res.service === 'gitlab') { + res.name; // $ExpectType "GitLab CI/CD" + res.service; // $ExpectType "gitlab" + res.commit; // $ExpectType string + res.tag; // $ExpectType string | undefined + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string + res.job; // $ExpectType string + res.jobUrl; // $ExpectType string + res.pr; // $ExpectError + res.isPr; // $ExpectError + res.prBranch; // $ExpectError + res.slug; // $ExpectType string + res.root; // $ExpectType string + } + if (res.service === 'jenkins') { + res.name; // $ExpectType "Jenkins" + res.service; // $ExpectType "jenkins" + res.commit; // $ExpectType string + res.tag; // $ExpectError + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string + res.job; // $ExpectError + res.jobUrl; // $ExpectError + res.pr; // $ExpectType string | undefined + res.isPr; // $ExpectType boolean + res.prBranch; // $ExpectType string | undefined + res.slug; // $ExpectError + res.root; // $ExpectType string + } + if (res.service === 'sail') { + res.name; // $ExpectType "Sail CI" + res.service; // $ExpectType "sail" + res.commit; // $ExpectType string + res.tag; // $ExpectError + res.build; // $ExpectError + res.buildUrl; // $ExpectError + res.branch; // $ExpectType string | undefined + res.job; // $ExpectError + res.jobUrl; // $ExpectError + res.pr; // $ExpectType string | undefined + res.isPr; // $ExpectType boolean + res.prBranch; // $ExpectError + res.slug; // $ExpectType string + res.root; // $ExpectType string + } + if (res.service === 'semaphore') { + res.name; // $ExpectType "Semaphore" + res.service; // $ExpectType "semaphore" + res.commit; // $ExpectType string + res.tag; // $ExpectError + res.build; // $ExpectType string + res.buildUrl; // $ExpectError + res.branch; // $ExpectType string | undefined + res.job; // $ExpectError + res.jobUrl; // $ExpectError + res.pr; // $ExpectType string | undefined + res.isPr; // $ExpectType boolean + res.prBranch; // $ExpectType string | undefined + res.slug; // $ExpectType string + res.root; // $ExpectType string + } + if (res.service === 'shippable') { + res.name; // $ExpectType "Shippable" + res.service; // $ExpectType "shippable" + res.commit; // $ExpectType string + res.tag; // $ExpectType string | undefined + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string + res.job; // $ExpectType string + res.jobUrl; // $ExpectError + res.pr; // $ExpectType string | undefined + res.isPr; // $ExpectType boolean + res.prBranch; // $ExpectType string | undefined + res.slug; // $ExpectType string + res.root; // $ExpectType string + } + if (res.service === 'teamcity') { + res.name; // $ExpectType "TeamCity" + res.service; // $ExpectType "teamcity" + res.commit; // $ExpectType string + res.tag; // $ExpectError + res.build; // $ExpectType string + res.buildUrl; // $ExpectError + res.branch; // $ExpectType string | undefined + res.job; // $ExpectError + res.jobUrl; // $ExpectError + res.pr; // $ExpectError + res.isPr; // $ExpectError + res.prBranch; // $ExpectError + res.slug; // $ExpectType string + res.root; // $ExpectType string | undefined + } + if (res.service === 'travis') { + res.name; // $ExpectType "Travis CI" + res.service; // $ExpectType "travis" + res.commit; // $ExpectType string + res.tag; // $ExpectType string | undefined + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string | undefined + res.job; // $ExpectType string + res.jobUrl; // $ExpectType string + res.pr; // $ExpectType string | undefined + res.isPr; // $ExpectType boolean + res.prBranch; // $ExpectType string + res.slug; // $ExpectType string + res.root; // $ExpectType string + } + if (res.service === 'vsts') { + res.name; // $ExpectType "Visual Studio Team Services" + res.service; // $ExpectType "vsts" + res.commit; // $ExpectType string + res.tag; // $ExpectError + res.build; // $ExpectType string + res.buildUrl; // $ExpectError + res.branch; // $ExpectType string + res.job; // $ExpectError + res.jobUrl; // $ExpectError + res.pr; // $ExpectType string | undefined + res.isPr; // $ExpectType boolean + res.prBranch; // $ExpectType string | undefined + res.slug; // $ExpectError + res.root; // $ExpectType string + } + if (res.service === 'wercker') { + res.name; // $ExpectType "Wercker" + res.service; // $ExpectType "wercker" + res.commit; // $ExpectType string + res.tag; // $ExpectError + res.build; // $ExpectType string + res.buildUrl; // $ExpectType string + res.branch; // $ExpectType string + res.job; // $ExpectError + res.jobUrl; // $ExpectError + res.pr; // $ExpectError + res.isPr; // $ExpectError + res.prBranch; // $ExpectError + res.slug; // $ExpectType string + res.root; // $ExpectType string + } +} diff --git a/types/env-ci/index.d.ts b/types/env-ci/index.d.ts new file mode 100644 index 0000000000..d3ac867796 --- /dev/null +++ b/types/env-ci/index.d.ts @@ -0,0 +1,328 @@ +// Type definitions for env-ci 3.1 +// Project: https://github.com/pvdlg/env-ci#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export = envCi; + +declare function envCi(options?: envCi.Options): envCi.CiEnv; + +declare namespace envCi { + interface Options { + env?: { [envVar: string]: any }; + cwd?: string; + } + + type CiEnv = NonCiEnv | KnownCiEnv; + type KnownCiEnv = + | AppveyorEnv + | BambooEnv + | BitbucketEnv + | BitriseEnv + | BuddyEnv + | BuildkiteEnv + | CircleCiEnv + | CirrusEnv + | CodeBuildEnv + | CodefreshEnv + | CodeshipEnv + | DroneEnv + | GitLabEnv + | JenkinsEnv + | SailEnv + | SemaphoreEnv + | ShippableEnv + | TeamCityEnv + | TravisEnv + | VstsEnv + | WerckerEnv; + + interface NonCiEnv { + isCi: false; + branch?: string; + commit?: string; + } + + interface CiEnvBase { + isCi: true; + } + + interface AppveyorEnv extends CiEnvBase { + name: 'Appveyor'; + service: 'appveyor'; + commit: string; + tag?: string; + build: string; + buildUrl: string; + branch: string; + job: string; + jobUrl: string; + pr?: string; + isPr: boolean; + prBranch?: string; + slug: string; + root: string; + } + + interface BambooEnv extends CiEnvBase { + name: 'Bamboo'; + service: 'bamboo'; + commit: string; + build: string; + buildUrl: string; + branch: string; + job: string; + root: string; + } + + interface BitbucketEnv extends CiEnvBase { + name: 'Bitbucket Pipelines'; + service: 'bitbucket'; + commit: string; + tag?: string; + build: string; + buildUrl: string; + branch: string; + slug: string; + root: string; + } + + interface BitriseEnv extends CiEnvBase { + name: 'Bitrise'; + service: 'bitrise'; + commit: string; + tag?: string; + build: string; + buildUrl: string; + branch: string; + pr?: string; + isPr: boolean; + prBranch?: string; + slug: string; + } + + interface BuddyEnv extends CiEnvBase { + name: 'Buddy'; + service: 'buddy'; + commit: string; + tag?: string; + build: string; + buildUrl: string; + branch?: string; + pr?: string; + isPr: boolean; + slug: string; + } + + interface BuildkiteEnv extends CiEnvBase { + name: 'Buildkite'; + service: 'buildkite'; + build: string; + buildUrl: string; + commit: string; + tag?: string; + branch: string; + pr?: string; + isPr: boolean; + prBranch?: string; + slug: string; + root: string; + } + + interface CircleCiEnv extends CiEnvBase { + name: 'CircleCI'; + service: 'circleci'; + build: string; + buildUrl: string; + job: string; + commit: string; + tag?: string; + branch?: string; + pr?: string; + isPr: boolean; + prBranch?: string; + slug: string; + } + + interface CirrusEnv extends CiEnvBase { + name: 'Cirrus CI'; + service: 'cirrus'; + commit: string; + tag?: string; + build: string; + buildUrl: string; + job: string; + jobUrl: string; + branch: string; + pr?: string; + isPr: boolean; + slug: string; + root: string; + } + + interface CodeBuildEnv extends CiEnvBase { + name: 'AWS CodeBuild'; + service: 'codebuild'; + commit: string; + build: string; + branch: string; + buildUrl: string; + root: string; + } + + interface CodefreshEnv extends CiEnvBase { + name: 'Codefresh'; + service: 'codefresh'; + commit: string; + build: string; + buildUrl: string; + branch: string; + pr?: string; + isPr: boolean; + prBranch?: string; + slug: string; + root: string; + } + + interface CodeshipEnv extends CiEnvBase { + name: 'Codeship'; + service: 'codeship'; + build: string; + buildUrl: string; + commit: string; + branch: string; + slug: string; + } + + interface DroneEnv extends CiEnvBase { + name: 'Drone'; + service: 'drone'; + commit: string; + tag?: string; + build: string; + branch: string; + job: string; + pr?: string; + isPr: boolean; + prBranch?: string; + slug: string; + } + + interface GitLabEnv extends CiEnvBase { + name: 'GitLab CI/CD'; + service: 'gitlab'; + commit: string; + tag?: string; + build: string; + buildUrl: string; + job: string; + jobUrl: string; + branch: string; + slug: string; + root: string; + } + + interface JenkinsEnv extends CiEnvBase { + name: 'Jenkins'; + service: 'jenkins'; + commit: string; + branch: string; + build: string; + buildUrl: string; + pr?: string; + isPr: boolean; + prBranch?: string; + root: string; + } + + interface SailEnv extends CiEnvBase { + name: 'Sail CI'; + service: 'sail'; + commit: string; + branch?: string; + pr?: string; + isPr: boolean; + slug: string; + root: string; + } + + interface SemaphoreEnv extends CiEnvBase { + name: 'Semaphore'; + service: 'semaphore'; + commit: string; + build: string; + branch?: string; + pr?: string; + isPr: boolean; + prBranch?: string; + slug: string; + root: string; + } + + interface ShippableEnv extends CiEnvBase { + name: 'Shippable'; + service: 'shippable'; + commit: string; + tag?: string; + build: string; + buildUrl: string; + branch: string; + job: string; + pr?: string; + isPr: boolean; + prBranch?: string; + slug: string; + root: string; + } + + interface TeamCityEnv extends CiEnvBase { + name: 'TeamCity'; + service: 'teamcity'; + branch?: string; + commit: string; + build: string; + slug: string; + root?: string; + } + + interface TravisEnv extends CiEnvBase { + name: 'Travis CI'; + service: 'travis'; + commit: string; + tag?: string; + build: string; + buildUrl: string; + branch?: string; + job: string; + jobUrl: string; + pr?: string; + isPr: boolean; + prBranch: string; + slug: string; + root: string; + } + + interface VstsEnv extends CiEnvBase { + name: 'Visual Studio Team Services'; + service: 'vsts'; + commit: string; + build: string; + branch: string; + pr?: string; + isPr: boolean; + prBranch?: string; + root: string; + } + + interface WerckerEnv extends CiEnvBase { + name: 'Wercker'; + service: 'wercker'; + commit: string; + build: string; + buildUrl: string; + branch: string; + slug: string; + root: string; + } +} diff --git a/types/env-ci/tsconfig.json b/types/env-ci/tsconfig.json new file mode 100644 index 0000000000..9544838913 --- /dev/null +++ b/types/env-ci/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", + "env-ci-tests.ts" + ] +} diff --git a/types/env-ci/tslint.json b/types/env-ci/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/env-ci/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/env-editor/env-editor-tests.ts b/types/env-editor/env-editor-tests.ts new file mode 100644 index 0000000000..c03cacc38b --- /dev/null +++ b/types/env-editor/env-editor-tests.ts @@ -0,0 +1,8 @@ +import * as envEditor from 'env-editor'; + +// $ExpectType Editor +envEditor.get('sublime'); +// $ExpectType Editor +envEditor.default(); +// $ExpectType Editor[] +envEditor.all(); diff --git a/types/env-editor/index.d.ts b/types/env-editor/index.d.ts new file mode 100644 index 0000000000..8bf9e6d68f --- /dev/null +++ b/types/env-editor/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for env-editor 0.3 +// Project: https://github.com/sindresorhus/env-editor#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export default function(): Editor; +export function get(editor: string): Editor; +export function all(): Editor[]; + +export interface Editor { + id: string; + name: string; + bin: string; + isTerminalEditor: boolean; + paths: string[]; + keywords: string[]; +} diff --git a/types/env-editor/tsconfig.json b/types/env-editor/tsconfig.json new file mode 100644 index 0000000000..6d137bf389 --- /dev/null +++ b/types/env-editor/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", + "env-editor-tests.ts" + ] +} diff --git a/types/env-editor/tslint.json b/types/env-editor/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/env-editor/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/enzyme/enzyme-tests.tsx b/types/enzyme/enzyme-tests.tsx index 0711243d0c..0c7e2c2e90 100644 --- a/types/enzyme/enzyme-tests.tsx +++ b/types/enzyme/enzyme-tests.tsx @@ -35,6 +35,10 @@ interface MyComponentState { stateProperty: string; } +function toComponentType(Component: ComponentClass | StatelessComponent): ComponentClass | StatelessComponent { + return Component; +} + class MyComponent extends Component { handleEcho(value: string) { return value; @@ -59,6 +63,8 @@ const MyStatelessComponent = (props: StatelessProps) => ; const AnotherStatelessComponent = (props: AnotherStatelessProps) => ; +const ComponentType = toComponentType(MyComponent); + // Enzyme.configure function configureTest() { const configureAdapter: { adapter: EnzymeAdapter } = { adapter: {} }; @@ -859,6 +865,14 @@ function ReactWrapperTest() { reactWrapper = new ReactWrapper(, undefined, { attachTo: document.createElement('div') }); reactWrapper = new ReactWrapper(, reactWrapper, { attachTo: document.createElement('div') }); } + + function test_component_type() { + const wrapper1 = shallow(

); + wrapper1.find(ComponentType).props().stringProp; // $ExpectType string + + const wrapper2 = mount(
); + wrapper2.find(ComponentType).props().stringProp; // $ExpectType string + } } // CheerioWrapper diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index 0818b4e5ce..58e5938a8f 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -27,7 +27,9 @@ export interface ComponentClass { new(props: Props, context?: any): Component; } -export type StatelessComponent = (props: Props, context?: any) => JSX.Element; +export type StatelessComponent = (props: Props, context?: any) => JSX.Element | null; + +export type ComponentType = ComponentClass | StatelessComponent; /** * Many methods in Enzyme's API accept a selector as an argument. Selectors in Enzyme can fall into one of the @@ -372,8 +374,8 @@ export class ShallowWrapper

{ * Find every node in the render tree that matches the provided selector. * @param selector The selector to match. */ - find(component: ComponentClass): ShallowWrapper; find(statelessComponent: StatelessComponent): ShallowWrapper; + find(component: ComponentType): ShallowWrapper; find(props: EnzymePropSelector): ShallowWrapper; find(selector: string): ShallowWrapper; @@ -381,8 +383,8 @@ export class ShallowWrapper

{ * Removes nodes in the current wrapper that do not match the provided selector. * @param selector The selector to match. */ - filter(component: ComponentClass): ShallowWrapper; filter(statelessComponent: StatelessComponent): ShallowWrapper; + filter(component: ComponentType): ShallowWrapper; filter(props: EnzymePropSelector | string): ShallowWrapper; /** @@ -394,8 +396,8 @@ export class ShallowWrapper

{ * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector * can be provided and it will filter the children by this selector. */ - children(component: ComponentClass): ShallowWrapper; children(statelessComponent: StatelessComponent): ShallowWrapper; + children(component: ComponentType): ShallowWrapper; children(selector: string): ShallowWrapper; children(props?: EnzymePropSelector): ShallowWrapper; @@ -425,8 +427,8 @@ export class ShallowWrapper

{ * * Note: can only be called on a wrapper of a single node. */ - parents(component: ComponentClass): ShallowWrapper; parents(statelessComponent: StatelessComponent): ShallowWrapper; + parents(component: ComponentType): ShallowWrapper; parents(selector: string): ShallowWrapper; parents(props?: EnzymePropSelector): ShallowWrapper; @@ -436,8 +438,8 @@ export class ShallowWrapper

{ * * Note: can only be called on a wrapper of a single node. */ - closest(component: ComponentClass): ShallowWrapper; closest(statelessComponent: StatelessComponent): ShallowWrapper; + closest(component: ComponentType): ShallowWrapper; closest(props: EnzymePropSelector): ShallowWrapper; closest(selector: string): ShallowWrapper; @@ -487,8 +489,8 @@ export class ReactWrapper

{ * Find every node in the render tree that matches the provided selector. * @param selector The selector to match. */ - find(component: ComponentClass): ReactWrapper; find(statelessComponent: StatelessComponent): ReactWrapper; + find(component: ComponentType): ReactWrapper; find(props: EnzymePropSelector): ReactWrapper; find(selector: string): ReactWrapper; @@ -501,16 +503,16 @@ export class ReactWrapper

{ * Removes nodes in the current wrapper that do not match the provided selector. * @param selector The selector to match. */ - filter(component: ComponentClass): ReactWrapper; filter(statelessComponent: StatelessComponent): ReactWrapper; + filter(component: ComponentType): ReactWrapper; filter(props: EnzymePropSelector | string): ReactWrapper; /** * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector * can be provided and it will filter the children by this selector. */ - children(component: ComponentClass): ReactWrapper; children(statelessComponent: StatelessComponent): ReactWrapper; + children(component: ComponentType): ReactWrapper; children(selector: string): ReactWrapper; children(props?: EnzymePropSelector): ReactWrapper; @@ -526,8 +528,8 @@ export class ReactWrapper

{ * * Note: can only be called on a wrapper of a single node. */ - parents(component: ComponentClass): ReactWrapper; parents(statelessComponent: StatelessComponent): ReactWrapper; + parents(component: ComponentType): ReactWrapper; parents(selector: string): ReactWrapper; parents(props?: EnzymePropSelector): ReactWrapper; @@ -537,8 +539,8 @@ export class ReactWrapper

Hello, world!

+ +); + +// LocalizationProvider examples: +function* generateBundles(currentLocales: string[]) { + for (const locale of currentLocales) { + const bundle = new FluentBundle(locale); + bundle.addMessages(ftl`some-message = Hello`); + yield bundle; + } +} + +ReactDOM.render( + + Content + , + document.getElementById('root') +); + +// withLocalization examples: +interface Props { + getString: GetString; + otherProp: number; + someOtherProp: string; +} +function HelloButton(props: Props) { + const { getString } = props; + + return ( + + ); +} + +const LocalizedHelloButton = withLocalization(HelloButton); + +// Remove `getString` from list of required props: +const Test2 = () => ( + +); +// Should not allow `getString` prop: +const Test3 = () => ( + // $ExpectError + {}}/> +); + +// Should not allow any other props to be omitted: +const Test4 = () => ( + // $ExpectError + +); diff --git a/types/fluent-react/index.d.ts b/types/fluent-react/index.d.ts new file mode 100644 index 0000000000..5ffc93d874 --- /dev/null +++ b/types/fluent-react/index.d.ts @@ -0,0 +1,101 @@ +// Type definitions for fluent-react 0.8 +// Project: http://projectfluent.org +// Definitions by: Huy Nguyen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; +import { + FluentBundle, +} from 'fluent'; + +export interface Node { + TEXT_NODE: 3; + nodeType: number; + localName?: string; + textContext: string; +} + +export type MarkupParser = (str: string) => Node[]; + +export interface Context { + l10n: ReactLocalization; + parseMarkup: MarkupParser; +} +export interface LocalizationProviderProps { + bundles: IterableIterator; + parseMarkup?: MarkupParser; +} +export class LocalizationProvider extends React.Component { +} + +export class ReactLocalization { + constructor(bundles: IterableIterator); + getString(id: string, args?: object, fallback?: string): string; +} + +export interface LocalizedProps { + id: string; + attrs?: object; + [key: string]: any; +} + +export class Localized extends React.Component { +} + +// Inspired by react-redux's type definition: +/** + * A property P will be present if: + * - it is present in DecorationTargetProps + * + * Its value will be dependent on the following conditions + * - if property P is present in InjectedProps and its definition extends the definition + * in DecorationTargetProps, then its definition will be that of DecorationTargetProps[P] + * - if property P is not present in InjectedProps then its definition will be that of + * DecorationTargetProps[P] + * - if property P is present in InjectedProps but does not extend the + * DecorationTargetProps[P] definition, its definition will be that of InjectedProps[P] + */ +export type Matching = { + [P in keyof DecorationTargetProps]: P extends keyof InjectedProps + ? InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : InjectedProps[P] + : DecorationTargetProps[P]; +}; + +/** + * a property P will be present if : + * - it is present in both DecorationTargetProps and InjectedProps + * - InjectedProps[P] can satisfy DecorationTargetProps[P] + * ie: decorated component can accept more types than decorator is injecting + * + * For decoration, inject props or ownProps are all optionally + * required by the decorated (right hand side) component. + * But any property required by the decorated component must be satisfied by the injected property. + */ +export type Shared< + InjectedProps, + DecorationTargetProps extends Shared + > = { + [P in Extract]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never; + }; + +// Infers prop type from component C +export type GetProps = C extends React.ComponentType ? P : never; + +export type GetString = (id: string, args?: object) => string; + +export interface InjectedProps { + getString: GetString; +} + +// Taken from +// https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#predefined-conditional-types +export type Omit = Pick>; + +// Injects `getString` and removes it from the prop requirements. Will not pass +// through `getString` if it's passed in during render. +export function withLocalization>>>( + component: C +): React.ComponentType, keyof Shared>>>; diff --git a/types/fluent-react/package.json b/types/fluent-react/package.json new file mode 100644 index 0000000000..e6696d08e7 --- /dev/null +++ b/types/fluent-react/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "csstype": "^2.2.0" + } +} diff --git a/types/fluent-react/tsconfig.json b/types/fluent-react/tsconfig.json new file mode 100644 index 0000000000..5a962376b4 --- /dev/null +++ b/types/fluent-react/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "jsx": "preserve", + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "fluent-react-tests.tsx" + ] +} diff --git a/types/fluent-react/tslint.json b/types/fluent-react/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/fluent-react/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/fluent/fluent-tests.ts b/types/fluent/fluent-tests.ts new file mode 100644 index 0000000000..d2fcd4a6c4 --- /dev/null +++ b/types/fluent/fluent-tests.ts @@ -0,0 +1,44 @@ +import { FluentBundle, ftl, FluentResource } from 'fluent'; + +const bundle1 = new FluentBundle('en-US'); + +const errors1 = bundle1.addMessages(ftl` + -brand-name = Foo 3000 + welcome = Welcome, { $name }, to { -brand-name }! +`); + +if (errors1.length) { + // syntax errors are per-message and don't break the whole resource +} + +const welcome = bundle1.getMessage('welcome'); + +bundle1.format(welcome, { name: 'Anna' }); + +// FluentBundle constructor examples: +const bundle2 = new FluentBundle(['en-US']); + +const bundle3 = new FluentBundle(['en-US'], { useIsolating: false }); + +const bundle4 = new FluentBundle(['en-US'], { + useIsolating: true, + functions: { + NODE_ENV: () => 'production' + } +}); + +// FluentBundle addMessages examples: +bundle1.addMessages('foo = Foo'); +bundle2.getMessage('foo'); + +// FluentBundle addResource examples: +const a = FluentResource.fromString('foo'); +bundle1.addResource(a); +bundle2.getMessage('foo'); + +// FluentBundle format examples: +const errors2: any[] = []; +bundle1.addMessages('hello = Hello, { $name }!'); +const hello = bundle2.getMessage('hello'); +bundle3.format(hello, { name: 'Jane' }, errors2); +bundle3.format(hello, undefined, errors2); diff --git a/types/fluent/index.d.ts b/types/fluent/index.d.ts new file mode 100644 index 0000000000..56014044ab --- /dev/null +++ b/types/fluent/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for fluent 0.10 +// Project: http://projectfluent.org +// Definitions by: Huy Nguyen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export interface FluentBundleContructorOptions { + functions?: object; + useIsolating?: boolean; + transform?: (...args: any[]) => any; +} + +export class FluentType { + constructor(value: any, opts: object); + toString(bundle: FluentBundle): string; + valueOf(): any; +} + +export class FluentNone extends FluentType {} +export class FluentNumber extends FluentType {} +export class FluentDateTime extends FluentType {} + +export type FluentNode = FluentType | string; + +export class FluentResource extends Map { + static fromString(source: string): FluentResource; +} + +export class FluentBundle { + constructor(locales: string | string[], options?: FluentBundleContructorOptions); + addMessages(source: string): string[]; + getMessage(id: string): FluentNode[]; + format(message: FluentNode[], args?: object, errors?: string[]): string; + addResource(res: FluentResource): string[]; +} + +export function ftl(strings: TemplateStringsArray): string; diff --git a/types/fluent/tsconfig.json b/types/fluent/tsconfig.json new file mode 100644 index 0000000000..64e2460dcd --- /dev/null +++ b/types/fluent/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", + "fluent-tests.ts" + ] +} diff --git a/types/fluent/tslint.json b/types/fluent/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fluent/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/flushable/flushable-tests.ts b/types/flushable/flushable-tests.ts new file mode 100644 index 0000000000..3d4bf565dc --- /dev/null +++ b/types/flushable/flushable-tests.ts @@ -0,0 +1,20 @@ +/** + * The usage example is taken directly + * from the package's README + */ + +import flushable from 'flushable'; + +// prints a message to the console after 1 second +const operation = flushable(flushed => { + const result = `I completed ${flushed ? 'early' : 'on time'}`; +}, 1000); + +// true if the callback has not been executed +operation.pending(); + +// stops the callback from being executed +operation.cancel(); + +// immediately executes the callback +operation.flush(); diff --git a/types/flushable/index.d.ts b/types/flushable/index.d.ts new file mode 100644 index 0000000000..eb3a08a214 --- /dev/null +++ b/types/flushable/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for flushable 1.0 +// Project: https://github.com/petegleeson/flushable#readme +// Definitions by: Parth Mehta +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export type FlushableOnCompleteHandler = (flushed: boolean) => any; + +export interface FlushableOperation { + /** Returns whether or not the callback has been executed */ + pending: () => boolean; + /** Stops the callback from being executed */ + cancel: () => void; + /** Immediately executes the callback */ + flush: () => void; +} + +export default function flushable( + onComplete: FlushableOnCompleteHandler, + delay: number +): FlushableOperation; diff --git a/types/flushable/tsconfig.json b/types/flushable/tsconfig.json new file mode 100644 index 0000000000..27b5900f3e --- /dev/null +++ b/types/flushable/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "flushable-tests.ts"] +} diff --git a/types/flushable/tslint.json b/types/flushable/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/flushable/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/forever-monitor/index.d.ts b/types/forever-monitor/index.d.ts index c9de58e7cc..cc666b65c0 100644 --- a/types/forever-monitor/index.d.ts +++ b/types/forever-monitor/index.d.ts @@ -25,7 +25,7 @@ export interface Options { sourceDir?: string; watch?: boolean; watchIgnoreDotFiles?: boolean; - watchIgnorePatters?: string[]; + watchIgnorePatterns?: string[]; watchDirectory?: string; spawnWith?: SpawnWith; env?: NodeJS.ProcessEnv; diff --git a/types/forge-apis/README.md b/types/forge-apis/README.md new file mode 100644 index 0000000000..9da41d3d61 --- /dev/null +++ b/types/forge-apis/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/forge-apis` + +# Summary +This package contains type definitions for Forge Node.js SDK (https://github.com/Autodesk-Forge/forge-api-nodejs-client). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/forge-apis + +Additional Details + * Last updated: Fri, 11 Jan 2019 10:39:13 GMT + * Dependencies: @types/three + * Global values: none + +# Credits +Forge Partner Development diff --git a/types/forge-apis/forge-apis-tests.ts b/types/forge-apis/forge-apis-tests.ts new file mode 100644 index 0000000000..d7031facb9 --- /dev/null +++ b/types/forge-apis/forge-apis-tests.ts @@ -0,0 +1,13 @@ +import { AuthClientTwoLegged, AuthClientThreeLegged, BucketsApi, HubsApi, FoldersApi, DerivativesApi } from 'forge-apis'; + +const authClientTwoLegged: AuthClientTwoLegged = new AuthClientTwoLegged("", "", []); + +const authClientThreeLegged: AuthClientThreeLegged = new AuthClientThreeLegged("", "", "", []); + +const bucketsApi: BucketsApi = new BucketsApi(); + +const hubsApi: HubsApi = new HubsApi(); + +const foldersApi: FoldersApi = new FoldersApi(); + +const derivativesApi: DerivativesApi = new DerivativesApi(); diff --git a/types/forge-apis/index.d.ts b/types/forge-apis/index.d.ts new file mode 100644 index 0000000000..07dca58812 --- /dev/null +++ b/types/forge-apis/index.d.ts @@ -0,0 +1,193 @@ +// Type definitions for Forge-apis 0.4 +// Project: https://github.com/Autodesk-Forge/forge-api-nodejs-client +// Definitions by: Autodesk Forge Partner Development +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +// Copyright (c) Autodesk, Inc. All rights reserved +// +// Permission to use, copy, modify, and distribute this software in +// object code form for any purpose and without fee is hereby granted, +// provided that the above copyright notice appears in all copies and +// that both that copyright notice and the limited warranty and +// restricted rights notice below appear in all supporting +// documentation. +// +// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. +// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF +// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. +// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE +// UNINTERRUPTED OR ERROR FREE. +// + +export class AuthClientTwoLegged { + constructor(clientId: string, clientSecret: string, scope: string[]); + + authenticate(): Promise; + getCredentials(): AuthToken; + setCredentials(credentials: AuthToken): void; + isAuthorized(): boolean; +} + +export class AuthClientThreeLegged { + constructor(clientId: string, clientSecret: string, redirectUri: string, scope: string[]); + + generateAuthUrl(): string; + getToken(code: string): Promise; + refreshToken(credentials: AuthToken): Promise; +} + +export interface ApiResponse { + body: any; + headers: any; + statusCode: number; +} + +export interface ApiError { + statusCode: number; + statusMessage: string; +} + +export class BucketsApi { + constructor(); + + createBucket(postBuckets: object, opts: object, credentials: AuthToken): Promise; + deleteBucket(bucketKey: string, credentials: AuthToken): Promise; + getBucketDetails(bucketKey: string, credentials: AuthToken): Promise; + getBuckets(options: object, credentials: AuthToken): Promise; +} + +export class HubsApi { + constructor(); + + getHub(hubId: string, opts: object, credentials: AuthToken): Promise; + getHubs(opts: object, credentials: AuthToken): Promise; + getHubProjects(hubId: string, opts: object, credentials: AuthToken): Promise; +} + +export class FoldersApi { + constructor(); + + getFolderContents(projectId: string, folderId: string, opts: object, credentials: AuthToken): Promise; +} + +export interface JobPayload { + input: JobPayloadInput; + output: JobPayloadOutput; +} + +export interface JobPayloadInput { + urn: string; + compressedUrn?: boolean; + rootFilename?: string; +} + +export interface JobPayloadOutput { + formats: JobPayloadItem[]; +} + +export interface JobPayloadItem { + type: string; + views?: string[]; + advanced?: { + applicationProtocol: string; + tolerance: number; + }; + format?: string; + exportColor?: boolean; + exportFileStructure?: string; +} + +export class DerivativesApi { + constructor(); + + deleteManifest(urn: string, credentials: AuthToken): Promise; + getDerivativeManifest(urn: string, derivativeUrn: string, opts: object, credentials: AuthToken): Promise; + getFormats(opts: object, credentials: AuthToken): Promise; + getManifest(urn: string, opts: object, credentials: AuthToken): Promise; + getMetadata(urn: string, opts: object, credentials: AuthToken): Promise; + getModelviewMetadata(urn: string, guid: string, opts: object, credentials: AuthToken): Promise; + getModelviewProperties(urn: string, guid: string, opts: object, credentials: AuthToken): Promise; + getThumbnail(urn: string, opts: object, credentials: AuthToken): Promise; + translate(job: JobPayload, opts: { xAdsForce?: boolean }, credentials: AuthToken): Promise; +} + +export interface Credentials { + client_id: string; + client_secret: string; + grant_type: string; + scope?: string; +} + +export interface AuthToken { + access_token: string; + expires_in: number; + token_type: string; + refresh_token?: string; +} + +export namespace Dm { + interface BucketResponse { + bucketKey: string; + bucketOwner: string; + createdDate: number; + permissions: Array<{ + access: string; + authId: string; + }>; + policyKey: string; + } + + interface ItemResponse { + data: any[]; + included: Item[]; + jsonapi: { + version: string; + }; + links: any; + } + + interface Item { + attributes: { + createTime: string; + createUserId: string; + displayName: string; + extension: object; + fileType: string; + lastModifiedTime: string; + lastModifiedUserId: string; + mimeType: string; + name: string; + storageSize: number; + versionNumber: number; + }; + id: string; + links: { + self: { + href: string; + }; + }; + relationships: { + derivatives: { + data: { + id: string; + }, + meta: { + link: { + href: string; + } + } + }, + item: any; + refs: any; + storage: { + data: { + id: string; + type: string; + } + }; + thumbnail: any; + }; + type: string; + } +} diff --git a/types/forge-apis/tsconfig.json b/types/forge-apis/tsconfig.json new file mode 100644 index 0000000000..3e026ae2b1 --- /dev/null +++ b/types/forge-apis/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", + "forge-apis-tests.ts" + ] +} diff --git a/types/forge-apis/tslint.json b/types/forge-apis/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/forge-apis/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/forge-viewer/README.md b/types/forge-viewer/README.md new file mode 100644 index 0000000000..50bc407084 --- /dev/null +++ b/types/forge-viewer/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/forge-viewer` + +# Summary +This package contains type definitions for Autodesk Forge Viewer.js Library (https://forge.autodesk.com/en/docs/viewer/v6/reference/javascript/viewer3d/). + +# Details +These are for our Model Visualization library Viewer.js which at the moment can only be loaded externally from our CDN via script tags so the library itself is not a NPM package at the moment. + +Additional Details + * Last updated: Wed, 23 Jan 2019 10:39:13 GMT + * Dependencies: @types/three + * Global values: none + +# Credits +Forge Partner Development diff --git a/types/forge-viewer/index.d.ts b/types/forge-viewer/index.d.ts new file mode 100644 index 0000000000..2834f2e4c1 --- /dev/null +++ b/types/forge-viewer/index.d.ts @@ -0,0 +1,490 @@ +// Type definitions for Forge Viewer 6.3 +// Project: https://forge.autodesk.com/en/docs/viewer/v6/reference/javascript/viewer3d/ +// Definitions by: Autodesk Forge Partner Development +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +// Copyright (c) Autodesk, Inc. All rights reserved +// +// Permission to use, copy, modify, and distribute this software in +// object code form for any purpose and without fee is hereby granted, +// provided that the above copyright notice appears in all copies and +// that both that copyright notice and the limited warranty and +// restricted rights notice below appear in all supporting +// documentation. +// +// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. +// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF +// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. +// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE +// UNINTERRUPTED OR ERROR FREE. +// +/// + +declare namespace Autodesk { + namespace Viewing { + // events + let ESCAPE_EVENT: string; + let PROGRESS_UPDATE_EVENT: string; + let FULLSCREEN_MODE_EVENT: string; + let NAVIGATION_MODE_CHANGED_EVENT: string; + let VIEWER_STATE_RESTORED_EVENT: string; + let VIEWER_RESIZE_EVENT: string; + let VIEWER_UNINITIALIZED: string; + let MODEL_ROOT_LOADED_EVENT: string; + let GEOMETRY_LOADED_EVENT: string; + let TOOLBAR_CREATED_EVENT: string; + let OBJECT_TREE_CREATED_EVENT: string; + let OBJECT_TREE_UNAVAILABLE_EVENT: string; + let MODEL_UNLOADED_EVENT: string; + let SELECTION_CHANGED_EVENT: string; + let AGGREGATE_SELECTION_CHANGED_EVENT: string; + let ISOLATE_EVENT: string; + let HIDE_EVENT: string; + let SHOW_EVENT: string; + let HIGHLIGHT_EVENT: string; + let CAMERA_CHANGE_EVENT: string; + let EXPLODE_CHANGE_EVENT: string; + let CUTPLANES_CHANGE_EVENT: string; + let TOOL_CHANGE_EVENT: string; + let RENDER_OPTION_CHANGED_EVENT: string; + let LAYER_VISIBILITY_CHANGED_EVENT: string; + let RESET_EVENT: string; + let ANIMATION_READY_EVENT: string; + + enum SelectionMode { + LEAF_OBJECT, + FIRST_OBJECT, + LAST_OBJECT + } + + let theExtensionManager: ExtensionManager; + + interface InitializerOptions { + env?: string; + language?: string; + webGLHelpLink?: string; + getAccessToken?(callback?: (accessToken: string, expires: number) => void): void; + refreshToken?(callback?: (accessToken: string, expires: number) => void): void; + } + + function Initializer(options: InitializerOptions, callback?: () => void): void; + + class Document { + static load(documentId: string, successCallback: (doc: Document) => void, + errorCallback: (errorCode: number, errorMsg: string, messages: any[]) => void, accessControlProperties: any): void; + static getSubItemsWithProperties(item: object, properties: Properties, recursive: boolean): object[]; + + acmSessionId: string; + + getRootItem(): object; + getViewablePath(item: object): string; + } + + class Extension { + viewer: Private.GuiViewer3D; + options: any; + constructor(viewer: Private.GuiViewer3D, options: any); + + load(): boolean; + unload(): boolean; + } + + class ExtensionManager { + registerExtension(extensionId: string, extension: any): boolean; + unregisterExtension(extensionId: string): boolean; + + getExtension(extensionId: string): any; + } + + class InstanceTree { + maxDepth: number; + nodeAccess: InstanceTreeAccess; + numHidden: number; + numOff: number; + objectCount: number; + + enumNodeChildren(node: any, callback: (dbId: number) => void, recursive?: boolean): void; + enumNodeFragments(node: any, callback: (fragId: number) => void, recursive?: boolean): void; + getChildCount(dbId: number): number; + getNodeBox(dbId: number, nodeBox: Float32Array): void; + getNodeParentId(dbId: number): number; + getRootId(): number; + setFlagGlobal(flag: any, value: any): void; + setFlagNode(dbId: number, flag: any, value: any): boolean; + } + + class InstanceTreeAccess { + children: any; + dbIdToIndex: any; + nameSuffixes: any; + names: any; + nodeBoxes: any; + nodes: any; + numNodes: number; + rootId: number; + strings: string[]; + visibleIds: number; + } + + interface InstanceTreeNode { + dbId: number; + name: string; + fragments: number[]; + children: InstanceTreeNode[]; + } + + class Model { + getBoundingBox(): THREE.Box3; + getBulkProperties(dbIds: number[], propFilter?: string[], successCallback?: (r: any) => void, errorCallback?: (err: any) => void): void; + getData(): any; + getFragmentList(): any; + getObjectTree(successCallback?: (result: InstanceTree) => void, errorCallback?: (err: any) => void): void; + getProperties(dbId: number, successCallback?: (r: PropertyResult) => void, errorCallback?: (err: any) => void): void; + getUnitScale(): number; + getUnitString(): number; + + search(text: string, successCallback: (r: number[]) => void, errorCallback?: (err: any) => void, attributeNames?: string[]): void; + clearThemingColors(): void; + + getInstanceTree(): InstanceTree; + visibilityManager: Private.VisibilityManager; + } + + interface PropertyResult { + dbId: number; + externalId?: string; + name?: string; + properties: Property[]; + } + + interface Property { + displayCategory: string; + displayName: string; + displayValue: string; + hidden: boolean; + type: number; + units: string; + } + + class Navigation { + getCamera(): any; + getEyeVector(): THREE.Vector3; + getFovMin(): number; + getFovMax(): number; + getPivotPoint(): THREE.Vector3; + setPivotPoint(pivot: THREE.Vector3): void; + getPosition(): THREE.Vector3; + setPosition(pos: THREE.Vector3): void; + getTarget(): THREE.Vector3; + setTarget(target: THREE.Vector3): void; + getScreenViewport(): ClientRect; + setScreenViewport(viewport: ClientRect): void; + setView(position: THREE.Vector3, target: THREE.Vector3): void; + setCameraUpVector(up: THREE.Vector): void; + } + + interface Properties { + type: string; + role: string; + } + + class ToolController { + activateTool(name: string): boolean; + deactivateTool(name: string): boolean; + registerTool(tool: any): boolean; + deregisterTool(tool: any): boolean; + getToolNames(): string[]; + getActiveToolName(): string; + } + + interface ToolInterface { + getCursor?(): string; + getName(): string; + getNames(): string[]; + register(): void; + deregister(): void; + activate(name: string, viewerApi?: Private.GuiViewer3D): void; + deactivate(name: string): void; + update(): boolean; + handleSingleClick?(event: MouseEvent, button: number): boolean; + handleDoubleClick?(event: MouseEvent, button: number): boolean; + handleSingleTap?(event: Event): boolean; + handleDoubleTap?(event: Event): boolean; + handleKeyDown?(event: KeyboardEvent, keyCode: number): boolean; + handleKeyUp?(event: KeyboardEvent, keyCode: number): boolean; + handleWheelInput?(delta: number): boolean; + handleButtonDown?(event: MouseEvent, button: number): boolean; + handleButtonUp?(event: MouseEvent, button: number): boolean; + handleMouseMove?(event: MouseEvent): boolean; + handleGesture?(event: Event): boolean; + handleBlur?(event: Event): boolean; + handleResize?(): void; + } + + class UnifiedCamera { + } + + interface ContextMenuCallbackStatus { + hasHidden: boolean; + hasSelected: boolean; + hasVisible: boolean; + numSelected: number; + } + + interface ContextMenuItem { + target: () => void; + title: string; + } + + class Viewer3D { + id: number; + + clearSelection(): void; + clearThemingColors(model: any): void; + clientToWorld(point: THREE.Vector3): THREE.Vector3; + createViewCube(): void; + displayViewCube(display: boolean): void; + fitToView(objectIds?: number[], model?: Model): boolean; + getHiddenNodes(): number[]; + getIsolatedNodes(): number[]; + getSelection(): number[]; + getSelectionCount(): number; + getSelectionVisibility(): { hasVisible: boolean, hasHidden: boolean }; + getState(filter?: any): any; + hide(node: number | number[]): void; + hideById(node: number): void; + isolate(node: number | number[]): void; + isolateById(dbIds: number | number[]): void; + registerContextMenuCallback(id: string, callback: (menu: ContextMenuItem[], status: ContextMenuCallbackStatus) => void): void; + resize(): void; + restoreState(state: any, filter?: any, immediate?: boolean): boolean; + search(text: string, successCallback: (r: number[]) => void, errorCallback: (err: any) => void, attributeNames?: string[]): void; + select(dbIds: number | number[]): void; + setCutPlanes(planes: THREE.Vector4[]): void; + setSelectionMode(mode: SelectionMode): void; + setThemingColor(dbId: number, color: THREE.Vector4, model?: any): void; + setUp(config?: any): void; + setViewCube(face: string): void; + show(node: number | number[]): void; + showAll(): void; + tearDown(): void; + toggleSelect(dbid: number): void; + unregisterContextMenuCallback(id: string): void; + worldToClient(point: THREE.Vector3): THREE.Vector3; + } + + class ViewingUtilities { + getHitPoint(x: number, y: number): THREE.Vector3; + } + + namespace Private { + function getHtmlTemplate(url: string, callback: (error: string, content: string) => void): void; + + class GuiViewer3D extends Viewer3D { + constructor(container: HTMLElement, config?: object); + + canvas: HTMLCanvasElement; + container: Element; + toolController: ToolController; + impl: Viewer3DImpl; + model: Model; + navigation: Navigation; + + getCamera(): UnifiedCamera; + getToolbar(create: boolean): UI.ToolBar; + initialize(): any; + load(urn: string, sharedPropertyDbPath?: string, onSuccesfullCallback?: () => void, + onErrorCallback?: (errorCode: number, errorMessage: string, statusCode: number, statusText: string) => void): any; + loadModel(urn: string, options?: any, onSuccesfullCallback?: () => void, + onErrorCallback?: (errorCode: number, errorMessage: string, statusCode: number, statusText: string) => void): any; + start(path?: string, options?: object): any; + finish(): any; + setUsePivotAlways(value: boolean): any; + + setGroundShadow(param: boolean): void ; + setGroundReflection(param: boolean): void ; + setOptimizeNavigation(param: boolean): void ; + setQualityLevel(useSAO: boolean, useFXAA: boolean): void; + + loadExtension(extensionId: string, options?: object): boolean; + unloadExtension(extensionId: string): boolean; + getExtension(extensionId: string): Extension; + + addPanel(panel: UI.DockingPanel): boolean; + removePanel(panel: UI.DockingPanel): boolean; + resizePanels(options: any): void; + + addEventListener(event: string, callback: (event: any) => void, useCapture?: boolean): void; + removeEventListener(event: string, callback: (event: any) => void, useCapture?: boolean): void; + } + + interface HitTestResult { + dbId: number; + face: THREE.Face3; + fragId: number; + intersectPoint: THREE.Vector3; + model: Model; + } + + namespace HudMessage { + function displayMessage(container: Element, messageSpec: { + msgTitleKey: string, + msgTitleDefault?: string, + messageKey: string, + messageDefaultValue?: string, + buttonText?: string, + checkboxChecked?: boolean + }, closeCallback?: (event: any) => void, buttonCallback?: (event: any) => void, checkboxCallback?: (event: any) => void): void; + + function dismiss(): boolean; + } + + class Viewer3DImpl { + constructor(thecanvas: any, theapi: any); + + visibilityManager: VisibilityManager; + + clientToViewport(clientX: number, clientY: number): THREE.Vector3; + hitTest(clientX: number, clientY: number, ignoreTransparent: boolean): HitTestResult; + hitTestViewport(vpVec: THREE.Vector3, ignoreTransparent: boolean): HitTestResult; + initialize(): void; + setLightPreset(index: number, force?: boolean): void; + viewportToClient(viewportX: number, viewportY: number): THREE.Vector3; + + getMaterials(): any; + getRenderProxy(model: Model, fragId: number): any; + sceneUpdated(param: boolean): void; + } + + class VisibilityManager { + constructor(viewerImpl: any, model: any); + + getHiddenNodes(): any; + getInstanceTree(): InstanceTree; + getIsolatedNodes(): any; + hide(node: number | object): void; + isNodeVisible(dbId: number): boolean; + isolate(node: number | object): void; + isolateMultiple(nodeList: any[]): void; + isolateNone(): void; + setAllVisibility(visible: boolean): void; + setVisibilityOnNode(node: number | object, visible: boolean): void; + setNodeOff(node: number | object, isOff: boolean): void; + show(node: number | object): void; + toggleVisibility(node: number | object): void; + updateNodeVisibilityTracking(node: number | object, visible: boolean): void; + } + } + + namespace UI { + class Control { + container: HTMLElement; + + getId(): string; + isCollapsed(): boolean; + setCollapsed(collappsed: boolean): boolean; + setToolTip(toolTipText: string): void; + getToolTip(): string; + isVisible(): boolean; + setVisible(visible: boolean): boolean; + } + + class Button extends Control { + constructor(id: string, options?: any); + + setIcon(iconClass: string): void; + getState(): Button.State; + setState(state: Button.State): boolean; + onClick(event: MouseEvent): void; + onMouseOver(event: MouseEvent): void; + onMouseOut(event: MouseEvent): void; + } + + // NOTE: TypeScript doesn't support enum inside class + namespace Button { + enum State { ACTIVE, INACTIVE, DISABLED } + } + + class ControlGroup extends Control { + constructor(id: string, options?: any); + + addClass(name: string): void; + addControl(control: Control, options?: any): any; + removeControl(control: Control | string): any; + getControl(controlId: string): Control; + getNumberOfControls(): number; + } + + class ToolBar extends ControlGroup { + addEventListener(event: string, callback: () => void): void; + getDimensions(): { width: number, height: number }; + } + + namespace ToolBar { + interface Event { + SIZE_CHANGED: string; + CONTROL_REMOVED: string; + CONTROL_ADDED: string; + COLLAPSED_CHANGED: string; + VISIBILITY_CHANGED: string; + } + } + + interface ClientRect { + bottom: number; + height: number; + left: number; + right: number; + top: number; + width: number; + } + + interface ContentSize { + height: number; + width: number; + } + + class DockingPanel { + constructor(parentContainer: any, id: string, title: string, options?: any); + + closer: HTMLElement; + container: any; + content: any; + id: string; + scrollContainer: HTMLElement; + title: string; + titleTable: string; + + initialize(): void; + uninitialize(): void; + setVisible(show: boolean): void; + isVisible(): boolean; + getContentSize(): ContentSize; + resizeToContent(): void; + getContainerBoundingRect(): ClientRect; + setTitle(text: string, options: any): void; + createCloseButton(): HTMLElement; + createScrollContainer(options: { + heightAdjustment?: number; + left?: boolean; + marginTop?: number; + }): void; + initializeMoveHandlers(mover: HTMLElement): void; + initializeCloseHandler(close: HTMLElement): void; + + visibilityChanged(): void; + onStartMove(event: MouseEvent, startX: number, startY: number): void; + onEndMove(event: MouseEvent, endX: number, endY: number): void; + onMove(event: MouseEvent, currentX: number, currentY: number): void; + onTitleClick(event: Event): void; + onTitleDoubleClick(event: Event): void; + + addVisibilityListener(callback: (state: boolean) => void): void; + + addEventListener(target: object, eventId: string, callback: (event: any) => void): void; + removeEventListener(target: object, eventId: string, callback: (event: any) => void): boolean; + } + } + } +} diff --git a/types/forge-viewer/tsconfig.json b/types/forge-viewer/tsconfig.json new file mode 100644 index 0000000000..fe1ad377b9 --- /dev/null +++ b/types/forge-viewer/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} diff --git a/types/forge-viewer/tslint.json b/types/forge-viewer/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/forge-viewer/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/frisby/frisby-tests.ts b/types/frisby/frisby-tests.ts index d0bb27ff20..65a7315790 100644 --- a/types/frisby/frisby-tests.ts +++ b/types/frisby/frisby-tests.ts @@ -18,4 +18,9 @@ describe('Test Suite 1', () => { .expect('status', 418) .done(done); }); + + it('should handle jest matchers', () => { + const str = 'bar'; + expect(str).toHaveLength(3); + }); }); diff --git a/types/frisby/index.d.ts b/types/frisby/index.d.ts index 1bcd6fdabb..85151daa68 100644 --- a/types/frisby/index.d.ts +++ b/types/frisby/index.d.ts @@ -5,7 +5,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -/// +/// // #region Imports export import nodeFetch = require('node-fetch'); // Import all definitions from node-fetch. diff --git a/types/ganache-core/index.d.ts b/types/ganache-core/index.d.ts index 07d0892f24..f96bbf128a 100644 --- a/types/ganache-core/index.d.ts +++ b/types/ganache-core/index.d.ts @@ -16,5 +16,6 @@ export interface GanacheOpts { mnemonic?: string; gasLimit?: number; vmErrorsOnRPCResponse?: boolean; + db_path?: string; } export function provider(opts: GanacheOpts): Provider; diff --git a/types/gapi.auth2/gapi.auth2-tests.ts b/types/gapi.auth2/gapi.auth2-tests.ts index 1fc03f7f4f..229a18f5fc 100644 --- a/types/gapi.auth2/gapi.auth2-tests.ts +++ b/types/gapi.auth2/gapi.auth2-tests.ts @@ -144,7 +144,8 @@ function handleSignoutClick(event: MouseEvent) { // Load the API and make an API call. Display the results on the screen. function makeApiCall() { gapi.client.people.people.get({ - resourceName: 'people/me' + resourceName: 'people/me', + personFields: 'names' }).then((resp) => { const p = document.createElement('p'); const name = resp.result.names[0].givenName; diff --git a/types/gapi.client.drive/index.d.ts b/types/gapi.client.drive/index.d.ts index 1b2a939a7d..ca28f228e7 100644 --- a/types/gapi.client.drive/index.d.ts +++ b/types/gapi.client.drive/index.d.ts @@ -1042,6 +1042,8 @@ declare namespace gapi.client { }): Request; /** Creates a new file. */ create(request: { + /** Resource Parameter for folder creation */ + resource?: any; /** Data format for the response. */ alt?: string; /** Selector specifying which fields to include in a partial response. */ diff --git a/types/gapi.people/gapi.people-tests.ts b/types/gapi.people/gapi.people-tests.ts index 65b6339765..349f956b39 100644 --- a/types/gapi.people/gapi.people-tests.ts +++ b/types/gapi.people/gapi.people-tests.ts @@ -64,6 +64,7 @@ var request = gapi.client.people.people.connections.list({ 'resourceName': 'people/me', 'pageSize': 10, + 'personFields': 'names' }); request.execute(function(resp) { diff --git a/types/gapi.people/index.d.ts b/types/gapi.people/index.d.ts index 851eab2c0b..d39dc0b875 100644 --- a/types/gapi.people/index.d.ts +++ b/types/gapi.people/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Google People API 1.0 // Project: https://developers.google.com/people/ // Definitions by: Tanguy Krotoff +// Joshua O'Brien // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -13,7 +14,7 @@ declare namespace gapi.client.people { resourceName: string; // Query parameters - requestMask?: RequestMask; + personFields: string; } function get(parameters: GetParameters): HttpRequest; @@ -21,7 +22,7 @@ declare namespace gapi.client.people { interface GetBatchGetParameters { // Query parameters resourcesName?: string; - requestMask?: RequestMask; + personFields: string; } function getBatchGet(parameters: GetBatchGetParameters): HttpRequest; @@ -49,7 +50,7 @@ declare namespace gapi.client.people { pageSize?: number; sortOrder?: SortOrder; syncToken?: string; - requestMask?: RequestMask; + personFields: string; } interface Response { @@ -60,10 +61,6 @@ declare namespace gapi.client.people { } } - interface RequestMask { - includeField: string; - } - type SourceType = 'SOURCE_TYPE_UNSPECIFIED' | 'ACCOUNT' | 'PROFILE' | 'DOMAIN_PROFILE' | 'CONTACT'; interface Source { diff --git a/types/gapi/gapi-tests.ts b/types/gapi/gapi-tests.ts index 7c5308aaf9..0de37fdccb 100644 --- a/types/gapi/gapi-tests.ts +++ b/types/gapi/gapi-tests.ts @@ -20,7 +20,8 @@ https://developers.google.com/api-client-library/javascript/reference/referenced }).then(function() { // 3. Initialize and make the API request. return gapi.client.people.people.get({ - resourceName: 'people/me' + resourceName: 'people/me', + personFields: 'name' }); }).then(function(response) { console.log(response.result); diff --git a/types/gdal/gdal-tests.ts b/types/gdal/gdal-tests.ts new file mode 100644 index 0000000000..d30c83d571 --- /dev/null +++ b/types/gdal/gdal-tests.ts @@ -0,0 +1,78 @@ +import * as gdal from 'gdal'; + +// gdal.checksumImage(srcRasterBand, 0, 0, 512, 512); + +gdal.config.get('GDAL_DATA'); +gdal.config.set('GDAL_DATA', 'C:\\warmerda\\bld\\data'); + +/*gdal.contourGenerate({ + src: srcRasterBand, + dst: dstRasterBand +});*/ + +gdal.decToDMS(60, 'lat'); +gdal.decToDMS(60, 'lat', 2); + +/*gdal.fillNodata({ + +});*/ + +let creationOptionsArray: string[]; +creationOptionsArray = ['VRT_CREATION_OPTION=...']; +let creationOptionsObject: object; +creationOptionsObject = { + VRT_CREATION_OPTION: '...' +}; +gdal.open('C:\\datasets\\ogr.shp'); +gdal.open('C:\\datasets\\ogr.shp', 'r'); +gdal.open('C:\\datasets\\ogr.shp', 'r', 'ESRI Shapefile'); +gdal.open('C:\\datasets\\ogr.shp', 'r', ['ESRI Shapefile']); +gdal.open('C:\\datasets\\ogr.shp', 'r+'); +gdal.open('C:\\datasets\\ogr.shp', 'r+', 'ESRI Shapefile'); +gdal.open('C:\\datasets\\ogr.shp', 'r+', ['ESRI Shapefile']); +gdal.open('C:\\datasets\\raster.vrt', 'w', 'VRT'); +gdal.open('C:\\datasets\\raster.vrt', 'w', 'VRT', 512, 512, 3, 1, creationOptionsArray); +gdal.open('C:\\datasets\\raster.vrt', 'w', 'VRT', 512, 512, 3, 1, creationOptionsObject); +gdal.open('C:\\datasets\\raster.vrt', 'w', ['VRT']); +gdal.open('C:\\datasets\\raster.vrt', 'w', ['VRT'], 512, 512, 3, 1, creationOptionsArray); +gdal.open('C:\\datasets\\raster.vrt', 'w', ['VRT'], 512, 512, 3, 1, creationOptionsObject); + +/*let polygonizeOptions: gdal.PolygonizeOptions; +polygonizeOptions = { + src: srcRasterBand, + dst: dstRasterBand, + connectedness: 1, + mask: maskRasterBand, + pixValField: 1, + useFloats: true +}; +gdal.polygonize(polygonizeOptions); +gdal.polygonize({ + src: srcRasterBand, + dst: dstRasterBand, + pixValField: 1 +});*/ + +gdal.quiet(); + +/*let reprojectImageOptions: gdal.ReprojectImageOptions; +reprojectImageOptions = { + src: srcRasterBand, + dst: dstRasterBand, + s_srs: sourceSRS, + t_srs: targetSRS +}; +gdal.reprojectImage(reprojectImageOptions); +gdal.reprojectImage({ + +}); + +gdal.sieveFilter({ + +}); + +gdal.suggestedWarpOutput({ + +});*/ + +gdal.verbose(); diff --git a/types/gdal/index.d.ts b/types/gdal/index.d.ts new file mode 100644 index 0000000000..d6c76ba226 --- /dev/null +++ b/types/gdal/index.d.ts @@ -0,0 +1,707 @@ +// Type definitions for gdal 0.9 +// Project: https://github.com/naturalatlas/node-gdal#readme +// Definitions by: Andrei Digori +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +export as namespace gdal; + +/* Internal interfaces */ + +export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array; +export type Resampling = 'NEAREST' | 'GAUSS' | 'CUBIC' | 'AVERAGE' | 'MODE' | 'AVERAGE_MAGPHASE' | 'NONE'; + +export interface XY { + x: number; + y: number; +} + +export interface XYZ extends XY { + z: number; +} + +export interface EnvelopeBounds { + minX: number; + maxX: number; + minY: number; + maxY: number; +} + +export interface Envelope3DBounds extends EnvelopeBounds { + minZ: number; + maxZ: number; +} + +export interface RasterBandStatistics { + min: number; + max: number; + mean: number; + std_dev: number; +} + +export interface RasterBandPixelsWriteOptions { + buffer_width?: number; + buffer_height?: number; + pixel_space?: number; + line_space?: number; +} + +export interface RasterBandPixelsReadOptions { + buffer_width?: number; + buffer_height?: number; + pixel_space?: number; + line_space?: number; + data_type?: string; +} + +export interface ContourGenerateOptions { + src: RasterBand; + dst: Layer; + offset?: number; + interval?: number; + fixedLevels?: number[]; + nodata?: number; + idField?: number; + elevField?: number; +} + +export interface FillNoDataOptions { + src: RasterBand; + mask?: RasterBand; + searchDist: number; + smoothingIterations?: number; +} + +export interface PolygonizeOptions { + src: RasterBand; + dst: Layer; + mask?: RasterBand; + pixValField: number; + connectedness?: number; + useFloats?: boolean; +} + +export interface ReprojectImageOptions { + src: Dataset; + dst: Dataset; + s_srs: SpatialReference; + t_srs: SpatialReference; + resampling?: string; + cutline?: Geometry; + srcBands?: number[]; + dstBands?: number[]; + srcAlphaBand?: number; + dstAlphaBand?: number; + srcNodata?: number; + dstNodata?: number; + memoryLimit?: number; + maxError?: number; + multi?: boolean; + options?: string[] | object; +} + +export interface SieveFilterOptions { + src: RasterBand; + dst: RasterBand; + mask?: RasterBand; + threshold: number; + connectedness?: number; +} + +export interface SuggestedWarpOutputOptions { + src: Dataset; + s_srs: SpatialReference; + t_srs: SpatialReference; + maxError?: number; +} + +/* From API: https://naturalatlas.github.io/node-gdal/ */ + +/* Constants */ + +// CPL Error Codes +export const CPLE_AppDefined: number; +export const CPLE_AssertionFailed: number; +export const CPLE_FileIO: number; +export const CPLE_IllegalArg: number; +export const CPLE_None: number; +export const CPLE_NotSupported: number; +export const CPLE_NoWriteAccess: number; +export const CPLE_ObjectNull: number; +export const CPLE_OpenFailed: number; +export const CPLE_OutOfMemory: number; +export const CPLE_UserInterrupt: number; + +// CPL Error Levels +export const CE_Debug: number; +export const CE_Failure: number; +export const CE_Fatal: number; +export const CE_None: number; +export const CE_Warning: number; + +// DCAP +export const DCAP_CREATE: string; +export const DCAP_CREATECOPY: string; +export const DCAP_VIRTUALIO: string; + +// DMD +export const DMD_CREATIONDATATYPES: string; +export const DMD_CREATIONOPTIONLIST: string; +export const DMD_EXTENSION: string; +export const DMD_HELPTOPIC: string; +export const DMD_LONGNAME: string; +export const DMD_MIMETYPE: string; + +// GCI +export const GCI_AlphaBand: string; +export const GCI_BlackBand: string; +export const GCI_BlueBand: string; +export const GCI_CyanBand: string; +export const GCI_GrayIndex: string; +export const GCI_GreenBand: string; +export const GCI_HueBand: string; +export const GCI_LightnessBand: string; +export const GCI_MagentaBand: string; +export const GCI_PaletteIndex: string; +export const GCI_RedBand: string; +export const GCI_SaturationBand: string; +export const GCI_Undefined: string; +export const GCI_YCbCr_CbBand: string; +export const GCI_YCbCr_CrBand: string; +export const GCI_YCbCr_YBand: string; +export const GCI_YellowBand: string; + +// GDT +export const GDT_Byte: string; +export const GDT_CFloat32: string; +export const GDT_CFloat64: string; +export const GDT_CInt16: string; +export const GDT_CInt32: string; +export const GDT_Float32: string; +export const GDT_Float64: string; +export const GDT_Int16: string; +export const GDT_Int32: string; +export const GDT_UInt16: string; +export const GDT_UInt32: string; +export const GDT_Unknown: string; + +// GRA +export const GRA_Average: string; +export const GRA_Bilinear: string; +export const GRA_Cubic: string; +export const GRA_CubicSpline: string; +export const GRA_Lanczos: string; +export const GRA_Mode: string; +export const GRA_NearestNeighbor: string; + +// ODsC +export const ODrCCreateDataSource: string; +export const ODrCDeleteDataSource: string; +export const ODsCCreateGeomFieldAfterCreateLayer: string; +export const ODsCCreateLayer: string; +export const ODsCDeleteLayer: string; + +// OFT +export const OFTBinary: string; +export const OFTDate: string; +export const OFTDateTime: string; +export const OFTInteger: string; +export const OFTIntegerList: string; +export const OFTReal: string; +export const OFTRealList: string; +export const OFTString: string; +export const OFTStringList: string; +export const OFTTime: string; +export const OFTWideString: string; +export const OFTWideStringList: string; + +// OJ +export const OJLeft: string; +export const OJRight: string; +export const OJUndefined: string; + +// OLC +export const OLCAlterFieldDefn: string; +export const OLCCreateField: string; +export const OLCCreateGeomField: string; +export const OLCDeleteFeature: string; +export const OLCDeleteField: string; +export const OLCFastFeatureCount: string; +export const OLCFastGetExtent: string; +export const OLCFastSetNextByIndex: string; +export const OLCFastSpatialFilter: string; +export const OLCIgnoreFields: string; +export const OLCRandomRead: string; +export const OLCRandomWrite: string; +export const OLCReorderFields: string; +export const OLCSequentialWrite: string; +export const OLCStringsAsUTF8: string; +export const OLCTransactions: string; + +// wkbByteOrder +export const wkbNDR: string; +export const wkbXDR: string; + +// wkbGeometryType +export const wkb25DBit: number; +export const wkbGeometryCollection: number; +export const wkbGeometryCollection25D: number; +export const wkbLinearRing: string; +export const wkbLinearRing25D: number; +export const wkbLineString: number; +export const wkbLineString25D: number; +export const wkbMultiLineString: number; +export const wkbMultiLineString25D: number; +export const wkbMultiPoint: number; +export const wkbMultiPoint25D: number; +export const wkbMultiPolygon: number; +export const wkbMultiPolygon25D: number; +export const wkbNone: number; +export const wkbPoint: number; +export const wkbPoint25D: number; +export const wkbPolygon: number; +export const wkbPolygon25D: number; +export const wkbUnknown: number; + +// wkbVariant +export const wkbVariantIso: string; +export const wkbVariantOgc: string; +export const wkbVariantOldOgc: string; + +/* Classes and interfaces */ + +export class CoordinateTransformation { + constructor(source: SpatialReference, target: SpatialReference | Dataset); + transformPoint(x: number, y: number, z?: number): XYZ; +} + +export interface Dataset { + buildOverviews(resampling: Resampling, overviews: number[], bands?: number[]): void; + close(): void; + executeSQL(statement: string, spatial_filter?: Geometry, dialect?: string): Layer; + flush(): void; + getFileList(): string[]; + getGCPProjection(): string; + getGCPs(): object[]; + getMetadata(domain?: string): object; + setGCPs(gcps: object[], projection: string): void; + testCapability(capability: string): boolean; + + readonly bands: DatasetBands; + readonly description: string; + readonly driver: Driver; + geoTransform: number[]; + readonly layers: DatasetLayers; + readonly rasterSize: XY; + srs: SpatialReference; +} + +export interface DatasetBands { + count(): number; + create(dataType: number): RasterBand; + forEach(callback: (band: RasterBand, i: number) => void): void; + get(id: number): RasterBand; + map(callback: (band: RasterBand, i: number) => T): T[]; + + readonly ds: Dataset; +} + +export interface DatasetLayers { + copy(src_lyr_name: string, dst_lyr_name: string, options?: object | string[]): Layer; + count(): number; + create(name: string, srs: SpatialReference, geomType: number | Geometry, creation_options: string[] | object): Layer; + forEach(callback: (layer: Layer, i: number) => void): void; + get(key: string | number): Layer; + map(callback: (layer: Layer, i: number) => T): T[]; + remove(index: number): void; + + readonly ds: Dataset; +} + +export interface Driver { + copyFiles(name_old: string, name_new: string): void; + create(filename: string, x_size?: number, y_size?: number, band_count?: number, data_type?: number, creation_options?: string[] | object): Dataset; + createCopy(filename: string, src: Dataset, strict?: boolean, options?: string[] | object): Dataset; + deleteDataset(filename: string): void; + getMetadata(domain?: string): object; + open(path: string, mode?: 'r' | 'r+'): Dataset; + rename(new_name: string, old_name: string): void; + + readonly description: string; +} + +export class Envelope { + constructor(bounds: EnvelopeBounds); + contains(envelope: Envelope): boolean; + intersect(envelope: Envelope): void; + intersects(envelope: Envelope): boolean; + isEmpty(): boolean; + merge(envelope: Envelope): void; + toPolygon(): Polygon; +} + +export class Envelope3D extends Envelope { + constructor(bounds: Envelope3DBounds); +} + +export class Feature { + constructor(definition: Layer | FeatureDefn); + clone(): Feature; + destroy(): void; + equals(feature: Feature): boolean; + getFieldDefn(index: number): FieldDefn; + getGeometry(): Geometry; + setFrom(feature: Feature, index_map?: number[], forgiving?: boolean): void; + setGeometry(geometry: Geometry): void; + + readonly defn: FeatureDefn; + fid: number; + readonly fields: FeatureFields; +} + +export class FeatureDefn { + constructor(); + clone(): FeatureDefn; + + readonly fields: FeatureDefnFields; + geomIgnored: boolean; + geomType: number; + readonly name: string; + styleIgnored: boolean; +} + +export interface FeatureDefnFields { + add(field: FieldDefn | FieldDefn[]): void; + count(): number; + forEach(callback: (field: FieldDefn, i: number) => void): void; + get(key: string | number): FieldDefn; + getNames(): string[]; + indexOf(name: string): number; + map(callback: (field: FieldDefn, i: number) => T): T[]; + remove(key: string | number): void; + reorder(map: number[]): void; + + readonly featureDefn: FeatureDefn; +} + +export interface FeatureFields { + count(): number; + forEach(callback: (value: any, key: string) => void): void; + get(key: string | number): any; + getNames(): string[]; + indexOf(name: string): number; + map(callback: (value: any, key: string) => T): T[]; + reset(values: object, value: any): void; + set(key: string | number, value: any): void; + toArray(): any[]; + toJSON(): string; + toObject(): object; + + readonly feature: Feature; +} + +export class FieldDefn { + constructor(name: string, type: string); + + ignored: boolean; + justification: string; + name: string; + precision: number; + type: string; + width: number; +} + +export interface GDALDrivers { + count(): number; + forEach(callback: (driver: Driver, i: number) => void): void; + get(index: number | string): Driver; + getNames(): string[]; + map(callback: (driver: Driver, i: number) => T): T[]; +} + +export abstract class Geometry { + static create(type: number): Geometry; + static fromWKB(wkb: number, srs?: SpatialReference): Geometry; + static fromWKT(wkt: string, srs?: SpatialReference): Geometry; + static getConstructor(type: number): Geometry; + static getName(type: number): string; + + boundary(): Geometry; + buffer(distance: number, segments: number): Geometry; + centroid(): Point; + clone(): Geometry; + closeRings(): void; + contains(geometry: Geometry): boolean; + convexHull(): Geometry; + crosses(geometry: Geometry): boolean; + difference(geometry: Geometry): Geometry; + disjoint(geometry: Geometry): boolean; + distance(geometry: Geometry): number; + empty(): void; + equals(geometry: Geometry): boolean; + getEnvelope(): Envelope; + getEnvelope3D(): Envelope3D; + intersection(geometry: Geometry): Geometry; + intersects(geometry: Geometry): boolean; + isEmpty(): boolean; + isRing(): boolean; + isSimple(): boolean; + isValid(): boolean; + overlaps(geometry: Geometry): boolean; + segmentize(segment_length: number): number; + simplify(tolerance: number): Geometry; + simplifyPreserveTopology(tolerance: number): Geometry; + swapXY(): void; + symDifference(geometry: Geometry): Geometry; + toGML(): Geometry; + toJSON(): Geometry; + toKML(): Geometry; + toObject(): object; + touches(geometry: Geometry): boolean; + toWKB(byte_order?: string, variant?: string): Geometry; + toWKT(): Geometry; + transform(transformation: CoordinateTransformation): void; + transformTo(srs: SpatialReference): void; + union(geometry: Geometry): Geometry; + within(geometry: Geometry): boolean; + + readonly coordinateDimension: number; + readonly dimension: number; + readonly name: string; + srs: SpatialReference; + readonly wkbSize: number; + readonly wkbType: number; +} + +export class GeometryCollection extends Geometry { + getArea(): number; + getLength(): number; + + children: GeometryCollectionChildren; +} + +export interface GeometryCollectionChildren { + add(geometry: Geometry | Geometry[]): void; + count(): number; + forEach(callback: (geometry: Geometry, i: number) => void): void; + get(index: number): Geometry; + map(callback: (geometry: Geometry, i: number) => T): T[]; + remove(index: number): void; + toArray(): Geometry[]; + readonly layer: Layer; +} + +export interface Layer { + flush(): void; + getExtent(force?: boolean): Envelope; + getSpatialFilter(): Geometry; + setAttributeFilter(filter: string): void; + setSpatialFilter(filter: Geometry): void; + setSpatialFilter(minX: number, maxX: number, minY: number, maxY: number): void; + testCapability(capability: string): boolean; + readonly ds: Dataset; + readonly features: LayerFeatures; + readonly fidColumn: string; + readonly fields: LayerFields; + readonly geomColumn: string; + readonly geomType: number; + readonly name: string; + readonly srs: SpatialReference; +} + +export interface LayerFeatures { + add(feature: Feature): void; + count(force?: boolean): number; + first(): Feature; + forEach(callback: (feature: Feature, i: number) => void): void; + get(id: number): Feature; + map(callback: (feature: Feature, i: number) => T): T[]; + next(): Feature; + remove(id: number): void; + set(id: number, feature: Feature): void; + readonly layer: Layer; +} + +export interface LayerFields { + add(def: FieldDefn | FieldDefn[], approx?: boolean): void; + count(): number; + forEach(callback: (field: FieldDefn, i: number) => void): void; + fromJSON(object: object, approx_ok?: boolean): LayerFields; + get(field: string | number): FieldDefn; + getNames(): string[]; + indexOf(field: string): number; + map(callback: (field: FieldDefn, i: number) => T): T[]; + remove(field: string | number): void; + reorder(map: number[]): void; + readonly layer: Layer; +} + +export class LinearRing extends LineString { + getArea(): number; +} + +export class LineString extends Geometry { + addSubLineString(line: LineString, start?: number, end?: number): void; + getLength(): number; + value(distance: number): Point; + readonly points: LineStringPoints; +} + +export interface LineStringPoints { + add(point: Point | Point[]): void; + count(): number; + forEach(callback: (point: Point, i: number) => void): void; + get(index: number): Point; + map(callback: (point: Point, i: number) => T): T[]; + remove(index: number): void; + resize(count: number): void; + reverse(): void; + set(index: number, point: Point): void; + toArray(): Point[]; +} + +export class MultiLineString extends GeometryCollection { + polygonize(): Polygon; +} + +export class MultiPoint extends GeometryCollection {} + +export class MultiPolygon extends GeometryCollection { + getArea(): number; + unionCascaded(): Geometry; +} + +export class Point extends Geometry { + constructor(x: number, y: number, z?: number); + x: number; + y: number; + z: number; +} + +export class Polygon extends Geometry { + getArea(): number; + rings: PolygonRings; +} + +export interface PolygonRings { + add(ring: LinearRing | LinearRing[]): void; + count(): number; + forEach(callback: (ring: LinearRing, i: number) => void): void; + get(index: number): LinearRing; + map(callback: (ring: LinearRing, i: number) => T): T[]; + remove(index: number): void; + toArray(): LinearRing[]; + readonly layer: Layer; +} + +export interface RasterBand { + computeStatistics(allow_approximation: boolean): RasterBandStatistics; + createMaskBand(flags: number): void; + fill(real_value: number, imaginary_value?: number): void; + flush(): void; + getMaskBand(): RasterBand; + getMaskFlags(): number; + getMetadata(domain?: string): object; + getStatistics(allow_approximation: boolean, force: boolean): RasterBandStatistics; + setStatistics(min: number, max: number, mean: number, std_dev: number): void; + readonly blockSize: XY; + categoryNames: string[]; + colorInterpretation: string; + readonly dataType: string; + readonly description: string; + readonly ds: Dataset; + readonly hasArbitraryOverviews: boolean; + readonly id: number; + readonly maximum: number; + readonly minimum: number; + noDataValue: number; + offset: number; + readonly overviews: RasterBandOverviews; + readonly pixels: RasterBandPixels; + readonly readOnly: boolean; + scale: number; + readonly size: XY; + unitType: string; +} + +export interface RasterBandOverviews { + count(): number; + forEach(callback: (overviewBand: RasterBand, i: number) => void): void; + get(index: number): RasterBand; + getBySampleCount(samples: number): RasterBand; + map(callback: (overviewBand: RasterBand, i: number) => T): T[]; +} + +export interface RasterBandPixels { + get(x: number, y: number): number; + read(x: number, y: number, width: number, height: number, data?: TypedArray, options?: RasterBandPixelsReadOptions): TypedArray; + readBlock(x: number, y: number, data?: TypedArray): TypedArray; + set(x: number, y: number, value: number): void; + write(x: number, y: number, width: number, height: number, data: TypedArray, options?: RasterBandPixelsWriteOptions): void; + writeBlock(x: number, y: number, data: TypedArray): void; +} + +export class SpatialReference { + constructor(wkt?: string); + autoIdentifyEPSG(): void; + clone(): SpatialReference; + cloneGeogCS(): SpatialReference; + EPSGTreatsAsLatLong(): boolean; + EPSGTreatsAsNorthingEasting(): boolean; + getAngularUnits(): { value: any, unit: any }; + getAttrValue(node_name: string, attr_index?: number): string; + getAuthorityCode(target_key: string): string; + getAuthorityName(target_key: string): string; + getLinearUnits(): { value: any, unit: any }; + isCompound(): boolean; + isGeocentric(): boolean; + isGeographic(): boolean; + isLocal(): boolean; + isProjected(): boolean; + isSame(srs: SpatialReference): boolean; + isSameGeogCS(srs: SpatialReference): boolean; + isSameVertCS(srs: SpatialReference): boolean; + isVertical(): boolean; + morphFromESRI(): void; + morphToESRI(): void; + setWellKnownGeogCS(name: string): void; + toPrettyWKT(simplify?: boolean): string; + toProj4(): string; + toWKT(): string; + toXML(): string; + validate(): string; + static fromCRSURL(input: string): SpatialReference; + static fromEPSG(input: string): SpatialReference; + static fromEPSGA(input: number): SpatialReference; + static fromESRI(input: string[]): SpatialReference; + static fromMICoordSys(input: string): SpatialReference; + static fromProj4(input: string): SpatialReference; + static fromURL(url: string): SpatialReference; + static fromURN(input: string): SpatialReference; + static fromUserInput(input: string): SpatialReference; + static fromWKT(wkt: string): SpatialReference; + static fromWMSAUTO(input: string): SpatialReference; + static fromXML(input: string): SpatialReference; +} + +export namespace config { + function get(key: string): string; + function set(key: string, value: string): void; +} + +export const drivers: GDALDrivers; +export const lastError: { number: any, message: any, type: any }; +export const version: string; + +export function checksumImage(src: RasterBand, x?: number, y?: number, w?: number, h?: number): number; +export function contourGenerate(options: ContourGenerateOptions): void; +export function decToDMS(angle: number, axis: 'lat' | 'long', precision?: number): string; +export function fillNodata(options: FillNoDataOptions): void; +export function open(path: string, mode?: 'r' | 'r+' | 'w', drivers?: string | string[]): Dataset; +export function open(path: string, mode?: 'w', drivers?: string | string[], x_size?: number, y_size?: number, band_count?: number, data_type?: number, creation_options?: string[] | object): Dataset; +export function polygonize(options: PolygonizeOptions): void; +export function quiet(): void; +export function reprojectImage(options: ReprojectImageOptions): void; +export function sieveFilter(options: SieveFilterOptions): void; +export function suggestedWarpOutput(options: SuggestedWarpOutputOptions): { rasterSize: any, geoTransform: any }; +export function verbose(): void; diff --git a/types/gdal/tsconfig.json b/types/gdal/tsconfig.json new file mode 100644 index 0000000000..5c11132a33 --- /dev/null +++ b/types/gdal/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", + "gdal-tests.ts" + ] +} diff --git a/types/gdal/tslint.json b/types/gdal/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gdal/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/generic-pool/generic-pool-tests.ts b/types/generic-pool/generic-pool-tests.ts index 4b8a69aa93..28590def30 100644 --- a/types/generic-pool/generic-pool-tests.ts +++ b/types/generic-pool/generic-pool-tests.ts @@ -34,7 +34,7 @@ const opts = { priorityRange: 5, autostart: false, evictionRunIntervalMillis: 200, - numTestsPerRun: 3, + numTestsPerEvictionRun: 3, softIdleTimeoutMillis: 100, idleTimeoutMillis: 5000 }; diff --git a/types/generic-pool/index.d.ts b/types/generic-pool/index.d.ts index 0fd1f58b4b..6bb537e9ba 100644 --- a/types/generic-pool/index.d.ts +++ b/types/generic-pool/index.d.ts @@ -23,7 +23,7 @@ export class Pool extends EventEmitter { destroy(resource: T): PromiseLike; drain(): PromiseLike; clear(): PromiseLike; - use(cb: (resource: T) => U): PromiseLike; + use(cb: (resource: T) => U | PromiseLike): PromiseLike; isBorrowedResource(resource: T): boolean; } @@ -43,7 +43,7 @@ export interface Options { priorityRange?: number; autostart?: boolean; evictionRunIntervalMillis?: number; - numTestsPerRun?: number; + numTestsPerEvictionRun?: number; softIdleTimeoutMillis?: number; idleTimeoutMillis?: number; } diff --git a/types/geojson/geojson-tests.ts b/types/geojson/geojson-tests.ts index 4ea0f57a6f..82787c8c36 100644 --- a/types/geojson/geojson-tests.ts +++ b/types/geojson/geojson-tests.ts @@ -1,10 +1,10 @@ import { - BBox, Feature, FeatureCollection, GeometryCollection, LineString, - MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, GeometryObject + MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, GeoJsonGeometryTypes, + GeoJsonTypes, GeometryObject } from "geojson"; -let featureCollection: FeatureCollection = { +let featureCollection: FeatureCollection = { type: "FeatureCollection", features: [ { @@ -53,6 +53,17 @@ let featureCollection: FeatureCollection = { type: "Feature", bbox: [-180.0, -90.0, 180.0, 90.0], @@ -65,6 +76,11 @@ const featureWithPolygon: Feature = { properties: null }; +featureWithPolygon.type; // $ExpectType "Feature" +featureWithPolygon.geometry; // $ExpectType Polygon +featureWithPolygon.geometry.type; // $ExpectType "Polygon" +featureWithPolygon.geometry.coordinates; // $ExpectType number[][][] + const point: Point = { type: "Point", coordinates: [100.0, 0.0] @@ -135,6 +151,8 @@ let feature: Feature = { properties: null }; +feature.properties; // $ExpectType GeoJsonProperties + feature = { type: "Feature", geometry: polygon, @@ -275,12 +293,16 @@ const featureGeometryNull: Feature = { geometry: null }; +featureGeometryNull.properties.foo; // $ExpectType "bar" | "baz" + const featureNoNull: Feature = { type: "Feature", properties: testProps, geometry: point }; +featureNoNull.geometry.type; // $ExpectType "Point" + const collectionAllNull: FeatureCollection = { type: "FeatureCollection", features: [featureAllNull], @@ -301,6 +323,8 @@ const collectionGeometryMaybeNull: FeatureCollection features: [featureGeometryNull, featureNoNull], }; +collectionGeometryMaybeNull.features[0].geometry; // $ExpectType Point | null + const collectionNoNull: FeatureCollection = { type: "FeatureCollection", features: [featureNoNull], @@ -311,6 +335,9 @@ const collectionDefault: FeatureCollection = { features: [] }; +collectionDefault.features[0].geometry; // $ExpectType Geometry +collectionDefault.features[0].properties!.foo; // $ExpectType any + isNull = featureAllNull.geometry; isPoint = featurePropertyNull.geometry; isNull = featureAllNull.properties; diff --git a/types/geojson/index.d.ts b/types/geojson/index.d.ts index 93f66d3f27..db8074e242 100644 --- a/types/geojson/index.d.ts +++ b/types/geojson/index.d.ts @@ -4,6 +4,7 @@ // Arne Schubert // Jeff Jacobson // Ilia Choly +// Dan Vanderkam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -16,14 +17,13 @@ export as namespace GeoJSON; * The valid values for the "type" property of GeoJSON geometry objects. * https://tools.ietf.org/html/rfc7946#section-1.4 */ -export type GeoJsonGeometryTypes = "Point" | "LineString" | "MultiPoint" | "Polygon" | "MultiLineString" | - "MultiPolygon" | "GeometryCollection"; +export type GeoJsonGeometryTypes = Geometry['type']; /** * The value values for the "type" property of GeoJSON Objects. * https://tools.ietf.org/html/rfc7946#section-1.4 */ -export type GeoJsonTypes = "FeatureCollection" | "Feature" | GeoJsonGeometryTypes; +export type GeoJsonTypes = GeoJSON['type']; /** * Bounding box @@ -58,6 +58,10 @@ export interface GeoJsonObject { type: GeoJsonTypes; /** * Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. + * The value of the bbox member is an array of length 2*n where n is the number of dimensions + * represented in the contained geometries, with all axes of the most southwesterly point + * followed by all axes of the more northeasterly point. + * The axes order of a bbox follows the axes order of geometries. * https://tools.ietf.org/html/rfc7946#section-5 */ bbox?: BBox; @@ -69,24 +73,17 @@ export interface GeoJsonObject { export type GeoJSON = Geometry | Feature | FeatureCollection; /** - * A geometry object. - * https://tools.ietf.org/html/rfc7946#section-3 - */ -export interface GeometryObject extends GeoJsonObject { - type: GeoJsonGeometryTypes; -} - -/** - * Union of geometry objects. + * Geometry object. * https://tools.ietf.org/html/rfc7946#section-3 */ export type Geometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | GeometryCollection; +export type GeometryObject = Geometry; /** * Point geometry object. * https://tools.ietf.org/html/rfc7946#section-3.1.2 */ -export interface Point extends GeometryObject { +export interface Point extends GeoJsonObject { type: "Point"; coordinates: Position; } @@ -95,7 +92,7 @@ export interface Point extends GeometryObject { * MultiPoint geometry object. * https://tools.ietf.org/html/rfc7946#section-3.1.3 */ -export interface MultiPoint extends GeometryObject { +export interface MultiPoint extends GeoJsonObject { type: "MultiPoint"; coordinates: Position[]; } @@ -104,7 +101,7 @@ export interface MultiPoint extends GeometryObject { * LineString geometry object. * https://tools.ietf.org/html/rfc7946#section-3.1.4 */ -export interface LineString extends GeometryObject { +export interface LineString extends GeoJsonObject { type: "LineString"; coordinates: Position[]; } @@ -113,7 +110,7 @@ export interface LineString extends GeometryObject { * MultiLineString geometry object. * https://tools.ietf.org/html/rfc7946#section-3.1.5 */ -export interface MultiLineString extends GeometryObject { +export interface MultiLineString extends GeoJsonObject { type: "MultiLineString"; coordinates: Position[][]; } @@ -122,7 +119,7 @@ export interface MultiLineString extends GeometryObject { * Polygon geometry object. * https://tools.ietf.org/html/rfc7946#section-3.1.6 */ -export interface Polygon extends GeometryObject { +export interface Polygon extends GeoJsonObject { type: "Polygon"; coordinates: Position[][]; } @@ -131,7 +128,7 @@ export interface Polygon extends GeometryObject { * MultiPolygon geometry object. * https://tools.ietf.org/html/rfc7946#section-3.1.7 */ -export interface MultiPolygon extends GeometryObject { +export interface MultiPolygon extends GeoJsonObject { type: "MultiPolygon"; coordinates: Position[][][]; } @@ -140,7 +137,7 @@ export interface MultiPolygon extends GeometryObject { * Geometry Collection * https://tools.ietf.org/html/rfc7946#section-3.1.8 */ -export interface GeometryCollection extends GeometryObject { +export interface GeometryCollection extends GeoJsonObject { type: "GeometryCollection"; geometries: Geometry[]; } @@ -151,7 +148,7 @@ export type GeoJsonProperties = { [name: string]: any; } | null; * A feature object which contains a geometry and associated properties. * https://tools.ietf.org/html/rfc7946#section-3.2 */ -export interface Feature extends GeoJsonObject { +export interface Feature extends GeoJsonObject { type: "Feature"; /** * The feature's geometry @@ -172,7 +169,7 @@ export interface Feature extends GeoJsonObject { +export interface FeatureCollection extends GeoJsonObject { type: "FeatureCollection"; features: Array>; } diff --git a/types/geolite2/geolite2-tests.ts b/types/geolite2/geolite2-tests.ts new file mode 100644 index 0000000000..987fc917f4 --- /dev/null +++ b/types/geolite2/geolite2-tests.ts @@ -0,0 +1,5 @@ +import * as geolite2 from 'geolite2'; + +const asn = geolite2.paths.asn; // $ExpectType string +const city = geolite2.paths.city; // $ExpectType string +const country = geolite2.paths.country; // $ExpectType string diff --git a/types/geolite2/index.d.ts b/types/geolite2/index.d.ts new file mode 100644 index 0000000000..c79f623d86 --- /dev/null +++ b/types/geolite2/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for geolite2 1.2 +// Project: https://github.com/runk/node-geolite2#readme +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export namespace paths { + const asn: string; + const city: string; + const country: string; +} diff --git a/types/geolite2/tsconfig.json b/types/geolite2/tsconfig.json new file mode 100644 index 0000000000..2e3907e21c --- /dev/null +++ b/types/geolite2/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", + "geolite2-tests.ts" + ] +} diff --git a/types/geolite2/tslint.json b/types/geolite2/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/geolite2/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/gestalt/index.d.ts b/types/gestalt/index.d.ts index 162d61dd52..dd9ff81e41 100644 --- a/types/gestalt/index.d.ts +++ b/types/gestalt/index.d.ts @@ -359,7 +359,15 @@ export type Icons = | "sound" | "speech" | "speech-ellipsis" - | "tag"; + | "tag" + | "terms" + | "text-align-left" + | "text-align-center" + | "text-align-right" + | "twitter" + | "view-type-default" + | "view-type-dense" + | "view-type-list"; export interface IconProps { accessibilityLabel: string; diff --git a/types/get-certain/get-certain-tests.ts b/types/get-certain/get-certain-tests.ts new file mode 100644 index 0000000000..fde423095c --- /dev/null +++ b/types/get-certain/get-certain-tests.ts @@ -0,0 +1,9 @@ +import getCertain = require('get-certain'); + +const map = new Map(); + +map.set('foo', 1); + +// $ExpectType number +getCertain(map, 'foo'); +getCertain(map, 'bar', 'This map is barless.'); diff --git a/types/get-certain/index.d.ts b/types/get-certain/index.d.ts new file mode 100644 index 0000000000..bbde669d19 --- /dev/null +++ b/types/get-certain/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for get-certain 1.0 +// Project: https://github.com/wtgtybhertgeghgtwtg/get-certain#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = getCertain; + +declare function getCertain( + map: Map, + key: TKey, + message?: string +): TValue; diff --git a/types/get-certain/tsconfig.json b/types/get-certain/tsconfig.json new file mode 100644 index 0000000000..777807992c --- /dev/null +++ b/types/get-certain/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", + "get-certain-tests.ts" + ] +} diff --git a/types/get-certain/tslint.json b/types/get-certain/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/get-certain/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/get-emails/get-emails-tests.ts b/types/get-emails/get-emails-tests.ts new file mode 100644 index 0000000000..dbdad0f5a3 --- /dev/null +++ b/types/get-emails/get-emails-tests.ts @@ -0,0 +1,6 @@ +import getEmails = require('get-emails'); + +const text = 'Lorem ipsum dolor, sindresorhus@gmail.com consectetuer unicorn@rainbow.cake elit.'; + +// $ExpectType Set +getEmails(text); diff --git a/types/get-emails/index.d.ts b/types/get-emails/index.d.ts new file mode 100644 index 0000000000..2063abc878 --- /dev/null +++ b/types/get-emails/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for get-emails 2.1 +// Project: https://github.com/sindresorhus/get-emails#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = getEmails; + +declare function getEmails(text: string): Set; diff --git a/types/get-emails/tsconfig.json b/types/get-emails/tsconfig.json new file mode 100644 index 0000000000..3590ec5f4b --- /dev/null +++ b/types/get-emails/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", + "get-emails-tests.ts" + ] +} diff --git a/types/get-emails/tslint.json b/types/get-emails/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/get-emails/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/get-emoji/get-emoji-tests.ts b/types/get-emoji/get-emoji-tests.ts new file mode 100644 index 0000000000..fe196cbb92 --- /dev/null +++ b/types/get-emoji/get-emoji-tests.ts @@ -0,0 +1,7 @@ +import getEmoji, { emojiList } from 'get-emoji'; + +// $ExpectType string +getEmoji('rage'); + +// $ExpectType string[] +emojiList; diff --git a/types/get-emoji/index.d.ts b/types/get-emoji/index.d.ts new file mode 100644 index 0000000000..a596108872 --- /dev/null +++ b/types/get-emoji/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for get-emoji 2.0 +// Project: https://github.com/conorhastings/get-emoji +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export default function getEmoji(emojiName: string): string; +export const emojiList: string[]; diff --git a/types/get-emoji/tsconfig.json b/types/get-emoji/tsconfig.json new file mode 100644 index 0000000000..9b947e40e4 --- /dev/null +++ b/types/get-emoji/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", + "get-emoji-tests.ts" + ] +} diff --git a/types/get-emoji/tslint.json b/types/get-emoji/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/get-emoji/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/get-func-name/get-func-name-tests.ts b/types/get-func-name/get-func-name-tests.ts new file mode 100644 index 0000000000..3199af25d7 --- /dev/null +++ b/types/get-func-name/get-func-name-tests.ts @@ -0,0 +1,12 @@ +import getFuncName = require('get-func-name'); + +const unknownFunction = function myCoolFunction(word: string) { + return word + 'is cool'; +}; + +const anonymousFunction = (() => { + return () => {}; +})(); + +getFuncName(unknownFunction); // $ExpectType string +getFuncName(anonymousFunction); // $ExpectType string diff --git a/types/get-func-name/index.d.ts b/types/get-func-name/index.d.ts new file mode 100644 index 0000000000..f43bf3dd2a --- /dev/null +++ b/types/get-func-name/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for get-func-name 2.0 +// Project: https://github.com/chaijs/get-func-name#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = getFuncName; + +declare function getFuncName(fn: Function): string; // tslint:disable-line:ban-types diff --git a/types/get-func-name/tsconfig.json b/types/get-func-name/tsconfig.json new file mode 100644 index 0000000000..acb6f50f0e --- /dev/null +++ b/types/get-func-name/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", + "get-func-name-tests.ts" + ] +} diff --git a/types/get-func-name/tslint.json b/types/get-func-name/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/get-func-name/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/get-port/get-port-tests.ts b/types/get-port/get-port-tests.ts index 53a9e8e69b..5e47c33c1a 100644 --- a/types/get-port/get-port-tests.ts +++ b/types/get-port/get-port-tests.ts @@ -1,13 +1,10 @@ -import * as getPort from "get-port"; +import getPort = require('get-port'); -getPort().then(port => { - console.log(port); -}); - -getPort({ port: 3000 }).then(port => { - console.log(port); -}); - -getPort({ port: [3000, 3001] }).then(port => { - console.log(port); -}); +// $ExpectType Promise +getPort(); +// $ExpectType Promise +getPort({ port: 3000 }); +// $ExpectType Promise +getPort({ port: [3000, 3001] }); +// $ExpectType Promise +getPort({ host: 'foo.local' }); diff --git a/types/get-port/index.d.ts b/types/get-port/index.d.ts index f8adb4851e..9af3b311fc 100644 --- a/types/get-port/index.d.ts +++ b/types/get-port/index.d.ts @@ -1,9 +1,12 @@ // Type definitions for get-port 4.0 // Project: https://github.com/sindresorhus/get-port -// Definitions by: York Yao +// Definitions by: York Yao +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module "get-port" { - var getPort: (options?: { port?: number | ReadonlyArray, host?: string }) => PromiseLike - export = getPort; -} +declare function getPort(options?: { + port?: number | ReadonlyArray; + host?: string; +}): Promise; + +export = getPort; diff --git a/types/get-port/tsconfig.json b/types/get-port/tsconfig.json index c221d4e9fd..0d9f3a8975 100644 --- a/types/get-port/tsconfig.json +++ b/types/get-port/tsconfig.json @@ -2,12 +2,11 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "es6" ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -21,4 +20,4 @@ "index.d.ts", "get-port-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/get-port/tslint.json b/types/get-port/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/get-port/tslint.json +++ b/types/get-port/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/get-range/get-range-tests.ts b/types/get-range/get-range-tests.ts new file mode 100644 index 0000000000..b52e2fb90b --- /dev/null +++ b/types/get-range/get-range-tests.ts @@ -0,0 +1,11 @@ +import getRange = require('get-range'); + +for (const i of getRange(4)) { +} + +const r = getRange(0, 4, 2); +r.next().value; +r.next().value; + +getRange(0, -5); +getRange(0, -5, -1); diff --git a/types/get-range/index.d.ts b/types/get-range/index.d.ts new file mode 100644 index 0000000000..f0556da442 --- /dev/null +++ b/types/get-range/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for get-range 1.0 +// Project: https://github.com/sindresorhus/get-range#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = getRange; + +// tslint:disable:unified-signatures + +declare function getRange(stop: number): Iterator & Iterable; +declare function getRange( + start: number, + stop: number, + step?: number +): Iterator & Iterable; diff --git a/types/get-range/tsconfig.json b/types/get-range/tsconfig.json new file mode 100644 index 0000000000..f3ac944af9 --- /dev/null +++ b/types/get-range/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "get-range-tests.ts" + ] +} diff --git a/types/get-range/tslint.json b/types/get-range/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/get-range/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/get-urls/get-urls-tests.ts b/types/get-urls/get-urls-tests.ts new file mode 100644 index 0000000000..a901a2aac2 --- /dev/null +++ b/types/get-urls/get-urls-tests.ts @@ -0,0 +1,16 @@ +import getUrls = require('get-urls'); + +const text = + 'Lorem ipsum dolor sit amet, //sindresorhus.com consectetuer adipiscing http://yeoman.io elit.'; + +// $ExpectType Set +getUrls(text); + +// $ExpectType Set +getUrls(text, { extractFromQueryString: true }); + +// $ExpectType Set +getUrls(text, { exclude: ['foo'] }); + +// $ExpectType Set +getUrls(text, { defaultProtocol: 'ftp' }); diff --git a/types/get-urls/index.d.ts b/types/get-urls/index.d.ts new file mode 100644 index 0000000000..b62c32aa24 --- /dev/null +++ b/types/get-urls/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for get-urls 8.0 +// Project: https://github.com/sindresorhus/get-urls#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Options as NormalizeUrlOptions } from 'normalize-url'; + +export = getUrls; + +declare function getUrls(text: string, options?: getUrls.Options): Set; + +declare namespace getUrls { + interface Options extends NormalizeUrlOptions { + extractFromQueryString?: boolean; + exclude?: string[]; + } +} diff --git a/types/get-urls/tsconfig.json b/types/get-urls/tsconfig.json new file mode 100644 index 0000000000..fd5acf72bd --- /dev/null +++ b/types/get-urls/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", + "get-urls-tests.ts" + ] +} diff --git a/types/get-urls/tslint.json b/types/get-urls/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/get-urls/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/gfc/gfc-tests.ts b/types/gfc/gfc-tests.ts new file mode 100644 index 0000000000..d1deffaf32 --- /dev/null +++ b/types/gfc/gfc-tests.ts @@ -0,0 +1,43 @@ +import firstCommit = require('gfc'); + +firstCommit({ cwd: 'foo/bar' }); // $ExpectType Promise<{ stdout: string | Buffer; stderr: string | Buffer; }> +firstCommit({ exec: { encoding: 'buffer' } }); // $ExpectType Promise<{ stdout: string | Buffer; stderr: string | Buffer; }> +firstCommit({ exec: { input: 'foo' } }); // $ExpectError +firstCommit({ message: 'foo' }); // $ExpectType Promise<{ stdout: string | Buffer; stderr: string | Buffer; }> +firstCommit({ file: false }); // $ExpectType Promise<{ stdout: string | Buffer; stderr: string | Buffer; }> +firstCommit({ file: { path: 'foo' } }); // $ExpectType Promise<{ stdout: string | Buffer; stderr: string | Buffer; }> +firstCommit({ file: { path: 'foo', contents: 'bar' } }); // $ExpectType Promise<{ stdout: string | Buffer; stderr: string | Buffer; }> +firstCommit({ commit: false }); // $ExpectType Promise<{ stdout: string | Buffer; stderr: string | Buffer; }> +firstCommit({ forceFile: false }); // $ExpectType Promise<{ stdout: string | Buffer; stderr: string | Buffer; }> +firstCommit({ remote: 'foo' }); // $ExpectType Promise<{ stdout: string | Buffer; stderr: string | Buffer; }> +firstCommit({ push: false }); // $ExpectType Promise<{ stdout: string | Buffer; stderr: string | Buffer; }> + +firstCommit().then(res => { + res.stdout; // $ExpectType string | Buffer + res.stderr; // $ExpectType string | Buffer +}); +firstCommit('foo/bar').then(res => { + res.stdout; // $ExpectType string | Buffer + res.stderr; // $ExpectType string | Buffer +}); +firstCommit('foo/bar', { cwd: 'foo/bar' }).then(res => { + res.stdout; // $ExpectType string | Buffer + res.stderr; // $ExpectType string | Buffer +}); +// $ExpectType void +firstCommit('foo/bar', (err, stdout, stderr) => { + err; // $ExpectType ExecException | null + stdout; // $ExpectType string | Buffer + stderr; // $ExpectType string | Buffer +}); +// $ExpectType void +firstCommit('foo/bar', { cwd: 'foo/bar' }, (err, stdout, stderr) => { + err; // $ExpectType ExecException | null + stdout; // $ExpectType string | Buffer + stderr; // $ExpectType string | Buffer +}); + +firstCommit.sync(); // $ExpectType string | Buffer +firstCommit.sync('foo/bar'); // $ExpectType string | Buffer +firstCommit.sync('foo/bar', { exec: { input: 'foo' } }); // $ExpectType string | Buffer +firstCommit.sync({ exec: { input: 'foo' } }); // $ExpectType string | Buffer diff --git a/types/gfc/index.d.ts b/types/gfc/index.d.ts new file mode 100644 index 0000000000..6b5a1009d2 --- /dev/null +++ b/types/gfc/index.d.ts @@ -0,0 +1,54 @@ +// Type definitions for gfc 2.0 +// Project: https://github.com/jonschlinkert/gfc +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import { ExecOptions, ExecException, ExecSyncOptions } from 'child_process'; + +export = gitFirstCommit; + +declare function gitFirstCommit( + options?: gitFirstCommit.Options +): Promise<{ stdout: string | Buffer; stderr: string | Buffer }>; +declare function gitFirstCommit( + cwd: string, + options?: gitFirstCommit.Options +): Promise<{ stdout: string | Buffer; stderr: string | Buffer }>; +declare function gitFirstCommit( + cwd: string, + callback: ( + error: ExecException | null, + stdout: string | Buffer, + stderr: string | Buffer + ) => void +): void; +declare function gitFirstCommit( + cwd: string, + options: gitFirstCommit.Options, + callback: ( + error: ExecException | null, + stdout: string | Buffer, + stderr: string | Buffer + ) => void +): void; + +declare namespace gitFirstCommit { + function sync(options?: Options): string | Buffer; + function sync(cwd: string, options?: Options): string | Buffer; + + type ExecOptionsWithEncoding = { encoding?: BufferEncoding | 'buffer' | null } & ExecOptions; + + interface Options { + cwd?: string; + exec?: TExecOptions; + message?: string; + file?: { path: string; contents?: string } | false; + commit?: boolean; + forceFile?: boolean; + remote?: string; + push?: boolean; + } +} diff --git a/types/gfc/tsconfig.json b/types/gfc/tsconfig.json new file mode 100644 index 0000000000..bfed10e8ce --- /dev/null +++ b/types/gfc/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", + "gfc-tests.ts" + ] +} diff --git a/types/gfc/tslint.json b/types/gfc/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gfc/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/gijgo/index.d.ts b/types/gijgo/index.d.ts index 611373be11..07d97da01b 100644 --- a/types/gijgo/index.d.ts +++ b/types/gijgo/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Gijgo v1.9.6 +// Type definitions for Gijgo v1.9.12 // Project: http://gijgo.com // Definitions by: Atanas Atanasov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -262,6 +262,8 @@ declare module Types { modal?: boolean; header?: boolean; footer?: boolean; + showOnFocus?: boolean; + showRightIcon?: boolean; //Events change?: (e: any) => any; @@ -467,6 +469,7 @@ declare module Types { disable(node: any, cascade?: boolean) : Tree; enableAll() : Tree; disableAll() : Tree; + //parents(id: string): Array; getCheckedNodes() : Array; checkAll() : Tree; diff --git a/types/git-add-remote/git-add-remote-tests.ts b/types/git-add-remote/git-add-remote-tests.ts new file mode 100644 index 0000000000..8b9b844710 --- /dev/null +++ b/types/git-add-remote/git-add-remote-tests.ts @@ -0,0 +1,11 @@ +import addRemotePrepare = require('git-add-remote'); + +const addRemote = addRemotePrepare('foo/bar'); + +addRemote('foo', 'https://foo.git', (err, stdout, stderr) => { + err; // $ExpectType ExecException | null + stdout; // $ExpectType string + stderr; // $ExpectType string +}); + +addRemote.sync('foo', 'https://foo.git'); diff --git a/types/git-add-remote/index.d.ts b/types/git-add-remote/index.d.ts new file mode 100644 index 0000000000..21cdc2d67e --- /dev/null +++ b/types/git-add-remote/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for git-add-remote 1.0 +// Project: https://github.com/jonschlinkert/git-add-remote +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { ExecException } from 'child_process'; + +export = prepare; + +declare function prepare(cwd?: string): prepare.AddRemote; + +declare namespace prepare { + interface AddRemote { + ( + name: string, + url: string, + callback: (error: ExecException | null, stdout: string, stderr: string) => void + ): void; + + sync(name: string, url: string): void; + } +} diff --git a/types/git-add-remote/tsconfig.json b/types/git-add-remote/tsconfig.json new file mode 100644 index 0000000000..9abdd6bfe0 --- /dev/null +++ b/types/git-add-remote/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", + "git-add-remote-tests.ts" + ] +} diff --git a/types/git-add-remote/tslint.json b/types/git-add-remote/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/git-add-remote/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/git-branch/git-branch-tests.ts b/types/git-branch/git-branch-tests.ts index 4b02cb5da3..79676c58ff 100644 --- a/types/git-branch/git-branch-tests.ts +++ b/types/git-branch/git-branch-tests.ts @@ -1,14 +1,18 @@ import gitBranch = require('git-branch'); gitBranch() - .then((name) => {}); + .then((name) => { + name; // $ExpectType string + }); gitBranch('cwd') - .then((name) => {}); + .then((name) => { + name; // $ExpectType string + }); -gitBranch.sync(); -gitBranch.sync('cwd'); +gitBranch.sync(); // $ExpectType string +gitBranch.sync('cwd'); // $ExpectType string -gitBranch((err, name) => {}); +gitBranch((err, name) => {}); // $ExpectType void -gitBranch('cwd', (err, name) => {}); +gitBranch('cwd', (err, name) => {}); // $ExpectType void diff --git a/types/git-branch/index.d.ts b/types/git-branch/index.d.ts index a1cecc9691..9f893ca5cd 100644 --- a/types/git-branch/index.d.ts +++ b/types/git-branch/index.d.ts @@ -8,7 +8,7 @@ export = GitBranch; declare function GitBranch(cwd?: string): Promise; declare function GitBranch(cwd?: string, callback?: (err: null | string, name: string) => void): void; -declare function GitBranch(callback?: (err: null | string, name: string) => void): void; +declare function GitBranch(callback: (err: null | string, name: string) => void): void; declare namespace GitBranch { function sync(cwd?: string): string; diff --git a/types/git-config-path/git-config-path-tests.ts b/types/git-config-path/git-config-path-tests.ts new file mode 100644 index 0000000000..1a18058e4a --- /dev/null +++ b/types/git-config-path/git-config-path-tests.ts @@ -0,0 +1,4 @@ +import gitConfigPath = require('git-config-path'); + +gitConfigPath(); // $ExpectType string +gitConfigPath('global'); // $ExpectType string diff --git a/types/git-config-path/index.d.ts b/types/git-config-path/index.d.ts new file mode 100644 index 0000000000..425b6a49f5 --- /dev/null +++ b/types/git-config-path/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for git-config-path 2.0 +// Project: https://github.com/jonschlinkert/git-config-path +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = gitConfigPath; + +declare function gitConfigPath(global?: 'global'): string; diff --git a/types/git-config-path/tsconfig.json b/types/git-config-path/tsconfig.json new file mode 100644 index 0000000000..6584f73fe4 --- /dev/null +++ b/types/git-config-path/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "git-config-path-tests.ts" + ] +} diff --git a/types/git-config-path/tslint.json b/types/git-config-path/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/git-config-path/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/git-repo-name/git-repo-name-tests.ts b/types/git-repo-name/git-repo-name-tests.ts new file mode 100644 index 0000000000..6b9fe45b00 --- /dev/null +++ b/types/git-repo-name/git-repo-name-tests.ts @@ -0,0 +1,26 @@ +import repoName = require('git-repo-name'); + +repoName('foo'); // $ExpectType Promise +repoName({ cwd: 'foo' }); // $ExpectType Promise +repoName({ path: 'foo' }); // $ExpectType Promise +// $ExpectType void +repoName((err, repoName) => { + err; // $ExpectType Error | null + repoName; // $ExpectType string +}); +// $ExpectType void +repoName('foo', (err, repoName) => { + err; // $ExpectType Error | null + repoName; // $ExpectType string +}); +// $ExpectType void +repoName({ cwd: 'foo' }, (err, repoName) => { + err; // $ExpectType Error | null + repoName; // $ExpectType string +}); + +repoName.promise('foo'); // $ExpectType Promise +repoName.promise({ cwd: 'foo' }); // $ExpectType Promise + +repoName.sync('foo'); // $ExpectType string +repoName.sync({ cwd: 'foo' }); // $ExpectType string diff --git a/types/git-repo-name/index.d.ts b/types/git-repo-name/index.d.ts new file mode 100644 index 0000000000..c6a99b9072 --- /dev/null +++ b/types/git-repo-name/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for git-repo-name 1.0 +// Project: https://github.com/jonschlinkert/git-repo-name +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = gitRepoName; + +declare function gitRepoName(options?: string | gitRepoName.Options): Promise; +declare function gitRepoName(callback: (err: Error | null, repoName: string) => void): void; +declare function gitRepoName( + options: string | gitRepoName.Options, + callback: (err: Error | null, repoName: string) => void +): void; + +declare namespace gitRepoName { + function promise(options?: string | Options): Promise; + function sync(options?: string | Options): string; + + interface Options { + cwd?: string; + path?: string; + } +} diff --git a/types/git-repo-name/tsconfig.json b/types/git-repo-name/tsconfig.json new file mode 100644 index 0000000000..224d7cacaa --- /dev/null +++ b/types/git-repo-name/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", + "git-repo-name-tests.ts" + ] +} diff --git a/types/git-repo-name/tslint.json b/types/git-repo-name/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/git-repo-name/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/git-user-email/git-user-email-tests.ts b/types/git-user-email/git-user-email-tests.ts new file mode 100644 index 0000000000..82f73d642e --- /dev/null +++ b/types/git-user-email/git-user-email-tests.ts @@ -0,0 +1,3 @@ +import email = require('git-user-email'); + +email(); // $ExpectType string diff --git a/types/git-user-email/index.d.ts b/types/git-user-email/index.d.ts new file mode 100644 index 0000000000..38e61ccc33 --- /dev/null +++ b/types/git-user-email/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for git-user-email 0.2 +// Project: https://github.com/jonschlinkert/git-user-email +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = gitUserEmail; + +declare function gitUserEmail(): string; diff --git a/types/git-user-email/tsconfig.json b/types/git-user-email/tsconfig.json new file mode 100644 index 0000000000..179c0e785e --- /dev/null +++ b/types/git-user-email/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", + "git-user-email-tests.ts" + ] +} diff --git a/types/git-user-email/tslint.json b/types/git-user-email/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/git-user-email/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/git-user-name/git-user-name-tests.ts b/types/git-user-name/git-user-name-tests.ts new file mode 100644 index 0000000000..4d7e0adc54 --- /dev/null +++ b/types/git-user-name/git-user-name-tests.ts @@ -0,0 +1,6 @@ +import userName = require('git-user-name'); + +userName(); // $ExpectType string | null +userName({ cwd: 'foo' }); // $ExpectType string | null +userName({ path: 'foo' }); // $ExpectType string | null +userName({ gitconfig: 'foo' }); // $ExpectType string | null diff --git a/types/git-user-name/index.d.ts b/types/git-user-name/index.d.ts new file mode 100644 index 0000000000..b72e1645c3 --- /dev/null +++ b/types/git-user-name/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for git-user-name 2.0 +// Project: https://github.com/jonschlinkert/git-user-name +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = gitUserName; + +declare function gitUserName(options?: gitUserName.Options): string | null; + +declare namespace gitUserName { + interface Options { + cwd?: string; + path?: string; + gitconfig?: string; + } +} diff --git a/types/git-user-name/tsconfig.json b/types/git-user-name/tsconfig.json new file mode 100644 index 0000000000..ba7fc9dcd5 --- /dev/null +++ b/types/git-user-name/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", + "git-user-name-tests.ts" + ] +} diff --git a/types/git-user-name/tslint.json b/types/git-user-name/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/git-user-name/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/git-username/git-username-tests.ts b/types/git-username/git-username-tests.ts new file mode 100644 index 0000000000..1ee150ef0b --- /dev/null +++ b/types/git-username/git-username-tests.ts @@ -0,0 +1,5 @@ +import username = require('git-username'); + +username('some/path'); // $ExpectType string | null +username({ cwd: 'some/path' }); // $ExpectType string | null +username({ strict: true }); // $ExpectType string diff --git a/types/git-username/index.d.ts b/types/git-username/index.d.ts new file mode 100644 index 0000000000..f2da948fb8 --- /dev/null +++ b/types/git-username/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for git-username 1.0 +// Project: https://github.com/jonschlinkert/git-username +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = gitUsername; + +declare function gitUsername(options: gitUsername.StrictOptions): string; +declare function gitUsername(options?: string | gitUsername.BaseOptions): string | null; + +declare namespace gitUsername { + interface BaseOptions { + cwd?: string; + strict?: boolean; + } + + interface StrictOptions extends BaseOptions { + strict: true; + } +} diff --git a/types/git-username/tsconfig.json b/types/git-username/tsconfig.json new file mode 100644 index 0000000000..b49ccd7e47 --- /dev/null +++ b/types/git-username/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", + "git-username-tests.ts" + ] +} diff --git a/types/git-username/tslint.json b/types/git-username/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/git-username/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/github-username/github-username-tests.ts b/types/github-username/github-username-tests.ts new file mode 100644 index 0000000000..0caee06bdc --- /dev/null +++ b/types/github-username/github-username-tests.ts @@ -0,0 +1,4 @@ +import githubUsername = require('github-username'); + +// $ExpectType Promise +githubUsername('sindresorhus@gmail.com', 'deadbeef'); diff --git a/types/github-username/index.d.ts b/types/github-username/index.d.ts new file mode 100644 index 0000000000..a1083c7dc3 --- /dev/null +++ b/types/github-username/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for github-username 4.1 +// Project: https://github.com/sindresorhus/github-username#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = githubUsername; + +declare function githubUsername(email: string, token: string): Promise; diff --git a/types/github-username/tsconfig.json b/types/github-username/tsconfig.json new file mode 100644 index 0000000000..33308515f6 --- /dev/null +++ b/types/github-username/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", + "github-username-tests.ts" + ] +} diff --git a/types/github-username/tslint.json b/types/github-username/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/github-username/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/gl-matrix/gl-matrix-tests.ts b/types/gl-matrix/gl-matrix-tests.ts index 36700536cd..5f165e9ced 100644 --- a/types/gl-matrix/gl-matrix-tests.ts +++ b/types/gl-matrix/gl-matrix-tests.ts @@ -308,6 +308,7 @@ outMat4 = mat4.perspective(outMat4, Math.PI, 1, 0, 1); outMat4 = mat4.perspectiveFromFieldOfView(outMat4, {upDegrees:Math.PI, downDegrees:-Math.PI, leftDegrees:-Math.PI, rightDegrees:Math.PI}, 1, 0); outMat4 = mat4.ortho(outMat4, -1, 1, -1, 1, -1, 1); outMat4 = mat4.lookAt(outMat4, vec3A, vec3B, vec3A); +outMat4 = mat4.targetTo(outMat4, vec3A, vec3B, vec3A); outStr = mat4.str(mat4A); outVal = mat4.frob(mat4A); outMat4 = mat4.add(outMat4, mat4A, mat4B); @@ -670,6 +671,7 @@ outMat4 = _mat4.perspective(outMat4, Math.PI, 1, 0, 1); outMat4 = _mat4.perspectiveFromFieldOfView(outMat4, {upDegrees:Math.PI, downDegrees:-Math.PI, leftDegrees:-Math.PI, rightDegrees:Math.PI}, 1, 0); outMat4 = _mat4.ortho(outMat4, -1, 1, -1, 1, -1, 1); outMat4 = _mat4.lookAt(outMat4, vec3A, vec3B, vec3A); +outMat4 = _mat4.targetTo(outMat4, vec3A, vec3B, vec3A); outStr = _mat4.str(mat4A); outVal = _mat4.frob(mat4A); outMat4 = _mat4.add(outMat4, mat4A, mat4B); diff --git a/types/gl-matrix/index.d.ts b/types/gl-matrix/index.d.ts index 8d2d522ddc..750eb73509 100644 --- a/types/gl-matrix/index.d.ts +++ b/types/gl-matrix/index.d.ts @@ -2662,6 +2662,17 @@ declare module 'gl-matrix' { */ public static lookAt(out: mat4, eye: vec3 | number[], center: vec3 | number[], up: vec3 | number[]): mat4; + /** + * Generates a matrix that makes something look at something else. + * + * @param out mat4 frustum matrix will be written into + * @param eye Position of the viewer + * @param target Point the viewer is looking at + * @param up vec3 pointing up + * @returns out + */ + public static targetTo(out: mat4, eye: vec3 | number[], target: vec3 | number[], up: vec3 | number[]): mat4; + /** * Returns a string representation of a mat4 * diff --git a/types/gl/gl-tests.ts b/types/gl/gl-tests.ts new file mode 100644 index 0000000000..9b0a64b491 --- /dev/null +++ b/types/gl/gl-tests.ts @@ -0,0 +1,8 @@ +import createContext = require("gl"); + +createContext(0, 0); // $ExpectType WebGLRenderingContext & StackGLExtension +createContext(0, 0, { preserveDrawingBuffer: true }); // $ExpectType WebGLRenderingContext & StackGLExtension +createContext(0, 0).getExtension("STACKGL_resize_drawingbuffer"); // $ExpectType STACKGL_resize_drawingbuffer | null +createContext(0, 0).getExtension("STACKGL_destroy_context"); // $ExpectType STACKGL_destroy_context | null +createContext(0, 0).getExtension("STACKGL_resize_drawingbuffer")!.resize(0, 0); // $ExpectType void +createContext(0, 0).getExtension("STACKGL_destroy_context")!.destroy(); // $ExpectType void diff --git a/types/gl/index.d.ts b/types/gl/index.d.ts new file mode 100644 index 0000000000..ad8a7b5767 --- /dev/null +++ b/types/gl/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for gl 4.1 +// Project: https://github.com/stackgl/headless-gl#readme +// Definitions by: sjx233 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface StackGLExtension { + getExtension(extensionName: "STACKGL_resize_drawingbuffer"): STACKGL_resize_drawingbuffer | null; + getExtension(extensionName: "STACKGL_destroy_context"): STACKGL_destroy_context | null; +} + +interface STACKGL_resize_drawingbuffer { + resize(width: GLint, height: GLint): void; +} + +interface STACKGL_destroy_context { + destroy(): void; +} + +declare function createContext(width: number, height: number, options?: WebGLContextAttributes): WebGLRenderingContext & StackGLExtension; + +export = createContext; diff --git a/types/gl/tsconfig.json b/types/gl/tsconfig.json new file mode 100644 index 0000000000..36e5d3af07 --- /dev/null +++ b/types/gl/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", + "gl-tests.ts" + ] +} diff --git a/types/gl/tslint.json b/types/gl/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gl/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/global-dirs/global-dirs-tests.ts b/types/global-dirs/global-dirs-tests.ts new file mode 100644 index 0000000000..9ea2626670 --- /dev/null +++ b/types/global-dirs/global-dirs-tests.ts @@ -0,0 +1,15 @@ +import * as globalDirs from 'global-dirs'; + +// $ExpectType string +globalDirs.npm.prefix; +// $ExpectType string +globalDirs.npm.packages; +// $ExpectType string +globalDirs.npm.binaries; + +// $ExpectType string +globalDirs.yarn.prefix; +// $ExpectType string +globalDirs.yarn.packages; +// $ExpectType string +globalDirs.yarn.binaries; diff --git a/types/global-dirs/index.d.ts b/types/global-dirs/index.d.ts new file mode 100644 index 0000000000..b8f26312a4 --- /dev/null +++ b/types/global-dirs/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for global-dirs 0.1 +// Project: https://github.com/sindresorhus/global-dirs#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export const npm: GlobalDirs; +export const yarn: GlobalDirs; + +export interface GlobalDirs { + packages: string; + binaries: string; + prefix: string; +} diff --git a/types/global-dirs/tsconfig.json b/types/global-dirs/tsconfig.json new file mode 100644 index 0000000000..095ad058e0 --- /dev/null +++ b/types/global-dirs/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", + "global-dirs-tests.ts" + ] +} diff --git a/types/global-dirs/tslint.json b/types/global-dirs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/global-dirs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/global-modules/global-modules-tests.ts b/types/global-modules/global-modules-tests.ts new file mode 100644 index 0000000000..f392934f97 --- /dev/null +++ b/types/global-modules/global-modules-tests.ts @@ -0,0 +1,3 @@ +import globalModules = require('global-modules'); + +globalModules; // $ExpectType string diff --git a/types/global-modules/index.d.ts b/types/global-modules/index.d.ts new file mode 100644 index 0000000000..2f92021b88 --- /dev/null +++ b/types/global-modules/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for global-modules 2.0 +// Project: https://github.com/jonschlinkert/global-modules +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = globalModules; +declare const globalModules: string; diff --git a/types/global-modules/tsconfig.json b/types/global-modules/tsconfig.json new file mode 100644 index 0000000000..5333047d4a --- /dev/null +++ b/types/global-modules/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", + "global-modules-tests.ts" + ] +} diff --git a/types/global-modules/tslint.json b/types/global-modules/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/global-modules/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/global-paths/global-paths-tests.ts b/types/global-paths/global-paths-tests.ts new file mode 100644 index 0000000000..3038b65c1b --- /dev/null +++ b/types/global-paths/global-paths-tests.ts @@ -0,0 +1,4 @@ +import paths = require('global-paths'); + +paths(); // $ExpectType string[] +paths('foo'); // $ExpectType string[] diff --git a/types/global-paths/index.d.ts b/types/global-paths/index.d.ts new file mode 100644 index 0000000000..0ae365b07f --- /dev/null +++ b/types/global-paths/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for global-paths 1.0 +// Project: https://github.com/jonschlinkert/global-paths +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = globalPaths; + +declare function globalPaths(cwd?: string): string[]; diff --git a/types/global-paths/tsconfig.json b/types/global-paths/tsconfig.json new file mode 100644 index 0000000000..85f6aaba4f --- /dev/null +++ b/types/global-paths/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", + "global-paths-tests.ts" + ] +} diff --git a/types/global-paths/tslint.json b/types/global-paths/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/global-paths/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/global-prefix/global-prefix-tests.ts b/types/global-prefix/global-prefix-tests.ts new file mode 100644 index 0000000000..63ff460fe3 --- /dev/null +++ b/types/global-prefix/global-prefix-tests.ts @@ -0,0 +1,3 @@ +import prefix = require('global-prefix'); + +prefix; // $ExpectType string diff --git a/types/global-prefix/index.d.ts b/types/global-prefix/index.d.ts new file mode 100644 index 0000000000..4f27627232 --- /dev/null +++ b/types/global-prefix/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for global-prefix 3.0 +// Project: https://github.com/jonschlinkert/global-prefix +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = globalPrefix; +declare const globalPrefix: string; diff --git a/types/global-prefix/tsconfig.json b/types/global-prefix/tsconfig.json new file mode 100644 index 0000000000..f46b118297 --- /dev/null +++ b/types/global-prefix/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", + "global-prefix-tests.ts" + ] +} diff --git a/types/global-prefix/tslint.json b/types/global-prefix/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/global-prefix/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/google-apps-script/google-apps-script.base.d.ts b/types/google-apps-script/google-apps-script.base.d.ts index 7558263306..209be25b19 100644 --- a/types/google-apps-script/google-apps-script.base.d.ts +++ b/types/google-apps-script/google-apps-script.base.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2018-07-11 +// Type definitions for Google Apps Script 2019-01-23 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -7,7 +7,7 @@ declare namespace GoogleAppsScript { export module Base { - /** + /** * A data interchange object for Apps Script services. */ export interface Blob { @@ -74,9 +74,10 @@ declare namespace GoogleAppsScript { } /** - * This class provides access to G Suite specific dialog boxes. + * This class provides access to dialog boxes specific to Google Sheets. * * The methods in this class are only available for use in the context of a Google Spreadsheet. + * Please use G Suite dialogs instead. * See also * * ButtonSet @@ -163,9 +164,9 @@ declare namespace GoogleAppsScript { /** * An enumeration that provides access to MIME-type declarations without typing the strings - * explicitly. Any method that expects a MIME type rendered as a string (for example, - * 'image/png') will also accept one of the values below, so long as the method - * supports the underlying MIME type. + * explicitly. Methods that expect a MIME type rendered as a string (for example, + * 'image/png') also accept any of the values below, so long as the method supports the + * underlying MIME type. * * // Use MimeType enum to log the name of every Google Doc in the user's Drive. * var docs = DriveApp.getFilesByType(MimeType.GOOGLE_DOCS); @@ -283,15 +284,13 @@ declare namespace GoogleAppsScript { * // A simple INFO log message, using sprintf() formatting. * console.info('Timing the %s function (%d arguments)', 'myFunction', 1); * - * // Log a JSON object at a DEBUG level. The log is labeled - * // with the message string in the log viewer, and the JSON content - * // is displayed in the expanded log structure under "structPayload". + * // Log a JSON object at a DEBUG level. Writes the stringified object to the log. * var parameters = { * isValid: true, * content: 'some string', * timestamp: new Date() * }; - * console.log({message: 'Function Input', initialData: parameters}); + * console.log(parameters); * * var label = 'myFunction() time'; // Labels the timing log entry. * console.time(label); // Starts the timer. @@ -305,11 +304,15 @@ declare namespace GoogleAppsScript { * } */ export interface console { + error(): void; error(formatOrObject: Object, ...values: Object[]): void; + info(): void; info(formatOrObject: Object, ...values: Object[]): void; + log(): void; log(formatOrObject: Object, ...values: Object[]): void; time(label: string): void; timeEnd(label: string): void; + warn(): void; warn(formatOrObject: Object, ...values: Object[]): void; } @@ -321,3 +324,4 @@ declare var Logger: GoogleAppsScript.Base.Logger; // conflicts with MimeType in lib.d.ts // declare var MimeType: GoogleAppsScript.Base.MimeType; declare var Session: GoogleAppsScript.Base.Session; +declare var console: GoogleAppsScript.Base.console; diff --git a/types/google-apps-script/google-apps-script.cache.d.ts b/types/google-apps-script/google-apps-script.cache.d.ts index 7056dc0b08..c1e72c3f64 100644 --- a/types/google-apps-script/google-apps-script.cache.d.ts +++ b/types/google-apps-script/google-apps-script.cache.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2018-07-11 +// Type definitions for Google Apps Script 2019-01-23 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -44,6 +44,9 @@ declare namespace GoogleAppsScript { * This class lets you get a specific cache instance. Public caches are for things that are not * dependent on which user is accessing your script. Private caches are for things which are * user-specific, like settings or recent activity. + * + * The data you write to the cache is not guaranteed to persist until its expiration time. You + * must be prepared to get back null from all reads. */ export interface CacheService { getDocumentCache(): Cache; diff --git a/types/google-apps-script/google-apps-script.card.d.ts b/types/google-apps-script/google-apps-script.card-service.d.ts similarity index 84% rename from types/google-apps-script/google-apps-script.card.d.ts rename to types/google-apps-script/google-apps-script.card-service.d.ts index 60a8bb9d37..64f5194595 100644 --- a/types/google-apps-script/google-apps-script.card.d.ts +++ b/types/google-apps-script/google-apps-script.card-service.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2018-07-11 +// Type definitions for Google Apps Script 2018-12-26 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -7,7 +7,7 @@ /// declare namespace GoogleAppsScript { - export module Card { + export module Card_Service { /** * An action that enables interactivity within UI elements. The action does not happen directly on * the client but rather invokes an Apps Script callback function with optional parameters. @@ -37,7 +37,7 @@ declare namespace GoogleAppsScript { * // An action that shows a notification. * var actionResponse = CardService.newActionResponseBuilder() * .setNotification(CardService.newNotification() - * .setType(CardService.Notification.INFO) + * .setType(CardService.NotificationType.INFO) * .setText("Some info to display to user")) * .build(); * @@ -251,6 +251,7 @@ declare namespace GoogleAppsScript { */ export interface CardService { ComposedEmailType: typeof ComposedEmailType; + ContentType: typeof ContentType; Icon: typeof Icon; ImageStyle: typeof ImageStyle; LoadIndicator: typeof LoadIndicator; @@ -258,6 +259,8 @@ declare namespace GoogleAppsScript { OnClose: typeof OnClose; OpenAs: typeof OpenAs; SelectionInputType: typeof SelectionInputType; + TextButtonStyle: typeof TextButtonStyle; + UpdateDraftBodyType: typeof UpdateDraftBodyType; newAction(): Action; newActionResponseBuilder(): ActionResponseBuilder; newAuthorizationAction(): AuthorizationAction; @@ -282,11 +285,18 @@ declare namespace GoogleAppsScript { newTextInput(): TextInput; newTextParagraph(): TextParagraph; newUniversalActionResponseBuilder(): UniversalActionResponseBuilder; + newUpdateDraftActionResponseBuilder(): UpdateDraftActionResponseBuilder; + newUpdateDraftBodyAction(): UpdateDraftBodyAction; } /** * The response object that may be returned from a callback method for compose action in a Gmail add-on. * + * Note: This object isn't related to compose actions that are + * used to extend the compose UI. Rather, + * this object is a response to an Action that composes draft messages when a specific UI element is + * selected. + * * var composeActionResponse = CardService.newComposeActionResponseBuilder() * .setGmailDraft(GmailApp.createDraft("recipient", "subject", "body")) * .build(); @@ -297,6 +307,11 @@ declare namespace GoogleAppsScript { /** * A builder for ComposeActionResponse objects. + * + * Note: This object isn't related to compose actions that are + * used to extend the compose UI. Rather, + * this builder creates responses to an Action that composes draft messages when a specific + * UI element is selected. */ export interface ComposeActionResponseBuilder { build(): ComposeActionResponse; @@ -308,6 +323,11 @@ declare namespace GoogleAppsScript { */ export enum ComposedEmailType { REPLY_AS_DRAFT, STANDALONE_DRAFT } + /** + * An enum value that specifies the content type of the content generated by a UpdateDraftActionResponse. + */ + export enum ContentType { TEXT, MUTABLE_HTML, IMMUTABLE_HTML } + /** * Predefined icons that can be used in various UI objects, such as ImageButton or KeyValue widgets. */ @@ -579,13 +599,25 @@ declare namespace GoogleAppsScript { */ export interface TextButton { setAuthorizationAction(action: AuthorizationAction): TextButton; + setBackgroundColor(backgroundColor: string): TextButton; setComposeAction(action: Action, composedEmailType: ComposedEmailType): TextButton; + setDisabled(disabled: boolean): TextButton; setOnClickAction(action: Action): TextButton; setOnClickOpenLinkAction(action: Action): TextButton; setOpenLink(openLink: OpenLink): TextButton; setText(text: string): TextButton; + setTextButtonStyle(textButtonStyle: TextButtonStyle): TextButton; } + /** + * An enum that specifies the style for TextButton. + * + * TEXT is the default; it renders a simple text button with clear background. + * FILLED buttons have a background color you can set with + * TextButton.setBackgroundColor(backgroundColor). + */ + export enum TextButtonStyle { TEXT, FILLED } + /** * A input field widget that accepts text input. * @@ -648,6 +680,67 @@ declare namespace GoogleAppsScript { setOpenLink(openLink: OpenLink): UniversalActionResponseBuilder; } + /** + * Represents an action that updates the email draft that the user is currently editing. + * + * // A UpdateDraftActionResponse that inserts non-editable content (a link in this case) into an + * // email draft. + * var updateDraftActionResponse = CardService.newUpdateDraftActionResponseBuilder() + * .setUpdateDraftBodyAction(CardService.newUpdateDraftBodyAction() + * .addUpdateContent( + * "Google", + * ContentType.IMMUTABLE_HTML) + * .setUpdateType(UpdateDraftBodyType.IN_PLACE_INSERT)) + * .build(); + * + * // A UpdateDraftActionResponse that inserts a link into an email draft. The added content can be + * // edited further. + * var updateDraftActionResponse = CardService.newUpdateDraftActionResponseBuilder() + * .setUpdateDraftBodyAction(CardService.newUpdateDraftBodyAction() + * .addUpdateContent( + * "Google", + * ContentType.MUTABLE_HTML) + * .setUpdateType(UpdateDraftBodyType.IN_PLACE_INSERT)) + * .build(); + * + * // A UpdateDraftActionResponse that inserts multiple values of different types. + * // The example action response inserts two lines next to each other in the email + * // draft, at the cursor position. Each line contains the content added by + * // {@link UpdateDraftActionResponseBuilder#addUpdateContent}. + * var updateDraftActionResponse = CardService.newUpdateDraftActionResponseBuilder() + * .setUpdateDraftBodyAction(CardService.newUpdateDraftBodyAction() + * .addUpdateContent( + * "Google", + * ContentType.MUTABLE_HTML) + * .addUpdateContent("Above is a google link.", ContentType.PLAIN_TEXT) + * .setUpdateType(UpdateDraftBodyType.IN_PLACE_INSERT)) + * .build(); + */ + export interface UpdateDraftActionResponse { + printJson(): string; + } + + /** + * A builder for UpdateDraftActionResponse objects. + */ + export interface UpdateDraftActionResponseBuilder { + build(): UpdateDraftActionResponse; + setUpdateDraftBodyAction(updateDraftBodyAction: UpdateDraftBodyAction): UpdateDraftActionResponseBuilder; + } + + /** + * Represents an action that updates the email draft body. + */ + export interface UpdateDraftBodyAction { + addUpdateContent(content: string, contentType: ContentType): UpdateDraftBodyAction; + setUpdateType(updateType: UpdateDraftBodyType): UpdateDraftBodyAction; + } + + /** + * An enum value that specifies the type of an UpdateDraftBodyAction. + */ + export enum UpdateDraftBodyType { IN_PLACE_INSERT } + /** * Base class for all widgets that can be added to a Card. */ @@ -657,4 +750,4 @@ declare namespace GoogleAppsScript { } } -declare var CardService: GoogleAppsScript.Card.CardService; +declare var CardService: GoogleAppsScript.Card_Service.CardService; diff --git a/types/google-apps-script/google-apps-script.charts.d.ts b/types/google-apps-script/google-apps-script.charts.d.ts index 50013a36d0..5898092bb4 100644 --- a/types/google-apps-script/google-apps-script.charts.d.ts +++ b/types/google-apps-script/google-apps-script.charts.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2018-07-11 +// Type definitions for Google Apps Script 2018-12-26 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -536,7 +536,7 @@ declare namespace GoogleAppsScript { * function doGet() { * // This example creates two table charts side by side. One uses a data view definition to * // restrict the number of displayed columns. - * var app = UiApp.createApplication(); + * * // Get sample data from a spreadsheet. * var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AF' + * '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=4&headers=-1'; @@ -555,9 +555,17 @@ declare namespace GoogleAppsScript { * .setDataViewDefinition(dataViewDefinition) * .build(); * - * var panel = app.createHorizontalPanel().setSpacing(15); - * panel.add(originalChart).add(limitedChart); - * return app.add(panel); + * var htmlOutput = HtmlService.createHtmlOutput(); + * var originalChartData = Utilities.base64Encode(originalChart.getAs('image/png').getBytes()); + * var originalChartUrl = "data:image/png;base64," + encodeURI(originalChartData); + * var limitedChartData = Utilities.base64Encode(limitedChart.getAs('image/png').getBytes()); + * var limitedChartUrl = "data:image/png;base64," + encodeURI(limitedChartData); + * htmlOutput.append("
"); + * htmlOutput.append(""); + * htmlOutput.append(""); + * htmlOutput.append(""); + * htmlOutput.append("
"); + * return htmlOutput; * } */ export interface DataViewDefinitionBuilder { diff --git a/types/google-apps-script/google-apps-script.data-studio.d.ts b/types/google-apps-script/google-apps-script.data-studio.d.ts new file mode 100644 index 0000000000..332dff6dbc --- /dev/null +++ b/types/google-apps-script/google-apps-script.data-studio.d.ts @@ -0,0 +1,362 @@ +// Type definitions for Google Apps Script 2019-01-23 +// Project: https://developers.google.com/apps-script/ +// Definitions by: motemen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace GoogleAppsScript { + export module Data_Studio { + /** + * An enum that defines the aggregation types that can be set for a Field. + */ + export enum AggregationType { NO_AGGREGATION, AVG, COUNT, COUNT_DISTINCT, MAX, MIN, SUM } + + /** + * An enum that defines the authentication types that can be set for a connector. + */ + export enum AuthType { NONE, OAUTH2, USER_PASS, KEY, USER_TOKEN } + + /** + * Contains checkbox information for the config. Its properties determine how the checkbox is + * displayed in Data Studio. + * + * var checkbox = config.newCheckbox() + * .setId("use_https") + * .setName("Use Https?") + * .setHelpText("Whether or not https should be used.") + * .setAllowOverride(true); + */ + export interface Checkbox { + setAllowOverride(allowOverride: boolean): Checkbox; + setHelpText(helpText: string): Checkbox; + setId(id: string): Checkbox; + setName(name: string): Checkbox; + } + + /** + * CommunityConnector enables scripts to access builders and utilities to help with development of + * Community Connectors for Data Studio. Use this class to get a reference to the Fields + * object and the FieldType and AggregationType enums so they can be used in the + * construction of Fields. + * + * var cc = DataStudioApp.createCommunityConnector(); + * var fieldType = cc.FieldType; + * var aggregationType = cc.AggregationType; + * + * var fields = cc.getFields(); + * + * fields.newMetric() + * .setAggregation(aggregationType.AVG) + * .setFieldType(fieldType.CURRENCY_USD); + */ + export interface CommunityConnector { + AggregationType: typeof AggregationType; + AuthType: typeof AuthType; + FieldType: typeof FieldType; + getConfig(): Config; + getFields(): Fields; + newAuthTypeResponse(): GetAuthTypeResponse; + newDebugError(): DebugError; + newUserError(): UserError; + } + + /** + * Contains the configuration entries for a connector. These configuration entries define what + * questions are asked when adding a new connector. + * + * var cc = DataStudioApp.createCommunityConnector(); + * var config = cc.getConfig(); + * + * var info_entry = config.newInfo() + * .setId("info_id") + * .setHelpText("This connector can connect to multiple data endpoints."); + */ + export interface Config { + build(): Object; + newCheckbox(): Checkbox; + newInfo(): Info; + newOptionBuilder(): OptionBuilder; + newSelectMultiple(): SelectMultiple; + newSelectSingle(): SelectSingle; + newTextArea(): TextArea; + newTextInput(): TextInput; + printJson(): string; + setDateRangeRequired(dateRangeRequired: boolean): Config; + } + + /** + * DataStudioApp allows scripts to interact with developer-oriented features for Data Studio. + */ + export interface DataStudioApp { + createCommunityConnector(): CommunityConnector; + } + + /** + * An error that is only visible to admins of the connector. + * + * var cc = DataStudioApp.createCommunityConnector(); + * + * cc.newDebugError() + * .setText("This is the debug error text.") + * .throwException(); + */ + export interface DebugError { + printJson(): string; + setText(text: string): DebugError; + throwException(): void; + } + + /** + * Contains field-related data. Its properties determine how the field is used in Data Studio. + * + * var cc = DataStudioApp.createCommunityConnector(); + * var fields = cc.getFields(); + * var types = cc.FieldType; + * + * var field1 = fields.newDimension() + * .setId('field1_id') + * .setName('Field 1 ID') + * .setDescription('The first field.') + * .setType(types.YEAR_MONTH) + * .setGroup('DATETIME'); + */ + export interface Field { + getAggregation(): AggregationType; + getDescription(): string; + getFormula(): string; + getGroup(): string; + getId(): string; + getName(): string; + getType(): FieldType; + isDefault(): boolean; + isDimension(): boolean; + isHidden(): boolean; + isMetric(): boolean; + setAggregation(aggregation: AggregationType): Field; + setDescription(description: string): Field; + setFormula(formula: string): Field; + setGroup(group: string): Field; + setId(id: string): Field; + setIsHidden(isHidden: boolean): Field; + setName(name: string): Field; + setType(type: FieldType): Field; + } + + /** + * An enum that defines the types that can be set for a Field. + */ + export enum FieldType { YEAR, YEAR_QUARTER, YEAR_MONTH, YEAR_WEEK, YEAR_MONTH_DAY, YEAR_MONTH_DAY_HOUR, QUARTER, MONTH, WEEK, MONTH_DAY, DAY_OF_WEEK, DAY, HOUR, MINUTE, DURATION, COUNTRY, COUNTRY_CODE, CONTINENT, CONTINENT_CODE, SUB_CONTINENT, SUB_CONTINENT_CODE, REGION, REGION_CODE, CITY, CITY_CODE, METRO, METRO_CODE, LATITUDE_LONGITUDE, NUMBER, PERCENT, TEXT, BOOLEAN, URL, CURRENCY_AED, CURRENCY_ALL, CURRENCY_ARS, CURRENCY_AUD, CURRENCY_BDT, CURRENCY_BGN, CURRENCY_BOB, CURRENCY_BRL, CURRENCY_CAD, CURRENCY_CDF, CURRENCY_CHF, CURRENCY_CLP, CURRENCY_CNY, CURRENCY_COP, CURRENCY_CRC, CURRENCY_CZK, CURRENCY_DKK, CURRENCY_DOP, CURRENCY_EGP, CURRENCY_ETB, CURRENCY_EUR, CURRENCY_GBP, CURRENCY_HKD, CURRENCY_HRK, CURRENCY_HUF, CURRENCY_IDR, CURRENCY_ILS, CURRENCY_INR, CURRENCY_IRR, CURRENCY_ISK, CURRENCY_JMD, CURRENCY_JPY, CURRENCY_KRW, CURRENCY_LKR, CURRENCY_LTL, CURRENCY_MNT, CURRENCY_MVR, CURRENCY_MXN, CURRENCY_MYR, CURRENCY_NOK, CURRENCY_NZD, CURRENCY_PAB, CURRENCY_PEN, CURRENCY_PHP, CURRENCY_PKR, CURRENCY_PLN, CURRENCY_RON, CURRENCY_RSD, CURRENCY_RUB, CURRENCY_SAR, CURRENCY_SEK, CURRENCY_SGD, CURRENCY_THB, CURRENCY_TRY, CURRENCY_TWD, CURRENCY_TZS, CURRENCY_UAH, CURRENCY_USD, CURRENCY_UYU, CURRENCY_VEF, CURRENCY_VND, CURRENCY_YER, CURRENCY_ZAR } + + /** + * Contains a set of Fields for a community connector. This set of fields define which + * dimensions and metrics can be used in Data Studio. + * + * var cc = DataStudioApp.createCommunityConnector(); + * var fields = cc.getFields(); + * var types = cc.FieldType; + * + * var field1 = fields.newDimension() + * // Set other properties as needed. + * .setId('field1_id'); + */ + export interface Fields { + asArray(): Field[]; + build(): Object[]; + forIds(ids: string[]): Fields; + getDefaultDimension(): Field; + getDefaultMetric(): Field; + getFieldById(fieldId: string): Field; + newDimension(): Field; + newMetric(): Field; + setDefaultDimension(fieldId: string): void; + setDefaultMetric(fieldId: string): void; + } + + /** + * Builder to create a getAuthType() response for your script project. + * + * function getAuthType() { + * var cc = DataStudioApp.createCommunityConnector(); + * var authTypes = cc.AuthType; + * + * return cc.newGetAuthTypeResponse() + * .setAuthType(authTypes.USER_PASS) + * .setHelpUrl("https://www.example.org/connector-auth-help") + * .build(); + * } + */ + export interface GetAuthTypeResponse { + build(): Object; + printJson(): string; + setAuthType(authType: AuthType): GetAuthTypeResponse; + setHelpUrl(helpUrl: string): GetAuthTypeResponse; + } + + /** + * Contains info data for the config. Its properties determine how the info is displayed in Data + * Studio. + * + * var cc = DataStudioApp.createCommunityConnector(); + * var config = cc.getConfig(); + * + * var info1 = config.newInfo() + * .setId("info1") + * .setText("This text gives some context on the configuration."); + */ + export interface Info { + setId(id: string): Info; + setText(text: string): Info; + } + + /** + * A builder for creating options for SelectSingles and SelectMultiples. + * + * var cc = DataStudioApp.createCommunityConnector(); + * var config = cc.getConfig(); + * + * var option1 = config.newOptionBuilder() + * .setLabel("option label") + * .setValue("option_value"); + * + * var option2 = config.newOptionBuilder() + * .setLabel("second option label") + * .setValue("option_value_2"); + * + * var info1 = config.newSelectSingle() + * .setId("api_endpoint") + * .setName("Data Type") + * .setHelpText("Select the data type you're interested in.") + * .addOption(option1) + * .addOption(option2); + */ + export interface OptionBuilder { + setLabel(label: string): OptionBuilder; + setValue(value: string): OptionBuilder; + } + + /** + * Contains select multiple information for the config. Its properties determine how the select + * multiple is displayed in Data Studio. + * + * Usage: + * + * var option1 = config.newOptionBuilder() + * .setLabel("option label") + * .setValue("option_value"); + * + * var option2 = config.newOptionBuilder() + * .setLabel("second option label") + * .setValue("option_value_2"); + * + * var info1 = config.newSelectMultiple() + * .setId("api_endpoint") + * .setName("Data Type") + * .setHelpText("Select the data type you're interested in.") + * .setAllowOverride(true) + * .addOption(option1) + * .addOption(option2); + */ + export interface SelectMultiple { + addOption(optionBuilder: OptionBuilder): SelectMultiple; + setAllowOverride(allowOverride: boolean): SelectMultiple; + setHelpText(helpText: string): SelectMultiple; + setId(id: string): SelectMultiple; + setName(name: string): SelectMultiple; + } + + /** + * Contains select single information for the config. Its properties determine how the select single + * is displayed in Data Studio. + * + * var option1 = config.newOptionBuilder() + * .setLabel("option label") + * .setValue("option_value"); + * + * var option2 = config.newOptionBuilder() + * .setLabel("second option label") + * .setValue("option_value_2"); + * + * var info1 = config.newSelectMultiple() + * .setId("api_endpoint") + * .setName("Data Type") + * .setHelpText("Select the data type you're interested in.") + * .setAllowOverride(true) + * .addOption(option1) + * .addOption(option2); + */ + export interface SelectSingle { + addOption(optionBuilder: OptionBuilder): SelectSingle; + setAllowOverride(allowOverride: boolean): SelectSingle; + setHelpText(helpText: string): SelectSingle; + setId(id: string): SelectSingle; + setName(name: string): SelectSingle; + } + + /** + * Contains text area information for the config. Its properties determine how the text input is + * displayed in Data Studio. + * + * Usage: + * + * var cc = DataStudioApp.createCommunityConnector(); + * var config = cc.getConfig(); + * + * var textArea1 = config.newTextArea() + * .setId("textArea1") + * .setName("Search") + * .setHelpText("for example, Coldplay") + * .setAllowOverride(true) + * .setPlaceholder("Search for an artist for all songs."); + */ + export interface TextArea { + setAllowOverride(allowOverride: boolean): TextArea; + setHelpText(helpText: string): TextArea; + setId(id: string): TextArea; + setName(name: string): TextArea; + setPlaceholder(placeholder: string): TextArea; + } + + /** + * Contains text input information for the config. Its properties determine how the text input is + * displayed in Data Studio. + * + * var cc = DataStudioApp.createCommunityConnector(); + * var config = cc.getConfig(); + * + * var info1 = config.newTextInput() + * .setId("info1") + * .setName("Search") + * .setHelpText("for example, Coldplay") + * .setAllowOverride(true) + * .setPlaceholder("Search for an artist for all songs."); + */ + export interface TextInput { + setAllowOverride(allowOverride: boolean): TextInput; + setHelpText(helpText: string): TextInput; + setId(id: string): TextInput; + setName(name: string): TextInput; + setPlaceholder(placeholder: string): TextInput; + } + + /** + * An error that is shown to users of the connector. + * + * var cc = DataStudioApp.createCommunityConnector(); + * + * cc.newUserError() + * .setText("This is the debug error text.") + * .setDebugText("This text is only shown to admins.") + * .throwException(); + */ + export interface UserError { + printJson(): string; + setDebugText(text: string): UserError; + setText(text: string): UserError; + throwException(): void; + } + + } +} + +declare var DataStudioApp: GoogleAppsScript.Data_Studio.DataStudioApp; diff --git a/types/google-apps-script/google-apps-script.forms.d.ts b/types/google-apps-script/google-apps-script.forms.d.ts index df08002505..2f4508a956 100644 --- a/types/google-apps-script/google-apps-script.forms.d.ts +++ b/types/google-apps-script/google-apps-script.forms.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2018-07-11 +// Type definitions for Google Apps Script 2018-12-26 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -671,7 +671,7 @@ declare namespace GoogleAppsScript { * item.setHelpText('Description of new section.'); * } */ - export enum ItemType { CHECKBOX, CHECKBOX_GRID, DATE, DATETIME, DURATION, GRID, IMAGE, LIST, MULTIPLE_CHOICE, PAGE_BREAK, PARAGRAPH_TEXT, SCALE, SECTION_HEADER, TEXT, TIME } + export enum ItemType { CHECKBOX, CHECKBOX_GRID, DATE, DATETIME, DURATION, GRID, IMAGE, LIST, MULTIPLE_CHOICE, PAGE_BREAK, PARAGRAPH_TEXT, SCALE, SECTION_HEADER, TEXT, TIME, VIDEO } /** * A question item that allows the respondent to select one choice from a drop-down list. Items can diff --git a/types/google-apps-script/google-apps-script.gmail.d.ts b/types/google-apps-script/google-apps-script.gmail.d.ts index db8e6ecc52..b71a7226b6 100644 --- a/types/google-apps-script/google-apps-script.gmail.d.ts +++ b/types/google-apps-script/google-apps-script.gmail.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2018-07-11 +// Type definitions for Google Apps Script 2018-12-26 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -103,6 +103,7 @@ declare namespace GoogleAppsScript { getContentType(): string; getDataAsString(): string; getDataAsString(charset: string): string; + getHash(): string; getName(): string; getSize(): Integer; isGoogleType(): boolean; diff --git a/types/google-apps-script/google-apps-script.groups.d.ts b/types/google-apps-script/google-apps-script.groups.d.ts index 757029f044..958838de57 100644 --- a/types/google-apps-script/google-apps-script.groups.d.ts +++ b/types/google-apps-script/google-apps-script.groups.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2018-07-11 +// Type definitions for Google Apps Script 2018-12-26 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -16,13 +16,13 @@ declare namespace GoogleAppsScript { * * function listGroupMembers() { * var group = GroupsApp.getGroupByEmail("example@googlegroups.com"); - * var s = group.getEmail() + ': '; + * var str = group.getEmail() + ': '; * var users = group.getUsers(); * for (var i = 0; i < users.length; i++) { * var user = users[i]; - * s = s + user.getEmail() + ", "; + * str = str + user.getEmail() + ", "; * } - * Logger.log(s); + * Logger.log(str); * } */ export interface Group { diff --git a/types/google-apps-script/google-apps-script.script.d.ts b/types/google-apps-script/google-apps-script.script.d.ts index fbe95deb8c..5130b54db9 100644 --- a/types/google-apps-script/google-apps-script.script.d.ts +++ b/types/google-apps-script/google-apps-script.script.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2018-07-11 +// Type definitions for Google Apps Script 2018-12-26 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -15,8 +15,8 @@ declare namespace GoogleAppsScript { * An enumeration that identifies which categories of authorized services Apps Script is able to * execute through a triggered function. These values are exposed in triggered functions as the authMode * property of the event parameter, e. For - * more information, see the guide to the authorization - * lifecycle for add-ons. + * more information, see the guide to the + * authorization lifecycle for add-ons. * * function onOpen(e) { * var menu = SpreadsheetApp.getUi().createAddonMenu(); diff --git a/types/google-apps-script/google-apps-script.sites.d.ts b/types/google-apps-script/google-apps-script.sites.d.ts index b8e7fff5f0..6ca13e808a 100644 --- a/types/google-apps-script/google-apps-script.sites.d.ts +++ b/types/google-apps-script/google-apps-script.sites.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2018-07-11 +// Type definitions for Google Apps Script 2019-01-23 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,7 +11,8 @@ declare namespace GoogleAppsScript { /** * A Sites Attachment such as a file attached to a page. * - * Note that an Attachment is a Blob and can be used anywhere Blob input is expected. A rebuilt + * Note that an Attachment is a Blob and can be used anywhere Blob input is expected. + * A rebuilt * version of Sites was launched on November 22, 2016. Apps Script cannot currently access or * modify Sites made with this version, but script can still access * classic Sites. @@ -44,7 +45,8 @@ declare namespace GoogleAppsScript { } /** - * A typesafe enum for sites attachment type. A rebuilt + * A typesafe enum for sites attachment type. + * A rebuilt * version of Sites was launched on November 22, 2016. Apps Script cannot currently access or * modify Sites made with this version, but script can still access * classic Sites. @@ -52,7 +54,8 @@ declare namespace GoogleAppsScript { export enum AttachmentType { WEB, HOSTED } /** - * A Sites Column - a column from a Sites List page. A rebuilt + * A Sites Column - a column from a Sites List page. + * A rebuilt * version of Sites was launched on November 22, 2016. Apps Script cannot currently access or * modify Sites made with this version, but script can still access * classic Sites. @@ -65,7 +68,8 @@ declare namespace GoogleAppsScript { } /** - * A Comment attached to any Sites page. A rebuilt + * A Comment attached to any Sites page. + * A rebuilt * version of Sites was launched on November 22, 2016. Apps Script cannot currently access or * modify Sites made with this version, but script can still access * classic Sites. @@ -83,7 +87,8 @@ declare namespace GoogleAppsScript { } /** - * A Sites ListItem - a list element from a Sites List page. A rebuilt + * A Sites ListItem - a list element from a Sites List page. + * A rebuilt * version of Sites was launched on November 22, 2016. Apps Script cannot currently access or * modify Sites made with this version, but script can still access * classic Sites. @@ -101,7 +106,8 @@ declare namespace GoogleAppsScript { } /** - * A Page on a Google Site. A rebuilt + * A Page on a Google Site. + * A rebuilt * version of Sites was launched on November 22, 2016. Apps Script cannot currently access or * modify Sites made with this version, but script can still access * classic Sites. @@ -162,7 +168,8 @@ declare namespace GoogleAppsScript { } /** - * A typesafe enum for sites page type. A rebuilt + * A typesafe enum for sites page type. + * A rebuilt * version of Sites was launched on November 22, 2016. Apps Script cannot currently access or * modify Sites made with this version, but script can still access * classic Sites. @@ -170,7 +177,8 @@ declare namespace GoogleAppsScript { export enum PageType { WEB_PAGE, LIST_PAGE, ANNOUNCEMENT, ANNOUNCEMENTS_PAGE, FILE_CABINET_PAGE } /** - * An object representing a Google Site. A rebuilt + * An object representing a Google Site. + * A rebuilt * version of Sites was launched on November 22, 2016. Apps Script cannot currently access or * modify Sites made with this version, but script can still access * classic Sites. @@ -238,7 +246,8 @@ declare namespace GoogleAppsScript { } /** - * Create and access Google Sites. A rebuilt + * Create and access Google Sites. + * A rebuilt * version of Sites was launched on November 22, 2016. Apps Script cannot currently access or * modify Sites made with this version, but script can still access * classic Sites. diff --git a/types/google-apps-script/google-apps-script.slides.d.ts b/types/google-apps-script/google-apps-script.slides.d.ts index 3d1aac9227..1619d92369 100644 --- a/types/google-apps-script/google-apps-script.slides.d.ts +++ b/types/google-apps-script/google-apps-script.slides.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2018-07-11 +// Type definitions for Google Apps Script 2019-01-06 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -125,6 +125,14 @@ declare namespace GoogleAppsScript { */ export enum ColorType { UNSUPPORTED, RGB, THEME } + /** + * The connection site on a PageElement that can connect to a connector. + */ + export interface ConnectionSite { + getIndex(): Integer; + getPageElement(): PageElement; + } + /** * The content alignments for a Shape or TableCell. The supported alignments * correspond to predefined text anchoring types from the ECMA-376 standard. @@ -172,8 +180,11 @@ declare namespace GoogleAppsScript { */ export interface Group { alignOnPage(alignmentPosition: AlignmentPosition): Group; + bringForward(): Group; + bringToFront(): Group; duplicate(): PageElement; getChildren(): PageElement[]; + getConnectionSites(): ConnectionSite[]; getDescription(): string; getHeight(): Number; getInherentHeight(): Number; @@ -194,9 +205,13 @@ declare namespace GoogleAppsScript { scaleWidth(ratio: Number): Group; select(): void; select(replace: boolean): void; + sendBackward(): Group; + sendToBack(): Group; + setDescription(description: string): Group; setHeight(height: Number): Group; setLeft(left: Number): Group; setRotation(angle: Number): Group; + setTitle(title: string): Group; setTop(top: Number): Group; setTransform(transform: AffineTransform): Group; setWidth(width: Number): Group; @@ -208,10 +223,13 @@ declare namespace GoogleAppsScript { */ export interface Image { alignOnPage(alignmentPosition: AlignmentPosition): Image; + bringForward(): Image; + bringToFront(): Image; duplicate(): PageElement; getAs(contentType: string): Base.Blob; getBlob(): Base.Blob; getBorder(): Border; + getConnectionSites(): ConnectionSite[]; getContentUrl(): string; getDescription(): string; getHeight(): Number; @@ -240,6 +258,9 @@ declare namespace GoogleAppsScript { scaleWidth(ratio: Number): Image; select(): void; select(replace: boolean): void; + sendBackward(): Image; + sendToBack(): Image; + setDescription(description: string): Image; setHeight(height: Number): Image; setLeft(left: Number): Image; setLinkSlide(slideIndex: Integer): Link; @@ -247,6 +268,7 @@ declare namespace GoogleAppsScript { setLinkSlide(slidePosition: SlidePosition): Link; setLinkUrl(url: string): Link; setRotation(angle: Number): Image; + setTitle(title: string): Image; setTop(top: Number): Image; setTransform(transform: AffineTransform): Image; setWidth(width: Number): Image; @@ -267,6 +289,7 @@ declare namespace GoogleAppsScript { getLines(): Line[]; getMaster(): Master; getObjectId(): string; + getPageElementById(id: string): PageElement; getPageElements(): PageElement[]; getPageType(): PageType; getPlaceholder(placeholderType: PlaceholderType): PageElement; @@ -285,6 +308,7 @@ declare namespace GoogleAppsScript { insertImage(imageUrl: string): Image; insertImage(imageUrl: string, left: Number, top: Number, width: Number, height: Number): Image; insertLine(line: Line): Line; + insertLine(lineCategory: LineCategory, startConnectionSite: ConnectionSite, endConnectionSite: ConnectionSite): Line; insertLine(lineCategory: LineCategory, startLeft: Number, startTop: Number, endLeft: Number, endTop: Number): Line; insertPageElement(pageElement: PageElement): PageElement; insertShape(shape: Shape): Shape; @@ -298,6 +322,8 @@ declare namespace GoogleAppsScript { insertTable(numRows: Integer, numColumns: Integer): Table; insertTable(numRows: Integer, numColumns: Integer, left: Number, top: Number, width: Number, height: Number): Table; insertTable(table: Table): Table; + insertTextBox(text: string): Shape; + insertTextBox(text: string, left: Number, top: Number, width: Number, height: Number): Shape; insertVideo(videoUrl: string): Video; insertVideo(videoUrl: string, left: Number, top: Number, width: Number, height: Number): Video; insertVideo(video: Video): Video; @@ -313,15 +339,20 @@ declare namespace GoogleAppsScript { */ export interface Line { alignOnPage(alignmentPosition: AlignmentPosition): Line; + bringForward(): Line; + bringToFront(): Line; duplicate(): PageElement; + getConnectionSites(): ConnectionSite[]; getDashStyle(): DashStyle; getDescription(): string; getEnd(): Point; getEndArrow(): ArrowStyle; + getEndConnection(): ConnectionSite; getHeight(): Number; getInherentHeight(): Number; getInherentWidth(): Number; getLeft(): Number; + getLineCategory(): LineCategory; getLineFill(): LineFill; getLineType(): LineType; getLink(): Link; @@ -332,24 +363,32 @@ declare namespace GoogleAppsScript { getRotation(): Number; getStart(): Point; getStartArrow(): ArrowStyle; + getStartConnection(): ConnectionSite; getTitle(): string; getTop(): Number; getTransform(): AffineTransform; getWeight(): Number; getWidth(): Number; + isConnector(): boolean; preconcatenateTransform(transform: AffineTransform): Line; remove(): void; removeLink(): void; + reroute(): Line; scaleHeight(ratio: Number): Line; scaleWidth(ratio: Number): Line; select(): void; select(replace: boolean): void; + sendBackward(): Line; + sendToBack(): Line; setDashStyle(style: DashStyle): Line; + setDescription(description: string): Line; setEnd(left: Number, top: Number): Line; setEnd(point: Point): Line; setEndArrow(style: ArrowStyle): Line; + setEndConnection(connectionSite: ConnectionSite): Line; setHeight(height: Number): Line; setLeft(left: Number): Line; + setLineCategory(lineCategory: LineCategory): Line; setLinkSlide(slideIndex: Integer): Link; setLinkSlide(slide: Slide): Link; setLinkSlide(slidePosition: SlidePosition): Link; @@ -358,6 +397,8 @@ declare namespace GoogleAppsScript { setStart(left: Number, top: Number): Line; setStart(point: Point): Line; setStartArrow(style: ArrowStyle): Line; + setStartConnection(connectionSite: ConnectionSite): Line; + setTitle(title: string): Line; setTop(top: Number): Line; setTransform(transform: AffineTransform): Line; setWeight(points: Number): Line; @@ -370,7 +411,7 @@ declare namespace GoogleAppsScript { * The exact LineType created is determined based on the category and how it's routed to * connect to other page elements. */ - export enum LineCategory { STRAIGHT, BENT, CURVED } + export enum LineCategory { UNSUPPORTED, STRAIGHT, BENT, CURVED } /** * Describes the fill of a line or outline @@ -504,6 +545,7 @@ declare namespace GoogleAppsScript { getLayouts(): Layout[]; getLines(): Line[]; getObjectId(): string; + getPageElementById(id: string): PageElement; getPageElements(): PageElement[]; getPageType(): PageType; getPlaceholder(placeholderType: PlaceholderType): PageElement; @@ -522,6 +564,7 @@ declare namespace GoogleAppsScript { insertImage(imageUrl: string): Image; insertImage(imageUrl: string, left: Number, top: Number, width: Number, height: Number): Image; insertLine(line: Line): Line; + insertLine(lineCategory: LineCategory, startConnectionSite: ConnectionSite, endConnectionSite: ConnectionSite): Line; insertLine(lineCategory: LineCategory, startLeft: Number, startTop: Number, endLeft: Number, endTop: Number): Line; insertPageElement(pageElement: PageElement): PageElement; insertShape(shape: Shape): Shape; @@ -535,6 +578,8 @@ declare namespace GoogleAppsScript { insertTable(numRows: Integer, numColumns: Integer): Table; insertTable(numRows: Integer, numColumns: Integer, left: Number, top: Number, width: Number, height: Number): Table; insertTable(table: Table): Table; + insertTextBox(text: string): Shape; + insertTextBox(text: string, left: Number, top: Number, width: Number, height: Number): Shape; insertVideo(videoUrl: string): Video; insertVideo(videoUrl: string, left: Number, top: Number, width: Number, height: Number): Video; insertVideo(video: Video): Video; @@ -556,6 +601,7 @@ declare namespace GoogleAppsScript { getImages(): Image[]; getLines(): Line[]; getObjectId(): string; + getPageElementById(id: string): PageElement; getPageElements(): PageElement[]; getPlaceholder(placeholderType: PlaceholderType): PageElement; getPlaceholder(placeholderType: PlaceholderType, placeholderIndex: Integer): PageElement; @@ -579,6 +625,7 @@ declare namespace GoogleAppsScript { getImages(): Image[]; getLines(): Line[]; getObjectId(): string; + getPageElementById(id: string): PageElement; getPageElements(): PageElement[]; getPlaceholder(placeholderType: PlaceholderType): PageElement; getPlaceholder(placeholderType: PlaceholderType, placeholderIndex: Integer): PageElement; @@ -606,6 +653,7 @@ declare namespace GoogleAppsScript { getImages(): Image[]; getLines(): Line[]; getObjectId(): string; + getPageElementById(id: string): PageElement; getPageElements(): PageElement[]; getPageType(): PageType; getPlaceholder(placeholderType: PlaceholderType): PageElement; @@ -624,6 +672,7 @@ declare namespace GoogleAppsScript { insertImage(imageUrl: string): Image; insertImage(imageUrl: string, left: Number, top: Number, width: Number, height: Number): Image; insertLine(line: Line): Line; + insertLine(lineCategory: LineCategory, startConnectionSite: ConnectionSite, endConnectionSite: ConnectionSite): Line; insertLine(lineCategory: LineCategory, startLeft: Number, startTop: Number, endLeft: Number, endTop: Number): Line; insertPageElement(pageElement: PageElement): PageElement; insertShape(shape: Shape): Shape; @@ -637,6 +686,8 @@ declare namespace GoogleAppsScript { insertTable(numRows: Integer, numColumns: Integer): Table; insertTable(numRows: Integer, numColumns: Integer, left: Number, top: Number, width: Number, height: Number): Table; insertTable(table: Table): Table; + insertTextBox(text: string): Shape; + insertTextBox(text: string, left: Number, top: Number, width: Number, height: Number): Shape; insertVideo(videoUrl: string): Video; insertVideo(videoUrl: string, left: Number, top: Number, width: Number, height: Number): Video; insertVideo(video: Video): Video; @@ -686,7 +737,10 @@ declare namespace GoogleAppsScript { asTable(): Table; asVideo(): Video; asWordArt(): WordArt; + bringForward(): PageElement; + bringToFront(): PageElement; duplicate(): PageElement; + getConnectionSites(): ConnectionSite[]; getDescription(): string; getHeight(): Number; getInherentHeight(): Number; @@ -707,9 +761,13 @@ declare namespace GoogleAppsScript { scaleWidth(ratio: Number): PageElement; select(): void; select(replace: boolean): void; + sendBackward(): PageElement; + sendToBack(): PageElement; + setDescription(description: string): PageElement; setHeight(height: Number): PageElement; setLeft(left: Number): PageElement; setRotation(angle: Number): PageElement; + setTitle(title: string): PageElement; setTop(top: Number): PageElement; setTransform(transform: AffineTransform): PageElement; setWidth(width: Number): PageElement; @@ -828,6 +886,7 @@ declare namespace GoogleAppsScript { appendSlide(layout: Layout): Slide; appendSlide(predefinedLayout: PredefinedLayout): Slide; appendSlide(slide: Slide): Slide; + appendSlide(slide: Slide, linkingMode: SlideLinkingMode): Slide; getEditors(): Base.User[]; getId(): string; getLayouts(): Layout[]; @@ -836,11 +895,11 @@ declare namespace GoogleAppsScript { getNotesMaster(): NotesMaster; getNotesPageHeight(): Number; getNotesPageWidth(): Number; - getPageElementById(id: string): PageElement; + getPageElementById(id: string): PageElement; getPageHeight(): Number; getPageWidth(): Number; getSelection(): Selection; - getSlideById(id: string): Slide; + getSlideById(id: string): Slide; getSlides(): Slide[]; getUrl(): string; getViewers(): Base.User[]; @@ -848,6 +907,7 @@ declare namespace GoogleAppsScript { insertSlide(insertionIndex: Integer, layout: Layout): Slide; insertSlide(insertionIndex: Integer, predefinedLayout: PredefinedLayout): Slide; insertSlide(insertionIndex: Integer, slide: Slide): Slide; + insertSlide(insertionIndex: Integer, slide: Slide, linkingMode: SlideLinkingMode): Slide; removeEditor(emailAddress: string): Presentation; removeEditor(user: Base.User): Presentation; removeViewer(emailAddress: string): Presentation; @@ -903,8 +963,11 @@ declare namespace GoogleAppsScript { */ export interface Shape { alignOnPage(alignmentPosition: AlignmentPosition): Shape; + bringForward(): Shape; + bringToFront(): Shape; duplicate(): PageElement; getBorder(): Border; + getConnectionSites(): ConnectionSite[]; getContentAlignment(): ContentAlignment; getDescription(): string; getFill(): Fill; @@ -940,7 +1003,10 @@ declare namespace GoogleAppsScript { scaleWidth(ratio: Number): Shape; select(): void; select(replace: boolean): void; + sendBackward(): Shape; + sendToBack(): Shape; setContentAlignment(contentAlignment: ContentAlignment): Shape; + setDescription(description: string): Shape; setHeight(height: Number): Shape; setLeft(left: Number): Shape; setLinkSlide(slideIndex: Integer): Link; @@ -948,6 +1014,7 @@ declare namespace GoogleAppsScript { setLinkSlide(slidePosition: SlidePosition): Link; setLinkUrl(url: string): Link; setRotation(angle: Number): Shape; + setTitle(title: string): Shape; setTop(top: Number): Shape; setTransform(transform: AffineTransform): Shape; setWidth(width: Number): Shape; @@ -968,8 +1035,11 @@ declare namespace GoogleAppsScript { export interface SheetsChart { alignOnPage(alignmentPosition: AlignmentPosition): SheetsChart; asImage(): Image; + bringForward(): SheetsChart; + bringToFront(): SheetsChart; duplicate(): PageElement; getChartId(): Integer; + getConnectionSites(): ConnectionSite[]; getDescription(): string; getEmbedType(): SheetsChartEmbedType; getHeight(): Number; @@ -995,6 +1065,9 @@ declare namespace GoogleAppsScript { scaleWidth(ratio: Number): SheetsChart; select(): void; select(replace: boolean): void; + sendBackward(): SheetsChart; + sendToBack(): SheetsChart; + setDescription(description: string): SheetsChart; setHeight(height: Number): SheetsChart; setLeft(left: Number): SheetsChart; setLinkSlide(slideIndex: Integer): Link; @@ -1002,6 +1075,7 @@ declare namespace GoogleAppsScript { setLinkSlide(slidePosition: SlidePosition): Link; setLinkUrl(url: string): Link; setRotation(angle: Number): SheetsChart; + setTitle(title: string): SheetsChart; setTop(top: Number): SheetsChart; setTransform(transform: AffineTransform): SheetsChart; setWidth(width: Number): SheetsChart; @@ -1028,6 +1102,7 @@ declare namespace GoogleAppsScript { getLines(): Line[]; getNotesPage(): NotesPage; getObjectId(): string; + getPageElementById(id: string): PageElement; getPageElements(): PageElement[]; getPageType(): PageType; getPlaceholder(placeholderType: PlaceholderType): PageElement; @@ -1035,6 +1110,9 @@ declare namespace GoogleAppsScript { getPlaceholders(): PageElement[]; getShapes(): Shape[]; getSheetsCharts(): SheetsChart[]; + getSlideLinkingMode(): SlideLinkingMode; + getSourcePresentationId(): string; + getSourceSlideObjectId(): string; getTables(): Table[]; getVideos(): Video[]; getWordArts(): WordArt[]; @@ -1046,6 +1124,7 @@ declare namespace GoogleAppsScript { insertImage(imageUrl: string): Image; insertImage(imageUrl: string, left: Number, top: Number, width: Number, height: Number): Image; insertLine(line: Line): Line; + insertLine(lineCategory: LineCategory, startConnectionSite: ConnectionSite, endConnectionSite: ConnectionSite): Line; insertLine(lineCategory: LineCategory, startLeft: Number, startTop: Number, endLeft: Number, endTop: Number): Line; insertPageElement(pageElement: PageElement): PageElement; insertShape(shape: Shape): Shape; @@ -1059,17 +1138,26 @@ declare namespace GoogleAppsScript { insertTable(numRows: Integer, numColumns: Integer): Table; insertTable(numRows: Integer, numColumns: Integer, left: Number, top: Number, width: Number, height: Number): Table; insertTable(table: Table): Table; + insertTextBox(text: string): Shape; + insertTextBox(text: string, left: Number, top: Number, width: Number, height: Number): Shape; insertVideo(videoUrl: string): Video; insertVideo(videoUrl: string, left: Number, top: Number, width: Number, height: Number): Video; insertVideo(video: Video): Video; insertWordArt(wordArt: WordArt): WordArt; move(index: Integer): void; + refreshSlide(): void; remove(): void; replaceAllText(findText: string, replaceText: string): Integer; replaceAllText(findText: string, replaceText: string, matchCase: boolean): Integer; selectAsCurrentPage(): void; + unlink(): void; } + /** + * The mode of links between slides. + */ + export enum SlideLinkingMode { UNSUPPORTED, LINKED, NOT_LINKED } + /** * The relative position of a Slide. */ @@ -1144,9 +1232,12 @@ declare namespace GoogleAppsScript { alignOnPage(alignmentPosition: AlignmentPosition): Table; appendColumn(): TableColumn; appendRow(): TableRow; + bringForward(): Table; + bringToFront(): Table; duplicate(): PageElement; getCell(rowIndex: Integer, columnIndex: Integer): TableCell; getColumn(columnIndex: Integer): TableColumn; + getConnectionSites(): ConnectionSite[]; getDescription(): string; getHeight(): Number; getInherentHeight(): Number; @@ -1172,9 +1263,13 @@ declare namespace GoogleAppsScript { scaleWidth(ratio: Number): Table; select(): void; select(replace: boolean): void; + sendBackward(): Table; + sendToBack(): Table; + setDescription(description: string): Table; setHeight(height: Number): Table; setLeft(left: Number): Table; setRotation(angle: Number): Table; + setTitle(title: string): Table; setTop(top: Number): Table; setTransform(transform: AffineTransform): Table; setWidth(width: Number): Table; @@ -1343,8 +1438,11 @@ declare namespace GoogleAppsScript { */ export interface Video { alignOnPage(alignmentPosition: AlignmentPosition): Video; + bringForward(): Video; + bringToFront(): Video; duplicate(): PageElement; getBorder(): Border; + getConnectionSites(): ConnectionSite[]; getDescription(): string; getHeight(): Number; getInherentHeight(): Number; @@ -1369,9 +1467,13 @@ declare namespace GoogleAppsScript { scaleWidth(ratio: Number): Video; select(): void; select(replace: boolean): void; + sendBackward(): Video; + sendToBack(): Video; + setDescription(description: string): Video; setHeight(height: Number): Video; setLeft(left: Number): Video; setRotation(angle: Number): Video; + setTitle(title: string): Video; setTop(top: Number): Video; setTransform(transform: AffineTransform): Video; setWidth(width: Number): Video; @@ -1387,7 +1489,10 @@ declare namespace GoogleAppsScript { */ export interface WordArt { alignOnPage(alignmentPosition: AlignmentPosition): WordArt; + bringForward(): WordArt; + bringToFront(): WordArt; duplicate(): PageElement; + getConnectionSites(): ConnectionSite[]; getDescription(): string; getHeight(): Number; getInherentHeight(): Number; @@ -1411,6 +1516,9 @@ declare namespace GoogleAppsScript { scaleWidth(ratio: Number): WordArt; select(): void; select(replace: boolean): void; + sendBackward(): WordArt; + sendToBack(): WordArt; + setDescription(description: string): WordArt; setHeight(height: Number): WordArt; setLeft(left: Number): WordArt; setLinkSlide(slideIndex: Integer): Link; @@ -1418,6 +1526,7 @@ declare namespace GoogleAppsScript { setLinkSlide(slidePosition: SlidePosition): Link; setLinkUrl(url: string): Link; setRotation(angle: Number): WordArt; + setTitle(title: string): WordArt; setTop(top: Number): WordArt; setTransform(transform: AffineTransform): WordArt; setWidth(width: Number): WordArt; diff --git a/types/google-apps-script/google-apps-script.spreadsheet.d.ts b/types/google-apps-script/google-apps-script.spreadsheet.d.ts index 4ac5c84d6b..d8dc3bc4d0 100644 --- a/types/google-apps-script/google-apps-script.spreadsheet.d.ts +++ b/types/google-apps-script/google-apps-script.spreadsheet.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2018-07-11 +// Type definitions for Google Apps Script 2019-01-23 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -99,7 +99,7 @@ declare namespace GoogleAppsScript { * var range = sheet.getRange("A1:B3"); * var rule = SpreadsheetApp.newConditionalFormatRule() * .whenNumberBetween(1, 10) - * .setBackgroundColor("#FF0000") + * .setBackground("#FF0000") * .setRanges([range]) * .build(); * var rules = sheet.getConditionalFormatRules(); @@ -268,6 +268,61 @@ declare namespace GoogleAppsScript { */ export enum DataValidationCriteria { DATE_AFTER, DATE_BEFORE, DATE_BETWEEN, DATE_EQUAL_TO, DATE_IS_VALID_DATE, DATE_NOT_BETWEEN, DATE_ON_OR_AFTER, DATE_ON_OR_BEFORE, NUMBER_BETWEEN, NUMBER_EQUAL_TO, NUMBER_GREATER_THAN, NUMBER_GREATER_THAN_OR_EQUAL_TO, NUMBER_LESS_THAN, NUMBER_LESS_THAN_OR_EQUAL_TO, NUMBER_NOT_BETWEEN, NUMBER_NOT_EQUAL_TO, TEXT_CONTAINS, TEXT_DOES_NOT_CONTAIN, TEXT_EQUAL_TO, TEXT_IS_VALID_EMAIL, TEXT_IS_VALID_URL, VALUE_IN_LIST, VALUE_IN_RANGE, CUSTOM_FORMULA, CHECKBOX } + /** + * Access and modify developer metadata. To create new developer metadata use Range.addDeveloperMetadata(key), Sheet.addDeveloperMetadata(key), or Spreadsheet.addDeveloperMetadata(key). + */ + export interface DeveloperMetadata { + getId(): Integer; + getKey(): string; + getLocation(): DeveloperMetadataLocation; + getValue(): string; + getVisibility(): DeveloperMetadataVisibility; + moveToColumn(column: Range): DeveloperMetadata; + moveToRow(row: Range): DeveloperMetadata; + moveToSheet(sheet: Sheet): DeveloperMetadata; + moveToSpreadsheet(): DeveloperMetadata; + remove(): void; + setKey(key: string): DeveloperMetadata; + setValue(value: string): DeveloperMetadata; + setVisibility(visibility: DeveloperMetadataVisibility): DeveloperMetadata; + } + + /** + * Search for developer metadata in a spreadsheet. To create new developer metadata finder use + * Range.createDeveloperMetadataFinder(), Sheet.createDeveloperMetadataFinder(), + * or Spreadsheet.createDeveloperMetadataFinder(). + */ + export interface DeveloperMetadataFinder { + find(): DeveloperMetadata[]; + onIntersectingLocations(): DeveloperMetadataFinder; + withId(id: Integer): DeveloperMetadataFinder; + withKey(key: string): DeveloperMetadataFinder; + withLocationType(locationType: DeveloperMetadataLocationType): DeveloperMetadataFinder; + withValue(value: string): DeveloperMetadataFinder; + withVisibility(visibility: DeveloperMetadataVisibility): DeveloperMetadataFinder; + } + + /** + * Access developer metadata location information. + */ + export interface DeveloperMetadataLocation { + getColumn(): Range; + getLocationType(): DeveloperMetadataLocationType; + getRow(): Range; + getSheet(): Sheet; + getSpreadsheet(): Spreadsheet; + } + + /** + * An enumeration of the types of developer metadata location types. + */ + export enum DeveloperMetadataLocationType { SPREADSHEET, SHEET, ROW, COLUMN } + + /** + * An enumeration of the types of developer metadata visibility. + */ + export enum DeveloperMetadataVisibility { DOCUMENT, PROJECT } + /** * An enumeration of possible directions along which data can be stored in a spreadsheet. */ @@ -896,6 +951,36 @@ declare namespace GoogleAppsScript { setRange(range: Range): NamedRange; } + /** + * Represents an image over the grid in a spreadsheet. + */ + export interface OverGridImage { + assignScript(functionName: string): OverGridImage; + getAltTextDescription(): string; + getAltTextTitle(): string; + getAnchorCell(): Range; + getAnchorCellXOffset(): Integer; + getAnchorCellYOffset(): Integer; + getHeight(): Integer; + getInherentHeight(): Integer; + getInherentWidth(): Integer; + getScript(): string; + getSheet(): Sheet; + getUrl(): string; + getWidth(): Integer; + remove(): void; + replace(blob: Base.BlobSource): OverGridImage; + replace(url: string): OverGridImage; + resetSize(): OverGridImage; + setAltTextDescription(description: string): OverGridImage; + setAltTextTitle(title: string): OverGridImage; + setAnchorCell(cell: Range): OverGridImage; + setAnchorCellXOffset(offset: Integer): OverGridImage; + setAnchorCellYOffset(offset: Integer): OverGridImage; + setHeight(height: Integer): OverGridImage; + setWidth(width: Integer): OverGridImage; + } + /** * * Deprecated. For spreadsheets created in the newer version of Google Sheets, use the more powerful @@ -1091,6 +1176,10 @@ declare namespace GoogleAppsScript { export interface Range { activate(): Range; activateAsCurrentCell(): Range; + addDeveloperMetadata(key: string): Range; + addDeveloperMetadata(key: string, visibility: DeveloperMetadataVisibility): Range; + addDeveloperMetadata(key: string, value: string): Range; + addDeveloperMetadata(key: string, value: string, visibility: DeveloperMetadataVisibility): Range; applyColumnBanding(): Banding; applyColumnBanding(bandingTheme: BandingTheme): Banding; applyColumnBanding(bandingTheme: BandingTheme, showHeader: boolean, showFooter: boolean): Banding; @@ -1115,6 +1204,7 @@ declare namespace GoogleAppsScript { copyTo(destination: Range, options: Object): void; copyValuesToRange(gridId: Integer, column: Integer, columnEnd: Integer, row: Integer, rowEnd: Integer): void; copyValuesToRange(sheet: Sheet, column: Integer, columnEnd: Integer, row: Integer, rowEnd: Integer): void; + createDeveloperMetadataFinder(): DeveloperMetadataFinder; createFilter(): Filter; createPivotTable(sourceData: Range): PivotTable; deleteCells(shiftDimension: Dimension): void; @@ -1130,6 +1220,7 @@ declare namespace GoogleAppsScript { getDataTable(firstRowIsHeader: boolean): Charts.DataTable; getDataValidation(): DataValidation; getDataValidations(): DataValidation[][]; + getDeveloperMetadata(): DeveloperMetadata[]; getDisplayValue(): string; getDisplayValues(): string[][]; getFilter(): Filter; @@ -1163,6 +1254,8 @@ declare namespace GoogleAppsScript { getNumRows(): Integer; getNumberFormat(): string; getNumberFormats(): string[][]; + getRichTextValue(): RichTextValue; + getRichTextValues(): RichTextValue[][]; getRow(): Integer; getRowIndex(): Integer; getSheet(): Sheet; @@ -1170,6 +1263,8 @@ declare namespace GoogleAppsScript { getTextDirections(): TextDirection[][]; getTextRotation(): TextRotation; getTextRotations(): TextRotation[][]; + getTextStyle(): TextStyle; + getTextStyles(): TextStyle[][]; getValue(): Object; getValues(): Object[][]; getVerticalAlignment(): string; @@ -1178,7 +1273,7 @@ declare namespace GoogleAppsScript { getWrap(): boolean; getWrapStrategies(): WrapStrategy[][]; getWrapStrategy(): WrapStrategy; - getWraps(): Boolean[][]; + getWraps(): boolean[][]; insertCells(shiftDimension: Dimension): Range; isBlank(): boolean; isEndColumnBounded(): boolean; @@ -1224,12 +1319,16 @@ declare namespace GoogleAppsScript { setNotes(notes: Object[][]): Range; setNumberFormat(numberFormat: string): Range; setNumberFormats(numberFormats: Object[][]): Range; + setRichTextValue(value: RichTextValue): Range; + setRichTextValues(values: RichTextValue[][]): Range; setShowHyperlink(showHyperlink: boolean): Range; setTextDirection(direction: TextDirection): Range; setTextDirections(directions: TextDirection[][]): Range; setTextRotation(degrees: Integer): Range; setTextRotation(rotation: TextRotation): Range; setTextRotations(rotations: TextRotation[][]): Range; + setTextStyle(style: TextStyle): Range; + setTextStyles(styles: TextStyle[][]): Range; setValue(value: Object): Range; setValues(values: Object[][]): Range; setVerticalAlignment(alignment: string): Range; @@ -1292,6 +1391,34 @@ declare namespace GoogleAppsScript { */ export enum RelativeDate { TODAY, TOMORROW, YESTERDAY, PAST_WEEK, PAST_MONTH, PAST_YEAR } + /** + * A stylized text string used to represent cell text. Substrings of the text can have different + * text styles. + * + * A run is the longest unbroken substring having the same text style. For example, the + * sentence "This kid has two apples." has four runs: ["This ", "kid ", "has two ", + * "apples."]. + */ + export interface RichTextValue { + copy(): RichTextValueBuilder; + getEndIndex(): Integer; + getRuns(): RichTextValue[]; + getStartIndex(): Integer; + getText(): string; + getTextStyle(): TextStyle; + getTextStyle(startOffset: Integer, endOffset: Integer): TextStyle; + } + + /** + * A builder for Rich Text values. + */ + export interface RichTextValueBuilder { + build(): RichTextValue; + setText(text: string): RichTextValueBuilder; + setTextStyle(startOffset: Integer, endOffset: Integer, textStyle: TextStyle): RichTextValueBuilder; + setTextStyle(textStyle: TextStyle): RichTextValueBuilder; + } + /** * Access the current active selection in the active sheet. A selection is the set of cells the user * has highlighted in the sheet, which can be non-adjacent ranges. One cell in the selection is the @@ -1328,6 +1455,10 @@ declare namespace GoogleAppsScript { */ export interface Sheet { activate(): Sheet; + addDeveloperMetadata(key: string): Sheet; + addDeveloperMetadata(key: string, visibility: DeveloperMetadataVisibility): Sheet; + addDeveloperMetadata(key: string, value: string): Sheet; + addDeveloperMetadata(key: string, value: string, visibility: DeveloperMetadataVisibility): Sheet; appendRow(rowContents: Object[]): Sheet; autoResizeColumn(columnPosition: Integer): Sheet; autoResizeColumns(startColumn: Integer, numColumns: Integer): Sheet; @@ -1341,6 +1472,7 @@ declare namespace GoogleAppsScript { collapseAllColumnGroups(): Sheet; collapseAllRowGroups(): Sheet; copyTo(spreadsheet: Spreadsheet): Sheet; + createDeveloperMetadataFinder(): DeveloperMetadataFinder; deleteColumn(columnPosition: Integer): Sheet; deleteColumns(columnPosition: Integer, howMany: Integer): void; deleteRow(rowPosition: Integer): Sheet; @@ -1361,10 +1493,12 @@ declare namespace GoogleAppsScript { getConditionalFormatRules(): ConditionalFormatRule[]; getCurrentCell(): Range; getDataRange(): Range; + getDeveloperMetadata(): DeveloperMetadata[]; getFilter(): Filter; getFormUrl(): string; getFrozenColumns(): Integer; getFrozenRows(): Integer; + getImages(): OverGridImage[]; getIndex(): Integer; getLastColumn(): Integer; getLastRow(): Integer; @@ -1404,17 +1538,20 @@ declare namespace GoogleAppsScript { insertColumns(columnIndex: Integer, numColumns: Integer): void; insertColumnsAfter(afterPosition: Integer, howMany: Integer): Sheet; insertColumnsBefore(beforePosition: Integer, howMany: Integer): Sheet; - insertImage(blobSource: Base.BlobSource, column: Integer, row: Integer): void; - insertImage(blobSource: Base.BlobSource, column: Integer, row: Integer, offsetX: Integer, offsetY: Integer): void; - insertImage(url: string, column: Integer, row: Integer): void; - insertImage(url: string, column: Integer, row: Integer, offsetX: Integer, offsetY: Integer): void; + insertImage(blobSource: Base.BlobSource, column: Integer, row: Integer): OverGridImage; + insertImage(blobSource: Base.BlobSource, column: Integer, row: Integer, offsetX: Integer, offsetY: Integer): OverGridImage; + insertImage(url: string, column: Integer, row: Integer): OverGridImage; + insertImage(url: string, column: Integer, row: Integer, offsetX: Integer, offsetY: Integer): OverGridImage; insertRowAfter(afterPosition: Integer): Sheet; insertRowBefore(beforePosition: Integer): Sheet; insertRows(rowIndex: Integer): void; insertRows(rowIndex: Integer, numRows: Integer): void; insertRowsAfter(afterPosition: Integer, howMany: Integer): Sheet; insertRowsBefore(beforePosition: Integer, howMany: Integer): Sheet; + isColumnHiddenByUser(columnPosition: Integer): boolean; isRightToLeft(): boolean; + isRowHiddenByFilter(rowPosition: Integer): boolean; + isRowHiddenByUser(rowPosition: Integer): boolean; isSheetHidden(): boolean; moveColumns(columnSpec: Range, destinationIndex: Integer): void; moveRows(rowSpec: Range, destinationIndex: Integer): void; @@ -1458,6 +1595,10 @@ declare namespace GoogleAppsScript { * collaborators. */ export interface Spreadsheet { + addDeveloperMetadata(key: string): Spreadsheet; + addDeveloperMetadata(key: string, visibility: DeveloperMetadataVisibility): Spreadsheet; + addDeveloperMetadata(key: string, value: string): Spreadsheet; + addDeveloperMetadata(key: string, value: string, visibility: DeveloperMetadataVisibility): Spreadsheet; addEditor(emailAddress: string): Spreadsheet; addEditor(user: Base.User): Spreadsheet; addEditors(emailAddresses: string[]): Spreadsheet; @@ -1468,6 +1609,7 @@ declare namespace GoogleAppsScript { appendRow(rowContents: Object[]): Sheet; autoResizeColumn(columnPosition: Integer): Sheet; copy(name: string): Spreadsheet; + createDeveloperMetadataFinder(): DeveloperMetadataFinder; deleteActiveSheet(): Sheet; deleteColumn(columnPosition: Integer): Sheet; deleteColumns(columnPosition: Integer, howMany: Integer): void; @@ -1485,11 +1627,13 @@ declare namespace GoogleAppsScript { getColumnWidth(columnPosition: Integer): Integer; getCurrentCell(): Range; getDataRange(): Range; + getDeveloperMetadata(): DeveloperMetadata[]; getEditors(): Base.User[]; getFormUrl(): string; getFrozenColumns(): Integer; getFrozenRows(): Integer; getId(): string; + getImages(): OverGridImage[]; getLastColumn(): Integer; getLastRow(): Integer; getName(): string; @@ -1517,10 +1661,10 @@ declare namespace GoogleAppsScript { insertColumnBefore(beforePosition: Integer): Sheet; insertColumnsAfter(afterPosition: Integer, howMany: Integer): Sheet; insertColumnsBefore(beforePosition: Integer, howMany: Integer): Sheet; - insertImage(blobSource: Base.BlobSource, column: Integer, row: Integer): void; - insertImage(blobSource: Base.BlobSource, column: Integer, row: Integer, offsetX: Integer, offsetY: Integer): void; - insertImage(url: string, column: Integer, row: Integer): void; - insertImage(url: string, column: Integer, row: Integer, offsetX: Integer, offsetY: Integer): void; + insertImage(blobSource: Base.BlobSource, column: Integer, row: Integer): OverGridImage; + insertImage(blobSource: Base.BlobSource, column: Integer, row: Integer, offsetX: Integer, offsetY: Integer): OverGridImage; + insertImage(url: string, column: Integer, row: Integer): OverGridImage; + insertImage(url: string, column: Integer, row: Integer, offsetX: Integer, offsetY: Integer): OverGridImage; insertRowAfter(afterPosition: Integer): Sheet; insertRowBefore(beforePosition: Integer): Sheet; insertRowsAfter(afterPosition: Integer, howMany: Integer): Sheet; @@ -1533,6 +1677,9 @@ declare namespace GoogleAppsScript { insertSheet(sheetName: string, sheetIndex: Integer): Sheet; insertSheet(sheetName: string, sheetIndex: Integer, options: Object): Sheet; insertSheet(sheetName: string, options: Object): Sheet; + isColumnHiddenByUser(columnPosition: Integer): boolean; + isRowHiddenByFilter(rowPosition: Integer): boolean; + isRowHiddenByUser(rowPosition: Integer): boolean; moveActiveSheet(pos: Integer): void; removeEditor(emailAddress: string): Spreadsheet; removeEditor(user: Base.User): Spreadsheet; @@ -1582,6 +1729,8 @@ declare namespace GoogleAppsScript { BorderStyle: typeof BorderStyle; CopyPasteType: typeof CopyPasteType; DataValidationCriteria: typeof DataValidationCriteria; + DeveloperMetadataLocationType: typeof DeveloperMetadataLocationType; + DeveloperMetadataVisibility: typeof DeveloperMetadataVisibility; Dimension: typeof Dimension; Direction: typeof Direction; GroupControlTogglePosition: typeof GroupControlTogglePosition; @@ -1607,6 +1756,8 @@ declare namespace GoogleAppsScript { newConditionalFormatRule(): ConditionalFormatRuleBuilder; newDataValidation(): DataValidationBuilder; newFilterCriteria(): FilterCriteriaBuilder; + newRichTextValue(): RichTextValueBuilder; + newTextStyle(): TextStyleBuilder; open(file: Drive.File): Spreadsheet; openById(id: string): Spreadsheet; openByUrl(url: string): Spreadsheet; @@ -1631,6 +1782,38 @@ declare namespace GoogleAppsScript { isVertical(): boolean; } + /** + * The rendered style of text in a cell. + * + * Text styles can have a corresponding RichTextValue. If the RichTextValue spans multiple text runs that have different values for a given text style read + * method, the method returns null. To avoid this, query for text styles using the Rich Text + * values returned by the RichTextValue.getRuns() method. + */ + export interface TextStyle { + copy(): TextStyleBuilder; + getFontFamily(): string; + getFontSize(): Integer; + getForegroundColor(): string; + isBold(): boolean; + isItalic(): boolean; + isStrikethrough(): boolean; + isUnderline(): boolean; + } + + /** + * A builder for text styles. + */ + export interface TextStyleBuilder { + build(): TextStyle; + setBold(bold: boolean): TextStyleBuilder; + setFontFamily(fontFamily: string): TextStyleBuilder; + setFontSize(fontSize: Integer): TextStyleBuilder; + setForegroundColor(cssString: string): TextStyleBuilder; + setItalic(italic: boolean): TextStyleBuilder; + setStrikethrough(strikethrough: boolean): TextStyleBuilder; + setUnderline(underline: boolean): TextStyleBuilder; + } + /** * An enumeration of the types of preset delimiters that can split a column of text into multiple * columns. diff --git a/types/google-apps-script/google-apps-script.utilities.d.ts b/types/google-apps-script/google-apps-script.utilities.d.ts index 272c341b6c..922e31544a 100644 --- a/types/google-apps-script/google-apps-script.utilities.d.ts +++ b/types/google-apps-script/google-apps-script.utilities.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Apps Script 2018-07-11 +// Type definitions for Google Apps Script 2018-12-26 // Project: https://developers.google.com/apps-script/ // Definitions by: motemen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -14,7 +14,7 @@ declare namespace GoogleAppsScript { export enum Charset { US_ASCII, UTF_8 } /** - * Selector of Digest algorithm + * Selector of Digest algorithm. */ export enum DigestAlgorithm { MD2, MD5, SHA_1, SHA_256, SHA_384, SHA_512 } @@ -23,6 +23,11 @@ declare namespace GoogleAppsScript { */ export enum MacAlgorithm { HMAC_MD5, HMAC_SHA_1, HMAC_SHA_256, HMAC_SHA_384, HMAC_SHA_512 } + /** + * Selector of RSA algorithm + */ + export enum RsaAlgorithm { RSA_SHA_1, RSA_SHA_256 } + /** * This service provides utilities for string encoding/decoding, date formatting, JSON manipulation, * and other miscellaneous tasks. @@ -31,6 +36,7 @@ declare namespace GoogleAppsScript { Charset: typeof Charset; DigestAlgorithm: typeof DigestAlgorithm; MacAlgorithm: typeof MacAlgorithm; + RsaAlgorithm: typeof RsaAlgorithm; base64Decode(encoded: string): Byte[]; base64Decode(encoded: string, charset: Charset): Byte[]; base64DecodeWebSafe(encoded: string): Byte[]; @@ -50,8 +56,12 @@ declare namespace GoogleAppsScript { computeHmacSignature(algorithm: MacAlgorithm, value: Byte[], key: Byte[]): Byte[]; computeHmacSignature(algorithm: MacAlgorithm, value: string, key: string): Byte[]; computeHmacSignature(algorithm: MacAlgorithm, value: string, key: string, charset: Charset): Byte[]; + computeRsaSha1Signature(value: string, key: string): Byte[]; + computeRsaSha1Signature(value: string, key: string, charset: Charset): Byte[]; computeRsaSha256Signature(value: string, key: string): Byte[]; computeRsaSha256Signature(value: string, key: string, charset: Charset): Byte[]; + computeRsaSignature(algorithm: RsaAlgorithm, value: string, key: string): Byte[]; + computeRsaSignature(algorithm: RsaAlgorithm, value: string, key: string, charset: Charset): Byte[]; formatDate(date: Date, timeZone: string, format: string): string; formatString(template: string, ...args: Object[]): string; getUuid(): string; @@ -80,4 +90,5 @@ declare namespace GoogleAppsScript { declare var Charset: GoogleAppsScript.Utilities.Charset; declare var DigestAlgorithm: GoogleAppsScript.Utilities.DigestAlgorithm; declare var MacAlgorithm: GoogleAppsScript.Utilities.MacAlgorithm; +declare var RsaAlgorithm: GoogleAppsScript.Utilities.RsaAlgorithm; declare var Utilities: GoogleAppsScript.Utilities.Utilities; diff --git a/types/google-apps-script/index.d.ts b/types/google-apps-script/index.d.ts index ae463c738b..8e565f334f 100644 --- a/types/google-apps-script/index.d.ts +++ b/types/google-apps-script/index.d.ts @@ -11,28 +11,29 @@ // Google Services (Google APIs) /// -/// -/// /// -/// +/// /// /// /// /// /// -/// +/// /// /// /// /// // Script Services (Other *App / *Service) +/// +/// +/// /// /// -/// /// -/// +/// /// +/// /// /// /// diff --git a/types/google-cloud__kms/google-cloud__kms-tests.ts b/types/google-cloud__kms/google-cloud__kms-tests.ts new file mode 100644 index 0000000000..96ab80c7c1 --- /dev/null +++ b/types/google-cloud__kms/google-cloud__kms-tests.ts @@ -0,0 +1,117 @@ +import kms = require('@google-cloud/kms'); + +let kmsClientV1: kms.v1.KeyManagementServiceClient; +kmsClientV1 = new kms.v1.KeyManagementServiceClient(); + +const credentials = { + type: 'service_account', + project_id: '****', + private_key_id: '****', + private_key: '****', + client_email: '****', + client_id: '****', + auth_uri: 'https://accounts.google.com/o/oauth2/auth', + token_uri: 'https://oauth2.googleapis.com/token', + auth_provider_x509_cert_url: 'https://www.googleapis.com/oauth2/v1/certs', + client_x509_cert_url: '****' +}; + +let kmsClient: kms.KeyManagementServiceClient; +kmsClient = new kms.KeyManagementServiceClient({ credentials }); + +async function exampleListKeyRings() { + const locationPath = kmsClient.locationPath('[PROJECT_ID]', '[LOCATION]'); + const [ asyncKeyRings ] = await kmsClient.listKeyRings({parent: locationPath}); + if (asyncKeyRings.length > 0) { + const keyRing = asyncKeyRings[ 0 ]; + console.log(`KeyRing: ${keyRing.name}`); + } + + kmsClient.listKeyRings({parent: locationPath}, (err, [ callbackKeyRings ]) => { + if (callbackKeyRings.length > 0) { + const keyRing = callbackKeyRings[ 0 ]; + console.log(`KeyRing: ${keyRing.name}`); + } + }); + + kmsClient.listKeyRings({parent: locationPath}, { timeout: 1000 }, (err, [ callbackWithOptionsKeyRings ]) => { + if (callbackWithOptionsKeyRings.length > 0) { + const keyRing = callbackWithOptionsKeyRings[ 0 ]; + console.log(`KeyRing: ${keyRing.name}`); + } + }); +} + +async function exampleListCryptoKeys() { + const keyRingPath = kmsClient.keyRingPath('[PROJECT_ID]', '[LOCATION]', '[KEYRING_ID]'); + const [ asyncKeys ] = await kmsClient.listCryptoKeys({parent: keyRingPath}); + if (asyncKeys.length > 0) { + const key = asyncKeys[ 0 ]; + console.log(`CryptoKey: ${key.name} Version: ${key.primary.name}`); + } + + kmsClient.listCryptoKeys({parent: keyRingPath}, (err, [ callbackKeys ]) => { + if (callbackKeys.length > 0) { + const key = callbackKeys[ 0 ]; + console.log(`CryptoKey: ${key.name} Version: ${key.primary.name}`); + } + }); + + kmsClient.listCryptoKeys({parent: keyRingPath}, { timeout: 1000 }, (err, [ callbackWithOptionsKeys ]) => { + if (callbackWithOptionsKeys.length > 0) { + const key = callbackWithOptionsKeys[ 0 ]; + console.log(`CryptoKey: ${key.name} Version: ${key.primary.name}`); + } + }); +} + +async function exampleEncrypt() { + const formattedName = kmsClient.cryptoKeyPath('[PROJECT_ID]', '[LOCATION]', '[KEYRING_ID]', '[KEY_ID]'); + const unencryptedText = new Buffer('Hello World'); + + const [ asyncEncryptResult ] = await kmsClient.encrypt({ name: formattedName, plaintext: unencryptedText.toString('base64') }); + if (asyncEncryptResult != null) { + console.log(`Encrypted: ${asyncEncryptResult.ciphertext.toString('base64')}`); + } + + kmsClient.encrypt({ name: formattedName, plaintext: unencryptedText.toString('base64') }, (err, [ callbackEncryptResult ]) => { + if (callbackEncryptResult != null) { + console.log(`Encrypted: ${callbackEncryptResult.ciphertext.toString('base64')}`); + } + }); + + kmsClient.encrypt({ name: formattedName, plaintext: unencryptedText.toString('base64') }, { timeout: 1000 }, (err, [ callbackWithOptionsEncryptResult ]) => { + if (callbackWithOptionsEncryptResult != null) { + console.log(`Encrypted: ${callbackWithOptionsEncryptResult.ciphertext.toString('base64')}`); + } + }); +} + +async function exampleDecrypt() { + // Example pulling a file from Cloud Storage + // const secretsStorage = new Storage({ credentials }); + // const bucket = secretsStorage.bucket('[KMS_STORAGE_BUCKET]'); + // const filePath = '[PATH_TO_KMS_ENCRYPTED_FILE'; + // const file = bucket.file(filePath); + // const buffers = await file.download(); + // const buffer = buffers[ 0 ]; + + const buffer = new Buffer('[ENCRYPTED_SOURCE_BUFFER]'); + const formattedName = kmsClient.cryptoKeyPath('[PROJECT_ID]', '[LOCATION]', '[KEYRING_ID]', '[KEY_ID]'); + const [ asyncDecryptResult ] = await kmsClient.decrypt({name: formattedName, ciphertext: buffer.toString('base64') }); + if (asyncDecryptResult != null) { + console.log(`Decrypted: ${asyncDecryptResult.plaintext}`); + } + + kmsClient.decrypt({ name: formattedName, ciphertext: buffer.toString('base64') }, (err, [ callbackDecryptResult ]) => { + if (callbackDecryptResult != null) { + console.log(`Decrypted: ${callbackDecryptResult.plaintext}`); + } + }); + + kmsClient.decrypt({ name: formattedName, ciphertext: buffer.toString('base64') }, (err, [ callbackWithOptionsDecryptResult ]) => { + if (callbackWithOptionsDecryptResult != null) { + console.log(`Decrypted: ${callbackWithOptionsDecryptResult.plaintext}`); + } + }); +} diff --git a/types/google-cloud__kms/index.d.ts b/types/google-cloud__kms/index.d.ts new file mode 100644 index 0000000000..237c7115a0 --- /dev/null +++ b/types/google-cloud__kms/index.d.ts @@ -0,0 +1,273 @@ +// Type definitions for @google-cloud/kms 0.2 +// Project: https://github.com/googleapis/nodejs-kms +// Definitions by: Ben Talbot +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +import * as google_protobuf_timestamp_pb from "google-protobuf/google/protobuf/timestamp_pb"; + +export namespace v1 { + enum CryptoKeyVersionAlgorithm { + // Not specified. + CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED = 0, + + // Creates symmetric encryption keys. + GOOGLE_SYMMETRIC_ENCRYPTION = 1, + + // RSASSA-PSS 2048 bit key with a SHA256 digest. + RSA_SIGN_PSS_2048_SHA256 = 2, + + // RSASSA-PSS 3072 bit key with a SHA256 digest. + RSA_SIGN_PSS_3072_SHA256 = 3, + + // RSASSA-PSS 4096 bit key with a SHA256 digest. + RSA_SIGN_PSS_4096_SHA256 = 4, + + // RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest. + RSA_SIGN_PKCS1_2048_SHA256 = 5, + + // RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest. + RSA_SIGN_PKCS1_3072_SHA256 = 6, + + // RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest. + RSA_SIGN_PKCS1_4096_SHA256 = 7, + + // RSAES-OAEP 2048 bit key with a SHA256 digest. + RSA_DECRYPT_OAEP_2048_SHA256 = 8, + + // RSAES-OAEP 3072 bit key with a SHA256 digest. + RSA_DECRYPT_OAEP_3072_SHA256 = 9, + + // RSAES-OAEP 4096 bit key with a SHA256 digest. + RSA_DECRYPT_OAEP_4096_SHA256 = 10, + + // ECDSA on the NIST P-256 curve with a SHA256 digest. + EC_SIGN_P256_SHA256 = 12, + + // ECDSA on the NIST P-384 curve with a SHA384 digest. + EC_SIGN_P384_SHA384 = 13, + } + + enum CryptoKeyVersionState { + // Not specified. + CRYPTO_KEY_VERSION_STATE_UNSPECIFIED = 0, + + // This version is still being generated. It may not be used, enabled, + // disabled, or destroyed yet. Cloud KMS will automatically mark this + // version [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] as soon as the version is ready. + PENDING_GENERATION = 5, + + // This version may be used for cryptographic operations. + ENABLED = 1, + + // This version may not be used, but the key material is still available, + // and the version can be placed back into the [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] state. + DISABLED = 2, + + // This version is destroyed, and the key material is no longer stored. + // A version may not leave this state once entered. + DESTROYED = 3, + + // This version is scheduled for destruction, and will be destroyed soon. + // Call + // [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] + // to put it back into the [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] state. + DESTROY_SCHEDULED = 4, + } + + enum CryptoKeyVersionView { + // Default view for each [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Does not include + // the [attestation][google.cloud.kms.v1.CryptoKeyVersion.attestation] field. + CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED = 0, + + // Provides all fields in each [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], including the + // [attestation][google.cloud.kms.v1.CryptoKeyVersion.attestation]. + FULL = 1, + } + + enum ProtectionLevel { + // Not specified. + PROTECTION_LEVEL_UNSPECIFIED = 0, + + // Crypto operations are performed in software. + SOFTWARE = 1, + + // Crypto operations are performed in a Hardware Security Module. + HSM = 2, + } + + enum AttestationFormat { + ATTESTATION_FORMAT_UNSPECIFIED = 0, + + // Cavium HSM attestation compressed with gzip. Note that this format is + // defined by Cavium and subject to change at any time. + CAVIUM_V1_COMPRESSED = 3, + } + + interface KeyOperationAttestation { + format: AttestationFormat; + } + + interface CryptoKeyVersion { + name: string; + state: CryptoKeyVersionState; + protectionLevel: ProtectionLevel; + algorithm: CryptoKeyVersionAlgorithm; + attestation?: KeyOperationAttestation; + createTime: google_protobuf_timestamp_pb.Timestamp.AsObject; + generateTime: google_protobuf_timestamp_pb.Timestamp.AsObject; + destroyTime?: google_protobuf_timestamp_pb.Timestamp.AsObject; + destroyEventTime?: google_protobuf_timestamp_pb.Timestamp.AsObject; + } + + interface CryptoKeyVersionTemplate { + protectionLevel: ProtectionLevel; + algorithm: CryptoKeyVersionAlgorithm; + } + + enum CryptoKeyPurpose { + // Not specified. + CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0, + + // [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used with + // [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and + // [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + ENCRYPT_DECRYPT = 1, + + // [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used with + // [AsymmetricSign][google.cloud.kms.v1.KeyManagementService.AsymmetricSign] and + // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + ASYMMETRIC_SIGN = 5, + + // [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used with + // [AsymmetricDecrypt][google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt] and + // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + ASYMMETRIC_DECRYPT = 6, + } + + interface CryptoKey { + name: string; + primary: CryptoKeyVersion; + purpose: CryptoKeyPurpose; + createTime: google_protobuf_timestamp_pb.Timestamp.AsObject; + nextRotationTime?: google_protobuf_timestamp_pb.Timestamp.AsObject; + versionTemplate: CryptoKeyVersionTemplate; + labels: { [s: string]: string; }; + } + + interface KeyRing { + name: string; + createTime: google_protobuf_timestamp_pb.Timestamp.AsObject; + } + + namespace KeyManagementServiceClient { + interface ConfigurationObject { + credentials?: { + client_email?: string; + private_key?: string + }; + email?: string; + keyFilename?: string; + port?: number; + projectId?: string; + promise?: any; + servicePath?: string; + } + + interface EncryptRequest { + name: string; + plaintext: string; + additionalAuthenticatedData?: string; + } + interface EncryptResponse { + name: string; + ciphertext: Buffer; + } + type EncryptCallback = (err: Error | null, apiResponse: [EncryptResponse, any, any]) => void; + + interface DecryptRequest { + name: string; + ciphertext: string; + additionalAuthenticatedData?: string; + } + interface DecryptResponse { + plaintext: Buffer; + } + type DecryptCallback = (err: Error | null, apiResponse: [DecryptResponse, any, any]) => void; + + interface ListKeyRingsRequest { + parent: string; + page_size?: number; + page_token?: string; + } + type ListKeyRingsCallback = (err: Error | null, apiResponse: [KeyRing[], any, any]) => void; + + interface ListCryptoKeysRequest { + parent: string; + page_size?: number; + page_token?: string; + } + type ListCryptoKeysCallback = (err: Error | null, apiResponse: [CryptoKey[], any, any]) => void; + } + + class KeyManagementServiceClient { + constructor(options?: KeyManagementServiceClient.ConfigurationObject); + + keyRingPath(project: string, location: string, keyRing: string): string; + cryptoKeyPathPath(project: string, location: string, keyRing: string, cryptoKeyPath: string): string; + locationPath(project: string, location: string): string; + cryptoKeyPath(project: string, location: string, keyRing: string, cryptoKey: string): string; + cryptoKeyVersionPath(project: string, location: string, keyRing: string, cryptoKey: string, cryptoKeyVersion: string): string; + + encrypt(request: KeyManagementServiceClient.EncryptRequest, gaxOpts?: GAX.CallOptions): Promise<[KeyManagementServiceClient.EncryptResponse, any, any]>; + encrypt(request: KeyManagementServiceClient.EncryptRequest, callback: KeyManagementServiceClient.EncryptCallback): void; + encrypt(request: KeyManagementServiceClient.EncryptRequest, gaxOpts: GAX.CallOptions, callback: KeyManagementServiceClient.EncryptCallback): void; + + decrypt(request: KeyManagementServiceClient.DecryptRequest, gaxOpts?: GAX.CallOptions): Promise<[KeyManagementServiceClient.DecryptResponse, any, any]>; + decrypt(request: KeyManagementServiceClient.DecryptRequest, callback: KeyManagementServiceClient.DecryptCallback): void; + decrypt(request: KeyManagementServiceClient.DecryptRequest, gaxOpts: GAX.CallOptions, callback: KeyManagementServiceClient.DecryptCallback): void; + + listKeyRings(request: KeyManagementServiceClient.ListKeyRingsRequest, gaxOpts?: GAX.CallOptions): Promise<[KeyRing[], any, any]>; + listKeyRings(request: KeyManagementServiceClient.ListKeyRingsRequest, callback: KeyManagementServiceClient.ListKeyRingsCallback): void; + listKeyRings(request: KeyManagementServiceClient.ListKeyRingsRequest, gaxOpts: GAX.CallOptions, callback: KeyManagementServiceClient.ListKeyRingsCallback): void; + + listCryptoKeys(request: KeyManagementServiceClient.ListCryptoKeysRequest, gaxOpts?: GAX.CallOptions): Promise<[CryptoKey[], any, any]>; + listCryptoKeys(request: KeyManagementServiceClient.ListCryptoKeysRequest, callback: KeyManagementServiceClient.ListCryptoKeysCallback): void; + listCryptoKeys(request: KeyManagementServiceClient.ListCryptoKeysRequest, gaxOpts: GAX.CallOptions, callback: KeyManagementServiceClient.ListCryptoKeysCallback): void; + } +} + +export class KeyManagementServiceClient extends v1.KeyManagementServiceClient { + constructor(options?: v1.KeyManagementServiceClient.ConfigurationObject); +} + +export namespace GAX { + /** https://googleapis.github.io/gax-nodejs/global.html#CallOptions */ + interface CallOptions { + timeout?: number; + retry?: RetryOptions; + autoPaginate?: boolean; + pageToken?: object; + isBundling?: boolean; + longrunning?: BackoffSettings; + promise?: PromiseConstructor; // FIXME Unsure if this is the correct type; remove this comment if it is + } + + /** https://googleapis.github.io/gax-nodejs/global.html#RetryOptions */ + interface RetryOptions { + retryCodes: string[]; + backoffSettings: BackoffSettings; + } + + /** https://googleapis.github.io/gax-nodejs/global.html#BackoffSettings */ + interface BackoffSettings { + initialRetryDelayMillis: number; + retryDelayMultiplier: number; + maxRetryDelayMillis: number; + initialRpcTimeoutMillis: number; + maxRpcTimeoutMillis: number; + totalTimeoutMillis: number; + } +} diff --git a/types/google-cloud__kms/tsconfig.json b/types/google-cloud__kms/tsconfig.json new file mode 100644 index 0000000000..bb1ba097cc --- /dev/null +++ b/types/google-cloud__kms/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "paths": { + "@google-cloud/kms": [ + "google-cloud__kms" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "google-cloud__kms-tests.ts" + ] +} \ No newline at end of file diff --git a/types/google-cloud__kms/tslint.json b/types/google-cloud__kms/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/google-cloud__kms/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/google-cloud__tasks/google-cloud__tasks-tests.ts b/types/google-cloud__tasks/google-cloud__tasks-tests.ts new file mode 100644 index 0000000000..4539f345ff --- /dev/null +++ b/types/google-cloud__tasks/google-cloud__tasks-tests.ts @@ -0,0 +1,18 @@ +import Tasks, { Queue } from "@google-cloud/tasks"; + +const client = new Tasks({}); + +const formattedParent = client.locationPath("[PROJECT]", "[LOCATION]"); +const queue: Partial = {}; +const request = { + parent: formattedParent, + queue +}; +client + .createQueue(request) + .then(([queue]) => { + const q = queue; + }) + .catch(err => { + console.error(err); + }); diff --git a/types/google-cloud__tasks/index.d.ts b/types/google-cloud__tasks/index.d.ts new file mode 100644 index 0000000000..c3347c8ea4 --- /dev/null +++ b/types/google-cloud__tasks/index.d.ts @@ -0,0 +1,1627 @@ +// Type definitions for @google-cloud/tasks 0.2 +// Project: https://github.com/googleapis/nodejs-tasks +// Definitions by: Ifiok Jr. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.8 + +/// + +import { Transform } from "stream"; +export type GoogleError = any; +export type GoogleAuthOptions = any; +export type CallOptions = any; +export type GoogleAuth = any; + +export interface CloudTasksConfig extends GoogleAuthOptions { + key?: string; + autoRetry?: boolean; + maxRetries?: number; + libName?: string; + libVersion?: string; + promise?: PromiseConstructor; +} + +export interface AppEngineHttpQueue { + appEngineRoutingOverride: AppEngineRouting; +} + +export interface AppEngineHttpRequest { + appEngineRouting: AppEngineRouting; + body: string; + headers: { + [key: string]: string; + }; + httpMethod: string; + relativeUri: string; +} + +export interface AppEngineRouting { + host: string; + instance: string; + service: string; + version: string; +} + +export interface Attempt { + dispatchTime: string; + responseStatus: Status; + responseTime: string; + scheduleTime: string; +} + +export interface Binding { + condition: Expr; + members: string[]; + role: string; +} + +export interface CreateTaskRequest { + responseView: View; + task: Partial; +} + +export interface Expr { + description: string; + expression: string; + location: string; + title: string; +} + +export interface ListLocationsResponse { + locations: Location[]; + nextPageToken?: string; +} + +export interface ListQueuesResponse { + nextPageToken?: string; + queues: Queue[]; +} + +export interface ListTasksResponse { + nextPageToken?: string; + tasks: Task[]; +} + +export interface Location { + displayName: string; + labels: { + [key: string]: string; + }; + locationId: string; + metadata: object; + name: string; +} + +export interface Policy { + bindings: Binding[]; + etag: string; + version: number; +} + +export interface Queue { + appEngineHttpQueue: AppEngineHttpQueue; + name: string; + purgeTime: string; + rateLimits: RateLimits; + retryConfig: RetryConfig; + state: string; +} + +export interface RateLimits { + maxBurstSize: number; + maxConcurrentDispatches: number; + maxDispatchesPerSecond: number; +} + +export interface RetryConfig { + maxAttempts: number; + maxBackoff: string; + maxDoublings: number; + maxRetryDuration: string; + minBackoff: string; +} + +export interface RunTaskRequest { + responseView?: View; +} + +export interface SetIamPolicyRequest { + policy: Partial; +} + +export interface Status { + code: number; + details: object[]; + message: string; +} + +/** + * `VIEW_UNSPECIFIED = 0;` + * When Unspecified. Defaults to the behaviour of BASIC. + * + * `BASIC = 1;` + * The basic view omits fields which can be large or can contain + * sensitive data. + * This view does not include the + * ([payload in AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] and + * [payload in PullMessage][google.cloud.tasks.v2beta2.PullMessage.payload]). These payloads are + * desirable to return only when needed, because they can be large + * and because of the sensitivity of the data that you choose to + * store in it. + * + * `FULL = 2;` + * All information is returned. + * + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Queue][google.cloud.tasks.v2beta2.Queue] resource. + */ +export type View = 0 | 1 | 2; + +export interface Task { + appEngineHttpRequest: AppEngineHttpRequest; + createTime: string; + dispatchCount: number; + firstAttempt: Attempt; + lastAttempt: Attempt; + name: string; + responseCount: number; + scheduleTime: string; + view: View; +} + +export interface TestIamPermissionsRequest { + permissions?: string[]; +} + +export interface TestIamPermissionsResponse { + permissions?: string[]; +} + +export interface PromiseLike extends Promise { + /** + * Cancel the ongoing promise + */ + cancel(): void; +} + +export type Keys = keyof T; + +export type EnhancedPick< + T, + Req extends keyof T, + Opt extends keyof T +> = Required> & Partial>; + +export type ProjectIdCallback = ( + err?: Error | null, + projectId?: string | null +) => void; + +export type APICallback = ( + err: GoogleError | null, + response?: T +) => void; + +export type APIPaginatedCallback = ( + err: GoogleError | null, + response?: T, + next?: U | null, + rawResponse?: V +) => void; + +export interface CallOptionsWithPagination extends CallOptions { + autoPaginate: false; +} + +export interface MethodOverload { + (data: T, options?: CallOptions): PromiseLike<[R]>; + (data: T, options: CallOptions, callback: APICallback): void; + (data: T, callback: APICallback): void; +} + +export interface PaginatedMethodOverload { + (data: T, options: CallOptionsWithPagination): PromiseLike<[R, V, U]>; + (data: T, options?: CallOptions): PromiseLike<[R]>; + (data: T, options: CallOptions, callback: APICallback): void; + ( + data: T, + options: CallOptionsWithPagination, + callback: APIPaginatedCallback + ): void; + (data: T, callback: APICallback): void; +} + +export interface ParentRequest { + /** + * The location name. For example: projects/PROJECT_ID/locations/LOCATION_ID + */ + parent: string; +} + +export interface ResourceRequest { + /** + * The resource for which the policy is being requested. resource is usually specified as a path. For example, a Project resource is specified as projects/{project}. + */ + resource: string; +} + +export interface ListRequestObject extends ParentRequest { + /** + * `filter` can be used to specify a subset of queues. Any Queue field can be used as a filter and several operators as supported. + * For example: <=, <, >=, >, !=, =, :. The filter syntax is the same as described in Stackdriver's Advanced Logs Filters. + * Sample filter "state: PAUSED". + * Note that using filters might cause fewer queues than the requested page_size to be returned. + */ + filter?: string; + + /** + * The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, + * this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. + */ + pageSize?: number; +} + +export interface NamedRequest { + /** + * The resource name of the queue. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID + */ + name: string; +} + +export type CreateNamedRequest = ParentRequest & + { [P in N]: T }; +export type UpdateNamedRequest = ParentRequest & + { [P in N]: T }; + +/** + * Cloud Tasks allows developers to manage the execution of background + * work in their applications. + */ +export default class CloudTasksClient { + /** + * The DNS address for this API service. + * @default 'cloudtasks.googleapis.com' + */ + static readonly servicePath: string; + + /** + * The port for this API service. + * @default 443 + */ + static readonly port: number; + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @default ["https://www.googleapis.com/auth/cloud-platform"] + */ + static readonlyscopes: string; + + auth: GoogleAuth; + + /** + * Construct an instance of CloudTasksClient. + * + * @param [options] - The configuration object. See the subsequent + * parameters for more details. + * @param [options.credentials] - Credentials object. + * @param [options.credentials.client_email] + * @param [options.credentials.private_key] + * @param [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param [options.port] - The port on which to connect to + * the remote host. + * @param [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param [options.promise] - Custom promise module to use instead + * of native Promises. + * @param [options.servicePath] - The domain name of the + * API remote host. + */ + constructor(config: CloudTasksConfig); + + /** + * Return the project ID used by this class. + * @param callback - the callback to + * be called with the current project Id. + */ + getProjectId(): PromiseLike; + getProjectId(callback: ProjectIdCallback): void; + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Lists queues. + * + * Queues are returned in lexicographical order. + * + * @param request + * The request object that will be sent. + * @param request.parent + * Required. + * + * The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * @param [request.filter] + * `filter` can be used to specify a subset of queues. Any Queue + * field can be used as a filter and several operators as supported. + * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as + * described in + * [Stackdriver's Advanced Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * + * Sample filter "state: PAUSED". + * + * Note that using filters might cause fewer queues than the + * requested page_size to be returned. + * @param [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [ListQueuesResponse]{@link google.cloud.tasks.v2beta3.ListQueuesResponse}. + * The first element of the array is Array of [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Queue]{@link google.cloud.tasks.v2beta3.Queue} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListQueuesResponse]{@link google.cloud.tasks.v2beta3.ListQueuesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * + * client.listQueues({parent: formattedParent}) + * .then(responses => { + * const resources = responses[0]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.listQueues(nextRequest, options).then(callback); + * } + * } + * client.listQueues({parent: formattedParent}, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + listQueues: PaginatedMethodOverload< + ListRequestObject, + Queue[], + ListQueuesResponse + >; + + /** + * Equivalent to {@link listQueues}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listQueues} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param request + * The request object that will be sent. + * @param request.parent + * Required. + * + * The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * @param [request.filter] + * `filter` can be used to specify a subset of queues. Any Queue + * field can be used as a filter and several operators as supported. + * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as + * described in + * [Stackdriver's Advanced Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * + * Sample filter "state: PAUSED". + * + * Note that using filters might cause fewer queues than the + * requested page_size to be returned. + * @param [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * An object stream which emits an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue} on 'data' event. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * client.listQueuesStream({parent: formattedParent}) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + listQueuesStream( + request: ListRequestObject, + options?: CallOptions + ): Transform; + + /** + * Gets a queue. + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * client.getQueue({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getQueue: MethodOverload; + + /** + * Creates a queue. + * + * Queues created with this method allow tasks to live for a maximum of 31 + * days. After a task is 31 days old, the task will be deleted regardless of whether + * it was dispatched or not. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) + * before using this method. + * + * @param request + * The request object that will be sent. + * @param request.parent + * Required. + * + * The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * ListLocations. + * @param request.queue + * Required. + * + * The queue to create. + * + * Queue's name cannot be the same as an existing queue. + * + * This object should have the same structure as [Queue]{@link google.cloud.tasks.v2beta3.Queue} + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * const queue = {}; + * const request = { + * parent: formattedParent, + * queue: queue, + * }; + * client.createQueue(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + createQueue: MethodOverload< + CreateNamedRequest<"queue", Partial>, + Queue + >; + + /** + * Updates a queue. + * + * This method creates the queue if it does not exist and updates + * the queue if it does exist. + * + * Queues created with this method allow tasks to live for a maximum of 31 + * days. After a task is 31 days old, the task will be deleted regardless of whether + * it was dispatched or not. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) + * before using this method. + * + * @param request + * The request object that will be sent. + * @param request.queue + * Required. + * + * The queue to create or update. + * + * The queue's name must be specified. + * + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's name cannot be changed. + * + * This object should have the same structure as [Queue]{@link google.cloud.tasks.v2beta3.Queue} + * @param [request.updateMask] + * A mask used to specify which fields of the queue are being updated. + * + * If empty, then all fields will be updated. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const queue = {}; + * client.updateQueue({queue: queue}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateQueue: MethodOverload< + UpdateNamedRequest< + "queue", + EnhancedPick< + Queue, + "name", + "appEngineHttpQueue" | "rateLimits" | "retryConfig" + > + >, + Queue + >; + + /** + * Deletes a queue. + * + * This command will delete the queue even if it has tasks in it. + * + * Note: If you delete a queue, a queue with the same name can't be created + * for 7 days. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) + * before using this method. + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * client.deleteQueue({name: formattedName}).catch(err => { + * console.error(err); + * }); + */ + deleteQueue: MethodOverload; + + /** + * Purges a queue by deleting all of its tasks. + * + * All tasks created before this method is called are permanently deleted. + * + * Purge operations can take up to one minute to take effect. Tasks + * might be dispatched before the purge takes effect. A purge is irreversible. + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * client.purgeQueue({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + purgeQueue: MethodOverload; + + /** + * Pauses the queue. + * + * If a queue is paused then the system will stop dispatching tasks + * until the queue is resumed via + * ResumeQueue. Tasks can still be added + * when the queue is paused. A queue is paused if its + * state is PAUSED. + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * client.pauseQueue({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + pauseQueue: MethodOverload; + + /** + * Resume a queue. + * + * This method resumes a queue after it has been + * PAUSED or + * DISABLED. The state of a queue is stored + * in the queue's state; after calling this method it + * will be set to RUNNING. + * + * WARNING: Resuming many high-QPS queues at the same time can + * lead to target overloading. If you are resuming high-QPS + * queues, follow the 500/50/5 pattern described in + * [Managing Cloud Tasks Scaling Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * client.resumeQueue({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + resumeQueue: MethodOverload; + + /** + * Gets the access control policy for a Queue. + * Returns an empty policy if the resource exists and does not have a policy + * set. + * + * Authorization requires the following + * [Google IAM](https://cloud.google.com/iam) permission on the specified + * resource parent: + * + * * `cloudtasks.queues.getIamPolicy` + * + * @param request + * The request object that will be sent. + * @param request.resource + * REQUIRED: The resource for which the policy is being requested. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedResource = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * client.getIamPolicy({resource: formattedResource}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getIamPolicy: MethodOverload; + + /** + * Sets the access control policy for a Queue. Replaces any existing + * policy. + * + * Note: The Cloud Console does not check queue-level IAM permissions yet. + * Project-level permissions are required to use the Cloud Console. + * + * Authorization requires the following + * [Google IAM](https://cloud.google.com/iam) permission on the specified + * resource parent: + * + * * `cloudtasks.queues.setIamPolicy` + * + * @param request + * The request object that will be sent. + * @param request.resource + * REQUIRED: The resource for which the policy is being specified. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * @param request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * + * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedResource = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * const policy = {}; + * const request = { + * resource: formattedResource, + * policy: policy, + * }; + * client.setIamPolicy(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + setIamPolicy: MethodOverload; + + /** + * Returns permissions that a caller has on a Queue. + * If the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building permission-aware + * UIs and command-line tools, not for authorization checking. This operation + * may "fail open" without warning. + * + * @param request + * The request object that will be sent. + * @param request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * @param request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedResource = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * const permissions = []; + * const request = { + * resource: formattedResource, + * permissions: permissions, + * }; + * client.testIamPermissions(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + testIamPermissions: MethodOverload< + ResourceRequest & TestIamPermissionsRequest, + TestIamPermissionsResponse + >; + + /** + * Lists the tasks in a queue. + * + * By default, only the BASIC view is retrieved + * due to performance considerations; + * response_view controls the + * subset of information which is returned. + * + * The tasks may be returned in any order. The ordering may change at any + * time. + * + * @param request + * The request object that will be sent. + * @param request.parent + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param [request.responseView] + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the Task resource. + * + * The number should be among the values of [View]{@link google.cloud.tasks.v2beta3.View} + * @param [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [Task]{@link google.cloud.tasks.v2beta3.Task}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [ListTasksResponse]{@link google.cloud.tasks.v2beta3.ListTasksResponse}. + * The first element of the array is Array of [Task]{@link google.cloud.tasks.v2beta3.Task}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Task]{@link google.cloud.tasks.v2beta3.Task} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListTasksResponse]{@link google.cloud.tasks.v2beta3.ListTasksResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * + * client.listTasks({parent: formattedParent}) + * .then(responses => { + * const resources = responses[0]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.listTasks(nextRequest, options).then(callback); + * } + * } + * client.listTasks({parent: formattedParent}, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + listTasks: PaginatedMethodOverload< + ListRequestObject & RunTaskRequest, + Task[], + ListTasksResponse + >; + + /** + * Equivalent to {@link listTasks}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listTasks} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param request + * The request object that will be sent. + * @param request.parent + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param [request.responseView] + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the Task resource. + * + * The number should be among the values of [View]{@link google.cloud.tasks.v2beta3.View} + * @param [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * An object stream which emits an object representing [Task]{@link google.cloud.tasks.v2beta3.Task} on 'data' event. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * client.listTasksStream({parent: formattedParent}) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + listTasksStream( + request: ListRequestObject & RunTaskRequest, + options?: CallOptions + ): Transform; + + /** + * Gets a task. + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param [request.responseView] + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the Task resource. + * + * The number should be among the values of [View]{@link google.cloud.tasks.v2beta3.View} + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. + * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.taskPath('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * client.getTask({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getTask: MethodOverload; + /** + * Creates a task and adds it to a queue. + * + * Tasks cannot be updated after creation; there is no UpdateTask command. + * + * * For App Engine queues, the maximum task size is + * 100KB. + * + * @param request + * The request object that will be sent. + * @param request.parent + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * The queue must already exist. + * @param request.task + * Required. + * + * The task to add. + * + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task name. If a + * name is not specified then the system will generate a random + * unique task id, which will be set in the task returned in the + * response. + * + * If schedule_time is not set or is in the + * past then Cloud Tasks will set it to the current time. + * + * Task De-duplication: + * + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or executed recently then the call will fail + * with ALREADY_EXISTS. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1hour after the original task was + * deleted or executed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9days after the original task was deleted or executed. + * + * Because there is an extra lookup cost to identify duplicate task + * names, these CreateTask calls have significantly + * increased latency. Using hashed strings for the task id or for + * the prefix of the task id is recommended. Choosing task ids that + * are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * + * This object should have the same structure as [Task]{@link google.cloud.tasks.v2beta3.Task} + * @param [request.responseView] + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the Task resource. + * + * The number should be among the values of [View]{@link google.cloud.tasks.v2beta3.View} + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. + * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * const task = {}; + * const request = { + * parent: formattedParent, + * task: task, + * }; + * client.createTask(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + createTask: MethodOverload; + + /** + * Deletes a task. + * + * A task can be deleted if it is scheduled or dispatched. A task + * cannot be deleted if it has executed successfully or permanently + * failed. + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.taskPath('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * client.deleteTask({name: formattedName}).catch(err => { + * console.error(err); + * }); + */ + deleteTask: MethodOverload; + + /** + * Forces a task to run now. + * + * When this method is called, Cloud Tasks will dispatch the task, even if + * the task is already running, the queue has reached its RateLimits or + * is PAUSED. + * + * This command is meant to be used for manual debugging. For + * example, RunTask can be used to retry a failed + * task after a fix has been made or to manually force a task to be + * dispatched now. + * + * The dispatched task is returned. That is, the task that is returned + * contains the status after the task is dispatched but + * before the task is received by its target. + * + * If Cloud Tasks receives a successful response from the task's + * target, then the task will be deleted; otherwise the task's + * schedule_time will be reset to the time that + * RunTask was called plus the retry delay specified + * in the queue's RetryConfig. + * + * RunTask returns + * NOT_FOUND when it is called on a + * task that has already succeeded or permanently failed. + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param [request.responseView] + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the Task resource. + * + * The number should be among the values of [View]{@link google.cloud.tasks.v2beta3.View} + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. + * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.taskPath('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * client.runTask({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + runTask: MethodOverload; + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param project + */ + projectPath(project: string): string; + + /** + * Return a fully-qualified location resource name string. + * + * @param project + * @param location + */ + locationPath(project: string, location: string): string; + + /** + * Return a fully-qualified queue resource name string. + * + * @param project + * @param location + * @param queue + */ + queuePath(project: string, location: string, queue: string): string; + + /** + * Return a fully-qualified task resource name string. + * + * @param project + * @param location + * @param queue + * @param task + */ + taskPath( + project: string, + location: string, + queue: string, + task: string + ): string; + + /** + * Parse the projectName from a project resource. + * + * @param projectName + * A fully-qualified path representing a project resources. + */ + matchProjectFromProjectName(projectName: string): string; + + /** + * Parse the locationName from a location resource. + * + * @param locationName + * A fully-qualified path representing a location resources. + */ + matchProjectFromLocationName(locationName: string): string; + + /** + * Parse the locationName from a location resource. + * + * @param locationName + * A fully-qualified path representing a location resources. + */ + matchLocationFromLocationName(locationName: string): string; + + /** + * Parse the queueName from a queue resource. + * + * @param queueName + * A fully-qualified path representing a queue resources. + */ + matchProjectFromQueueName(queueName: string): string; + + /** + * Parse the queueName from a queue resource. + * + * @param queueName + * A fully-qualified path representing a queue resources. + */ + matchLocationFromQueueName(queueName: string): string; + + /** + * Parse the queueName from a queue resource. + * + * @param queueName + * A fully-qualified path representing a queue resources. + */ + matchQueueFromQueueName(queueName: string): string; + + /** + * Parse the taskName from a task resource. + * + * @param taskName + * A fully-qualified path representing a task resources. + */ + matchProjectFromTaskName(taskName: string): string; + + /** + * Parse the taskName from a task resource. + * + * @param taskName + * A fully-qualified path representing a task resources. + */ + matchLocationFromTaskName(taskName: string): string; + + /** + * Parse the taskName from a task resource. + * + * @param taskName + * A fully-qualified path representing a task resources. + */ + matchQueueFromTaskName(taskName: string): string; + + /** + * Parse the taskName from a task resource. + * + * @param taskName + * A fully-qualified path representing a task resources. + */ + matchTaskFromTaskName(taskName: string): string; +} diff --git a/types/google-cloud__tasks/package.json b/types/google-cloud__tasks/package.json new file mode 100644 index 0000000000..c4a850824a --- /dev/null +++ b/types/google-cloud__tasks/package.json @@ -0,0 +1,14 @@ +{ + "private": true, + "dependencies": { + "google-gax": "^0.22.1" + }, + "types": "index", + "typesVersions": { + ">=3.1.0-0": { + "*": [ + "ts3.1/*" + ] + } + } +} diff --git a/types/google-cloud__tasks/ts3.1/google-cloud__tasks-tests.ts b/types/google-cloud__tasks/ts3.1/google-cloud__tasks-tests.ts new file mode 100644 index 0000000000..94a7ebcfa4 --- /dev/null +++ b/types/google-cloud__tasks/ts3.1/google-cloud__tasks-tests.ts @@ -0,0 +1,21 @@ +import Tasks, { Queue } from "@google-cloud/tasks"; + +const client = new Tasks({}); + +// $ExpectError +const failedClient = new Tasks({ unrecognized: "" }); + +const formattedParent = client.locationPath("[PROJECT]", "[LOCATION]"); +const queue: Partial = {}; +const request = { + parent: formattedParent, + queue +}; +client + .createQueue(request) + .then(([queue]) => { + const q = queue; + }) + .catch(err => { + console.error(err); + }); diff --git a/types/google-cloud__tasks/ts3.1/index.d.ts b/types/google-cloud__tasks/ts3.1/index.d.ts new file mode 100644 index 0000000000..6b09fdd06d --- /dev/null +++ b/types/google-cloud__tasks/ts3.1/index.d.ts @@ -0,0 +1,1622 @@ +/// + +import { Transform } from "stream"; +import { + GoogleAuthOptions, + GoogleError, + CallOptions, + GoogleAuth +} from "google-gax"; + +export interface CloudTasksConfig extends GoogleAuthOptions { + key?: string; + autoRetry?: boolean; + maxRetries?: number; + libName?: string; + libVersion?: string; + promise?: PromiseConstructor; +} + +export interface AppEngineHttpQueue { + appEngineRoutingOverride: AppEngineRouting; +} + +export interface AppEngineHttpRequest { + appEngineRouting: AppEngineRouting; + body: string; + headers: { + [key: string]: string; + }; + httpMethod: string; + relativeUri: string; +} + +export interface AppEngineRouting { + host: string; + instance: string; + service: string; + version: string; +} + +export interface Attempt { + dispatchTime: string; + responseStatus: Status; + responseTime: string; + scheduleTime: string; +} + +export interface Binding { + condition: Expr; + members: string[]; + role: string; +} + +export interface CreateTaskRequest { + responseView: View; + task: Partial; +} + +export interface Expr { + description: string; + expression: string; + location: string; + title: string; +} + +export interface ListLocationsResponse { + locations: Location[]; + nextPageToken?: string; +} + +export interface ListQueuesResponse { + nextPageToken?: string; + queues: Queue[]; +} + +export interface ListTasksResponse { + nextPageToken?: string; + tasks: Task[]; +} + +export interface Location { + displayName: string; + labels: { + [key: string]: string; + }; + locationId: string; + metadata: object; + name: string; +} + +export interface Policy { + bindings: Binding[]; + etag: string; + version: number; +} + +export interface Queue { + appEngineHttpQueue: AppEngineHttpQueue; + name: string; + purgeTime: string; + rateLimits: RateLimits; + retryConfig: RetryConfig; + state: string; +} + +export interface RateLimits { + maxBurstSize: number; + maxConcurrentDispatches: number; + maxDispatchesPerSecond: number; +} + +export interface RetryConfig { + maxAttempts: number; + maxBackoff: string; + maxDoublings: number; + maxRetryDuration: string; + minBackoff: string; +} + +export interface RunTaskRequest { + responseView?: View; +} + +export interface SetIamPolicyRequest { + policy: Partial; +} + +export interface Status { + code: number; + details: object[]; + message: string; +} + +/** + * `VIEW_UNSPECIFIED = 0;` + * When Unspecified. Defaults to the behaviour of BASIC. + * + * `BASIC = 1;` + * The basic view omits fields which can be large or can contain + * sensitive data. + * This view does not include the + * ([payload in AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] and + * [payload in PullMessage][google.cloud.tasks.v2beta2.PullMessage.payload]). These payloads are + * desirable to return only when needed, because they can be large + * and because of the sensitivity of the data that you choose to + * store in it. + * + * `FULL = 2;` + * All information is returned. + * + * Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the [Queue][google.cloud.tasks.v2beta2.Queue] resource. + */ +export type View = 0 | 1 | 2; + +export interface Task { + appEngineHttpRequest: AppEngineHttpRequest; + createTime: string; + dispatchCount: number; + firstAttempt: Attempt; + lastAttempt: Attempt; + name: string; + responseCount: number; + scheduleTime: string; + view: View; +} + +export interface TestIamPermissionsRequest { + permissions?: string[]; +} + +export interface TestIamPermissionsResponse { + permissions?: string[]; +} + +export interface PromiseLike extends Promise { + /** + * Cancel the ongoing promise + */ + cancel(): void; +} + +export type Keys = keyof T; + +export type EnhancedPick< + T, + Req extends keyof T, + Opt extends keyof T +> = Required> & Partial>; + +export type ProjectIdCallback = ( + err?: Error | null, + projectId?: string | null +) => void; + +export type APICallback = ( + err: GoogleError | null, + response?: T +) => void; + +export type APIPaginatedCallback = ( + err: GoogleError | null, + response?: T, + next?: U | null, + rawResponse?: V +) => void; + +export interface CallOptionsWithPagination extends CallOptions { + autoPaginate: false; +} + +export interface MethodOverload { + (data: T, options?: CallOptions): PromiseLike<[R]>; + (data: T, options: CallOptions, callback: APICallback): void; + (data: T, callback: APICallback): void; +} + +export interface PaginatedMethodOverload { + (data: T, options: CallOptionsWithPagination): PromiseLike<[R, V, U]>; + (data: T, options?: CallOptions): PromiseLike<[R]>; + (data: T, options: CallOptions, callback: APICallback): void; + ( + data: T, + options: CallOptionsWithPagination, + callback: APIPaginatedCallback + ): void; + (data: T, callback: APICallback): void; +} + +export interface ParentRequest { + /** + * The location name. For example: projects/PROJECT_ID/locations/LOCATION_ID + */ + parent: string; +} + +export interface ResourceRequest { + /** + * The resource for which the policy is being requested. resource is usually specified as a path. For example, a Project resource is specified as projects/{project}. + */ + resource: string; +} + +export interface ListRequestObject extends ParentRequest { + /** + * `filter` can be used to specify a subset of queues. Any Queue field can be used as a filter and several operators as supported. + * For example: <=, <, >=, >, !=, =, :. The filter syntax is the same as described in Stackdriver's Advanced Logs Filters. + * Sample filter "state: PAUSED". + * Note that using filters might cause fewer queues than the requested page_size to be returned. + */ + filter?: string; + + /** + * The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, + * this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. + */ + pageSize?: number; +} + +export interface NamedRequest { + /** + * The resource name of the queue. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID + */ + name: string; +} + +export type CreateNamedRequest = ParentRequest & + { [P in N]: T }; +export type UpdateNamedRequest = ParentRequest & + { [P in N]: T }; + +/** + * Cloud Tasks allows developers to manage the execution of background + * work in their applications. + */ +export default class CloudTasksClient { + /** + * The DNS address for this API service. + * @default 'cloudtasks.googleapis.com' + */ + static readonly servicePath: string; + + /** + * The port for this API service. + * @default 443 + */ + static readonly port: number; + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @default ["https://www.googleapis.com/auth/cloud-platform"] + */ + static readonlyscopes: string; + + auth: GoogleAuth; + + /** + * Construct an instance of CloudTasksClient. + * + * @param [options] - The configuration object. See the subsequent + * parameters for more details. + * @param [options.credentials] - Credentials object. + * @param [options.credentials.client_email] + * @param [options.credentials.private_key] + * @param [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param [options.port] - The port on which to connect to + * the remote host. + * @param [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param [options.promise] - Custom promise module to use instead + * of native Promises. + * @param [options.servicePath] - The domain name of the + * API remote host. + */ + constructor(config: CloudTasksConfig); + + /** + * Return the project ID used by this class. + * @param callback - the callback to + * be called with the current project Id. + */ + getProjectId(): PromiseLike; + getProjectId(callback: ProjectIdCallback): void; + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Lists queues. + * + * Queues are returned in lexicographical order. + * + * @param request + * The request object that will be sent. + * @param request.parent + * Required. + * + * The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * @param [request.filter] + * `filter` can be used to specify a subset of queues. Any Queue + * field can be used as a filter and several operators as supported. + * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as + * described in + * [Stackdriver's Advanced Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * + * Sample filter "state: PAUSED". + * + * Note that using filters might cause fewer queues than the + * requested page_size to be returned. + * @param [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [ListQueuesResponse]{@link google.cloud.tasks.v2beta3.ListQueuesResponse}. + * The first element of the array is Array of [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Queue]{@link google.cloud.tasks.v2beta3.Queue} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListQueuesResponse]{@link google.cloud.tasks.v2beta3.ListQueuesResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * + * client.listQueues({parent: formattedParent}) + * .then(responses => { + * const resources = responses[0]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.listQueues(nextRequest, options).then(callback); + * } + * } + * client.listQueues({parent: formattedParent}, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + listQueues: PaginatedMethodOverload< + ListRequestObject, + Queue[], + ListQueuesResponse + >; + + /** + * Equivalent to {@link listQueues}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listQueues} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param request + * The request object that will be sent. + * @param request.parent + * Required. + * + * The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * @param [request.filter] + * `filter` can be used to specify a subset of queues. Any Queue + * field can be used as a filter and several operators as supported. + * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as + * described in + * [Stackdriver's Advanced Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters). + * + * Sample filter "state: PAUSED". + * + * Note that using filters might cause fewer queues than the + * requested page_size to be returned. + * @param [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * An object stream which emits an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue} on 'data' event. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * client.listQueuesStream({parent: formattedParent}) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + listQueuesStream( + request: ListRequestObject, + options?: CallOptions + ): Transform; + + /** + * Gets a queue. + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * client.getQueue({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getQueue: MethodOverload; + + /** + * Creates a queue. + * + * Queues created with this method allow tasks to live for a maximum of 31 + * days. After a task is 31 days old, the task will be deleted regardless of whether + * it was dispatched or not. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) + * before using this method. + * + * @param request + * The request object that will be sent. + * @param request.parent + * Required. + * + * The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * ListLocations. + * @param request.queue + * Required. + * + * The queue to create. + * + * Queue's name cannot be the same as an existing queue. + * + * This object should have the same structure as [Queue]{@link google.cloud.tasks.v2beta3.Queue} + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.locationPath('[PROJECT]', '[LOCATION]'); + * const queue = {}; + * const request = { + * parent: formattedParent, + * queue: queue, + * }; + * client.createQueue(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + createQueue: MethodOverload< + CreateNamedRequest<"queue", Partial>, + Queue + >; + + /** + * Updates a queue. + * + * This method creates the queue if it does not exist and updates + * the queue if it does exist. + * + * Queues created with this method allow tasks to live for a maximum of 31 + * days. After a task is 31 days old, the task will be deleted regardless of whether + * it was dispatched or not. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) + * before using this method. + * + * @param request + * The request object that will be sent. + * @param request.queue + * Required. + * + * The queue to create or update. + * + * The queue's name must be specified. + * + * Output only fields cannot be modified using UpdateQueue. + * Any value specified for an output only field will be ignored. + * The queue's name cannot be changed. + * + * This object should have the same structure as [Queue]{@link google.cloud.tasks.v2beta3.Queue} + * @param [request.updateMask] + * A mask used to specify which fields of the queue are being updated. + * + * If empty, then all fields will be updated. + * + * This object should have the same structure as [FieldMask]{@link google.protobuf.FieldMask} + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const queue = {}; + * client.updateQueue({queue: queue}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + updateQueue: MethodOverload< + UpdateNamedRequest< + "queue", + EnhancedPick< + Queue, + "name", + "appEngineHttpQueue" | "rateLimits" | "retryConfig" + > + >, + Queue + >; + + /** + * Deletes a queue. + * + * This command will delete the queue even if it has tasks in it. + * + * Note: If you delete a queue, a queue with the same name can't be created + * for 7 days. + * + * WARNING: Using this method may have unintended side effects if you are + * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. + * Read + * [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) + * before using this method. + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * client.deleteQueue({name: formattedName}).catch(err => { + * console.error(err); + * }); + */ + deleteQueue: MethodOverload; + + /** + * Purges a queue by deleting all of its tasks. + * + * All tasks created before this method is called are permanently deleted. + * + * Purge operations can take up to one minute to take effect. Tasks + * might be dispatched before the purge takes effect. A purge is irreversible. + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * client.purgeQueue({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + purgeQueue: MethodOverload; + + /** + * Pauses the queue. + * + * If a queue is paused then the system will stop dispatching tasks + * until the queue is resumed via + * ResumeQueue. Tasks can still be added + * when the queue is paused. A queue is paused if its + * state is PAUSED. + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * client.pauseQueue({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + pauseQueue: MethodOverload; + + /** + * Resume a queue. + * + * This method resumes a queue after it has been + * PAUSED or + * DISABLED. The state of a queue is stored + * in the queue's state; after calling this method it + * will be set to RUNNING. + * + * WARNING: Resuming many high-QPS queues at the same time can + * lead to target overloading. If you are resuming high-QPS + * queues, follow the 500/50/5 pattern described in + * [Managing Cloud Tasks Scaling Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * client.resumeQueue({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + resumeQueue: MethodOverload; + + /** + * Gets the access control policy for a Queue. + * Returns an empty policy if the resource exists and does not have a policy + * set. + * + * Authorization requires the following + * [Google IAM](https://cloud.google.com/iam) permission on the specified + * resource parent: + * + * * `cloudtasks.queues.getIamPolicy` + * + * @param request + * The request object that will be sent. + * @param request.resource + * REQUIRED: The resource for which the policy is being requested. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedResource = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * client.getIamPolicy({resource: formattedResource}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getIamPolicy: MethodOverload; + + /** + * Sets the access control policy for a Queue. Replaces any existing + * policy. + * + * Note: The Cloud Console does not check queue-level IAM permissions yet. + * Project-level permissions are required to use the Cloud Console. + * + * Authorization requires the following + * [Google IAM](https://cloud.google.com/iam) permission on the specified + * resource parent: + * + * * `cloudtasks.queues.setIamPolicy` + * + * @param request + * The request object that will be sent. + * @param request.resource + * REQUIRED: The resource for which the policy is being specified. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * @param request.policy + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + * + * This object should have the same structure as [Policy]{@link google.iam.v1.Policy} + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedResource = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * const policy = {}; + * const request = { + * resource: formattedResource, + * policy: policy, + * }; + * client.setIamPolicy(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + setIamPolicy: MethodOverload; + + /** + * Returns permissions that a caller has on a Queue. + * If the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building permission-aware + * UIs and command-line tools, not for authorization checking. This operation + * may "fail open" without warning. + * + * @param request + * The request object that will be sent. + * @param request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * `resource` is usually specified as a path. For example, a Project + * resource is specified as `projects/{project}`. + * @param request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedResource = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * const permissions = []; + * const request = { + * resource: formattedResource, + * permissions: permissions, + * }; + * client.testIamPermissions(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + testIamPermissions: MethodOverload< + ResourceRequest & TestIamPermissionsRequest, + TestIamPermissionsResponse + >; + + /** + * Lists the tasks in a queue. + * + * By default, only the BASIC view is retrieved + * due to performance considerations; + * response_view controls the + * subset of information which is returned. + * + * The tasks may be returned in any order. The ordering may change at any + * time. + * + * @param request + * The request object that will be sent. + * @param request.parent + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param [request.responseView] + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the Task resource. + * + * The number should be among the values of [View]{@link google.cloud.tasks.v2beta3.View} + * @param [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is Array of [Task]{@link google.cloud.tasks.v2beta3.Task}. + * + * When autoPaginate: false is specified through options, it contains the result + * in a single response. If the response indicates the next page exists, the third + * parameter is set to be used for the next request object. The fourth parameter keeps + * the raw response object of an object representing [ListTasksResponse]{@link google.cloud.tasks.v2beta3.ListTasksResponse}. + * The first element of the array is Array of [Task]{@link google.cloud.tasks.v2beta3.Task}. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Task]{@link google.cloud.tasks.v2beta3.Task} in a single response. + * The second element is the next request object if the response + * indicates the next page exists, or null. The third element is + * an object representing [ListTasksResponse]{@link google.cloud.tasks.v2beta3.ListTasksResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * // Iterate over all elements. + * const formattedParent = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * + * client.listTasks({parent: formattedParent}) + * .then(responses => { + * const resources = responses[0]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]) + * } + * }) + * .catch(err => { + * console.error(err); + * }); + * + * // Or obtain the paged response. + * const formattedParent = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * + * + * const options = {autoPaginate: false}; + * const callback = responses => { + * // The actual resources in a response. + * const resources = responses[0]; + * // The next request if the response shows that there are more responses. + * const nextRequest = responses[1]; + * // The actual response object, if necessary. + * // const rawResponse = responses[2]; + * for (let i = 0; i < resources.length; i += 1) { + * // doThingsWith(resources[i]); + * } + * if (nextRequest) { + * // Fetch the next page. + * return client.listTasks(nextRequest, options).then(callback); + * } + * } + * client.listTasks({parent: formattedParent}, options) + * .then(callback) + * .catch(err => { + * console.error(err); + * }); + */ + listTasks: PaginatedMethodOverload< + ListRequestObject & RunTaskRequest, + Task[], + ListTasksResponse + >; + + /** + * Equivalent to {@link listTasks}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listTasks} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param request + * The request object that will be sent. + * @param request.parent + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param [request.responseView] + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the Task resource. + * + * The number should be among the values of [View]{@link google.cloud.tasks.v2beta3.View} + * @param [request.pageSize] + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * An object stream which emits an object representing [Task]{@link google.cloud.tasks.v2beta3.Task} on 'data' event. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * client.listTasksStream({parent: formattedParent}) + * .on('data', element => { + * // doThingsWith(element) + * }).on('error', err => { + * console.log(err); + * }); + */ + listTasksStream( + request: ListRequestObject & RunTaskRequest, + options?: CallOptions + ): Transform; + + /** + * Gets a task. + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param [request.responseView] + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the Task resource. + * + * The number should be among the values of [View]{@link google.cloud.tasks.v2beta3.View} + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. + * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.taskPath('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * client.getTask({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + getTask: MethodOverload; + /** + * Creates a task and adds it to a queue. + * + * Tasks cannot be updated after creation; there is no UpdateTask command. + * + * * For App Engine queues, the maximum task size is + * 100KB. + * + * @param request + * The request object that will be sent. + * @param request.parent + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * The queue must already exist. + * @param request.task + * Required. + * + * The task to add. + * + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task name. If a + * name is not specified then the system will generate a random + * unique task id, which will be set in the task returned in the + * response. + * + * If schedule_time is not set or is in the + * past then Cloud Tasks will set it to the current time. + * + * Task De-duplication: + * + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or executed recently then the call will fail + * with ALREADY_EXISTS. + * If the task's queue was created using Cloud Tasks, then another task with + * the same name can't be created for ~1hour after the original task was + * deleted or executed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9days after the original task was deleted or executed. + * + * Because there is an extra lookup cost to identify duplicate task + * names, these CreateTask calls have significantly + * increased latency. Using hashed strings for the task id or for + * the prefix of the task id is recommended. Choosing task ids that + * are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + * + * This object should have the same structure as [Task]{@link google.cloud.tasks.v2beta3.Task} + * @param [request.responseView] + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the Task resource. + * + * The number should be among the values of [View]{@link google.cloud.tasks.v2beta3.View} + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. + * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedParent = client.queuePath('[PROJECT]', '[LOCATION]', '[QUEUE]'); + * const task = {}; + * const request = { + * parent: formattedParent, + * task: task, + * }; + * client.createTask(request) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + createTask: MethodOverload; + + /** + * Deletes a task. + * + * A task can be deleted if it is scheduled or dispatched. A task + * cannot be deleted if it has executed successfully or permanently + * failed. + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.taskPath('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * client.deleteTask({name: formattedName}).catch(err => { + * console.error(err); + * }); + */ + deleteTask: MethodOverload; + + /** + * Forces a task to run now. + * + * When this method is called, Cloud Tasks will dispatch the task, even if + * the task is already running, the queue has reached its RateLimits or + * is PAUSED. + * + * This command is meant to be used for manual debugging. For + * example, RunTask can be used to retry a failed + * task after a fix has been made or to manually force a task to be + * dispatched now. + * + * The dispatched task is returned. That is, the task that is returned + * contains the status after the task is dispatched but + * before the task is received by its target. + * + * If Cloud Tasks receives a successful response from the task's + * target, then the task will be deleted; otherwise the task's + * schedule_time will be reset to the time that + * RunTask was called plus the retry delay specified + * in the queue's RetryConfig. + * + * RunTask returns + * NOT_FOUND when it is called on a + * task that has already succeeded or permanently failed. + * + * @param request + * The request object that will be sent. + * @param request.name + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param [request.responseView] + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) + * permission on the Task resource. + * + * The number should be among the values of [View]{@link google.cloud.tasks.v2beta3.View} + * @param [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. + * @param [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. + * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * + * import CloudTasks from '@google-cloud/tasks'; + * + * const client = new tasks.v2beta3.CloudTasksClient({ + * // optional auth parameters. + * }); + * + * const formattedName = client.taskPath('[PROJECT]', '[LOCATION]', '[QUEUE]', '[TASK]'); + * client.runTask({name: formattedName}) + * .then(responses => { + * const response = responses[0]; + * // doThingsWith(response) + * }) + * .catch(err => { + * console.error(err); + * }); + */ + runTask: MethodOverload; + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param project + */ + projectPath(project: string): string; + + /** + * Return a fully-qualified location resource name string. + * + * @param project + * @param location + */ + locationPath(project: string, location: string): string; + + /** + * Return a fully-qualified queue resource name string. + * + * @param project + * @param location + * @param queue + */ + queuePath(project: string, location: string, queue: string): string; + + /** + * Return a fully-qualified task resource name string. + * + * @param project + * @param location + * @param queue + * @param task + */ + taskPath( + project: string, + location: string, + queue: string, + task: string + ): string; + + /** + * Parse the projectName from a project resource. + * + * @param projectName + * A fully-qualified path representing a project resources. + */ + matchProjectFromProjectName(projectName: string): string; + + /** + * Parse the locationName from a location resource. + * + * @param locationName + * A fully-qualified path representing a location resources. + */ + matchProjectFromLocationName(locationName: string): string; + + /** + * Parse the locationName from a location resource. + * + * @param locationName + * A fully-qualified path representing a location resources. + */ + matchLocationFromLocationName(locationName: string): string; + + /** + * Parse the queueName from a queue resource. + * + * @param queueName + * A fully-qualified path representing a queue resources. + */ + matchProjectFromQueueName(queueName: string): string; + + /** + * Parse the queueName from a queue resource. + * + * @param queueName + * A fully-qualified path representing a queue resources. + */ + matchLocationFromQueueName(queueName: string): string; + + /** + * Parse the queueName from a queue resource. + * + * @param queueName + * A fully-qualified path representing a queue resources. + */ + matchQueueFromQueueName(queueName: string): string; + + /** + * Parse the taskName from a task resource. + * + * @param taskName + * A fully-qualified path representing a task resources. + */ + matchProjectFromTaskName(taskName: string): string; + + /** + * Parse the taskName from a task resource. + * + * @param taskName + * A fully-qualified path representing a task resources. + */ + matchLocationFromTaskName(taskName: string): string; + + /** + * Parse the taskName from a task resource. + * + * @param taskName + * A fully-qualified path representing a task resources. + */ + matchQueueFromTaskName(taskName: string): string; + + /** + * Parse the taskName from a task resource. + * + * @param taskName + * A fully-qualified path representing a task resources. + */ + matchTaskFromTaskName(taskName: string): string; +} diff --git a/types/google-cloud__tasks/ts3.1/tsconfig.json b/types/google-cloud__tasks/ts3.1/tsconfig.json new file mode 100644 index 0000000000..08ba955879 --- /dev/null +++ b/types/google-cloud__tasks/ts3.1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "paths": { + "@google-cloud/tasks": ["google-cloud__tasks"] + }, + "baseUrl": "../../", + "typeRoots": ["../../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "google-cloud__tasks-tests.ts"] +} diff --git a/types/google-cloud__tasks/ts3.1/tslint.json b/types/google-cloud__tasks/ts3.1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/google-cloud__tasks/ts3.1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/google-cloud__tasks/tsconfig.json b/types/google-cloud__tasks/tsconfig.json new file mode 100644 index 0000000000..498e1217fc --- /dev/null +++ b/types/google-cloud__tasks/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "paths": { + "@google-cloud/tasks": ["google-cloud__tasks"] + }, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "google-cloud__tasks-tests.ts"] +} diff --git a/types/google-cloud__tasks/tslint.json b/types/google-cloud__tasks/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/google-cloud__tasks/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/google-maps-react/index.d.ts b/types/google-maps-react/index.d.ts index 1389982890..3d8d177d8b 100644 --- a/types/google-maps-react/index.d.ts +++ b/types/google-maps-react/index.d.ts @@ -89,6 +89,9 @@ export class Polyline extends React.Component { export class Circle extends React.Component { } +export class HeatMap extends React.Component { +} + export interface InfoWindowProps extends Partial { google: typeof google; map: google.maps.Map; diff --git a/types/google.script.client-side/google.script.client-side-tests.ts b/types/google.script.client-side/google.script.client-side-tests.ts new file mode 100644 index 0000000000..5e3c059c01 --- /dev/null +++ b/types/google.script.client-side/google.script.client-side-tests.ts @@ -0,0 +1,39 @@ +google.script.url.getLocation(location => { + location.hash; // $ExpectedType string + location.parameter; // $ExpectedType { [key: string]: string } + location.parameters; // $ExpectedType { [key: string]: ReadonlyArray } +}); + +google.script.history.push(null); +google.script.history.push({ timestamp: Date.now() }, { foo: 'bar', fiz: 'baz' }); +google.script.history.push({ timestamp: Date.now() }, { foo: ['bar', 'cat'], fiz: 'baz' }, 'anchor1'); + +google.script.history.replace(null); +google.script.history.replace({ timestamp: Date.now() }, { foo: 'bar', fiz: 'baz' }); +google.script.history.replace({ timestamp: Date.now() }, { foo: ['bar', 'cat'], fiz: 'baz' }, 'anchor1'); + +google.script.history.setChangeHandler(e => { + e.state; // $ExpectedType google.script.history.State + e.location.hash; // $ExpectedType string + e.location.parameter; // $ExpectedType { [key: string]: string } + e.location.parameters; // $ExpectedType { [key: string]: ReadonlyArray } +}); + +google.script.host.origin; // $ExpectType string +google.script.host.close(); +google.script.host.editor.focus(); +google.script.host.setHeight(450); +google.script.host.setWidth(300); + +google.script.run.withSuccessHandler(() => {}).executeScript({ message: 'test for google.script.run' }); + +google.script.run + .withSuccessHandler(value => {}) + .withFailureHandler(error => {}) + .getEmail(); + +google.script.run + .withSuccessHandler((value, userObject) => {}) + .withFailureHandler((error, userObject) => {}) + .withUserObject({}) + .getSomeData(Date.now(), { options: 'none' }, 'anchor1', true, null); diff --git a/types/google.script.client-side/index.d.ts b/types/google.script.client-side/index.d.ts new file mode 100644 index 0000000000..566fbb7397 --- /dev/null +++ b/types/google.script.client-side/index.d.ts @@ -0,0 +1,151 @@ +// Type definitions for Google Apps Script Client-side API 0.0 +// Project: https://developers.google.com/apps-script/guides/html/reference/host +// Definitions by: clomie +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare namespace google.script { + interface UrlLocation { + /** + * The string value of URL fragment after the # character, or an emptry string if no URL fragment is present + */ + hash: string; + + /** + * An object of key/value pairs that correspond to the URL request parameters. + * Only the first value will be returned for parameters that have multiple values. + * If no parameters are present, this will be an empty object. + */ + parameter: { [key: string]: string }; + + /** + * An object similar to location.parameter, but with an array of values for each key. + * If no parameters are present, this will be an empty object. + */ + parameters: { [key: string]: ReadonlyArray }; + } + + namespace url { + /** + * Gets a URL location object and passes it to the specified callback function (as the only argument). + * @param callback a client-side callback function to run, using the location object as the only argument. + */ + function getLocation(callback: (location: UrlLocation) => void): void; + } + + namespace history { + type State = object | null; + interface Query { + [key: string]: string | ReadonlyArray; + } + + /** + * Pushes the provided state object, URL parameters and URL fragment onto the browser history stack. + * @param stateObject An developer-defined object to be associated with a browser history event, and which resurfaces when the state is popped. + * Typically used to store application state information (such as page data) for future retrieval. + * @param params An object containing URL parameters to associate with this state. + * For example, {foo: “bar”, fiz: “baz”} equates to "?foo=bar&fiz=baz". + * Alternatively, arrays can be used: {foo: [“bar”, “cat”], fiz: “baz”} equates to "?foo=bar&foo=cat&fiz=baz". + * If null or undefined, the current URL parameters are not changed. If empty, the URL parameters are cleared. + * @param hash The string URL fragment appearing after the '#' character. + * If null or undefined, the current URL fragment is not changed. If empty, the URL fragment is cleared. + */ + function push(stateObject: State, params?: Query, hash?: string): void; + + /** + * Replaces the top event on the browser history stack with the provided (developer-defined) state object, URL parameters and URL fragment. + * @param stateObject An developer-defined object to be associated with a browser history event, and which resurfaces when the state is popped. + * Typically used to store application state information (such as page data) for future retrieval. + * @param params An object containing URL parameters to associate with this state. + * For example, {foo: “bar”, fiz: “baz”} equates to "?foo=bar&fiz=baz". + * Alternatively, arrays can be used: {foo: [“bar”, “cat”], fiz: “baz”} equates to "?foo=bar&foo=cat&fiz=baz". + * If null or undefined, the current URL parameters are not changed. If empty, the URL parameters are cleared. + * @param hash The string URL fragment appearing after the '#' character. + * If null or undefined, the current URL fragment is not changed. If empty, the URL fragment is cleared. + */ + function replace(stateObject: State, params?: Query, hash?: string): void; + + interface HistoryChangeEvent { + /** + * The state object associated with the popped event. + * This object is identical to the state object that used in the corresponding push() or replace() method that added the popped state to the history stack. + */ + state: State; + + /** + * A location object associated with the popped event + */ + location: UrlLocation; + } + + /** + * Sets a callback function to respond to changes in the browser history. + * @param callback a client-side callback function to run upon a history change event, using the event object as the only argument. + */ + function setChangeHandler(handler: (event: HistoryChangeEvent) => void): void; + } + + namespace host { + /** + * Provides the host domain, so scripts can set their origin correctly. + */ + const origin: string; + + /** + * Closes the current dialog or sidebar. + */ + function close(): void; + + namespace editor { + /** + * Switches browser focus from the dialog or sidebar to the Google Docs, Sheets, or Forms editor. + */ + function focus(): void; + } + + /** + * Sets the height of the current dialog. + * @param height the new height, in pixels + */ + function setHeight(height: number): void; + + /** + * Sets the width of the current dialog. + * @param width the new width, in pixels + */ + function setWidth(width: number): void; + } + + const run: Runner; + + interface Runner { + /** + * Executes the server-side Apps Script function with the corresponding name. + */ + [functionName: string]: (...args: any[]) => void; + + /** + * Sets a callback function to run if the server-side function throws an exception. + * Without a failure handler, failures are logged to the JavaScript console. + * To override this, call withFailureHandler(null) or supply a failure handler that does nothing. + * @param handler a client-side callback function to run if the server-side function throws an exception; + * the Error object is passed to the function as the first argument, and the user object (if any) is passed as a second argument + */ + withFailureHandler(handler: (error: Error, object?: any) => void): Runner; + + /** + * Sets a callback function to run if the server-side function returns successfully. + * @param handler a client-side callback function to run if the server-side function returns successfully; + * the server's return value is passed to the function as the first argument, and the user object (if any) is passed as a second argument + */ + withSuccessHandler(handler: (value?: any, object?: any) => void): Runner; + + /** + * Sets an object to pass as a second parameter to the success and failure handlers. + * @param object an object to pass as a second parameter to the success and failure handlers; + * because user objects are not sent to the server, they are not subject to the restrictions on parameters and return values for server calls. + * User objects cannot, however, be objects constructed with the new operator + */ + withUserObject(object: any): Runner; + } +} diff --git a/types/google.script.client-side/tsconfig.json b/types/google.script.client-side/tsconfig.json new file mode 100644 index 0000000000..83c99e2f06 --- /dev/null +++ b/types/google.script.client-side/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", + "google.script.client-side-tests.ts" + ] +} diff --git a/types/google.script.client-side/tslint.json b/types/google.script.client-side/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/google.script.client-side/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/google__maps/index.d.ts b/types/google__maps/index.d.ts index 4759d412dd..f1df5d8f38 100644 --- a/types/google__maps/index.d.ts +++ b/types/google__maps/index.d.ts @@ -907,7 +907,9 @@ export interface DirectionsRoute { * contains a single `points` object that holds an encoded polyline representation of the route. * This polyline is an approximate (smoothed) path of the resulting directions. */ - overview_polyline: string; + overview_polyline: { + points: string; + }; /** contains the viewport bounding box of the `overview_polyline`. */ bounds: LatLngBounds; /** contains the copyrights text to be displayed for this route. You must handle and display this information yourself. */ @@ -2005,7 +2007,7 @@ export interface GeocodingResponse { * When the geocoder returns a status code other than `OK`, there may be an additional `error_message` field * within the Geocoding response object. This field contains more detailed information about the reasons behind the given status code. */ - error_meesage: string; + error_message: string; /** * contains an array of geocoded address information and geometry information. * @@ -3105,7 +3107,7 @@ export interface QueryAutocompleteResult { * contains an `offset` value and a `length`. * These describe the location of the entered term in the prediction result text, so that the term can be highlighted if desired. */ - matched_substring: PredictionSubstring[]; + matched_substrings: PredictionSubstring[]; } /** A Radar Search request must include at least one of `keyword`, `name`, or `type`. */ diff --git a/types/got/got-tests.ts b/types/got/got-tests.ts index 55680e7d27..afaac89ba4 100644 --- a/types/got/got-tests.ts +++ b/types/got/got-tests.ts @@ -253,7 +253,7 @@ got('todomvc', { }).then(res => res.fromCache); got('todomvc', { - cache: new QuickLRU(), + cache: new QuickLRU({maxSize: 10}), }).then(res => res.fromCache); got(new url.URL('http://todomvc.com')); @@ -265,8 +265,128 @@ got('https://todomvc.com', { rejectUnauthorized: false }); got('/examples/angularjs', { baseUrl: 'http://todomvc.com' }); got('http://todomvc.com', { headers: { foo: 'bar'} }); got('http://todomvc.com', { cookieJar: new tough.CookieJar() }); + +// Test retry options. got('http://todomvc.com', { retry: 2 }); -got('http://todomvc.com', { retry: { retries: 2, methods: ['GET'], statusCodes: [408, 504], maxRetryAfter: 1 } }); +got('http://todomvc.com', { + retry: { + retries: 2, + methods: ['GET'], + statusCodes: [408, 504], + maxRetryAfter: 1, + errorCodes: ['ETIMEDOUT'] + } +}); +// Test custom retry error code. See https://github.com/sindresorhus/got/blob/9f3a09948ff80057b12af0af60846cc5b8f0372d/test/retry.js#L155 +got('http://todomvc.com', { + retry: { + retries: 1, + methods: ['GET'], + errorCodes: ['OH_SNAP'] + } +}); + got('http://todomvc.com', { throwHttpErrors: false }); -got('http://todomvc.com', { hooks: { beforeRequest: [ () => 'foo']} }); -got('http://todomvc.com', { timeout: 1 }).catch((e) => e instanceof got.TimeoutError); + +// Test timeout options. +got('http://todomvc.com', {timeout: 1}); +got('http://todomvc.com', { + timeout: { + lookup: 1, + connect: 2, + secureConnect: 3, + socket: 4, + response: 5, + send: 6, + request: 7 + } +}); + +// Test got.TimeoutError. +got('http://todomvc.com', {timeout: 1}).catch((err) => err instanceof got.TimeoutError); + +// Test hooks. +got('example.com', { + hooks: { + beforeRequest: [ + options => { + options.headers!['x-foo'] = 'bar'; + } + ] + } +}); +got('example.com', { + hooks: { + beforeRedirect: [ + options => { + if (options.hostname === 'deadSite') { + options.hostname = 'fallbackSite'; + } + } + ] + } +}); +got('example.com', { + hooks: { + beforeRetry: [ + (options, error, retryCount) => { + if (error instanceof got.HTTPError && error.statusCode === 413) { // Payload too large + options.body = 'new body'; + } + } + ] + } +}); +got('example.com', { + hooks: { + afterResponse: [ + (response, retryWithMergedOptions) => { + if (response.statusCode === 401) { // Unauthorized + const updatedOptions = { + headers: { + token: 'new token' // Refresh the access token + } + }; + + // Make a new retry + return retryWithMergedOptions(updatedOptions); + } + + // No changes otherwise + return response; + } + ] + } +}); +// Test async hooks. +{ + const doSomethingAsync = (): Promise => { + throw new Error('unimplemented'); + }; + + got('example.com', { + hooks: { + beforeRequest: [ + async () => { + await doSomethingAsync(); + } + ], + beforeRedirect: [ + async () => { + await doSomethingAsync(); + } + ], + beforeRetry: [ + async () => { + await doSomethingAsync(); + } + ], + afterResponse: [ + async (response) => { + await doSomethingAsync(); + return response; + } + ] + } + }); +} diff --git a/types/got/index.d.ts b/types/got/index.d.ts index d0cfc682dc..0c847d6489 100644 --- a/types/got/index.d.ts +++ b/types/got/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for got 9.2 +// Type definitions for got 9.4 // Project: https://github.com/sindresorhus/got#readme // Definitions by: BendingBender // Linus Unnebäck @@ -102,12 +102,50 @@ declare namespace got { type GotUrl = string | https.RequestOptions | Url | URL; - type Hook = (options: T) => any; - type Hooks = Record<'beforeRequest', Array>>; + /** + * Hooks allow modifications during the request lifecycle. Hook functions may be async and are + * run serially. + * + * @see https://github.com/sindresorhus/got#hooks + * @template Options Request options. + * @template Body Response body type. + */ + interface Hooks { + beforeRequest?: Array>; + beforeRedirect?: Array>; + beforeRetry?: Array>; + afterResponse?: Array>; + } + + /** + * @param options Normalized request options. + */ + type BeforeRequestHook = (options: Options) => any; + + /** + * @param options Normalized request options. + */ + type BeforeRedirectHook = (options: Options) => any; + + /** + * @param options Normalized request options. + * @param error Request error. + * @param retryCount Number of retry. + */ + type BeforeRetryHook = (options: Options, error: GotError, retryCount: number) => any; + + /** + * @param response Response object. + * @param retryWithMergedOptions Retries request with the updated options. + */ + type AfterResponseHook = ( + response: Response, + retryWithMergedOptions: (updateOptions: Options) => GotPromise + ) => Response | Promise>; interface GotBodyOptions extends GotOptions { body?: string | Buffer | nodeStream.Readable; - hooks?: Hooks>; + hooks?: Hooks, string | Buffer | nodeStream.Readable>; } interface GotJSONOptions extends GotOptions { @@ -115,14 +153,14 @@ declare namespace got { body?: object; form?: boolean; json: true; - hooks?: Hooks; + hooks?: Hooks; } interface GotFormOptions extends GotOptions { - body?: {[key: string]: any}; + body?: Record; form: true; json?: boolean; - hooks?: Hooks>; + hooks?: Hooks, Record>; } interface GotOptions extends InternalRequestOptions { @@ -140,9 +178,44 @@ declare namespace got { cache?: Cache; } + /** + * Contains properties to constrain the duration of each phase of the request lifecycle. + * + * @see https://github.com/sindresorhus/got#timeout + */ interface TimeoutOptions { + /** + * Starts when a socket is assigned and ends when the hostname has been resolved. Does not + * apply when using a Unix domain socket. + */ + lookup?: number; + /** + * Starts when `lookup` completes (or when the socket is assigned if lookup does not apply + * to the request) and ends when the socket is connected. + */ connect?: number; + /** + * Starts when `connect` completes and ends when the handshaking process completes (HTTPS + * only). + */ + secureConnect?: number; + /** + * Starts when the socket is connected. See [request.setTimeout](https://nodejs.org/api/http.html#http_request_settimeout_timeout_callback). + */ socket?: number; + /** + * Starts when the request has been written to the socket and ends when the response headers + * are received. + */ + response?: number; + /** + * Starts when the socket is connected and ends with the request has been written to the + * socket. + */ + send?: number; + /** + * Starts when the request is initiated and ends when the response's end event fires. + */ request?: number; } @@ -153,6 +226,10 @@ declare namespace got { methods?: Array<'GET' | 'PUT' | 'HEAD' | 'DELETE' | 'OPTIONS' | 'TRACE'>; statusCodes?: Array<408 | 413 | 429 | 500 | 502 | 503 | 504>; maxRetryAfter?: number; + /** + * Allowed error codes. + */ + errorCodes?: string[]; } interface AgentOptions { diff --git a/types/got/v8/got-tests.ts b/types/got/v8/got-tests.ts index 610ac87c26..5e115e96ac 100644 --- a/types/got/v8/got-tests.ts +++ b/types/got/v8/got-tests.ts @@ -252,7 +252,7 @@ got('todomvc', { }).then(res => res.fromCache); got('todomvc', { - cache: new QuickLRU(), + cache: new QuickLRU({maxSize: 10}), }).then(res => res.fromCache); got(new url.URL('http://todomvc.com')); diff --git a/types/graphql-errors/graphql-errors-tests.ts b/types/graphql-errors/graphql-errors-tests.ts new file mode 100644 index 0000000000..d9d07b2071 --- /dev/null +++ b/types/graphql-errors/graphql-errors-tests.ts @@ -0,0 +1,47 @@ +import { GraphQLSchema, buildSchema } from 'graphql'; +import { + UserError, + maskErrors, + HandlerFunction, + setDefaultHandler +} from 'graphql-errors'; + +// $ExpectType GraphQLSchema +const schema: GraphQLSchema = buildSchema(` + # graphql schema definition +`); + +const customHandler: HandlerFunction = err => { + return { ...err, message: 'Internal error' }; +}; + +/** + * Mask GraphQL error messages + */ + +// $ExpectType void +maskErrors(schema); + +// $ExpectType void +maskErrors(schema, customHandler); + +// $ExpectError +maskErrors('schema'); + +/** + * Set callback function that modifies the errors + */ + +// $ExpectType void +setDefaultHandler(customHandler); + +// $ExpectError +setDefaultHandler(); + +// $ExpectError +setDefaultHandler(err => {}); + +/** + * Thrown an user error + */ +new UserError("Uh, Houston, we've had a problem"); diff --git a/types/graphql-errors/index.d.ts b/types/graphql-errors/index.d.ts new file mode 100644 index 0000000000..d179cf3d7e --- /dev/null +++ b/types/graphql-errors/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for graphql-errors 2.1 +// Project: https://github.com/kadirahq/graphql-errors +// Definitions by: Matías Olivera +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { GraphQLSchema } from 'graphql'; + +export type HandlerFunction = (err: Error) => Error; + +export function setDefaultHandler(fn: HandlerFunction): void; + +export function maskErrors(schema: GraphQLSchema, fn?: HandlerFunction): void; + +export class UserError extends Error { + constructor(message: string); +} diff --git a/types/graphql-errors/tsconfig.json b/types/graphql-errors/tsconfig.json new file mode 100644 index 0000000000..159013d442 --- /dev/null +++ b/types/graphql-errors/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "esnext.asynciterable"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": ["index.d.ts", "graphql-errors-tests.ts"] +} diff --git a/types/graphql-errors/tslint.json b/types/graphql-errors/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/graphql-errors/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/graphql/index.d.ts b/types/graphql/index.d.ts index 0b87d35222..abaa81294b 100644 --- a/types/graphql/index.d.ts +++ b/types/graphql/index.d.ts @@ -16,6 +16,7 @@ // Brad Zacher // Curtis Layne // Jonathan Cardoso +// Pavel Lang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/graphql/language/predicates.d.ts b/types/graphql/language/predicates.d.ts index 81d2e02c41..c31a87f2a5 100644 --- a/types/graphql/language/predicates.d.ts +++ b/types/graphql/language/predicates.d.ts @@ -1,19 +1,30 @@ -import { ASTNode } from "./ast"; +import { + ASTNode, + DefinitionNode, + ExecutableDefinitionNode, + SelectionNode, + ValueNode, + TypeNode, + TypeSystemDefinitionNode, + TypeDefinitionNode, + TypeSystemExtensionNode, + TypeExtensionNode, +} from "./ast"; -export function isDefinitionNode(node: ASTNode): boolean; +export function isDefinitionNode(node: ASTNode): node is DefinitionNode; -export function isExecutableDefinitionNode(node: ASTNode): boolean; +export function isExecutableDefinitionNode(node: ASTNode): node is ExecutableDefinitionNode; -export function isSelectionNode(node: ASTNode): boolean; +export function isSelectionNode(node: ASTNode): node is SelectionNode; -export function isValueNode(node: ASTNode): boolean; +export function isValueNode(node: ASTNode): node is ValueNode; -export function isTypeNode(node: ASTNode): boolean; +export function isTypeNode(node: ASTNode): node is TypeNode; -export function isTypeSystemDefinitionNode(node: ASTNode): boolean; +export function isTypeSystemDefinitionNode(node: ASTNode): node is TypeSystemDefinitionNode; -export function isTypeDefinitionNode(node: ASTNode): boolean; +export function isTypeDefinitionNode(node: ASTNode): node is TypeDefinitionNode; -export function isTypeSystemExtensionNode(node: ASTNode): boolean; +export function isTypeSystemExtensionNode(node: ASTNode): node is TypeSystemExtensionNode; -export function isTypeExtensionNode(node: ASTNode): boolean; +export function isTypeExtensionNode(node: ASTNode): node is TypeExtensionNode; diff --git a/types/graphql/type/definition.d.ts b/types/graphql/type/definition.d.ts index 1df7c85690..97c16f305c 100644 --- a/types/graphql/type/definition.d.ts +++ b/types/graphql/type/definition.d.ts @@ -342,15 +342,15 @@ export interface GraphQLScalarTypeConfig { * }); * */ -export class GraphQLObjectType { +export class GraphQLObjectType { name: string; description: Maybe; astNode: Maybe; extensionASTNodes: Maybe>; - isTypeOf: Maybe>; + isTypeOf: Maybe>; - constructor(config: GraphQLObjectTypeConfig); - getFields(): GraphQLFieldMap; + constructor(config: GraphQLObjectTypeConfig); + getFields(): GraphQLFieldMap; getInterfaces(): GraphQLInterfaceType[]; toString(): string; toJSON(): string; @@ -371,7 +371,7 @@ export type GraphQLTypeResolver = ( value: TSource, context: TContext, info: GraphQLResolveInfo -) => MaybePromise>; +) => MaybePromise | string>>; export type GraphQLIsTypeOfFn = ( source: TSource, diff --git a/types/gsap/Timeline.d.ts b/types/gsap/Timeline.d.ts index 60292e354d..232d2ed9a3 100644 --- a/types/gsap/Timeline.d.ts +++ b/types/gsap/Timeline.d.ts @@ -85,7 +85,7 @@ declare namespace gsap { removeLabel(label: string): any; /** Jumps to a specific time (or label) without affecting whether or not the instance is paused or reversed. */ - seek(position: string | number, supressEvents: boolean): TimelineLite; + seek(position: string | number, supressEvents?: boolean): TimelineLite; /** * Adds a zero-duration tween to the end of the timeline (or elsewhere using the "position" parameter) that sets values immediately (when the virtual playhead reaches that diff --git a/types/guardian__prosemirror-invisibles/guardian__prosemirror-invisibles-tests.ts b/types/guardian__prosemirror-invisibles/guardian__prosemirror-invisibles-tests.ts new file mode 100644 index 0000000000..38398d9830 --- /dev/null +++ b/types/guardian__prosemirror-invisibles/guardian__prosemirror-invisibles-tests.ts @@ -0,0 +1,8 @@ +import { Node } from 'prosemirror-model'; +import { Plugin } from 'prosemirror-state'; + +import invisibles, { hardBreak, paragraph, space, Builder } from 'guardian__prosemirror-invisibles'; + +const plugin1: Plugin = invisibles([hardBreak((node: Node) => true), paragraph(), space((char: string) => false)]); + +const plugin2: Plugin = invisibles([hardBreak(), paragraph((node: Node) => false), space()]); diff --git a/types/guardian__prosemirror-invisibles/index.d.ts b/types/guardian__prosemirror-invisibles/index.d.ts new file mode 100644 index 0000000000..f3453cd6ec --- /dev/null +++ b/types/guardian__prosemirror-invisibles/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for @guardian/prosemirror-invisibles 1.0 +// Project: https://github.com/guardian/prosemirror-invisibles +// Definitions by: Daniil Dotsev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Node } from 'prosemirror-model'; +import { Decoration, DecorationSet } from "prosemirror-view"; +import { Plugin } from 'prosemirror-state'; + +export type Builder = (from: number, to: number, doc: Node, decos: DecorationSet) => DecorationSet; + +export interface TextBetweenPosition { + pos: number; + text: string; +} + +export default function(builders: Builder[]): Plugin; + +export function hardBreak(predicate?: (node: Node) => boolean): Builder; +export function paragraph(predicate?: (node: Node) => boolean): Builder; +export function space(predicate?: (char: string) => boolean): Builder; + +export function createDeco(pos: number, type: string): Decoration; +export function textBetween(from: number, to: number, doc: Node): TextBetweenPosition[]; diff --git a/types/guardian__prosemirror-invisibles/tsconfig.json b/types/guardian__prosemirror-invisibles/tsconfig.json new file mode 100644 index 0000000000..dd1f2f9a2d --- /dev/null +++ b/types/guardian__prosemirror-invisibles/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", + "guardian__prosemirror-invisibles-tests.ts" + ] +} diff --git a/types/guardian__prosemirror-invisibles/tslint.json b/types/guardian__prosemirror-invisibles/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/guardian__prosemirror-invisibles/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/gulp-minify-css/tsconfig.json b/types/gulp-minify-css/tsconfig.json index ccb2e4b319..0742a43568 100644 --- a/types/gulp-minify-css/tsconfig.json +++ b/types/gulp-minify-css/tsconfig.json @@ -12,6 +12,14 @@ "typeRoots": [ "../" ], + "paths": { + "clean-css": [ + "clean-css/v3" + ], + "clean-css/*": [ + "clean-css/v3/*" + ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/gulp-rev-replace/tsconfig.json b/types/gulp-rev-replace/tsconfig.json index d6b9abe0ba..736d44e64d 100644 --- a/types/gulp-rev-replace/tsconfig.json +++ b/types/gulp-rev-replace/tsconfig.json @@ -12,6 +12,14 @@ "typeRoots": [ "../" ], + "paths": { + "clean-css": [ + "clean-css/v3" + ], + "clean-css/*": [ + "clean-css/v3/*" + ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/gulp-useref/tsconfig.json b/types/gulp-useref/tsconfig.json index b8a3dc7bba..4dc6f70464 100644 --- a/types/gulp-useref/tsconfig.json +++ b/types/gulp-useref/tsconfig.json @@ -12,6 +12,14 @@ "typeRoots": [ "../" ], + "paths": { + "clean-css": [ + "clean-css/v3" + ], + "clean-css/*": [ + "clean-css/v3/*" + ] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/h2o2/h2o2-tests.ts b/types/h2o2/h2o2-tests.ts index 48b05b8aa3..9da2899258 100644 --- a/types/h2o2/h2o2-tests.ts +++ b/types/h2o2/h2o2-tests.ts @@ -1,106 +1,114 @@ -import http = require("http"); -import * as Boom from 'boom'; -import * as Hapi from 'hapi'; -import * as Wreck from 'wreck'; +import wreck = require('wreck'); import h2o2 = require('h2o2'); +import hapi = require('hapi'); -// https://github.com/hapijs/h2o2#manual-loading +async function main() { + const server = new hapi.Server({}); + await server.register(h2o2); -const server = new Hapi.Server({}); - -server.register({ - register: h2o2 -}, function (err) { - - if (err) { - console.log('Failed to load h2o2'); - } - - server.start(function (err) { - - console.log('Server started at: ' + server.info!.uri); + server.route({ + method: 'GET', + path: '/hproxyoptions', + async handler(request, h) { + // ResponseToolkit augmentation + // https://github.com/hapijs/h2o2#hproxyoptions + return h.proxy({ host: 'example.com', port: 80, protocol: 'http' }); + } }); -}); -// https://github.com/hapijs/h2o2#replyproxyoptions - -const handler: Hapi.RouteHandler = function (request, reply) { - - return reply.proxy({ host: 'example.com', port: 80, protocol: 'http' }); -}; - -// https://github.com/hapijs/h2o2#using-the-host-port-protocol-options - -server.route({ - method: 'GET', - path: '/', - handler: { - proxy: { - host: '10.33.33.1', - port: '443', - protocol: 'https' - } - } -}); - -// https://github.com/hapijs/h2o2#using-the-uri-option - -server.route({ - method: 'GET', - path: '/', - handler: { - proxy: { - uri: 'https://some.upstream.service.com/that/has?what=you&want=todo' - } - } -}); - -// https://github.com/hapijs/h2o2#custom-uri-template-values - -server.route({ - method: 'GET', - path: '/foo', - handler: { - proxy: { - uri: '{protocol}://{host}:{port}/go/to/{path}' - } - } -}); - -server.route({ - method: 'GET', - path: '/foo/{bar}', - handler: { - proxy: { - uri: 'https://some.upstream.service.com/some/path/to/{bar}' - } - } -}); - -// https://github.com/hapijs/h2o2#using-the-mapuri-and-onresponse-options - -server.route({ - method: 'GET', - path: '/', - handler: { - proxy: { - mapUri: function (request, callback) { - - console.log('doing some aditional stuff before redirecting'); - callback(null, 'https://some.upstream.service.com/'); - }, - onResponse: function (err, res, request, reply, settings, ttl) { - - console.log('receiving the response from the upstream.'); - Wreck.read(res, { json: true }, function (err, payload) { - - console.log('some payload manipulation if you want to.') - reply(payload).headers = res.headers as any; - }); + server.route({ + method: 'GET', + path: '/using-the-host-port-protocol-options', + handler: { + // HandlerDecorations augmentation + // https://github.com/hapijs/h2o2#using-the-host-port-protocol-options + proxy: { + host: '10.33.33.1', + port: '443', + protocol: 'https' } } - } -}); + }); + + server.route({ + method: 'GET', + path: '/using-the-uri-option', + handler: { + // HandlerDecorations augmentation + // https://github.com/hapijs/h2o2#using-the-uri-option + proxy: { + uri: 'https://some.upstream.service.com/that/has?what=you&want=todo' + } + } + }); + + + server.route({ + method: 'GET', + path: '/custom-uri-template-values', + handler: { + // HandlerDecorations augmentation + // https://github.com/hapijs/h2o2#custom-uri-template-values + proxy: { + uri: '{protocol}://{host}:{port}/go/to/{path}' + } + } + }); + + server.route({ + method: 'GET', + path: '/custom-uri-template-values/{bar}', + handler: { + // HandlerDecorations augmentation + // https://github.com/hapijs/h2o2#custom-uri-template-values + proxy: { + uri: 'https://some.upstream.service.com/some/path/to/{bar}' + } + } + }); + + server.route({ + method: 'GET', + path: '/', + handler: { + // HandlerDecorations augmentation + // https://github.com/hapijs/h2o2#using-the-mapuri-and-onresponse-options + proxy: { + async mapUri(request) { + console.log('doing some additional stuff before redirecting'); + return { + uri: 'https://some.upstream.service.com/' + }; + }, + + async onResponse(err, res, request, h, settings, ttl) { + console.log('receiving the response from the upstream.'); + const payload = await wreck.read(res, { json: true }); + + console.log('some payload manipulation if you want to.') + let response = h.response(payload); + + // TODO find a quicker way to do this + for (let header in res.headers) { + let value = res.headers[header]; + if (value) { + if (typeof value === 'string') { + value = [value]; + } + for (let v of value) { + response = response.header(header, v); + } + } + } + return response; + } + } + } + }); + + await server.start(); + await server.stop(); +} /** * test code added in additional to code in docs. Demonstrates that for the moment @@ -119,7 +127,7 @@ var proxyOptions: h2o2.ProxyHandlerOptions = { protocol: 'https' // errors correctly if misspelt } -server.route({ +const badProtocolDemo: hapi.ServerRoute = { method: 'GET', path: '/', handler: { @@ -127,39 +135,23 @@ server.route({ host: '10.33.33.1', port: '443', BAD_protocol: 'https' // TODO change typings to fix this / submit bug report + // port: null // detected as incompatible } } -}) +}; -server.route({ +const replyViaToolkit: hapi.ServerRoute = { method: 'GET', path: '/', - handler: { - proxy: { - uri: 'https://some.upstream.service.com/that/has?what=you&want=todo' - } + async handler(req, h): Promise { + return h.proxy({ + host: '10.33.33.1', + port: '443', + protocol: 'https' + }); } -}) +}; -server.route({ - method: 'GET', - path: '/', - handler: { - proxy: { - mapUri: function (request: Hapi.Request, callback: (err: null | Boom.BoomError, value: string) => void) { - - console.log('doing some aditional stuff before redirecting'); - callback(null, 'https://some.upstream.service.com/'); - }, - onResponse: function (err: null | Boom.BoomError, res: http.IncomingMessage, request: Hapi.Request, reply: Hapi.ReplyWithContinue, settings: h2o2.ProxyHandlerOptions, ttl: number) { - - console.log('receiving the response from the upstream.'); - Wreck.read(res, { json: true }, function (err: null | Boom.BoomError, payload: any) { - - console.log('some payload manipulation if you want to.') - reply(payload).headers = res.headers as any; - }); - } - } - } -}); +if (!module.parent) { + main().then(() => console.log('done'), err => console.error(err.stack)); +} diff --git a/types/h2o2/index.d.ts b/types/h2o2/index.d.ts index 3e47a084e8..58be5eb271 100644 --- a/types/h2o2/index.d.ts +++ b/types/h2o2/index.d.ts @@ -1,16 +1,33 @@ -// Type definitions for h2o2 5.4 -// Project: https://github.com/hapijs/catbox -// Definitions by: Jason Swearingen , AJP +// Type definitions for h2o2 8.1 +// Project: https://github.com/hapijs/h2o2 +// Definitions by: Jason Swearingen , AJP , Garth Kidd // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 /// -import http = require("http"); -import * as hapi from 'hapi'; -import * as Boom from 'boom'; +import http = require('http'); +import Boom = require('boom'); + +import { + Plugin, + Request, + ResponseObject, + ResponseToolkit, + Lifecycle, + RouteOptions, +} from 'hapi'; + +declare namespace h2o2 { + /** `mapURI` return value */ + export interface ProxyTarget { + /** The URI to request */ + uri: string; + + /** The headers with which to request `uri` */ + headers?: { [key: string]: string }; + } -declare namespace H2o2 { /** Proxy handler options */ export interface ProxyHandlerOptions { /** host - upstream service host to proxy requests to. It will have the same path as the client request. */ @@ -35,29 +52,26 @@ declare namespace H2o2 { redirects?: number | false; /** timeout - number of milliseconds before aborting the upstream request. Defaults to 180000 (3 minutes). */ timeout?: number; - /** mapUri - a function used to map the request URI to the proxied URI. Cannot be used together with host, port, protocol, or uri. The function signature is function (request, callback) where: + /** mapUri - a function used to map the request URI to the target `uri` and optional `headers` with which to make that request. Cannot be used together with `host`, `port`, `protocol`, or `uri`. * @param request - is the incoming request object. - * @param callback - is function (err, uri, headers) where: - * @param err - internal error condition. TODO: check this is of type BoomError or just Error. - * @param uri - the absolute proxy URI. - * @param headers - optional object where each key is an HTTP request header and the value is the header content. */ - mapUri?: (request: hapi.Request, callback: (err: null | Boom.BoomError, uri: string, headers?: { [key: string]: string }) => void) => void; + mapUri?: (this: ProxyHandlerOptions, request: Request) => Promise; /** - * onResponse - a custom function for processing the response from the upstream service before sending to the client. Useful for custom error handling of responses from the proxied endpoint or other payload manipulation. Function signature is function (err, res, request, reply, settings, ttl) where: + * onResponse - a custom function for processing the response from the upstream service before sending to the client. Useful for custom error handling of responses from the proxied endpoint or other payload manipulation. * @param err - internal or upstream error returned from attempting to contact the upstream proxy. TODO: check this is of type BoomError or just Error. * @param res - the node response object received from the upstream service. res is a readable stream (use the wreck module read method to easily convert it to a Buffer or string). * @param request - is the incoming request object. - * @param reply - the reply interface function. + * @param h - Hapi's response toolkit. * @param settings - the proxy handler configuration. * @param ttl - the upstream TTL in milliseconds if proxy.ttl it set to 'upstream' and the upstream response included a valid 'Cache-Control' header with 'max-age'. */ - onResponse?: (err: null | Boom.BoomError, + onResponse?: (this: RouteOptions, + err: null | Boom, res: http.IncomingMessage, - req: hapi.Request, - reply: hapi.ReplyWithContinue, // TODO, check it has continue + req: Request, + h: ResponseToolkit, settings: ProxyHandlerOptions, - ttl: number) => void; + ttl: number) => Lifecycle.ReturnValue; /** ttl - if set to 'upstream', applies the upstream response caching policy to the response using the response.ttl() method (or passed as an argument to the onResponse method if provided). */ ttl?: 'upstream'; /** agent - a node http(s) agent to be used for connections to upstream server. @see {@link https://nodejs.org/api/http.html#http_class_http_agent} */ @@ -68,24 +82,21 @@ declare namespace H2o2 { } declare module 'hapi' { - /** - * As one of the handlers for hapi, it is used through the route configuration object. - * [see docs](https://github.com/hapijs/h2o2#usage) - */ - interface RouteHandlerPlugins { - proxy?: H2o2.ProxyHandlerOptions; + interface HandlerDecorations { + /** + * Proxies the request to an upstream endpoint. + */ + proxy?: h2o2.ProxyHandlerOptions; } - interface Base_Reply { + interface ResponseToolkit { /** - * Proxies the request to an upstream endpoint - * @param options an object including the same keys and restrictions defined by the [route proxy handler options](https://github.com/hapijs/h2o2#options). - * [see docs](https://github.com/hapijs/h2o2#replyproxyoptions) + * Proxies the request to an upstream endpoint. `async`, so you'll need to `await` the `ResponseObject` to work on it before returning it. */ - proxy(options: H2o2.ProxyHandlerOptions): void; + proxy(options: h2o2.ProxyHandlerOptions): Promise; } } -declare var H2o2: hapi.PluginFunction<{}>; +declare const h2o2: Plugin<{}>; -export = H2o2; +export = h2o2; diff --git a/types/h2o2/tsconfig.json b/types/h2o2/tsconfig.json index d8e49426e5..16279498a6 100644 --- a/types/h2o2/tsconfig.json +++ b/types/h2o2/tsconfig.json @@ -13,22 +13,9 @@ "../" ], "types": [], - "paths": { - "boom": [ - "boom/v4" - ], - "catbox": [ - "catbox/v7" - ], - "hapi": [ - "hapi/v16" - ], - "wreck": [ - "wreck/v7" - ] - }, "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", diff --git a/types/handlebars/handlebars-tests.ts b/types/handlebars/handlebars-tests.ts index 1ec2528db3..340bbde590 100644 --- a/types/handlebars/handlebars-tests.ts +++ b/types/handlebars/handlebars-tests.ts @@ -1,6 +1,6 @@ //import Handlebars = require('handlebars'); -import * as Handlerbars from 'handlebars'; +import * as Handlebars from 'handlebars'; const context = { author: { firstName: 'Alan', lastName: 'Johnson' }, @@ -78,3 +78,10 @@ template6([{url:"", title:""}]) const escapedExpression = Handlebars.Utils.escapeExpression(''); Handlebars.helpers !== undefined; + +const parsedTmpl = Handlebars.parse('

Hello, my name is {{name}}.

', { + srcName: "/foo/bar/baz.hbs", + ignoreStandalone: true +}); + +const parsedTmplWithoutOptions = Handlebars.parse('

Hello, my name is {{name}}.

'); diff --git a/types/handlebars/index.d.ts b/types/handlebars/index.d.ts index 6272dde3a0..d6bebcb457 100644 --- a/types/handlebars/index.d.ts +++ b/types/handlebars/index.d.ts @@ -35,6 +35,11 @@ declare namespace Handlebars { [key: string]: HelperDelegate; } + export interface ParseOptions { + srcName?: string, + ignoreStandalone?: boolean + } + export function registerHelper(name: string, fn: HelperDelegate): void; export function registerHelper(name: HelperDeclareSpec): void; export function unregisterHelper(name: string): void; @@ -52,7 +57,7 @@ declare namespace Handlebars { export function blockParams(obj: any[], ids: any[]): any[]; export function Exception(message: string): void; export function log(level: number, obj: any): void; - export function parse(input: string): hbs.AST.Program; + export function parse(input: string, options?: ParseOptions): hbs.AST.Program; export function compile(input: any, options?: CompileOptions): HandlebarsTemplateDelegate; export function precompile(input: any, options?: PrecompileOptions): TemplateSpecification; export function template(precompilation: TemplateSpecification): HandlebarsTemplateDelegate; diff --git a/types/handlebars/tsconfig.json b/types/handlebars/tsconfig.json index 5c7bf000d0..0008e2154e 100644 --- a/types/handlebars/tsconfig.json +++ b/types/handlebars/tsconfig.json @@ -19,9 +19,5 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "handlebars-tests.ts" - ] -} \ No newline at end of file + } +} diff --git a/types/hapi-auth-bearer-token/hapi-auth-bearer-token-tests.ts b/types/hapi-auth-bearer-token/hapi-auth-bearer-token-tests.ts new file mode 100644 index 0000000000..4d145c3ae5 --- /dev/null +++ b/types/hapi-auth-bearer-token/hapi-auth-bearer-token-tests.ts @@ -0,0 +1,45 @@ +// from https://github.com/johnbrett/hapi-auth-bearer-token + +import { Server } from 'hapi'; +import * as AuthBearer from 'hapi-auth-bearer-token'; + +const server = new Server({ port: 8080 }); + +const start = async () => { + await server.register(AuthBearer); + + server.auth.strategy('simple', 'bearer-access-token', { + allowQueryToken: true, // optional, false by default + validate: (async (request, token, h) => { + // here is where you validate your token + // comparing with token from your database for example + const isValid = token === '1234'; + + const credentials = { token }; + const artifacts = { test: 'info' }; + + return { isValid, credentials, artifacts }; + }) as AuthBearer.Validate + }); + + server.auth.default('simple'); + + server.route({ + method: 'GET', + path: '/', + handler: async (request, h) => { + return { info: 'success!' }; + } + }); + + await server.start(); + + return server; +}; + +start() + .then((server) => console.log(`Server listening on ${server.info.uri}`)) + .catch(err => { + console.error(err); + process.exit(1); + }); diff --git a/types/hapi-auth-bearer-token/index.d.ts b/types/hapi-auth-bearer-token/index.d.ts new file mode 100644 index 0000000000..07ad3b868d --- /dev/null +++ b/types/hapi-auth-bearer-token/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for hapi-auth-bearer-token 6.1 +// Project: https://github.com/johnbrett/hapi-auth-bearer-token +// Definitions by: Rodrigo Saboya +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { + Request, + Plugin, + ResponseToolkit, + AuthenticationData, + } from 'hapi'; + + type ValidateReturn = AuthenticationData & { isValid: boolean }; + + declare module 'hapi' { + interface ServerAuth { + strategy(name: string, scheme: 'bearer-access-token', options: BearerToken.SchemaOptions): void; + } + } + + declare namespace BearerToken { + interface SchemaOptions { + validate: Validate; + accessTokenName?: string; + allowQueryToken?: boolean; + allowCookieToken?: boolean; + allowMultipleHeaders?: boolean; + allowChaining?: boolean; + tokenType?: string; + unauthorized?: (message: string | null, scheme: string) => any; + } + + type Validate = (request: Request, token: string, h: ResponseToolkit) => Promise | ValidateReturn; + } + + declare var BearerToken: Plugin<{}>; + + export = BearerToken; diff --git a/types/hapi-auth-bearer-token/tsconfig.json b/types/hapi-auth-bearer-token/tsconfig.json new file mode 100644 index 0000000000..404bf388a3 --- /dev/null +++ b/types/hapi-auth-bearer-token/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", + "hapi-auth-bearer-token-tests.ts" + ] +} diff --git a/types/hapi-auth-bearer-token/tslint.json b/types/hapi-auth-bearer-token/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/hapi-auth-bearer-token/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/hapi-pino/hapi-pino-tests.ts b/types/hapi-pino/hapi-pino-tests.ts new file mode 100644 index 0000000000..eb028d37ad --- /dev/null +++ b/types/hapi-pino/hapi-pino-tests.ts @@ -0,0 +1,44 @@ +import { Server } from 'hapi'; +import * as pino from 'pino'; +import * as HapiPino from 'hapi-pino'; + +const pinoLogger = pino(); + +const server = new Server(); + +server.register({ + plugin: HapiPino, + options: { + logPayload: false, + logRouteTags: false, + stream: process.stdout, + prettyPrint: process.env.NODE_ENV !== 'PRODUCTION', + levelTags: { + trace: 'trace', + debug: 'debug', + info: 'info', + warn: 'warn', + error: 'error' + }, + allTags: 'info', + serializers: { + req: (req: any) => console.log(req) + }, + instance: pinoLogger, + logEvents: false, + mergeHapiLogData: false, + ignorePaths: ['/testRoute'], + level: 'debug', + redact: ['test.property'] + } +}).then(() => { + server.logger().debug('using logger object directly'); + + server.route({ + method: 'GET', + path: '/', + handler: (request, h) => { + request.logger.debug('using logger directly'); + } + }); +}); diff --git a/types/hapi-pino/index.d.ts b/types/hapi-pino/index.d.ts new file mode 100644 index 0000000000..c3f61cbe8d --- /dev/null +++ b/types/hapi-pino/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for hapi-pino 5.2 +// Project: https://github.com/pinojs/hapi-pino#readme +// Definitions by: Rodrigo Saboya +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +import { + Plugin, +} from 'hapi'; +import * as pino from 'pino'; + +declare module 'hapi' { +interface Server { + logger: () => pino.Logger; +} + +interface Request { + logger: pino.Logger; +} +} + +declare namespace HapiPino { + type LogLevels = 'trace' | 'debug' | 'info' | 'warn' | 'error'; + + interface Options { + logPayload?: boolean; + logRouteTags?: boolean; + stream?: NodeJS.WriteStream; + prettyPrint?: boolean; + levelTags?: { [key in LogLevels]: string }; + allTags?: LogLevels; + serializers?: { [key: string]: (param: any) => void}; + instance?: pino.Logger; + logEvents?: string[] | false | null; + mergeHapiLogData?: boolean; + ignorePaths?: string[]; + level?: LogLevels; + redact?: string[]; + } +} + +declare var HapiPino: Plugin; + +export = HapiPino; diff --git a/types/hapi-pino/tsconfig.json b/types/hapi-pino/tsconfig.json new file mode 100644 index 0000000000..044a1596b4 --- /dev/null +++ b/types/hapi-pino/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", + "hapi-pino-tests.ts" + ] +} diff --git a/types/hapi-pino/tslint.json b/types/hapi-pino/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/hapi-pino/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 3e323f8c44..f66ae5a8ea 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -1,8 +1,9 @@ -// Type definitions for hapi 17.8 +// Type definitions for hapi 18.0 // Project: https://github.com/hapijs/hapi // Definitions by: Rafael Souza Fijalkowski // Justin Simms // Simon Schick +// Rodrigo Saboya // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -28,9 +29,9 @@ import * as zlib from 'zlib'; import { MimosOptions } from 'mimos'; import { SealOptions, SealOptionsSub } from 'iron'; -import { AnySchema, ValidationOptions } from 'joi'; +import { ValidationOptions, SchemaMap, Schema } from 'joi'; import Podium = require('podium'); -import { PolicyOptionVariants, EnginePrototypeOrObject, PolicyOptions, EnginePrototype, Policy } from 'catbox'; +import { PolicyOptionVariants, EnginePrototypeOrObject, PolicyOptions, EnginePrototype, Policy, ClientApi, ClientOptions } from 'catbox'; /* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -317,6 +318,8 @@ export interface RequestInfo { remotePort: string; /** request response timestamp (0 is not responded yet). */ responded: number; + /** request processing completion timestamp (0 is still processing). */ + completed: number; } /** @@ -502,9 +505,10 @@ export interface Request extends Podium { /** * Access: read / write (see limitations below). * The response object when set. The object can be modified but must not be assigned another object. To replace the response with another from within an extension point, use reply(response) to - * override with a different response. Contains null when no response has been set (e.g. when a request terminates prematurely when the client disconnects). + * override with a different response. + * In case of an aborted request the status code will be set to `disconnectStatusCode`. */ - response: ResponseObject | Boom | null; + response: ResponseObject | Boom; /** * Same as pre but represented as the response object created by the pre method. @@ -512,10 +516,9 @@ export interface Request extends Podium { readonly preResponses: Util.Dictionary; /** - * By default the object outputted from node's URL parse() method. Might also be set indirectly via request.setUrl in which case it may be a string (if url is set to an object with the query - * attribute as an unparsed string). + * By default the object outputted from node's URL parse() method. */ - readonly query: RequestQuery | string; + readonly query: RequestQuery; /** * An object containing the Node HTTP server objects. Direct interaction with these raw objects is not recommended. @@ -548,7 +551,7 @@ export interface Request extends Podium { /** * The parsed request URI. */ - readonly url: url.Url; + readonly url: url.URL; /** * Returns `true` when the request is active and processing should continue and `false` when the @@ -598,7 +601,7 @@ export interface Request extends Podium { * @return void * [See docs](https://hapijs.com/api/17.0.1#-requestseturlurl-striptrailingslash) */ - setUrl(url: string | url.Url, stripTrailingSlash?: boolean): void; + setUrl(url: string | url.URL, stripTrailingSlash?: boolean): void; } /* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1428,21 +1431,26 @@ export interface RouteOptionsPreObject { /** * key name used to assign the response of the method to in request.pre and request.preResponses. */ - assign: string; + assign?: string; /** * A failAction value which determine what to do when a pre-handler method throws an error. If assign is specified and the failAction setting is not 'error', the error will be assigned. */ failAction?: Lifecycle.FailAction; } -export interface ValidationObject { - [key: string]: AnySchema; -} +export type ValidationObject = SchemaMap; +/** + * * true - any query parameter value allowed (no validation performed). false - no parameter value allowed. + * * a joi validation object. + * * a validation function using the signature async function(value, options) where: + * * * value - the request.* object containing the request parameters. + * * * options - options. + */ export type RouteOptionsResponseSchema = boolean | ValidationObject - | AnySchema + | Schema | ((value: object | Buffer | string, options: ValidationOptions) => Promise); /** @@ -1516,6 +1524,16 @@ export interface RouteOptionsResponse { * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsresponsestatus) */ status?: Util.Dictionary; + + /** + * The default HTTP status code used to set a response error when the request is closed or aborted before the + * response is fully transmitted. + * Value can be any integer greater or equal to 400. + * The default value 499 is based on the non-standard nginx "CLIENT CLOSED REQUEST" error. + * The value is only used for logging as the request has already ended. + * @default 499 + */ + disconnectStatusCode?: number; } /** @@ -1629,21 +1647,15 @@ export interface RouteOptionsValidate { failAction?: Lifecycle.FailAction; /** - * Default value: true (no validation). * Validation rules for incoming request headers: - * * true - any headers allowed (no validation performed). - * * a joi validation object. - * * a validation function using the signature async function(value, options) where: - * * * value - the request.headers object containing the request headers. - * * * options - options. - * * * if a value is returned, the value is used as the new request.headers value and the original value is stored in request.orig.headers. Otherwise, the headers are left unchanged. If an error + * * If a value is returned, the value is used as the new request.headers value and the original value is stored in request.orig.headers. Otherwise, the headers are left unchanged. If an error * is thrown, the error is handled according to failAction. Note that all header field names must be in lowercase to match the headers normalized by node. * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsvalidateheaders) + * @default true */ headers?: RouteOptionsResponseSchema; /** - * Default value: none. * An options object passed to the joi rules or the custom validation methods. Used for setting global options such as stripUnknown or abortEarly (the complete list is available here). * If a custom validation function (see headers, params, query, or payload above) is defined then options can an arbitrary object that will be passed to this function as the second parameter. * The values of the other inputs (i.e. headers, query, params, payload, app, and auth) are added to the options object under the validation context (accessible in rules as @@ -1652,11 +1664,11 @@ export interface RouteOptionsValidate { * will reflect the raw, unvalidated and unmodified values. If the validation rules for headers, params, query, and payload are defined at both the server routes level and at the route level, the * individual route settings override the routes defaults (the rules are not merged). * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsvalidateparams) + * @default true */ options?: ValidationOptions | object; /** - * Default value: true (no validation). * Validation rules for incoming request path parameters, after matching the path against the route, extracting any parameters, and storing them in request.params, where: * * true - any path parameter value allowed (no validation performed). * * a joi validation object. @@ -1666,39 +1678,37 @@ export interface RouteOptionsValidate { * if a value is returned, the value is used as the new request.params value and the original value is stored in request.orig.params. Otherwise, the path parameters are left unchanged. If an * error is thrown, the error is handled according to failAction. Note that failing to match the validation rules to the route path parameters definition will cause all requests to fail. * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsvalidateparams) + * @default true */ params?: RouteOptionsResponseSchema; /** - * Default value: true (no validation). * Validation rules for incoming request payload (request body), where: - * * true - any payload allowed (no validation performed). false - no payload allowed. - * * a joi validation object. Note that empty payloads are represented by a null value. If a validation schema is provided and empty payload are allowed, the schema must be explicitly defined by - * setting the rule to a joi schema with null allowed (e.g. Joi.object({ keys here }).allow(null)). - * * a validation function using the signature async function(value, options) where: - * * * value - the request.query object containing the request query parameters. - * * * options - options. - * if a value is returned, the value is used as the new request.payload value and the original value is stored in request.orig.payload. Otherwise, the payload is left unchanged. If an error is + * * If a value is returned, the value is used as the new request.payload value and the original value is stored in request.orig.payload. Otherwise, the payload is left unchanged. If an error is * thrown, the error is handled according to failAction. Note that validating large payloads and modifying them will cause memory duplication of the payload (since the original is kept), as well * as the significant performance cost of validating large amounts of data. * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsvalidatepayload) + * @default true */ payload?: RouteOptionsResponseSchema; /** - * Default value: true (no validation). * Validation rules for incoming request URI query component (the key-value part of the URI between '?' and '#'). The query is parsed into its individual key-value pairs, decoded, and stored in * request.query prior to validation. Where: - * * true - any query parameter value allowed (no validation performed). false - no query parameter value allowed. - * * a joi validation object. - * * a validation function using the signature async function(value, options) where: - * * * value - the request.query object containing the request query parameters. - * * * options - options. - * if a value is returned, the value is used as the new request.query value and the original value is stored in request.orig.query. Otherwise, the query parameters are left unchanged. If an error + * * If a value is returned, the value is used as the new request.query value and the original value is stored in request.orig.query. Otherwise, the query parameters are left unchanged. + * If an error * is thrown, the error is handled according to failAction. Note that changes to the query parameters will not be reflected in request.url. * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsvalidatequery) + * @default true */ query?: RouteOptionsResponseSchema; + + /** + * Validation rules for incoming cookies. + * The cookie header is parsed and decoded into the request.state prior to validation. + * @default true + */ + state?: RouteOptionsResponseSchema; } /** @@ -2124,13 +2134,13 @@ export interface ServerAuth { * Tests a request against an authentication strategy where: * @param strategy - the strategy name registered with server.auth.strategy(). * @param request - the request object. - * @return Return value: the authentication credentials object if authentication was successful, otherwise throws an error. + * @return an object containing the authentication credentials and artifacts if authentication was successful, otherwise throws an error. * Note that the test() method does not take into account the route authentication configuration. It also does not * perform payload authentication. It is limited to the basic strategy authentication execution. It does not * include verifying scope, entity, or other route properties. * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-await-serverauthteststrategy-request) */ - test(strategy: string, request: Request): Promise; + test(strategy: string, request: Request): Promise; /** * Verify a request's authentication credentials against an authentication strategy. @@ -2305,7 +2315,7 @@ export interface RequestEvent { export type LogEventHandler = (event: LogEvent, tags: { [key: string]: true }) => void; export type RequestEventHandler = (request: Request, event: RequestEvent, tags: { [key: string]: true }) => void; export type ResponseEventHandler = (request: Request) => void; -export type RouteEventHandler = (route: ServerRoute) => void; +export type RouteEventHandler = (route: RequestRoute) => void; export type StartEventHandler = () => void; export type StopEventHandler = () => void; @@ -2646,15 +2656,24 @@ export interface ServerInfo { */ export interface ServerInjectOptions extends Shot.RequestOptions { /** - * an credentials object containing authentication information. The credentials are used to bypass the default authentication strategies, and are validated directly as if they were received via - * an authentication scheme. Defaults to no credentials. + * Authentication bypass options. */ - credentials?: AuthCredentials; - /** - * (an artifacts object containing authentication artifact information. The artifacts are used to bypass the default authentication strategies, and are validated directly as if they were received - * via an authentication scheme. Ignored if set without credentials. Defaults to no artifacts. - */ - artifacts?: object; + auth?: { + /** + * The authentication strategy name matching the provided credentials. + */ + strategy: string; + /** + * The credentials are used to bypass the default authentication strategies, + * and are validated directly as if they were received via an authentication scheme. + */ + credentials: AuthCredentials; + /** + * The artifacts are used to bypass the default authentication strategies, + * and are validated directly as if they were received via an authentication scheme. Defaults to no artifacts. + */ + artifacts?: object; + }; /** * sets the initial value of request.app, defaults to {}. */ @@ -2703,7 +2722,7 @@ export interface ServerInjectResponse extends Shot.ResponseObject { * * * ttl - 0 if result is valid but cannot be cached. Defaults to cache policy. * For reference [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servermethodname-method-options) */ -export type ServerMethod = (...args: any[]) => Promise; +export type ServerMethod = (...args: any[]) => any; /** * The same cache configuration used in server.cache(). @@ -2765,14 +2784,24 @@ export interface ServerMethodConfigurationObject { options?: ServerMethodOptions; } +export type CacheProvider = EnginePrototype | { + constructor: EnginePrototype; + options?: T; +}; + /** * hapi uses catbox for its cache implementation which includes support for common storage solutions (e.g. Redis, * MongoDB, Memcached, Riak, among others). Caching is only utilized if methods and plugins explicitly store their state in the cache. * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-cache) */ export interface ServerOptionsCache extends PolicyOptions { - /** a class, a prototype function, or a catbox engine object. */ - engine?: EnginePrototypeOrObject; + /** catbox engine object. */ + engine?: ClientApi; + + /** + * a class or a prototype function + */ + provider?: CacheProvider; /** * an identifier used later when provisioning or configuring caching for server methods or plugins. Each cache name must be unique. A single item may omit the name option which defines @@ -2850,7 +2879,7 @@ export interface ServerOptions { * * * other options passed to the catbox strategy used. Other options are only passed to catbox when engine above is a class or function and ignored if engine is a catbox engine object). * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serveroptionscache) */ - cache?: EnginePrototype | ServerOptionsCache | ServerOptionsCache[]; + cache?: CacheProvider | ServerOptionsCache | ServerOptionsCache[]; /** * Default value: { minBytes: 1024 }. @@ -2995,6 +3024,17 @@ export interface ServerOptions { * The full public URI without the path (e.g. 'http://example.com:8080'). If present, used as the server server.info.uri, otherwise constructed from the server settings. */ uri?: string; + + /** + * Query parameter configuration. + */ + query?: { + /** + * the method must return an object where each key is a parameter and matching value is the parameter value. + * If the method throws, the error is used as the response or returned when `request.setUrl` is called. + */ + parser(raw: Util.Dictionary): Util.Dictionary; + }; } /** diff --git a/types/hapi/test/request/info.ts b/types/hapi/test/request/info.ts new file mode 100644 index 0000000000..eae9d67d5f --- /dev/null +++ b/types/hapi/test/request/info.ts @@ -0,0 +1,4 @@ +import { Request } from "hapi"; + +const req: Request = {} as any; +const { completed, responded } = req.info; diff --git a/types/hapi/test/request/query.ts b/types/hapi/test/request/query.ts index 090ab3ae8d..26a886aa5f 100644 --- a/types/hapi/test/request/query.ts +++ b/types/hapi/test/request/query.ts @@ -6,10 +6,10 @@ const options: ServerOptions = { }; const handlerFn: Lifecycle.Method = (request, h) => { - const query1 = request.query as string; + const query1 = request.query; console.log(query1); - const query2 = request.query as RequestQuery; + const query2 = request.query; // http://localhost:8000/?name=test return `You asked for ${query2.name}`; }; diff --git a/types/hapi/test/response/response-events.ts b/types/hapi/test/response/response-events.ts index ec1b070b18..c78611cd2a 100644 --- a/types/hapi/test/response/response-events.ts +++ b/types/hapi/test/response/response-events.ts @@ -4,7 +4,7 @@ import * as Crypto from "crypto"; const preResponse: Lifecycle.Method = (request, h) => { // In onPreResponse, the response object will be defined. - const response = request.response!; + const response = request.response; const hash = Crypto.createHash('sha1'); response.events.on('peek', (chunk, encoding) => { diff --git a/types/hapi/test/route/route-options.ts b/types/hapi/test/route/route-options.ts index 438ef77d62..5f718a9c68 100644 --- a/types/hapi/test/route/route-options.ts +++ b/types/hapi/test/route/route-options.ts @@ -89,6 +89,7 @@ const routeOptionsResponse: RouteOptionsResponse = { 302: true, 404: false, }, + disconnectStatusCode: 123, }; const routeOptionSecure: RouteOptionsSecureObject = { diff --git a/types/hapi/test/route/validation.ts b/types/hapi/test/route/validation.ts index 6cc4ed186d..79b8effbb1 100644 --- a/types/hapi/test/route/validation.ts +++ b/types/hapi/test/route/validation.ts @@ -8,12 +8,30 @@ const options: ServerOptions = { const routeOptions: RouteOptions = { validate: { + payload: { + id: Joi.string().uuid().required(), + name: Joi.object({ + firstName: Joi.string().required(), + lastName: Joi.string().allow(null) + }), + firstName: Joi.ref("name.firstName") + }, params: { - name: Joi.string().min(3).max(10) - } + name: Joi.string().min(3).max(10), + nameRef: Joi.ref("name") + }, + state: { + woop: Joi.string().allow('doop'), + }, }, response: { - schema: Joi.string() + schema: Joi.object({ + a: Joi.string(), + b: Joi.object({ + c: Joi.number() + }), + d: Joi.ref("b.c") + }) } }; diff --git a/types/hapi/test/server/server-auth-test.ts b/types/hapi/test/server/server-auth-test.ts index 4e2a175e1a..c9f25fdfac 100644 --- a/types/hapi/test/server/server-auth-test.ts +++ b/types/hapi/test/server/server-auth-test.ts @@ -34,7 +34,7 @@ server.route({ path: '/', handler: async (request: Request, h: ResponseToolkit) => { try { - const credentials = await request.server.auth.test('default', request); + const { credentials } = await request.server.auth.test('default', request); return { status: true, user: credentials.name }; } catch (err) { return { status: false }; diff --git a/types/hapi/test/server/server-events.ts b/types/hapi/test/server/server-events.ts index 2334915f05..4e6d8103f1 100644 --- a/types/hapi/test/server/server-events.ts +++ b/types/hapi/test/server/server-events.ts @@ -14,7 +14,7 @@ const server = new Server({ }); server.events.on('route', route => { - console.log(route.path, route.method); + console.log(route.path, route.vhost, route.realm, route.method, route.settings, route.fingerprint); }); server.event('test'); diff --git a/types/hapi/test/server/server-inject.ts b/types/hapi/test/server/server-inject.ts index a2ae777a71..c7c7565ccf 100644 --- a/types/hapi/test/server/server-inject.ts +++ b/types/hapi/test/server/server-inject.ts @@ -25,6 +25,14 @@ declare module 'hapi' { } server.inject({ + auth: { + strategy: 'test', + credentials: { + user: { + a: 1, + }, + }, + }, url: "test", app: { injectState: 1 diff --git a/types/hapi/test/server/server-method.ts b/types/hapi/test/server/server-method.ts index bb729516b7..39c3fdb9d7 100644 --- a/types/hapi/test/server/server-method.ts +++ b/types/hapi/test/server/server-method.ts @@ -6,7 +6,7 @@ const server = new Server({ }); server.start(); -const add = (a: any, b: any) => { +const add = (a: any, b: any): number => { return a + b; }; diff --git a/types/hapi/tsconfig.json b/types/hapi/tsconfig.json index 9df329c575..f47f0d8dfb 100644 --- a/types/hapi/tsconfig.json +++ b/types/hapi/tsconfig.json @@ -22,6 +22,7 @@ "test/request/catch-all.ts", "test/request/event-types.ts", "test/request/get-log.ts", + "test/request/info.ts", "test/request/methods.ts", "test/request/parameters.ts", "test/request/query.ts", diff --git a/types/hapi/v17/index.d.ts b/types/hapi/v17/index.d.ts new file mode 100644 index 0000000000..d3262f5285 --- /dev/null +++ b/types/hapi/v17/index.d.ts @@ -0,0 +1,4005 @@ +// Type definitions for hapi 17.8 +// Project: https://github.com/hapijs/hapi +// Definitions by: Rafael Souza Fijalkowski +// Justin Simms +// Simon Schick +// Rodrigo Saboya +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WARNING: BACKWARDS INCOMPATIBLE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ + +/// + +import * as Boom from 'boom'; +import * as http from 'http'; +import * as https from 'https'; +import * as Shot from 'shot'; +import * as stream from 'stream'; +import * as url from 'url'; +import * as zlib from 'zlib'; + +import { MimosOptions } from 'mimos'; +import { SealOptions, SealOptionsSub } from 'iron'; +import { ValidationOptions, SchemaMap, Schema } from 'joi'; +import Podium = require('podium'); +import { PolicyOptionVariants, EnginePrototypeOrObject, PolicyOptions, EnginePrototype, Policy } from 'catbox'; + +/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Plugin + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ + +/** + * one of + * a single plugin name string. + * an array of plugin name strings. + * an object where each key is a plugin name and each matching value is a + * {@link https://www.npmjs.com/package/semver version range string} which must match the registered + * plugin version. + */ +export type Dependencies = string | string[] | { + [key: string]: string; +}; + +/** + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverregistrations) + */ + +/* tslint:disable-next-line:no-empty-interface */ +export interface PluginsListRegistered { +} + +/** + * An object of the currently registered plugins where each key is a registered plugin name and the value is an + * object containing: + * * version - the plugin version. + * * name - the plugin name. + * * options - (optional) options passed to the plugin during registration. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverregistrations) + */ +export interface PluginRegistered { + /** + * the plugin version. + */ + version: string; + + /** + * the plugin name. + */ + name: string; + + /** + * options used to register the plugin. + */ + options: object; +} + +/* tslint:disable-next-line:no-empty-interface */ +export interface PluginsStates { +} + +/* tslint:disable-next-line:no-empty-interface */ +export interface PluginSpecificConfiguration { +} + +export interface PluginNameVersion { + /** + * (required) the plugin name string. The name is used as a unique key. Published plugins (e.g. published in the npm + * registry) should use the same name as the name field in their 'package.json' file. Names must be + * unique within each application. + */ + name: string; + + /** + * optional plugin version. The version is only used informatively to enable other plugins to find out the versions loaded. The version should be the same as the one specified in the plugin's + * 'package.json' file. + */ + version?: string; +} + +export interface PluginPackage { + /** + * Alternatively, the name and version can be included via the pkg property containing the 'package.json' file for the module which already has the name and version included + */ + pkg: any; +} + +/** + * Plugins provide a way to organize application code by splitting the server logic into smaller components. Each + * plugin can manipulate the server through the standard server interface, but with the added ability to sandbox + * certain properties. For example, setting a file path in one plugin doesn't affect the file path set + * in another plugin. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#plugins) + * + * The type T is the type of the plugin options. + */ +export interface PluginBase { + /** + * (required) the registration function with the signature async function(server, options) where: + * * server - the server object with a plugin-specific server.realm. + * * options - any options passed to the plugin during registration via server.register(). + */ + register: (server: Server, options: T) => void | Promise; + + /** (optional) if true, allows the plugin to be registered multiple times with the same server. Defaults to false. */ + multiple?: boolean; + + /** (optional) a string or an array of strings indicating a plugin dependency. Same as setting dependencies via server.dependency(). */ + dependencies?: Dependencies; + + /** + * Allows defining semver requirements for node and hapi. + * @default Allows all. + */ + requirements?: { + node?: string; + hapi?: string; + }; + + /** once - (optional) if true, will only register the plugin once per server. If set, overrides the once option passed to server.register(). Defaults to no override. */ + once?: boolean; +} + +export type Plugin = PluginBase & (PluginNameVersion | PluginPackage); + +/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Request + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ + +/** + * User extensible types user credentials. + */ +// tslint:disable-next-line:no-empty-interface +export interface UserCredentials { +} + +/** + * User extensible types app credentials. + */ +// tslint:disable-next-line:no-empty-interface +export interface AppCredentials { +} + +/** + * User-extensible type for request.auth credentials. + */ +export interface AuthCredentials { + /** + * The application scopes to be granted. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsauthaccessscope) + */ + scope?: string[]; + /** + * If set, will only work with routes that set `access.entity` to `user`. + */ + user?: UserCredentials; + + /** + * If set, will only work with routes that set `access.entity` to `app`. + */ + app?: AppCredentials; +} + +/** + * Authentication information: + * * artifacts - an artifact object received from the authentication strategy and used in authentication-related actions. + * * credentials - the credential object received during the authentication process. The presence of an object does not mean successful authentication. + * * error - the authentication error is failed and mode set to 'try'. + * * isAuthenticated - true if the request has been successfully authenticated, otherwise false. + * * isAuthorized - true is the request has been successfully authorized against the route authentication access configuration. If the route has not access rules defined or if the request failed + * authorization, set to false. + * * mode - the route authentication mode. + * * strategy - the name of the strategy used. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestauth) + */ +export interface RequestAuth { + /** an artifact object received from the authentication strategy and used in authentication-related actions. */ + artifacts: object; + /** the credential object received during the authentication process. The presence of an object does not mean successful authentication. */ + credentials: AuthCredentials; + /** the authentication error is failed and mode set to 'try'. */ + error: Error; + /** true if the request has been successfully authenticated, otherwise false. */ + isAuthenticated: boolean; + /** + * true is the request has been successfully authorized against the route authentication access configuration. If the route has not access rules defined or if the request failed authorization, + * set to false. + */ + isAuthorized: boolean; + /** the route authentication mode. */ + mode: string; + /** the name of the strategy used. */ + strategy: string; +} + +/** + * 'peek' - emitted for each chunk of payload data read from the client connection. The event method signature is function(chunk, encoding). + * 'finish' - emitted when the request payload finished reading. The event method signature is function (). + * 'disconnect' - emitted when a request errors or aborts unexpectedly. + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestevents) + */ +export type RequestEventType = 'peek' | 'finish' | 'disconnect'; + +/** + * Access: read only and the public podium interface. + * The request.events supports the following events: + * * 'peek' - emitted for each chunk of payload data read from the client connection. The event method signature is function(chunk, encoding). + * * 'finish' - emitted when the request payload finished reading. The event method signature is function (). + * * 'disconnect' - emitted when a request errors or aborts unexpectedly. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestevents) + */ +export interface RequestEvents extends Podium { + /** + * Access: read only and the public podium interface. + * The request.events supports the following events: + * * 'peek' - emitted for each chunk of payload data read from the client connection. The event method signature is function(chunk, encoding). + * * 'finish' - emitted when the request payload finished reading. The event method signature is function (). + * * 'disconnect' - emitted when a request errors or aborts unexpectedly. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestevents) + */ + on(criteria: 'peek', listener: PeekListener): void; + + on(criteria: 'finish' | 'disconnect', listener: (data: undefined) => void): void; + + /** + * Access: read only and the public podium interface. + * The request.events supports the following events: + * * 'peek' - emitted for each chunk of payload data read from the client connection. The event method signature is function(chunk, encoding). + * * 'finish' - emitted when the request payload finished reading. The event method signature is function (). + * * 'disconnect' - emitted when a request errors or aborts unexpectedly. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestevents) + */ + once(criteria: 'peek', listener: PeekListener): void; + + once(criteria: 'finish' | 'disconnect', listener: (data: undefined) => void): void; +} + +/** + * Request information: + * * acceptEncoding - the request preferred encoding. + * * cors - if CORS is enabled for the route, contains the following: + * * isOriginMatch - true if the request 'Origin' header matches the configured CORS restrictions. Set to false if no 'Origin' header is found or if it does not match. Note that this is only + * available after the 'onRequest' extension point as CORS is configured per-route and no routing decisions are made at that point in the request lifecycle. + * * host - content of the HTTP 'Host' header (e.g. 'example.com:8080'). + * * hostname - the hostname part of the 'Host' header (e.g. 'example.com'). + * * id - a unique request identifier (using the format '{now}:{connection.info.id}:{5 digits counter}'). + * * received - request reception timestamp. + * * referrer - content of the HTTP 'Referrer' (or 'Referer') header. + * * remoteAddress - remote client IP address. + * * remotePort - remote client port. + * * responded - request response timestamp (0 is not responded yet). + * Note that the request.info object is not meant to be modified. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestinfo) + */ +export interface RequestInfo { + /** the request preferred encoding. */ + acceptEncoding: string; + /** if CORS is enabled for the route, contains the following: */ + cors: { + /** + * true if the request 'Origin' header matches the configured CORS restrictions. Set to false if no 'Origin' header is found or if it does not match. Note that this is only available after + * the 'onRequest' extension point as CORS is configured per-route and no routing decisions are made at that point in the request lifecycle. + */ + isOriginMatch?: boolean; + }; + /** content of the HTTP 'Host' header (e.g. 'example.com:8080'). */ + host: string; + /** the hostname part of the 'Host' header (e.g. 'example.com'). */ + hostname: string; + /** a unique request identifier (using the format '{now}:{connection.info.id}:{5 digits counter}') */ + id: string; + /** request reception timestamp. */ + received: number; + /** content of the HTTP 'Referrer' (or 'Referer') header. */ + referrer: string; + /** remote client IP address. */ + remoteAddress: string; + /** remote client port. */ + remotePort: string; + /** request response timestamp (0 is not responded yet). */ + responded: number; +} + +/** + * The request route information object, where: + * * method - the route HTTP method. + * * path - the route path. + * * vhost - the route vhost option if configured. + * * realm - the active realm associated with the route. + * * settings - the route options object with all defaults applied. + * * fingerprint - the route internal normalized string representing the normalized path. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestroute) + */ +export interface RequestRoute { + /** the route HTTP method. */ + method: Util.HTTP_METHODS_PARTIAL; + + /** the route path. */ + path: string; + + /** the route vhost option if configured. */ + vhost?: string | string[]; + + /** the active realm associated with the route. */ + realm: ServerRealm; + + /** the route options object with all defaults applied. */ + settings: RouteOptions; + + /** the route internal normalized string representing the normalized path. */ + fingerprint: string; + + auth: { + /** + * Validates a request against the route's authentication access configuration, where: + * @param request - the request object. + * @return Return value: true if the request would have passed the route's access requirements. + * Note that the route's authentication mode and strategies are ignored. The only match is made between the request.auth.credentials scope and entity information and the route access + * configuration. If the route uses dynamic scopes, the scopes are constructed against the request.query, request.params, request.payload, and request.auth.credentials which may or may + * not match between the route and the request's route. If this method is called using a request that has not been authenticated (yet or not at all), it will return false if the route + * requires any authentication. + * [See docs](https://hapijs.com/api/17.0.1#-requestrouteauthaccessrequest) + */ + access(request: Request): boolean; + }; +} + +/** + * An object containing the values of params, query, and payload before any validation modifications made. Only set when input validation is performed. + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestorig) + */ +export interface RequestOrig { + params: object; + query: object; + payload: object; +} + +export interface RequestLog { + request: string; + timestamp: number; + tags: string[]; + data: string | object; + channel: string; +} + +export interface RequestQuery { + [key: string]: string | string[]; +} + +/** + * The request object is created internally for each incoming request. It is not the same object received from the node + * HTTP server callback (which is available via [request.raw.req](https://github.com/hapijs/hapi/blob/master/API.md#request.raw)). The request properties change throughout + * the request [lifecycle](https://github.com/hapijs/hapi/blob/master/API.md#request-lifecycle). + */ +export interface Request extends Podium { + /** + * Application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name]. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestapp) + */ + app: ApplicationState; + + /** + * Authentication information: + * * artifacts - an artifact object received from the authentication strategy and used in authentication-related actions. + * * credentials - the credential object received during the authentication process. The presence of an object does not mean successful authentication. + * * error - the authentication error is failed and mode set to 'try'. + * * isAuthenticated - true if the request has been successfully authenticated, otherwise false. + * * isAuthorized - true is the request has been successfully authorized against the route authentication access configuration. If the route has not access rules defined or if the request failed + * authorization, set to false. + * * mode - the route authentication mode. + * * strategy - the name of the strategy used. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestauth) + */ + readonly auth: RequestAuth; + + /** + * Access: read only and the public podium interface. + * The request.events supports the following events: + * * 'peek' - emitted for each chunk of payload data read from the client connection. The event method signature is function(chunk, encoding). + * * 'finish' - emitted when the request payload finished reading. The event method signature is function (). + * * 'disconnect' - emitted when a request errors or aborts unexpectedly. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestevents) + */ + events: RequestEvents; + + /** + * The raw request headers (references request.raw.req.headers). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestheaders) + */ + readonly headers: Util.Dictionary; + + /** + * Request information: + * * acceptEncoding - the request preferred encoding. + * * cors - if CORS is enabled for the route, contains the following: + * * isOriginMatch - true if the request 'Origin' header matches the configured CORS restrictions. Set to false if no 'Origin' header is found or if it does not match. Note that this is only + * available after the 'onRequest' extension point as CORS is configured per-route and no routing decisions are made at that point in the request lifecycle. + * * host - content of the HTTP 'Host' header (e.g. 'example.com:8080'). + * * hostname - the hostname part of the 'Host' header (e.g. 'example.com'). + * * id - a unique request identifier (using the format '{now}:{connection.info.id}:{5 digits counter}'). + * * received - request reception timestamp. + * * referrer - content of the HTTP 'Referrer' (or 'Referer') header. + * * remoteAddress - remote client IP address. + * * remotePort - remote client port. + * * responded - request response timestamp (0 is not responded yet). + * Note that the request.info object is not meant to be modified. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestinfo) + */ + readonly info: RequestInfo; + + /** + * An array containing the logged request events. + * Note that this array will be empty if route log.collect is set to false. + */ + readonly logs: RequestLog[]; + + /** + * The request method in lower case (e.g. 'get', 'post'). + */ + readonly method: Util.HTTP_METHODS_PARTIAL_LOWERCASE; + + /** + * The parsed content-type header. Only available when payload parsing enabled and no payload error occurred. + */ + readonly mime: string; + + /** + * An object containing the values of params, query, and payload before any validation modifications made. Only set when input validation is performed. + */ + readonly orig: RequestOrig; + + /** + * An object where each key is a path parameter name with matching value as described in [Path parameters](https://github.com/hapijs/hapi/blob/master/API.md#path-parameters). + */ + readonly params: Util.Dictionary; + + /** + * An array containing all the path params values in the order they appeared in the path. + */ + readonly paramsArray: string[]; + + /** + * The request URI's pathname component. + */ + readonly path: string; + + /** + * The request payload based on the route payload.output and payload.parse settings. + * TODO check this typing and add references / links. + */ + readonly payload: stream.Readable | Buffer | string | object; + + /** + * Plugin-specific state. Provides a place to store and pass request-level plugin data. The plugins is an object where each key is a plugin name and the value is the state. + */ + plugins: PluginsStates; + + /** + * An object where each key is the name assigned by a route pre-handler methods function. The values are the raw values provided to the continuation function as argument. For the wrapped response + * object, use responses. + */ + readonly pre: Util.Dictionary; + + /** + * Access: read / write (see limitations below). + * The response object when set. The object can be modified but must not be assigned another object. To replace the response with another from within an extension point, use reply(response) to + * override with a different response. Contains null when no response has been set (e.g. when a request terminates prematurely when the client disconnects). + */ + response: ResponseObject | Boom | null; + + /** + * Same as pre but represented as the response object created by the pre method. + */ + readonly preResponses: Util.Dictionary; + + /** + * By default the object outputted from node's URL parse() method. Might also be set indirectly via request.setUrl in which case it may be a string (if url is set to an object with the query + * attribute as an unparsed string). + */ + readonly query: RequestQuery | string; + + /** + * An object containing the Node HTTP server objects. Direct interaction with these raw objects is not recommended. + * * req - the node request object. + * * res - the node response object. + */ + readonly raw: { + req: http.IncomingMessage; + res: http.ServerResponse; + }; + + /** + * The request route information object and method + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestroute) + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestrouteauthaccessrequest) + */ + readonly route: RequestRoute; + + /** + * Access: read only and the public server interface. + * The server object. + */ + server: Server; + + /** + * An object containing parsed HTTP state information (cookies) where each key is the cookie name and value is the matching cookie content after processing using any registered cookie definition. + */ + readonly state: Util.Dictionary; + + /** + * The parsed request URI. + */ + readonly url: url.Url; + + /** + * Returns `true` when the request is active and processing should continue and `false` when the + * request terminated early or completed its lifecycle. Useful when request processing is a + * resource-intensive operation and should be terminated early if the request is no longer active + * (e.g. client disconnected or aborted early). + */ + active(): boolean; + + /** + * Returns a response which you can pass into the reply interface where: + * @param source - the value to set as the source of the reply interface, optional. + * @param options - options for the method, optional. + * @return ResponseObject + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestgenerateresponsesource-options) + */ + /* tslint:disable-next-line:max-line-length */ + generateResponse(source: string | object | null, options?: { variety?: string; prepare?: (response: ResponseObject) => Promise; marshal?: (response: ResponseObject) => Promise; close?: (response: ResponseObject) => void; }): ResponseObject; + + /** + * Logs request-specific events. When called, the server emits a 'request' event which can be used by other listeners or plugins. The arguments are: + * @param tags - a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive mechanism + * for describing and filtering events. + * @param data - (optional) an message string or object with the application data being logged. If data is a function, the function signature is function() and it called once to generate (return + * value) the actual data emitted to the listeners. Any logs generated by the server internally will be emitted only on the 'request-internal' channel and will include the event.internal flag + * set to true. + * @return void + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestlogtags-data) + */ + log(tags: string | string[], data?: string | object | (() => string | object)): void; + + /** + * Changes the request method before the router begins processing the request where: + * @param method - is the request HTTP method (e.g. 'GET'). + * @return void + * Can only be called from an 'onRequest' extension method. + * [See docs](https://hapijs.com/api/17.0.1#-requestsetmethodmethod) + */ + setMethod(method: Util.HTTP_METHODS_PARTIAL): void; + + /** + * Changes the request URI before the router begins processing the request where: + * Can only be called from an 'onRequest' extension method. + * @param url - the new request URI. If url is a string, it is parsed with node's URL parse() method with parseQueryString set to true. url can also be set to an object compatible with node's URL + * parse() method output. + * @param stripTrailingSlash - if true, strip the trailing slash from the path. Defaults to false. + * @return void + * [See docs](https://hapijs.com/api/17.0.1#-requestseturlurl-striptrailingslash) + */ + setUrl(url: string | url.Url, stripTrailingSlash?: boolean): void; +} + +/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Response + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ + +/** + * Access: read only and the public podium interface. + * The response.events object supports the following events: + * * 'peek' - emitted for each chunk of data written back to the client connection. The event method signature is function(chunk, encoding). + * * 'finish' - emitted when the response finished writing but before the client response connection is ended. The event method signature is function (). + * [See docs](https://hapijs.com/api/17.0.1#-responseevents) + */ +export interface ResponseEvents extends Podium { + /** + * 'peek' - emitted for each chunk of data written back to the client connection. The event method signature is function(chunk, encoding). + * 'finish' - emitted when the response finished writing but before the client response connection is ended. The event method signature is function (). + */ + on(criteria: 'peek', listener: PeekListener): void; + + on(criteria: 'finish', listener: (data: undefined) => void): void; + + /** + * 'peek' - emitted for each chunk of data written back to the client connection. The event method signature is function(chunk, encoding). + * 'finish' - emitted when the response finished writing but before the client response connection is ended. The event method signature is function (). + */ + once(criteria: 'peek', listener: PeekListener): void; + + once(criteria: 'finish', listener: (data: undefined) => void): void; +} + +/** + * Object where: + * * append - if true, the value is appended to any existing header value using separator. Defaults to false. + * * separator - string used as separator when appending to an existing value. Defaults to ','. + * * override - if false, the header value is not set if an existing value present. Defaults to true. + * * duplicate - if false, the header value is not modified if the provided value is already included. Does not apply when append is false or if the name is 'set-cookie'. Defaults to true. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responseheadername-value-options) + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#response-object) + */ +export interface ResponseObjectHeaderOptions { + append?: boolean; + separator?: string; + override?: boolean; + duplicate?: boolean; +} + +/** + * The response object contains the request response value along with various HTTP headers and flags. When a lifecycle + * method returns a value, the value is wrapped in a response object along with some default flags (e.g. 200 status + * code). In order to customize a response before it is returned, the h.response() method is provided. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#response-object) + * TODO, check extending from Podium is correct. Extending because of "The response object supports the following events" [See docs](https://hapijs.com/api/17.0.1#-responseevents) + */ +export interface ResponseObject extends Podium { + /** + * Default value: {}. + * Application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name]. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responseapp) + */ + app: ApplicationState; + + /** + * Access: read only and the public podium interface. + * The response.events object supports the following events: + * * 'peek' - emitted for each chunk of data written back to the client connection. The event method signature is function(chunk, encoding). + * * 'finish' - emitted when the response finished writing but before the client response connection is ended. The event method signature is function (). + * [See docs](https://hapijs.com/api/17.0.1#-responseevents) + */ + readonly events: ResponseEvents; + + /** + * Default value: {}. + * An object containing the response headers where each key is a header field name and the value is the string header value or array of string. + * Note that this is an incomplete list of headers to be included with the response. Additional headers will be added once the response is prepared for transmission. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responseheaders) + */ + readonly headers: Util.Dictionary; + + /** + * Default value: {}. + * Plugin-specific state. Provides a place to store and pass request-level plugin data. plugins is an object where each key is a plugin name and the value is the state. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responseplugins) + */ + plugins: PluginsStates; + + /** + * Object containing the response handling flags. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsesettings) + */ + readonly settings: ResponseSettings; + + /** + * The raw value returned by the lifecycle method. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsesource) + */ + readonly source: Lifecycle.ReturnValue; + + /** + * Default value: 200. + * The HTTP response status code. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsestatuscode) + */ + readonly statusCode: number; + + /** + * A string indicating the type of source with available values: + * * 'plain' - a plain response such as string, number, null, or simple object. + * * 'buffer' - a Buffer. + * * 'stream' - a Stream. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsevariety) + */ + readonly variety: 'plain' | 'buffer' | 'stream'; + + /** + * Sets the HTTP 'Content-Length' header (to avoid chunked transfer encoding) where: + * @param length - the header value. Must match the actual payload size. + * @return Return value: the current response object. + * [See docs](https://hapijs.com/api/17.0.1#-responsebyteslength) + */ + bytes(length: number): ResponseObject; + + /** + * Sets the 'Content-Type' HTTP header 'charset' property where: + * @param charset - the charset property value. + * @return Return value: the current response object. + * [See docs](https://hapijs.com/api/17.0.1#-responsecharsetcharset) + */ + charset(charset: string): ResponseObject; + + /** + * Sets the 'Content-Type' HTTP header 'charset' property where: + * $param charset - the charset property value. + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsecodestatuscode) + */ + code(statusCode: number): ResponseObject; + + /** + * Sets the HTTP status message where: + * @param httpMessage - the HTTP status message (e.g. 'Ok' for status code 200). + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsemessagehttpmessage) + */ + message(httpMessage: string): ResponseObject; + + /** + * Sets the HTTP status code to Created (201) and the HTTP 'Location' header where: + * @param uri - an absolute or relative URI used as the 'Location' header value. + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsecreateduri) + */ + created(uri: string): ResponseObject; + + /** + * Sets the string encoding scheme used to serial data into the HTTP payload where: + * @param encoding the encoding property value (see node Buffer encoding [See docs](https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings)). + * * 'ascii' - for 7-bit ASCII data only. This encoding is fast and will strip the high bit if set. + * * 'utf8' - Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8. + * * 'utf16le' - 2 or 4 bytes, little-endian encoded Unicode characters. Surrogate pairs (U+10000 to U+10FFFF) are supported. + * * 'ucs2' - Alias of 'utf16le'. + * * 'base64' - Base64 encoding. When creating a Buffer from a string, this encoding will also correctly accept "URL and Filename Safe Alphabet" as specified in RFC4648, Section 5. + * * 'latin1' - A way of encoding the Buffer into a one-byte encoded string (as defined by the IANA in RFC1345, page 63, to be the Latin-1 supplement block and C0/C1 control codes). + * * 'binary' - Alias for 'latin1'. + * * 'hex' - Encode each byte as two hexadecimal characters. + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responseencodingencoding) + */ + encoding(encoding: 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'base64' | 'latin1' | 'binary' | 'hex'): ResponseObject; + + /** + * Sets the representation entity tag where: + * @param tag - the entity tag string without the double-quote. + * @param options - (optional) settings where: + * * weak - if true, the tag will be prefixed with the 'W/' weak signifier. Weak tags will fail to match identical tags for the purpose of determining 304 response status. Defaults to false. + * * vary - if true and content encoding is set or applied to the response (e.g 'gzip' or 'deflate'), the encoding name will be automatically added to the tag at transmission time (separated by + * a '-' character). Ignored when weak is true. Defaults to true. + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responseetagtag-options) + */ + etag(tag: string, options?: {weak: boolean, vary: boolean}): ResponseObject; + + /** + * Sets an HTTP header where: + * @param name - the header name. + * @param value - the header value. + * @param options - (optional) object where: + * * append - if true, the value is appended to any existing header value using separator. Defaults to false. + * * separator - string used as separator when appending to an existing value. Defaults to ','. + * * override - if false, the header value is not set if an existing value present. Defaults to true. + * * duplicate - if false, the header value is not modified if the provided value is already included. Does not apply when append is false or if the name is 'set-cookie'. Defaults to true. + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responseheadername-value-options) + */ + header(name: string, value: string, options?: ResponseObjectHeaderOptions): ResponseObject; + + /** + * Sets the HTTP 'Location' header where: + * @param uri - an absolute or relative URI used as the 'Location' header value. + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responselocationuri) + */ + location(uri: string): ResponseObject; + + /** + * Sets an HTTP redirection response (302) and decorates the response with additional methods, where: + * @param uri - an absolute or relative URI used to redirect the client to another resource. + * @return Return value: the current response object. + * Decorates the response object with the response.temporary(), response.permanent(), and response.rewritable() methods to easily change the default redirection code (302). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responseredirecturi) + */ + redirect(uri: string): ResponseObject; + + /** + * Sets the JSON.stringify() replacer argument where: + * @param method - the replacer function or array. Defaults to none. + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsereplacermethod) + */ + replacer(method: Json.StringifyReplacer): ResponseObject; + + /** + * Sets the JSON.stringify() space argument where: + * @param count - the number of spaces to indent nested object keys. Defaults to no indentation. + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsespacescount) + */ + spaces(count: number): ResponseObject; + + /** + * Sets an HTTP cookie where: + * @param name - the cookie name. + * @param value - the cookie value. If no options.encoding is defined, must be a string. See server.state() for supported encoding values. + * @param options - (optional) configuration. If the state was previously registered with the server using server.state(), the specified keys in options are merged with the default server + * definition. + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsestatename-value-options) + */ + state(name: string, value: object | string, options?: ServerStateCookieOptions): ResponseObject; + + /** + * Sets a string suffix when the response is process via JSON.stringify() where: + * @param suffix - the string suffix. + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsesuffixsuffix) + */ + suffix(suffix: string): ResponseObject; + + /** + * Overrides the default route cache expiration rule for this response instance where: + * @param msec - the time-to-live value in milliseconds. + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsettlmsec) + */ + ttl(msec: number): ResponseObject; + + /** + * Sets the HTTP 'Content-Type' header where: + * @param mimeType - is the mime type. + * @return Return value: the current response object. + * Should only be used to override the built-in default for each response type. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsetypemimetype) + */ + type(mimeType: string): ResponseObject; + + /** + * Clears the HTTP cookie by setting an expired value where: + * @param name - the cookie name. + * @param options - (optional) configuration for expiring cookie. If the state was previously registered with the server using server.state(), the specified options are merged with the server + * definition. + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responseunstatename-options) + */ + unstate(name: string, options?: ServerStateCookieOptions): ResponseObject; + + /** + * Adds the provided header to the list of inputs affected the response generation via the HTTP 'Vary' header where: + * @param header - the HTTP request header name. + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsevaryheader) + */ + vary(header: string): ResponseObject; + + /** + * Marks the response object as a takeover response. + * @return Return value: the current response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsetakeover) + */ + takeover(): ResponseObject; + + /** + * Sets the status code to 302 or 307 (based on the response.rewritable() setting) where: + * @param isTemporary - if false, sets status to permanent. Defaults to true. + * @return Return value: the current response object. + * Only available after calling the response.redirect() method. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsetemporaryistemporary) + */ + temporary(isTemporary: boolean): ResponseObject; + + /** + * Sets the status code to 301 or 308 (based on the response.rewritable() setting) where: + * @param isPermanent - if false, sets status to temporary. Defaults to true. + * @return Return value: the current response object. + * Only available after calling the response.redirect() method. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsepermanentispermanent) + */ + permanent(isPermanent: boolean): ResponseObject; + + /** + * Sets the status code to 301/302 for rewritable (allows changing the request method from 'POST' to 'GET') or 307/308 for non-rewritable (does not allow changing the request method from 'POST' + * to 'GET'). Exact code based on the response.temporary() or response.permanent() setting. Arguments: + * @param isRewritable - if false, sets to non-rewritable. Defaults to true. + * @return Return value: the current response object. + * Only available after calling the response.redirect() method. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responserewritableisrewritable) + */ + rewritable(isRewritable: boolean): ResponseObject; +} + +/** + * Object containing the response handling flags. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responsesettings) + */ +export interface ResponseSettings { + /** + * Defaults value: true. + * If true and source is a Stream, copies the statusCode and headers properties of the stream object to the outbound response. + */ + readonly passThrough: boolean; + + /** + * Default value: null (use route defaults). + * Override the route json options used when source value requires stringification. + */ + readonly stringify: Json.StringifyArguments; + + /** + * Default value: null (use route defaults). + * If set, overrides the route cache with an expiration value in milliseconds. + */ + readonly ttl: number; + + /** + * Default value: false. + * If true, a suffix will be automatically added to the 'ETag' header at transmission time (separated by a '-' character) when the HTTP 'Vary' header is present. + */ + varyEtag: boolean; +} + +/** + * See more about Lifecycle + * https://github.com/hapijs/hapi/blob/master/API.md#request-lifecycle + * + */ + +export type ResponseValue = string | object; + +export interface AuthenticationData { + credentials: AuthCredentials; + artifacts?: object; +} + +export interface Auth { + readonly isAuth: true; + readonly error?: Error | null; + readonly data?: AuthenticationData; +} + +/** + * The response toolkit is a collection of properties and utilities passed to every [lifecycle method](https://github.com/hapijs/hapi/blob/master/API.md#lifecycle-methods) + * It is somewhat hard to define as it provides both utilities for manipulating responses as well as other information. Since the + * toolkit is passed as a function argument, developers can name it whatever they want. For the purpose of this + * document the h notation is used. It is named in the spirit of the RethinkDB r method, with h for hapi. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#response-toolkit) + */ +export interface ResponseToolkit { + /** + * A response symbol. When returned by a lifecycle method, the request lifecycle skips to the finalizing step + * without further interaction with the node response stream. It is the developer's responsibility to write + * and end the response directly via [request.raw.res](https://github.com/hapijs/hapi/blob/master/API.md#request.raw). + */ + readonly abandon: symbol; + + /** + * A response symbol. When returned by a lifecycle method, the request lifecycle skips to the finalizing step after + * calling request.raw.res.end()) to close the the node response stream. + */ + readonly close: symbol; + + /** + * A response symbol. Provides access to the route or server context set via the route [bind](https://github.com/hapijs/hapi/blob/master/API.md#route.options.bind) + * option or [server.bind()](https://github.com/hapijs/hapi/blob/master/API.md#server.bind()). + */ + readonly context: any; + + /** + * A response symbol. When returned by a lifecycle method, the request lifecycle continues without changing the response. + */ + readonly continue: symbol; + + /** + * The [server realm](https://github.com/hapijs/hapi/blob/master/API.md#server.realm) associated with the matching + * route. Defaults to the root server realm in the onRequest step. + */ + readonly realm: ServerRealm; + + /** + * Access: read only and public request interface. + * The [request] object. This is a duplication of the request lifecycle method argument used by + * [toolkit decorations](https://github.com/hapijs/hapi/blob/master/API.md#server.decorate()) to access the current request. + */ + readonly request: Readonly; + + /** + * Used by the [authentication] method to pass back valid credentials where: + * @param data - an object with: + * * credentials - (required) object representing the authenticated entity. + * * artifacts - (optional) authentication artifacts object specific to the authentication scheme. + * @return Return value: an internal authentication object. + */ + authenticated(data: AuthenticationData): Auth; + + /** + * Sets the response 'ETag' and 'Last-Modified' headers and checks for any conditional request headers to decide if + * the response is going to qualify for an HTTP 304 (Not Modified). If the entity values match the request + * conditions, h.entity() returns a response object for the lifecycle method to return as its value which will + * set a 304 response. Otherwise, it sets the provided entity headers and returns undefined. + * The method argumetns are: + * @param options - a required configuration object with: + * * etag - the ETag string. Required if modified is not present. Defaults to no header. + * * modified - the Last-Modified header value. Required if etag is not present. Defaults to no header. + * * vary - same as the response.etag() option. Defaults to true. + * @return Return value: - a response object if the response is unmodified. - undefined if the response has changed. + * If undefined is returned, the developer must return a valid lifecycle method value. If a response is returned, + * it should be used as the return value (but may be customize using the response methods). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-hentityoptions) + */ + entity(options?: {etag?: string, modified?: string, vary?: boolean}): ResponseObject | undefined; + + /** + * Redirects the client to the specified uri. Same as calling h.response().redirect(uri). + * @param url + * @return Returns a response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-hredirecturi) + */ + redirect(uri?: string): ResponseObject; + + /** + * Wraps the provided value and returns a response object which allows customizing the response + * (e.g. setting the HTTP status code, custom headers, etc.), where: + * @param value - (optional) return value. Defaults to null. + * @return Returns a response object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-hresponsevalue) + */ + response(value?: ResponseValue): ResponseObject; + + /** + * Sets a response cookie using the same arguments as response.state(). + * @param name of the cookie + * @param value of the cookie + * @param (optional) ServerStateCookieOptions object. + * @return Return value: none. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-hstatename-value-options) + */ + state(name: string, value: string | object, options?: ServerStateCookieOptions): void; + + /** + * Used by the [authentication] method to indicate authentication failed and pass back the credentials received where: + * @param error - (required) the authentication error. + * @param data - (optional) an object with: + * * credentials - (required) object representing the authenticated entity. + * * artifacts - (optional) authentication artifacts object specific to the authentication scheme. + * @return void. + * The method is used to pass both the authentication error and the credentials. For example, if a request included + * expired credentials, it allows the method to pass back the user information (combined with a 'try' + * authentication mode) for error customization. + * There is no difference between throwing the error or passing it with the h.unauthenticated() method is no credentials are passed, but it might still be helpful for code clarity. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-hunauthenticatederror-data) + */ + unauthenticated(error: Error, data?: AuthenticationData): void; + + /** + * Clears a response cookie using the same arguments as + * @param name of the cookie + * @param options (optional) ServerStateCookieOptions object. + * @return void. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-hunstatename-options) + */ + unstate(name: string, options?: ServerStateCookieOptions): void; +} + +/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Route + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ + +export type RouteOptionsAccessScope = false | string | string[]; + +export type RouteOptionsAccessEntity = 'any' | 'user' | 'app'; + +export interface RouteOptionsAccessScopeObject { + scope: RouteOptionsAccessScope; +} + +export interface RouteOptionsAccessEntityObject { + entity: RouteOptionsAccessEntity; +} + +export type RouteOptionsAccessObject = + RouteOptionsAccessScopeObject + | RouteOptionsAccessEntityObject + | (RouteOptionsAccessScopeObject & RouteOptionsAccessEntityObject); + +/** + * Route Authentication Options + */ +export interface RouteOptionsAccess { + /** + * Default value: none. + * An object or array of objects specifying the route access rules. Each rule is evaluated against an incoming request and access is granted if at least one of the rules matches. Each rule object + * must include at least one of scope or entity. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsauthaccess) + */ + access?: RouteOptionsAccessObject | RouteOptionsAccessObject[]; + + /** + * Default value: false (no scope requirements). + * The application scope required to access the route. Value can be a scope string or an array of scope strings. When authenticated, the credentials object scope property must contain at least + * one of the scopes defined to access the route. If a scope string begins with a + character, that scope is required. If a scope string begins with a ! character, that scope is forbidden. For + * example, the scope ['!a', '+b', 'c', 'd'] means the incoming request credentials' scope must not include 'a', must include 'b', and must include one of 'c' or 'd'. You may also access + * properties on the request object (query, params, payload, and credentials) to populate a dynamic scope by using the '{' and '}' characters around the property name, such as 'user-{params.id}'. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsauthaccessscope) + */ + scope?: RouteOptionsAccessScope; + + /** + * Default value: 'any'. + * The required authenticated entity type. If set, must match the entity value of the request authenticated credentials. Available values: + * * 'any' - the authentication can be on behalf of a user or application. + * * 'user' - the authentication must be on behalf of a user which is identified by the presence of a 'user' attribute in the credentials object returned by the authentication strategy. + * * 'app' - the authentication must be on behalf of an application which is identified by the lack of presence of a user attribute in the credentials object returned by the authentication + * strategy. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsauthaccessentity) + */ + entity?: RouteOptionsAccessEntity; + + /** + * Default value: 'required'. + * The authentication mode. Available values: + * * 'required' - authentication is required. + * * 'optional' - authentication is optional - the request must include valid credentials or no credentials at all. + * * 'try' - similar to 'optional', any request credentials are attempted authentication, but if the credentials are invalid, the request proceeds regardless of the authentication error. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsauthmode) + */ + mode?: 'required' | 'optional' | 'try'; + + /** + * Default value: false, unless the scheme requires payload authentication. + * If set, the incoming request payload is authenticated after it is processed. Requires a strategy with payload authentication support (e.g. Hawk). Cannot be set to a value other than 'required' + * when the scheme sets the authentication options.payload to true. Available values: + * * false - no payload authentication. + * * 'required' - payload authentication required. + * * 'optional' - payload authentication performed only when the client includes payload authentication information (e.g. hash attribute in Hawk). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsauthpayload) + */ + payload?: false | 'required' | 'optional'; + + /** + * Default value: the default strategy set via server.auth.default(). + * An array of string strategy names in the order they should be attempted. Cannot be used together with strategy. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsauthstrategies) + */ + strategies?: string[]; + + /** + * Default value: the default strategy set via server.auth.default(). + * A string strategy names. Cannot be used together with strategies. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsauthstrategy) + */ + strategy?: string; +} + +/** + * Values are: + * * * 'default' - no privacy flag. + * * * 'public' - mark the response as suitable for public caching. + * * * 'private' - mark the response as suitable only for private caching. + * * expiresIn - relative expiration expressed in the number of milliseconds since the item was saved in the cache. Cannot be used together with expiresAt. + * * expiresAt - time of day expressed in 24h notation using the 'HH:MM' format, at which point all cache records for the route expire. Cannot be used together with expiresIn. + * * statuses - an array of HTTP response status code numbers (e.g. 200) which are allowed to include a valid caching directive. + * * otherwise - a string with the value of the 'Cache-Control' header when caching is disabled. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionscache) + */ +export type RouteOptionsCache = { + privacy?: 'default' | 'public' | 'private'; + statuses?: number[]; + otherwise?: string; +} & ( + { + expiresIn?: number; + expiresAt?: undefined; + } | { + expiresIn?: undefined; + expiresAt?: string; +} | { + expiresIn?: undefined; + expiresAt?: undefined; +} + ); + +/** + * Default value: false (no CORS headers). + * The Cross-Origin Resource Sharing protocol allows browsers to make cross-origin API calls. CORS is required by web applications running inside a browser which are loaded from a different domain + * than the API server. To enable, set cors to true, or to an object with the following options: + * * origin - an array of allowed origin servers strings ('Access-Control-Allow-Origin'). The array can contain any combination of fully qualified origins along with origin strings containing a + * wildcard '*' character, or a single '*' origin string. If set to 'ignore', any incoming Origin header is ignored (present or not) and the 'Access-Control-Allow-Origin' header is set to '*'. + * Defaults to any origin ['*']. + * * maxAge - number of seconds the browser should cache the CORS response ('Access-Control-Max-Age'). The greater the value, the longer it will take before the browser checks for changes in policy. + * Defaults to 86400 (one day). + * * headers - a strings array of allowed headers ('Access-Control-Allow-Headers'). Defaults to ['Accept', 'Authorization', 'Content-Type', 'If-None-Match']. + * * additionalHeaders - a strings array of additional headers to headers. Use this to keep the default headers in place. + * * exposedHeaders - a strings array of exposed headers ('Access-Control-Expose-Headers'). Defaults to ['WWW-Authenticate', 'Server-Authorization']. + * * additionalExposedHeaders - a strings array of additional headers to exposedHeaders. Use this to keep the default headers in place. + * * credentials - if true, allows user credentials to be sent ('Access-Control-Allow-Credentials'). Defaults to false. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionscors) + */ +export interface RouteOptionsCors { + /** + * an array of allowed origin servers strings ('Access-Control-Allow-Origin'). The array can contain any combination of fully qualified origins along with origin strings containing a wildcard '*' + * character, or a single '*' origin string. If set to 'ignore', any incoming Origin header is ignored (present or not) and the 'Access-Control-Allow-Origin' header is set to '*'. Defaults to any + * origin ['*']. + */ + origin?: string[] | '*' | 'ignore'; + /** + * number of seconds the browser should cache the CORS response ('Access-Control-Max-Age'). The greater the value, the longer it will take before the browser checks for changes in policy. + * Defaults to 86400 (one day). + */ + maxAge?: number; + /** + * a strings array of allowed headers ('Access-Control-Allow-Headers'). Defaults to ['Accept', 'Authorization', 'Content-Type', 'If-None-Match']. + */ + headers?: string[]; + /** + * a strings array of additional headers to headers. Use this to keep the default headers in place. + */ + additionalHeaders?: string[]; + /** + * a strings array of exposed headers ('Access-Control-Expose-Headers'). Defaults to ['WWW-Authenticate', 'Server-Authorization']. + */ + exposedHeaders?: string[]; + /** + * a strings array of additional headers to exposedHeaders. Use this to keep the default headers in place. + */ + additionalExposedHeaders?: string[]; + /** + * if true, allows user credentials to be sent ('Access-Control-Allow-Credentials'). Defaults to false. + */ + credentials?: boolean; +} + +/** + * The value must be one of: + * * 'data' - the incoming payload is read fully into memory. If parse is true, the payload is parsed (JSON, form-decoded, multipart) based on the 'Content-Type' header. If parse is false, a raw + * Buffer is returned. + * * 'stream' - the incoming payload is made available via a Stream.Readable interface. If the payload is 'multipart/form-data' and parse is true, field values are presented as text while files are + * provided as streams. File streams from a 'multipart/form-data' upload will also have a hapi property containing the filename and headers properties. Note that payload streams for multipart + * payloads are a synthetic interface created on top of the entire mutlipart content loaded into memory. To avoid loading large multipart payloads into memory, set parse to false and handle the + * multipart payload in the handler using a streaming parser (e.g. pez). + * * 'file' - the incoming payload is written to temporary file in the directory specified by the uploads settings. If the payload is 'multipart/form-data' and parse is true, field values are + * presented as text while files are saved to disk. Note that it is the sole responsibility of the application to clean up the files generated by the framework. This can be done by keeping track of + * which files are used (e.g. using the request.app object), and listening to the server 'response' event to perform cleanup. For context [See + * docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloadoutput) + */ +export type PayloadOutput = 'data' | 'stream' | 'file'; + +/** + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloadcompression) + */ +export type PayloadCompressionDecoderSettings = object; + +/** + * Determines how the request payload is processed. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayload) + */ +export interface RouteOptionsPayload { + /** + * Default value: allows parsing of the following mime types: + * * application/json + * * application/*+json + * * application/octet-stream + * * application/x-www-form-urlencoded + * * multipart/form-data + * * text/* + * A string or an array of strings with the allowed mime types for the endpoint. Use this settings to limit the set of allowed mime types. Note that allowing additional mime types not listed + * above will not enable them to be parsed, and if parse is true, the request will result in an error response. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloadallow) + */ + allow?: string | string[]; + + /** + * Default value: none. + * An object where each key is a content-encoding name and each value is an object with the desired decoder settings. Note that encoder settings are set in compression. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloadcompression) + */ + compression?: Util.Dictionary; + + /** + * Default value: 'application/json'. + * The default content type if the 'Content-Type' request header is missing. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloaddefaultcontenttype) + */ + defaultContentType?: string; + + /** + * Default value: 'error' (return a Bad Request (400) error response). + * A failAction value which determines how to handle payload parsing errors. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloadfailaction) + */ + failAction?: Lifecycle.FailAction; + + /** + * Default value: 1048576 (1MB). + * Limits the size of incoming payloads to the specified byte count. Allowing very large payloads may cause the server to run out of memory. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloadmaxbytes) + */ + maxBytes?: number; + + /** + * Default value: none. + * Overrides payload processing for multipart requests. Value can be one of: + * * false - disable multipart processing. + * an object with the following required options: + * * output - same as the output option with an additional value option: + * * * annotated - wraps each multipart part in an object with the following keys: // TODO type this? + * * * * headers - the part headers. + * * * * filename - the part file name. + * * * * payload - the processed part payload. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloadmultipart) + */ + multipart?: false | { + output: PayloadOutput | 'annotated'; + }; + + /** + * Default value: 'data'. + * The processed payload format. The value must be one of: + * * 'data' - the incoming payload is read fully into memory. If parse is true, the payload is parsed (JSON, form-decoded, multipart) based on the 'Content-Type' header. If parse is false, a raw + * Buffer is returned. + * * 'stream' - the incoming payload is made available via a Stream.Readable interface. If the payload is 'multipart/form-data' and parse is true, field values are presented as text while files + * are provided as streams. File streams from a 'multipart/form-data' upload will also have a hapi property containing the filename and headers properties. Note that payload streams for multipart + * payloads are a synthetic interface created on top of the entire mutlipart content loaded into memory. To avoid loading large multipart payloads into memory, set parse to false and handle the + * multipart payload in the handler using a streaming parser (e.g. pez). + * * 'file' - the incoming payload is written to temporary file in the directory specified by the uploads settings. If the payload is 'multipart/form-data' and parse is true, field values are + * presented as text while files are saved to disk. Note that it is the sole responsibility of the application to clean up the files generated by the framework. This can be done by keeping track + * of which files are used (e.g. using the request.app object), and listening to the server 'response' event to perform cleanup. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloadoutput) + */ + output?: PayloadOutput; + + /** + * Default value: none. + * A mime type string overriding the 'Content-Type' header value received. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloadoverride) + */ + override?: string; + + /** + * Default value: true. + * Determines if the incoming payload is processed or presented raw. Available values: + * * true - if the request 'Content-Type' matches the allowed mime types set by allow (for the whole payload as well as parts), the payload is converted into an object when possible. If the + * format is unknown, a Bad Request (400) error response is sent. Any known content encoding is decoded. + * * false - the raw payload is returned unmodified. + * * 'gunzip' - the raw payload is returned unmodified after any known content encoding is decoded. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloadparse) + */ + parse?: boolean | 'gunzip'; + + /** + * Default value: to 10000 (10 seconds). + * Payload reception timeout in milliseconds. Sets the maximum time allowed for the client to transmit the request payload (body) before giving up and responding with a Request Timeout (408) + * error response. Set to false to disable. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloadtimeout) + */ + timeout?: false | number; + + /** + * Default value: os.tmpdir(). + * The directory used for writing file uploads. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayloaduploads) + */ + uploads?: string; +} + +/** + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspre) + */ +export type RouteOptionsPreArray = RouteOptionsPreAllOptions[]; + +/** + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspre) + */ +export type RouteOptionsPreAllOptions = RouteOptionsPreObject | RouteOptionsPreObject[] | Lifecycle.Method; + +/** + * An object with: + * * method - a lifecycle method. + * * assign - key name used to assign the response of the method to in request.pre and request.preResponses. + * * failAction - A failAction value which determine what to do when a pre-handler method throws an error. If assign is specified and the failAction setting is not 'error', the error will be assigned. + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspre) + */ +export interface RouteOptionsPreObject { + /** + * a lifecycle method. + */ + method: Lifecycle.Method; + /** + * key name used to assign the response of the method to in request.pre and request.preResponses. + */ + assign?: string; + /** + * A failAction value which determine what to do when a pre-handler method throws an error. If assign is specified and the failAction setting is not 'error', the error will be assigned. + */ + failAction?: Lifecycle.FailAction; +} + +export type ValidationObject = SchemaMap; + +export type RouteOptionsResponseSchema = + boolean + | ValidationObject + | Schema + | ((value: object | Buffer | string, options: ValidationOptions) => Promise); + +/** + * Processing rules for the outgoing response. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsresponse) + */ +export interface RouteOptionsResponse { + /** + * Default value: 200. + * The default HTTP status code when the payload is considered empty. Value can be 200 or 204. Note that a 200 status code is converted to a 204 only at the time of response transmission (the + * response status code will remain 200 throughout the request lifecycle unless manually set). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsresponseemptystatuscode) + */ + emptyStatusCode?: 200 | 204; + + /** + * Default value: 'error' (return an Internal Server Error (500) error response). + * A failAction value which defines what to do when a response fails payload validation. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsresponsefailaction) + */ + failAction?: Lifecycle.FailAction; + + /** + * Default value: false. + * If true, applies the validation rule changes to the response payload. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsresponsemodify) + */ + modify?: boolean; + + /** + * Default value: none. + * [joi](http://github.com/hapijs/joi) options object pass to the validation function. Useful to set global options such as stripUnknown or abortEarly (the complete list is available here). If a + * custom validation function is defined via schema or status then options can an arbitrary object that will be passed to this function as the second argument. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsresponseoptions) + */ + options?: ValidationOptions; // TODO needs validation + + /** + * Default value: true. + * If false, payload range support is disabled. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsresponseranges) + */ + ranges?: boolean; + + /** + * Default value: 100 (all responses). + * The percent of response payloads validated (0 - 100). Set to 0 to disable all validation. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsresponsesample) + */ + sample?: number; + + /** + * Default value: true (no validation). + * The default response payload validation rules (for all non-error responses) expressed as one of: + * * true - any payload allowed (no validation). + * * false - no payload allowed. + * * a joi validation object. The options along with the request context ({ headers, params, query, payload, app, auth }) are passed to the validation function. + * * a validation function using the signature async function(value, options) where: + * * * value - the pending response payload. + * * * options - The options along with the request context ({ headers, params, query, payload, app, auth }). + * * * if the function returns a value and modify is true, the value is used as the new response. If the original response is an error, the return value is used to override the original error + * output.payload. If an error is thrown, the error is processed according to failAction. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsresponseschema) + */ + schema?: RouteOptionsResponseSchema; + + /** + * Default value: none. + * Validation schemas for specific HTTP status codes. Responses (excluding errors) not matching the listed status codes are validated using the default schema. + * status is set to an object where each key is a 3 digit HTTP status code and the value has the same definition as schema. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsresponsestatus) + */ + status?: Util.Dictionary; +} + +/** + * @see https://www.w3.org/TR/referrer-policy/ + */ +export type ReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'unsafe-url' | + 'same-origin' | 'origin' | 'strict-origin' | 'origin-when-cross-origin' | 'strict-origin-when-cross-origin'; + +/** + * Default value: false (security headers disabled). + * Sets common security headers. To enable, set security to true or to an object with the following options: + * * hsts - controls the 'Strict-Transport-Security' header, where: + * * * true - the header will be set to max-age=15768000. This is the default value. + * * * a number - the maxAge parameter will be set to the provided value. + * * * an object with the following fields: + * * * * maxAge - the max-age portion of the header, as a number. Default is 15768000. + * * * * includeSubDomains - a boolean specifying whether to add the includeSubDomains flag to the header. + * * * * preload - a boolean specifying whether to add the 'preload' flag (used to submit domains inclusion in Chrome's HTTP Strict Transport Security (HSTS) preload list) to the header. + * * xframe - controls the 'X-Frame-Options' header, where: + * * * true - the header will be set to 'DENY'. This is the default value. + * * * 'deny' - the headers will be set to 'DENY'. + * * * 'sameorigin' - the headers will be set to 'SAMEORIGIN'. + * * * an object for specifying the 'allow-from' rule, where: + * * * * rule - one of: + * * * * * 'deny' + * * * * * 'sameorigin' + * * * * * 'allow-from' + * * * * source - when rule is 'allow-from' this is used to form the rest of the header, otherwise this field is ignored. If rule is 'allow-from' but source is unset, the rule will be automatically + * changed to 'sameorigin'. + * * xss - boolean that controls the 'X-XSS-PROTECTION' header for Internet Explorer. Defaults to true which sets the header to equal '1; mode=block'. + * Note: this setting can create a security vulnerability in versions of Internet Exploere below 8, as well as unpatched versions of IE8. See here and here for more information. If you actively + * support old versions of IE, it may be wise to explicitly set this flag to false. + * * noOpen - boolean controlling the 'X-Download-Options' header for Internet Explorer, preventing downloads from executing in your context. Defaults to true setting the header to 'noopen'. + * * noSniff - boolean controlling the 'X-Content-Type-Options' header. Defaults to true setting the header to its only and default option, 'nosniff'. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionssecurity) + */ +export interface RouteOptionsSecureObject { + /** + * hsts - controls the 'Strict-Transport-Security' header + */ + hsts?: boolean | number | { + /** + * the max-age portion of the header, as a number. Default is 15768000. + */ + maxAge: number; + /** + * a boolean specifying whether to add the includeSubDomains flag to the header. + */ + includeSubdomains: boolean; + /** + * a boolean specifying whether to add the 'preload' flag (used to submit domains inclusion in Chrome's HTTP Strict Transport Security (HSTS) preload list) to the header. + */ + preload: boolean; + }; + /** + * controls the 'X-Frame-Options' header + */ + xframe?: true | 'deny' | 'sameorigin' | { + /** + * an object for specifying the 'allow-from' rule, + */ + rule: 'deny' | 'sameorigin' | 'allow-from'; + /** + * when rule is 'allow-from' this is used to form the rest of the header, otherwise this field is ignored. If rule is 'allow-from' but source is unset, the rule will be automatically changed + * to 'sameorigin'. + */ + source: string; + }; + /** + * boolean that controls the 'X-XSS-PROTECTION' header for Internet Explorer. Defaults to true which sets the header to equal '1; mode=block'. + * Note: this setting can create a security vulnerability in versions of Internet Exploere below 8, as well as unpatched versions of IE8. See here and here for more information. If you actively + * support old versions of IE, it may be wise to explicitly set this flag to false. + */ + xss: boolean; + /** + * boolean controlling the 'X-Download-Options' header for Internet Explorer, preventing downloads from executing in your context. Defaults to true setting the header to 'noopen'. + */ + noOpen?: boolean; + /** + * boolean controlling the 'X-Content-Type-Options' header. Defaults to true setting the header to its only and default option, 'nosniff'. + */ + noSniff?: boolean; + + /** + * Controls the `Referrer-Policy` header, which has the following possible values. + * @default false Header will not be send. + */ + referrer?: false | ReferrerPolicy; +} + +export type RouteOptionsSecure = boolean | RouteOptionsSecureObject; + +/** + * Default value: { headers: true, params: true, query: true, payload: true, failAction: 'error' }. + * Request input validation rules for various request components. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsvalidate) + */ +export interface RouteOptionsValidate { + /** + * Default value: none. + * An optional object with error fields copied into every validation error response. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsvalidateerrorfields) + */ + errorFields?: object; + + /** + * Default value: 'error' (return a Bad Request (400) error response). + * A failAction value which determines how to handle failed validations. When set to a function, the err argument includes the type of validation error under err.output.payload.validation.source. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsvalidatefailaction) + */ + failAction?: Lifecycle.FailAction; + + /** + * Default value: true (no validation). + * Validation rules for incoming request headers: + * * true - any headers allowed (no validation performed). + * * a joi validation object. + * * a validation function using the signature async function(value, options) where: + * * * value - the request.headers object containing the request headers. + * * * options - options. + * * * if a value is returned, the value is used as the new request.headers value and the original value is stored in request.orig.headers. Otherwise, the headers are left unchanged. If an error + * is thrown, the error is handled according to failAction. Note that all header field names must be in lowercase to match the headers normalized by node. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsvalidateheaders) + */ + headers?: RouteOptionsResponseSchema; + + /** + * Default value: none. + * An options object passed to the joi rules or the custom validation methods. Used for setting global options such as stripUnknown or abortEarly (the complete list is available here). + * If a custom validation function (see headers, params, query, or payload above) is defined then options can an arbitrary object that will be passed to this function as the second parameter. + * The values of the other inputs (i.e. headers, query, params, payload, app, and auth) are added to the options object under the validation context (accessible in rules as + * Joi.ref('$query.key')). + * Note that validation is performed in order (i.e. headers, params, query, and payload) and if type casting is used (e.g. converting a string to a number), the value of inputs not yet validated + * will reflect the raw, unvalidated and unmodified values. If the validation rules for headers, params, query, and payload are defined at both the server routes level and at the route level, the + * individual route settings override the routes defaults (the rules are not merged). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsvalidateparams) + */ + options?: ValidationOptions | object; + + /** + * Default value: true (no validation). + * Validation rules for incoming request path parameters, after matching the path against the route, extracting any parameters, and storing them in request.params, where: + * * true - any path parameter value allowed (no validation performed). + * * a joi validation object. + * * a validation function using the signature async function(value, options) where: + * * * value - the request.params object containing the request path parameters. + * * * options - options. + * if a value is returned, the value is used as the new request.params value and the original value is stored in request.orig.params. Otherwise, the path parameters are left unchanged. If an + * error is thrown, the error is handled according to failAction. Note that failing to match the validation rules to the route path parameters definition will cause all requests to fail. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsvalidateparams) + */ + params?: RouteOptionsResponseSchema; + + /** + * Default value: true (no validation). + * Validation rules for incoming request payload (request body), where: + * * true - any payload allowed (no validation performed). false - no payload allowed. + * * a joi validation object. Note that empty payloads are represented by a null value. If a validation schema is provided and empty payload are allowed, the schema must be explicitly defined by + * setting the rule to a joi schema with null allowed (e.g. Joi.object({ keys here }).allow(null)). + * * a validation function using the signature async function(value, options) where: + * * * value - the request.query object containing the request query parameters. + * * * options - options. + * if a value is returned, the value is used as the new request.payload value and the original value is stored in request.orig.payload. Otherwise, the payload is left unchanged. If an error is + * thrown, the error is handled according to failAction. Note that validating large payloads and modifying them will cause memory duplication of the payload (since the original is kept), as well + * as the significant performance cost of validating large amounts of data. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsvalidatepayload) + */ + payload?: RouteOptionsResponseSchema; + + /** + * Default value: true (no validation). + * Validation rules for incoming request URI query component (the key-value part of the URI between '?' and '#'). The query is parsed into its individual key-value pairs, decoded, and stored in + * request.query prior to validation. Where: + * * true - any query parameter value allowed (no validation performed). false - no query parameter value allowed. + * * a joi validation object. + * * a validation function using the signature async function(value, options) where: + * * * value - the request.query object containing the request query parameters. + * * * options - options. + * if a value is returned, the value is used as the new request.query value and the original value is stored in request.orig.query. Otherwise, the query parameters are left unchanged. If an error + * is thrown, the error is handled according to failAction. Note that changes to the query parameters will not be reflected in request.url. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsvalidatequery) + */ + query?: RouteOptionsResponseSchema; +} + +/** + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionscompression) + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverencoderencoding-encoder) + */ +export type RouteCompressionEncoderSettings = object; + +/** + * Empty interface to allow for user-defined augmentations. + */ +/* tslint:disable-next-line:no-empty-interface */ +export interface RouteOptionsApp { +} + +/** + * Each route can be customized to change the default behavior of the request lifecycle. + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#route-options) + */ +export interface RouteOptions { + /** + * Application-specific route configuration state. Should not be used by plugins which should use options.plugins[name] instead. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsapp) + */ + app?: RouteOptionsApp; + + /** + * Route authentication configuration. Value can be: + * false to disable authentication if a default strategy is set. + * a string with the name of an authentication strategy registered with server.auth.strategy(). The strategy will be set to 'required' mode. + * an authentication configuration object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsapp) + */ + auth?: false | string | RouteOptionsAccess; + + /** + * Default value: null. + * An object passed back to the provided handler (via this) when called. Ignored if the method is an arrow function. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsbind) + */ + bind?: object | null; + + /** + * Default value: { privacy: 'default', statuses: [200], otherwise: 'no-cache' }. + * If the route method is 'GET', the route can be configured to include HTTP caching directives in the response. Caching can be customized using an object with the following options: + * privacy - determines the privacy flag included in client-side caching using the 'Cache-Control' header. Values are: + * * * 'default' - no privacy flag. + * * * 'public' - mark the response as suitable for public caching. + * * * 'private' - mark the response as suitable only for private caching. + * * expiresIn - relative expiration expressed in the number of milliseconds since the item was saved in the cache. Cannot be used together with expiresAt. + * * expiresAt - time of day expressed in 24h notation using the 'HH:MM' format, at which point all cache records for the route expire. Cannot be used together with expiresIn. + * * statuses - an array of HTTP response status code numbers (e.g. 200) which are allowed to include a valid caching directive. + * * otherwise - a string with the value of the 'Cache-Control' header when caching is disabled. + * The default Cache-Control: no-cache header can be disabled by setting cache to false. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionscache) + */ + cache?: false | RouteOptionsCache; + + /** + * An object where each key is a content-encoding name and each value is an object with the desired encoder settings. Note that decoder settings are set in compression. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionscompression) + */ + compression?: Util.Dictionary; + + /** + * Default value: false (no CORS headers). + * The Cross-Origin Resource Sharing protocol allows browsers to make cross-origin API calls. CORS is required by web applications running inside a browser which are loaded from a different + * domain than the API server. To enable, set cors to true, or to an object with the following options: + * * origin - an array of allowed origin servers strings ('Access-Control-Allow-Origin'). The array can contain any combination of fully qualified origins along with origin strings containing a + * wildcard '*' character, or a single '*' origin string. If set to 'ignore', any incoming Origin header is ignored (present or not) and the 'Access-Control-Allow-Origin' header is set to '*'. + * Defaults to any origin ['*']. + * * maxAge - number of seconds the browser should cache the CORS response ('Access-Control-Max-Age'). The greater the value, the longer it will take before the browser checks for changes in + * policy. Defaults to 86400 (one day). + * * headers - a strings array of allowed headers ('Access-Control-Allow-Headers'). Defaults to ['Accept', 'Authorization', 'Content-Type', 'If-None-Match']. + * * additionalHeaders - a strings array of additional headers to headers. Use this to keep the default headers in place. + * * exposedHeaders - a strings array of exposed headers ('Access-Control-Expose-Headers'). Defaults to ['WWW-Authenticate', 'Server-Authorization']. + * * additionalExposedHeaders - a strings array of additional headers to exposedHeaders. Use this to keep the default headers in place. + * * credentials - if true, allows user credentials to be sent ('Access-Control-Allow-Credentials'). Defaults to false. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionscors) + */ + cors?: boolean | RouteOptionsCors; + + /** + * Default value: none. + * Route description used for generating documentation (string). + * This setting is not available when setting server route defaults using server.options.routes. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsdescription) + */ + description?: string; + + /** + * Default value: none. + * Route-level request extension points by setting the option to an object with a key for each of the desired extension points ('onRequest' is not allowed), and the value is the same as the + * server.ext(events) event argument. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsext) + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#request-lifecycle) + */ + ext?: { + [key in RouteRequestExtType]?: RouteExtObject | RouteExtObject[]; + }; + + /** + * Default value: { relativeTo: '.' }. + * Defines the behavior for accessing files: + * * relativeTo - determines the folder relative paths are resolved against. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsfiles) + */ + files?: { + relativeTo: string; + }; + + /** + * Default value: none. + * The route handler function performs the main business logic of the route and sets the response. handler can be assigned: + * * a lifecycle method. + * * an object with a single property using the name of a handler type registred with the server.handler() method. The matching property value is passed as options to the registered handler + * generator. Note: handlers using a fat arrow style function cannot be bound to any bind property. Instead, the bound context is available under h.context. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionshandler) + */ + handler?: Lifecycle.Method | object; + + /** + * Default value: none. + * An optional unique identifier used to look up the route using server.lookup(). Cannot be assigned to routes added with an array of methods. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsid) + */ + id?: string; + + /** + * Default value: false. + * If true, the route cannot be accessed through the HTTP listener but only through the server.inject() interface with the allowInternals option set to true. Used for internal routes that should + * not be accessible to the outside world. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsisinternal) + */ + isInternal?: boolean; + + /** + * Default value: none. + * Optional arguments passed to JSON.stringify() when converting an object or error response to a string payload or escaping it after stringification. Supports the following: + * * replacer - the replacer function or array. Defaults to no action. + * * space - number of spaces to indent nested object keys. Defaults to no indentation. + * * suffix - string suffix added after conversion to JSON string. Defaults to no suffix. + * * escape - calls Hoek.jsonEscape() after conversion to JSON string. Defaults to false. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsjson) + */ + json?: Json.StringifyArguments; + + /** + * Default value: none. + * Enables JSONP support by setting the value to the query parameter name containing the function name used to wrap the response payload. + * For example, if the value is 'callback', a request comes in with 'callback=me', and the JSON response is '{ "a":"b" }', the payload will be 'me({ "a":"b" });'. Cannot be used with stream + * responses. The 'Content-Type' response header is set to 'text/javascript' and the 'X-Content-Type-Options' response header is set to 'nosniff', and will override those headers even if + * explicitly set by response.type(). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsjsonp) + */ + jsonp?: string; + + /** + * Default value: { collect: false }. + * Request logging options: + * collect - if true, request-level logs (both internal and application) are collected and accessible via request.logs. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionslog) + */ + log?: { + collect: boolean; + }; + + /** + * Default value: none. + * Route notes used for generating documentation (string or array of strings). + * This setting is not available when setting server route defaults using server.options.routes. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsnotes) + */ + notes?: string | string[]; + + /** + * Determines how the request payload is processed. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspayload) + */ + payload?: RouteOptionsPayload; + + /** + * Default value: {}. + * Plugin-specific configuration. plugins is an object where each key is a plugin name and the value is the plugin configuration. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsplugins) + */ + plugins?: PluginSpecificConfiguration; + + /** + * Default value: none. + * The pre option allows defining methods for performing actions before the handler is called. These methods allow breaking the handler logic into smaller, reusable components that can be shared + * ascross routes, as well as provide a cleaner error handling of prerequisite operations (e.g. load required reference data from a database). pre is assigned an ordered array of methods which + * are called serially in order. If the pre array contains another array of methods as one of its elements, those methods are called in parallel. Note that during parallel execution, if any of + * the methods error, return a takeover response, or abort signal, the other parallel methods will continue to execute but will be ignored once completed. pre can be assigned a mixed array of: + * * an array containing the elements listed below, which are executed in parallel. + * * an object with: + * * * method - a lifecycle method. + * * * assign - key name used to assign the response of the method to in request.pre and request.preResponses. + * * * failAction - A failAction value which determine what to do when a pre-handler method throws an error. If assign is specified and the failAction setting is not 'error', the error will be + * assigned. + * * a method function - same as including an object with a single method key. + * Note that pre-handler methods do not behave the same way other lifecycle methods do when a value is returned. Instead of the return value becoming the new response payload, the value is used + * to assign the corresponding request.pre and request.preResponses properties. Otherwise, the handling of errors, takeover response response, or abort signal behave the same as any other + * lifecycle methods. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspre) + */ + pre?: RouteOptionsPreArray; + + /** + * Processing rules for the outgoing response. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsresponse) + */ + response?: RouteOptionsResponse; + + /** + * Default value: false (security headers disabled). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionssecurity) + */ + security?: RouteOptionsSecure; + + /** + * Default value: { parse: true, failAction: 'error' }. + * HTTP state management (cookies) allows the server to store information on the client which is sent back to the server with every request (as defined in RFC 6265). state supports the following + * options: parse - determines if incoming 'Cookie' headers are parsed and stored in the request.state object. failAction - A failAction value which determines how to handle cookie parsing + * errors. Defaults to 'error' (return a Bad Request (400) error response). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsstate) + */ + state?: { + parse?: boolean; + failAction?: Lifecycle.FailAction; + }; + + /** + * Default value: none. + * Route tags used for generating documentation (array of strings). + * This setting is not available when setting server route defaults using server.options.routes. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionstags) + */ + tags?: string[]; + + /** + * Default value: { server: false }. + * Timeouts for processing durations. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionstimeout) + */ + timeout?: { + /** + * Response timeout in milliseconds. Sets the maximum time allowed for the server to respond to an incoming request before giving up and responding with a Service Unavailable (503) error + * response. + */ + server?: boolean | number; + + /** + * Default value: none (use node default of 2 minutes). + * By default, node sockets automatically timeout after 2 minutes. Use this option to override this behavior. Set to false to disable socket timeouts. + */ + socket?: boolean | number; + }; + + /** + * Default value: { headers: true, params: true, query: true, payload: true, failAction: 'error' }. + * Request input validation rules for various request components. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsvalidate) + */ + validate?: RouteOptionsValidate; +} + +/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Server + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ + +/** + * The scheme options argument passed to server.auth.strategy() when instantiation a strategy. + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverauthschemename-scheme) + */ +export type ServerAuthSchemeOptions = object; + +/** + * the method implementing the scheme with signature function(server, options) where: + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverauthschemename-scheme) + * @param server - a reference to the server object the scheme is added to. + * @param options - (optional) the scheme options argument passed to server.auth.strategy() when instantiation a strategy. + */ +export type ServerAuthScheme = (server: Server, options?: ServerAuthSchemeOptions) => ServerAuthSchemeObject; + +/* tslint:disable-next-line:no-empty-interface */ +export interface ServerAuthSchemeObjectApi { +} + +/** + * The scheme method must return an object with the following + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#authentication-scheme) + */ +export interface ServerAuthSchemeObject { + /** + * optional object which is exposed via the [server.auth.api](https://github.com/hapijs/hapi/blob/master/API.md#server.auth.api) object. + */ + api?: ServerAuthSchemeObjectApi; + + /** + * A lifecycle method function called for each incoming request configured with the authentication scheme. The + * method is provided with two special toolkit methods for returning an authenticated or an unauthenticate result: + * * h.authenticated() - indicate request authenticated successfully. + * * h.unauthenticated() - indicate request failed to authenticate. + * @param request the request object. + * @param h the ResponseToolkit + * @return the Lifecycle.ReturnValue + */ + authenticate(request: Request, h: ResponseToolkit): Lifecycle.ReturnValue; + + /** + * A lifecycle method to authenticate the request payload. + * When the scheme payload() method returns an error with a message, it means payload validation failed due to bad + * payload. If the error has no message but includes a scheme name (e.g. Boom.unauthorized(null, 'Custom')), + * authentication may still be successful if the route auth.payload configuration is set to 'optional'. + * @param request the request object. + * @param h the ResponseToolkit + * @return the Lifecycle.ReturnValue + */ + payload?(request: Request, h: ResponseToolkit): Lifecycle.ReturnValue; + + /** + * A lifecycle method to decorate the response with authentication headers before the response headers or payload is written. + * @param request the request object. + * @param h the ResponseToolkit + * @return the Lifecycle.ReturnValue + */ + response?(request: Request, h: ResponseToolkit): Lifecycle.ReturnValue; + + /** + * a method used to verify the authentication credentials provided + * are still valid (e.g. not expired or revoked after the initial authentication). + * the method throws an `Error` when the credentials passed are no longer valid (e.g. expired or + * revoked). Note that the method does not have access to the original request, only to the + * credentials and artifacts produced by the `authenticate()` method. + */ + verify?(auth: RequestAuth): Promise; + + /** + * An object with the following keys: + * * payload + */ + options?: { + /** + * if true, requires payload validation as part of the scheme and forbids routes from disabling payload auth validation. Defaults to false. + */ + payload?: boolean; + }; +} + +/** + * An authentication configuration object using the same format as the route auth handler options. + * For reference [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverauthdefaultoptions) + */ +/* tslint:disable-next-line:no-empty-interface */ +export interface ServerAuthConfig extends RouteOptionsAccess { +} + +export interface ServerAuth { + /** + * An object where each key is an authentication strategy name and the value is the exposed strategy API. + * Available only when the authentication scheme exposes an API by returning an api key in the object + * returned from its implementation function. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverauthapi) + */ + api: Util.Dictionary; + + /** + * Contains the default authentication configuration is a default strategy was set via + * [server.auth.default()](https://github.com/hapijs/hapi/blob/master/API.md#server.auth.default()). + */ + readonly settings: { + default: ServerAuthConfig; + }; + + /** + * Sets a default strategy which is applied to every route where: + * @param options - one of: + * * a string with the default strategy name + * * an authentication configuration object using the same format as the route auth handler options. + * @return void. + * The default does not apply when a route config specifies auth as false, or has an authentication strategy + * configured (contains the strategy or strategies authentication settings). Otherwise, the route authentication + * config is applied to the defaults. + * Note that if the route has authentication configured, the default only applies at the time of adding the route, + * not at runtime. This means that calling server.auth.default() after adding a route with some authentication + * config will have no impact on the routes added prior. However, the default will apply to routes added + * before server.auth.default() is called if those routes lack any authentication config. + * The default auth strategy configuration can be accessed via server.auth.settings.default. To obtain the active + * authentication configuration of a route, use server.auth.lookup(request.route). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverauthdefaultoptions) + */ + default(options: string | ServerAuthConfig): void; + + /** + * Registers an authentication scheme where: + * @param name the scheme name. + * @param scheme - the method implementing the scheme with signature function(server, options) where: + * * server - a reference to the server object the scheme is added to. + * * options - (optional) the scheme options argument passed to server.auth.strategy() when instantiation a strategy. + * @return void. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverauthschemename-scheme) + */ + scheme(name: string, scheme: ServerAuthScheme): void; + + /** + * Registers an authentication strategy where: + * @param name - the strategy name. + * @param scheme - the scheme name (must be previously registered using server.auth.scheme()). + * @param options - scheme options based on the scheme requirements. + * @return Return value: none. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverauthstrategyname-scheme-options) + */ + strategy(name: string, scheme: string, options?: object): void; + + /** + * Tests a request against an authentication strategy where: + * @param strategy - the strategy name registered with server.auth.strategy(). + * @param request - the request object. + * @return Return value: the authentication credentials object if authentication was successful, otherwise throws an error. + * Note that the test() method does not take into account the route authentication configuration. It also does not + * perform payload authentication. It is limited to the basic strategy authentication execution. It does not + * include verifying scope, entity, or other route properties. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-await-serverauthteststrategy-request) + */ + test(strategy: string, request: Request): Promise; + + /** + * Verify a request's authentication credentials against an authentication strategy. + * Returns nothing if verification was successful, otherwise throws an error. + * + * Note that the `verify()` method does not take into account the route authentication configuration + * or any other information from the request other than the `request.auth` object. It also does not + * perform payload authentication. It is limited to verifying that the previously valid credentials + * are still valid (e.g. have not been revoked or expired). It does not include verifying scope, + * entity, or other route properties. + */ + verify(request: Request): Promise; +} + +export type CachePolicyOptions = PolicyOptionVariants & { + /** + * @default '_default' + */ + cache?: string; + segment?: string; +}; + +/** + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servercacheoptions) + */ +export interface ServerCache { + /** + * Provisions a cache segment within the server cache facility where: + * @param options - [catbox policy](https://github.com/hapijs/catbox#policy) configuration where: + * * expiresIn - relative expiration expressed in the number of milliseconds since the item was saved in the cache. Cannot be used together with expiresAt. + * * expiresAt - time of day expressed in 24h notation using the 'HH:MM' format, at which point all cache records expire. Uses local time. Cannot be used together with expiresIn. + * * generateFunc - a function used to generate a new cache item if one is not found in the cache when calling get(). The method's signature is async function(id, flags) where: + * - `id` - the `id` string or object provided to the `get()` method. + * - `flags` - an object used to pass back additional flags to the cache where: + * - `ttl` - the cache ttl value in milliseconds. Set to `0` to skip storing in the cache. Defaults to the cache global policy. + * * staleIn - number of milliseconds to mark an item stored in cache as stale and attempt to regenerate it when generateFunc is provided. Must be less than expiresIn. + * * staleTimeout - number of milliseconds to wait before checking if an item is stale. + * * generateTimeout - number of milliseconds to wait before returning a timeout error when the generateFunc function takes too long to return a value. When the value is eventually returned, it + * is stored in the cache for future requests. Required if generateFunc is present. Set to false to disable timeouts which may cause all get() requests to get stuck forever. + * * generateOnReadError - if false, an upstream cache read error will stop the cache.get() method from calling the generate function and will instead pass back the cache error. Defaults to true. + * * generateIgnoreWriteError - if false, an upstream cache write error when calling cache.get() will be passed back with the generated value when calling. Defaults to true. + * * dropOnError - if true, an error or timeout in the generateFunc causes the stale value to be evicted from the cache. Defaults to true. + * * pendingGenerateTimeout - number of milliseconds while generateFunc call is in progress for a given id, before a subsequent generateFunc call is allowed. Defaults to 0 (no blocking of + * concurrent generateFunc calls beyond staleTimeout). + * * cache - the cache name configured in server.cache. Defaults to the default cache. + * * segment - string segment name, used to isolate cached items within the cache partition. When called within a plugin, defaults to '!name' where 'name' is the plugin name. When called within a + * server method, defaults to '#name' where 'name' is the server method name. Required when called outside of a plugin. + * * shared - if true, allows multiple cache provisions to share the same segment. Default to false. + * @return Catbox Policy. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servercacheoptions) + */ + = CachePolicyOptions>(options: O): Policy; + + /** + * Provisions a server cache as described in server.cache where: + * @param options - same as the server cache configuration options. + * @return Return value: none. + * Note that if the server has been initialized or started, the cache will be automatically started to match the state of any other provisioned server cache. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-await-servercacheprovisionoptions) + */ + provision(options: ServerOptionsCache): Promise; +} + +/** + * an event name string. + * an event options object. + * a podium emitter object. + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servereventevents) + */ +export type ServerEventsApplication = string | ServerEventsApplicationObject | Podium; + +/** + * Object that it will be used in Event + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servereventevents) + */ +export interface ServerEventsApplicationObject { + /** the event name string (required). */ + name: string; + /** a string or array of strings specifying the event channels available. Defaults to no channel restrictions (event updates can specify a channel or not). */ + channels?: string | string[]; + /** + * if true, the data object passed to server.events.emit() is cloned before it is passed to the listeners (unless an override specified by each listener). Defaults to false (data is passed as-is). + */ + clone?: boolean; + /** + * if true, the data object passed to server.event.emit() must be an array and the listener method is called with each array element passed as a separate argument (unless an override specified + * by each listener). This should only be used when the emitted data structure is known and predictable. Defaults to false (data is emitted as a single argument regardless of its type). + */ + spread?: boolean; + /** + * if true and the criteria object passed to server.event.emit() includes tags, the tags are mapped to an object (where each tag string is the key and the value is true) which is appended to + * the arguments list at the end. A configuration override can be set by each listener. Defaults to false. + */ + tags?: boolean; + /** + * if true, the same event name can be registered multiple times where the second registration is ignored. Note that if the registration config is changed between registrations, only the first + * configuration is used. Defaults to false (a duplicate registration will throw an error). + */ + shared?: boolean; +} + +/** + * A criteria object with the following optional keys (unless noted otherwise): + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servereventsoncriteria-listener) + * + * The type parameter T is the type of the name of the event. + */ +export interface ServerEventCriteria { + /** (required) the event name string. */ + name: T; + /** + * a string or array of strings specifying the event channels to subscribe to. If the event registration specified a list of allowed channels, the channels array must match the allowed + * channels. If channels are specified, event updates without any channel designation will not be included in the subscription. Defaults to no channels filter. + */ + channels?: string | string[]; + /** if true, the data object passed to server.event.emit() is cloned before it is passed to the listener method. Defaults to the event registration option (which defaults to false). */ + clone?: boolean; + /** + * a positive integer indicating the number of times the listener can be called after which the subscription is automatically removed. A count of 1 is the same as calling server.events.once(). + * Defaults to no limit. + */ + count?: number; + /** + * filter - the event tags (if present) to subscribe to which can be one of: + * * a tag string. + * * an array of tag strings. + * * an object with the following: + * * * tags - a tag string or array of tag strings. + * * * all - if true, all tags must be present for the event update to match the subscription. Defaults to false (at least one matching tag). + */ + filter?: string | string[] | {tags: string | string[], all?: boolean}; + /** + * if true, and the data object passed to server.event.emit() is an array, the listener method is called with each array element passed as a separate argument. This should only be used + * when the emitted data structure is known and predictable. Defaults to the event registration option (which defaults to false). + */ + spread?: boolean; + /** + * if true and the criteria object passed to server.event.emit() includes tags, the tags are mapped to an object (where each tag string is the key and the value is true) which is appended + * to the arguments list at the end. Defaults to the event registration option (which defaults to false). + */ + tags?: boolean; +} + +export interface LogEvent { + /** the event timestamp. */ + timestamp: string; + /** an array of tags identifying the event (e.g. ['error', 'http']) */ + tags: string[]; + /** set to 'internal' for internally generated events, otherwise 'app' for events generated by server.log() */ + channel: 'internal' | 'app'; + /** the request identifier. */ + request: string; + /** event-specific information. Available when event data was provided and is not an error. Errors are passed via error. */ + data: object; + /** the error object related to the event if applicable. Cannot appear together with data */ + error: object; +} + +export interface RequestEvent { + /** the event timestamp. */ + timestamp: string; + /** an array of tags identifying the event (e.g. ['error', 'http']) */ + tags: string[]; + /** set to 'internal' for internally generated events, otherwise 'app' for events generated by server.log() */ + channel: 'internal' | 'app' | 'error'; + /** event-specific information. Available when event data was provided and is not an error. Errors are passed via error. */ + data: object; + /** the error object related to the event if applicable. Cannot appear together with data */ + error: object; +} + +export type LogEventHandler = (event: LogEvent, tags: { [key: string]: true }) => void; +export type RequestEventHandler = (request: Request, event: RequestEvent, tags: { [key: string]: true }) => void; +export type ResponseEventHandler = (request: Request) => void; +export type RouteEventHandler = (route: RequestRoute) => void; +export type StartEventHandler = () => void; +export type StopEventHandler = () => void; + +export interface PodiumEvent { + emit(criteria: K, listener: (value: T) => void): void; + + on(criteria: K, listener: (value: T) => void): void; + + once(criteria: K, listener: (value: T) => void): void; + + once(criteria: K): Promise; + + removeListener(criteria: K, listener: Podium.Listener): this; + + removeAllListeners(criteria: K): this; + + hasListeners(criteria: K): this; +} + +/** + * Access: podium public interface. + * The server events emitter. Utilizes the podium with support for event criteria validation, channels, and filters. + * Use the following methods to interact with server.events: + * [server.event(events)](https://github.com/hapijs/hapi/blob/master/API.md#server.event()) - register application events. + * [server.events.emit(criteria, data)](https://github.com/hapijs/hapi/blob/master/API.md#server.events.emit()) - emit server events. + * [server.events.on(criteria, listener)](https://github.com/hapijs/hapi/blob/master/API.md#server.events.on()) - subscribe to all events. + * [server.events.once(criteria, listener)](https://github.com/hapijs/hapi/blob/master/API.md#server.events.once()) - subscribe to + * Other methods include: server.events.removeListener(name, listener), server.events.removeAllListeners(name), and server.events.hasListeners(name). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverevents) + */ +export interface ServerEvents extends Podium { + /** + * Subscribe to an event where: + * @param criteria - the subscription criteria which must be one of: + * * event name string which can be any of the built-in server events + * * a custom application event registered with server.event(). + * * a criteria object + * @param listener - the handler method set to receive event updates. The function signature depends on the event argument, and the spread and tags options. + * @return Return value: none. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servereventsoncriteria-listener) + * See ['log' event](https://github.com/hapijs/hapi/blob/master/API.md#-log-event) + * See ['request' event](https://github.com/hapijs/hapi/blob/master/API.md#-request-event) + * See ['response' event](https://github.com/hapijs/hapi/blob/master/API.md#-response-event) + * See ['route' event](https://github.com/hapijs/hapi/blob/master/API.md#-route-event) + * See ['start' event](https://github.com/hapijs/hapi/blob/master/API.md#-start-event) + * See ['stop' event](https://github.com/hapijs/hapi/blob/master/API.md#-stop-event) + */ + on(criteria: 'log' | ServerEventCriteria<'log'>, listener: LogEventHandler): void; + + on(criteria: 'request' | ServerEventCriteria<'request'>, listener: RequestEventHandler): void; + + on(criteria: 'response' | ServerEventCriteria<'response'>, listener: ResponseEventHandler): void; + + on(criteria: 'route' | ServerEventCriteria<'route'>, listener: RouteEventHandler): void; + + on(criteria: 'start' | ServerEventCriteria<'start'>, listener: StartEventHandler): void; + + on(criteria: 'stop' | ServerEventCriteria<'stop'>, listener: StopEventHandler): void; + + /** + * Same as calling [server.events.on()](https://github.com/hapijs/hapi/blob/master/API.md#server.events.on()) with the count option set to 1. + * @param criteria - the subscription criteria which must be one of: + * * event name string which can be any of the built-in server events + * * a custom application event registered with server.event(). + * * a criteria object + * @param listener - the handler method set to receive event updates. The function signature depends on the event argument, and the spread and tags options. + * @return Return value: none. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servereventsoncecriteria-listener) + */ + once(criteria: 'log' | ServerEventCriteria<'log'>, listener: LogEventHandler): void; + + once(criteria: 'request' | ServerEventCriteria<'request'>, listener: RequestEventHandler): void; + + once(criteria: 'response' | ServerEventCriteria<'response'>, listener: ResponseEventHandler): void; + + once(criteria: 'route' | ServerEventCriteria<'route'>, listener: RouteEventHandler): void; + + once(criteria: 'start' | ServerEventCriteria<'start'>, listener: StartEventHandler): void; + + once(criteria: 'stop' | ServerEventCriteria<'stop'>, listener: StopEventHandler): void; + + /** + * Same as calling server.events.on() with the count option set to 1. + * @param criteria - the subscription criteria which must be one of: + * * event name string which can be any of the built-in server events + * * a custom application event registered with server.event(). + * * a criteria object + * @return Return value: a promise that resolves when the event is emitted. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-await-servereventsoncecriteria) + */ + once(criteria: string | ServerEventCriteria): Promise; + + /** + * The follow method is only mentioned in Hapi API. The doc about that method can be found [here](https://github.com/hapijs/podium/blob/master/API.md#podiumremovelistenername-listener) + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverevents) + */ + removeListener(name: string, listener: Podium.Listener): Podium; + + /** + * The follow method is only mentioned in Hapi API. The doc about that method can be found [here](https://github.com/hapijs/podium/blob/master/API.md#podiumremovealllistenersname) + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverevents) + */ + removeAllListeners(name: string): Podium; + + /** + * The follow method is only mentioned in Hapi API. The doc about that method can be found [here](https://github.com/hapijs/podium/blob/master/API.md#podiumhaslistenersname) + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverevents) + */ + hasListeners(name: string): boolean; +} + +/** + * The extension point event name. The available extension points include the request extension points as well as the following server extension points: + * 'onPreStart' - called before the connection listeners are started. + * 'onPostStart' - called after the connection listeners are started. + * 'onPreStop' - called before the connection listeners are stopped. + * 'onPostStop' - called after the connection listeners are stopped. + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverextevents) + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#request-lifecycle) + */ +export type ServerExtType = 'onPreStart' | 'onPostStart' | 'onPreStop' | 'onPostStop'; +export type RouteRequestExtType = 'onPreAuth' + | 'onCredentials' + | 'onPostAuth' + | 'onPreHandler' + | 'onPostHandler' + | 'onPreResponse'; + +export type ServerRequestExtType = + RouteRequestExtType + | 'onRequest'; + +/** + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverextevents) + * Registers an extension function in one of the request lifecycle extension points where: + * @param events - an object or array of objects with the following: + * * type - (required) the extension point event name. The available extension points include the request extension points as well as the following server extension points: + * * * 'onPreStart' - called before the connection listeners are started. + * * * 'onPostStart' - called after the connection listeners are started. + * * * 'onPreStop' - called before the connection listeners are stopped. + * * * 'onPostStop' - called after the connection listeners are stopped. + * * method - (required) a function or an array of functions to be executed at a specified point during request processing. The required extension function signature is: + * * * server extension points: async function(server) where: + * * * * server - the server object. + * * * * this - the object provided via options.bind or the current active context set with server.bind(). + * * * request extension points: a lifecycle method. + * * options - (optional) an object with the following: + * * * before - a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added. + * * * after - a string or array of strings of plugin names this method must execute after (on the same event). Otherwise, extension methods are executed in the order added. + * * * bind - a context object passed back to the provided method (via this) when called. Ignored if the method is an arrow function. + * * * sandbox - if set to 'plugin' when adding a request extension points the extension is only added to routes defined by the current plugin. Not allowed when configuring route-level extensions, or + * when adding server extensions. Defaults to 'server' which applies to any route added to the server the extension is added to. + * @return void + */ +export interface ServerExtEventsObject { + /** + * (required) the extension point event name. The available extension points include the request extension points as well as the following server extension points: + * * 'onPreStart' - called before the connection listeners are started. + * * 'onPostStart' - called after the connection listeners are started. + * * 'onPreStop' - called before the connection listeners are stopped. + */ + type: ServerExtType; + /** + * (required) a function or an array of functions to be executed at a specified point during request processing. The required extension function signature is: + * * server extension points: async function(server) where: + * * * server - the server object. + * * * this - the object provided via options.bind or the current active context set with server.bind(). + * * request extension points: a lifecycle method. + */ + method: ServerExtPointFunction | ServerExtPointFunction[]; + options?: ServerExtOptions; +} + +export interface RouteExtObject { + method: Lifecycle.Method; + options?: ServerExtOptions; +} + +/** + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverextevents) + * Registers an extension function in one of the request lifecycle extension points where: + * @param events - an object or array of objects with the following: + * * type - (required) the extension point event name. The available extension points include the request extension points as well as the following server extension points: + * * * 'onPreStart' - called before the connection listeners are started. + * * * 'onPostStart' - called after the connection listeners are started. + * * * 'onPreStop' - called before the connection listeners are stopped. + * * * 'onPostStop' - called after the connection listeners are stopped. + * * method - (required) a function or an array of functions to be executed at a specified point during request processing. The required extension function signature is: + * * * server extension points: async function(server) where: + * * * * server - the server object. + * * * * this - the object provided via options.bind or the current active context set with server.bind(). + * * * request extension points: a lifecycle method. + * * options - (optional) an object with the following: + * * * before - a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added. + * * * after - a string or array of strings of plugin names this method must execute after (on the same event). Otherwise, extension methods are executed in the order added. + * * * bind - a context object passed back to the provided method (via this) when called. Ignored if the method is an arrow function. + * * * sandbox - if set to 'plugin' when adding a request extension points the extension is only added to routes defined by the current plugin. Not allowed when configuring route-level extensions, or + * when adding server extensions. Defaults to 'server' which applies to any route added to the server the extension is added to. + * @return void + */ +export interface ServerExtEventsRequestObject { + /** + * (required) the extension point event name. The available extension points include the request extension points as well as the following server extension points: + * * 'onPreStart' - called before the connection listeners are started. + * * 'onPostStart' - called after the connection listeners are started. + * * 'onPreStop' - called before the connection listeners are stopped. + * * 'onPostStop' - called after the connection listeners are stopped. + */ + type: ServerRequestExtType; + /** + * (required) a function or an array of functions to be executed at a specified point during request processing. The required extension function signature is: + * * server extension points: async function(server) where: + * * * server - the server object. + * * * this - the object provided via options.bind or the current active context set with server.bind(). + * * request extension points: a lifecycle method. + */ + method: Lifecycle.Method | Lifecycle.Method[]; + /** + * (optional) an object with the following: + * * before - a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added. + * * after - a string or array of strings of plugin names this method must execute after (on the same event). Otherwise, extension methods are executed in the order added. + * * bind - a context object passed back to the provided method (via this) when called. Ignored if the method is an arrow function. + * * sandbox - if set to 'plugin' when adding a request extension points the extension is only added to routes defined by the current plugin. Not allowed when configuring route-level extensions, + * or when adding server extensions. Defaults to 'server' which applies to any route added to the server the extension is added to. + */ + options?: ServerExtOptions; +} + +export type ServerExtPointFunction = (server: Server) => void; + +/** + * An object with the following: + * * before - a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added. + * * after - a string or array of strings of plugin names this method must execute after (on the same event). Otherwise, extension methods are executed in the order added. + * * bind - a context object passed back to the provided method (via this) when called. Ignored if the method is an arrow function. + * * sandbox - if set to 'plugin' when adding a request extension points the extension is only added to routes defined by the current plugin. Not allowed when configuring route-level extensions, or + * when adding server extensions. Defaults to 'server' which applies to any route added to the server the extension is added to. For context [See + * docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverextevents) + */ +export interface ServerExtOptions { + /** + * a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added. + */ + before?: string | string[]; + /** + * a string or array of strings of plugin names this method must execute after (on the same event). Otherwise, extension methods are executed in the order added. + */ + after?: string | string[]; + /** + * a context object passed back to the provided method (via this) when called. Ignored if the method is an arrow function. + */ + bind?: object; + /** + * if set to 'plugin' when adding a request extension points the extension is only added to routes defined by the current plugin. Not allowed when configuring route-level extensions, or when + * adding server extensions. Defaults to 'server' which applies to any route added to the server the extension is added to. + */ + sandbox?: 'server' | 'plugin'; +} + +/** + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverinfo) + * An object containing information about the server where: + */ +export interface ServerInfo { + /** + * a unique server identifier (using the format '{hostname}:{pid}:{now base36}'). + */ + id: string; + + /** + * server creation timestamp. + */ + created: number; + + /** + * server start timestamp (0 when stopped). + */ + started: number; + + /** + * the connection [port](https://github.com/hapijs/hapi/blob/master/API.md#server.options.port) based on the following rules: + * * before the server has been started: the configured port value. + * * after the server has been started: the actual port assigned when no port is configured or was set to 0. + */ + port: number | string; + + /** + * The [host](https://github.com/hapijs/hapi/blob/master/API.md#server.options.host) configuration value. + */ + host: string; + + /** + * the active IP address the connection was bound to after starting. Set to undefined until the server has been + * started or when using a non TCP port (e.g. UNIX domain socket). + */ + address: undefined | string; + + /** + * the protocol used: + * * 'http' - HTTP. + * * 'https' - HTTPS. + * * 'socket' - UNIX domain socket or Windows named pipe. + */ + protocol: 'http' | 'https' | 'socket'; + + /** + * a string representing the connection (e.g. 'http://example.com:8080' or 'socket:/unix/domain/socket/path'). Contains + * the uri value if set, otherwise constructed from the available settings. If no port is configured or is set + * to 0, the uri will not include a port component until the server is started. + */ + uri: string; +} + +/** + * An object with: + * * method - (optional) the request HTTP method (e.g. 'POST'). Defaults to 'GET'. + * * url - (required) the request URL. If the URI includes an authority (e.g. 'example.com:8080'), it is used to automatically set an HTTP 'Host' header, unless one was specified in headers. + * * headers - (optional) an object with optional request headers where each key is the header name and the value is the header content. Defaults to no additions to the default shot headers. + * * payload - (optional) an string, buffer or object containing the request payload. In case of an object it will be converted to a string for you. Defaults to no payload. Note that payload + * processing defaults to 'application/json' if no 'Content-Type' header provided. + * * credentials - (optional) an credentials object containing authentication information. The credentials are used to bypass the default authentication strategies, and are validated directly as if + * they were received via an authentication scheme. Defaults to no credentials. + * * artifacts - (optional) an artifacts object containing authentication artifact information. The artifacts are used to bypass the default authentication strategies, and are validated directly as + * if they were received via an authentication scheme. Ignored if set without credentials. Defaults to no artifacts. + * * app - (optional) sets the initial value of request.app, defaults to {}. + * * plugins - (optional) sets the initial value of request.plugins, defaults to {}. + * * allowInternals - (optional) allows access to routes with config.isInternal set to true. Defaults to false. + * * remoteAddress - (optional) sets the remote address for the incoming connection. + * * simulate - (optional) an object with options used to simulate client request stream conditions for testing: + * * error - if true, emits an 'error' event after payload transmission (if any). Defaults to false. + * * close - if true, emits a 'close' event after payload transmission (if any). Defaults to false. + * * end - if false, does not end the stream. Defaults to true. + * * split - indicates whether the request payload will be split into chunks. Defaults to undefined, meaning payload will not be chunked. + * * validate - (optional) if false, the options inputs are not validated. This is recommended for run-time usage of inject() to make it perform faster where input validation can be tested + * separately. + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-await-serverinjectoptions) + * For context [Shot module](https://github.com/hapijs/shot) + */ +export interface ServerInjectOptions extends Shot.RequestOptions { + /** + * an credentials object containing authentication information. The credentials are used to bypass the default authentication strategies, and are validated directly as if they were received via + * an authentication scheme. Defaults to no credentials. + */ + credentials?: AuthCredentials; + /** + * (an artifacts object containing authentication artifact information. The artifacts are used to bypass the default authentication strategies, and are validated directly as if they were received + * via an authentication scheme. Ignored if set without credentials. Defaults to no artifacts. + */ + artifacts?: object; + /** + * sets the initial value of request.app, defaults to {}. + */ + app?: ApplicationState; + /** + * sets the initial value of request.plugins, defaults to {}. + */ + plugins?: PluginsStates; + /** + * allows access to routes with config.isInternal set to true. Defaults to false. + */ + allowInternals?: boolean; +} + +/** + * A response object with the following properties: + * * statusCode - the HTTP status code. + * * headers - an object containing the headers set. + * * payload - the response payload string. + * * rawPayload - the raw response payload buffer. + * * raw - an object with the injection request and response objects: + * * req - the simulated node request object. + * * res - the simulated node response object. + * * result - the raw handler response (e.g. when not a stream or a view) before it is serialized for transmission. If not available, the value is set to payload. Useful for inspection and reuse of + * the internal objects returned (instead of parsing the response string). + * * request - the request object. + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-await-serverinjectoptions) + * For context [Shot module](https://github.com/hapijs/shot) + */ +export interface ServerInjectResponse extends Shot.ResponseObject { + /** + * the raw handler response (e.g. when not a stream or a view) before it is serialized for transmission. If not available, the value is set to payload. Useful for inspection and reuse of the + * internal objects returned (instead of parsing the response string). + */ + result: object | undefined; + /** + * the request object. + */ + request: Request; +} + +/** + * The method function with a signature async function(...args, [flags]) where: + * * ...args - the method function arguments (can be any number of arguments or none). + * * flags - when caching is enabled, an object used to set optional method result flags: + * * * ttl - 0 if result is valid but cannot be cached. Defaults to cache policy. + * For reference [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servermethodname-method-options) + */ +export type ServerMethod = (...args: any[]) => any; + +/** + * The same cache configuration used in server.cache(). + * The generateTimeout option is required. + * For reference [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servermethodname-method-options) + * For reference [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servercacheoptions) + */ +export interface ServerMethodCache extends PolicyOptions { + generateTimeout: number | false; +} + +/** + * Configuration object: + * * bind - a context object passed back to the method function (via this) when called. Defaults to active context (set via server.bind() when the method is registered. Ignored if the method is an + * arrow function. + * * cache - the same cache configuration used in server.cache(). The generateTimeout option is required. + * * generateKey - a function used to generate a unique key (for caching) from the arguments passed to the method function (the flags argument is not passed as input). The server will automatically + * generate a unique key if the function's arguments are all of types 'string', 'number', or 'boolean'. However if the method uses other types of arguments, a key generation function must be provided + * which takes the same arguments as the function and returns a unique string (or null if no key can be generated). For reference [See + * docs](https://github.com/hapijs/hapi/blob/master/API.md#-servermethodname-method-options) + */ +export interface ServerMethodOptions { + /** + * a context object passed back to the method function (via this) when called. Defaults to active context (set via server.bind() when the method is registered. Ignored if the method is an arrow + * function. + */ + bind?: object; + /** + * the same cache configuration used in server.cache(). The generateTimeout option is required. + */ + cache?: ServerMethodCache; + /** + * a function used to generate a unique key (for caching) from the arguments passed to the method function (the flags argument is not passed as input). The server will automatically generate a + * unique key if the function's arguments are all of types 'string', 'number', or 'boolean'. However if the method uses other types of arguments, a key generation function must be provided which + * takes the same arguments as the function and returns a unique string (or null if no key can be generated). + */ + generateKey?(...args: any[]): string | null; +} + +/** + * An object or an array of objects where each one contains: + * * name - the method name. + * * method - the method function. + * * options - (optional) settings. + * For reference [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servermethodmethods) + */ +export interface ServerMethodConfigurationObject { + /** + * the method name. + */ + name: string; + /** + * the method function. + */ + method: ServerMethod; + /** + * (optional) settings. + */ + options?: ServerMethodOptions; +} + +/** + * hapi uses catbox for its cache implementation which includes support for common storage solutions (e.g. Redis, + * MongoDB, Memcached, Riak, among others). Caching is only utilized if methods and plugins explicitly store their state in the cache. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-cache) + */ +export interface ServerOptionsCache extends PolicyOptions { + /** a class, a prototype function, or a catbox engine object. */ + engine?: EnginePrototypeOrObject; + + /** + * an identifier used later when provisioning or configuring caching for server methods or plugins. Each cache name must be unique. A single item may omit the name option which defines + * the default cache. If every cache includes a name, a default memory cache is provisioned as well. + */ + name?: string; + + /** if true, allows multiple cache users to share the same segment (e.g. multiple methods using the same cache storage container). Default to false. */ + shared?: boolean; + + /** (optional) string used to isolate cached data. Defaults to 'hapi-cache'. */ + partition?: string; + + /** other options passed to the catbox strategy used. Other options are only passed to catbox when engine above is a class or function and ignored if engine is a catbox engine object). */ + [s: string]: any; +} + +export interface ServerOptionsCompression { + minBytes: number; +} + +/** + * Empty interface to allow for custom augmentation. + */ +/* tslint:disable-next-line:no-empty-interface */ +export interface ServerOptionsApp { +} + +/** + * The server options control the behavior of the server object. Note that the options object is deeply cloned + * (with the exception of listener which is shallowly copied) and should not contain any values that are unsafe to perform deep copy on. + * All options are optionals. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-server-options) + */ +export interface ServerOptions { + /** + * Default value: '0.0.0.0' (all available network interfaces). + * Sets the hostname or IP address the server will listen on. If not configured, defaults to host if present, otherwise to all available network interfaces. Set to '127.0.0.1' or 'localhost' to + * restrict the server to only those coming from the same host. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serveroptionsaddress) + */ + address?: string; + + /** + * Default value: {}. + * Provides application-specific configuration which can later be accessed via server.settings.app. The framework does not interact with this object. It is simply a reference made available + * anywhere a server reference is provided. Note the difference between server.settings.app which is used to store static configuration values and server.app which is meant for storing run-time + * state. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serveroptionsapp) + */ + app?: ServerOptionsApp; + + /** + * Default value: true. + * Used to disable the automatic initialization of the listener. When false, indicates that the listener will be started manually outside the framework. + * Cannot be set to true along with a port value. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serveroptionsautolisten) + */ + autoListen?: boolean; + + /** + * Default value: { engine: require('catbox-memory' }. + * Sets up server-side caching providers. Every server includes a default cache for storing application state. By default, a simple memory-based cache is created which has limited capacity and + * capabilities. hapi uses catbox for its cache implementation which includes support for common storage solutions (e.g. Redis, MongoDB, Memcached, Riak, among others). Caching is only utilized + * if methods and plugins explicitly store their state in the cache. The server cache configuration only defines the storage container itself. The configuration can be assigned one or more + * (array): + * * a class or prototype function (usually obtained by calling require() on a catbox strategy such as require('catbox-redis')). A new catbox client will be created internally using this + * function. + * * a configuration object with the following: + * * * engine - a class, a prototype function, or a catbox engine object. + * * * name - an identifier used later when provisioning or configuring caching for server methods or plugins. Each cache name must be unique. A single item may omit the name option which defines + * the default cache. If every cache includes a name, a default memory cache is provisioned as well. + * * * shared - if true, allows multiple cache users to share the same segment (e.g. multiple methods using the same cache storage container). Default to false. + * * * partition - (optional) string used to isolate cached data. Defaults to 'hapi-cache'. + * * * other options passed to the catbox strategy used. Other options are only passed to catbox when engine above is a class or function and ignored if engine is a catbox engine object). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serveroptionscache) + */ + cache?: EnginePrototype | ServerOptionsCache | ServerOptionsCache[]; + + /** + * Default value: { minBytes: 1024 }. + * Defines server handling of content encoding requests. If false, response content encoding is disabled and no compression is performed by the server. + */ + compression?: boolean | ServerOptionsCompression; + + /** + * Default value: { request: ['implementation'] }. + * Determines which logged events are sent to the console. This should only be used for development and does not affect which events are actually logged internally and recorded. Set to false to + * disable all console logging, or to an object with: + * * log - a string array of server log tags to be displayed via console.error() when the events are logged via server.log() as well as internally generated server logs. Defaults to no output. + * * request - a string array of request log tags to be displayed via console.error() when the events are logged via request.log() as well as internally generated request logs. For example, to + * display all errors, set the option to ['error']. To turn off all console debug messages set it to false. To display all request logs, set it to '*'. Defaults to uncaught errors thrown in + * external code (these errors are handled automatically and result in an Internal Server Error response) or runtime errors due to developer error. For example, to display all errors, set the log + * or request to ['error']. To turn off all output set the log or request to false. To display all server logs, set the log or request to '*'. To disable all debug information, set debug to + * false. + */ + debug?: false | { + log?: string[] | false; + request?: string[] | false; + }; + + /** + * Default value: the operating system hostname and if not available, to 'localhost'. + * The public hostname or IP address. Used to set server.info.host and server.info.uri and as address is none provided. + */ + host?: string; + + /** + * Default value: none. + * An optional node HTTP (or HTTPS) http.Server object (or an object with a compatible interface). + * If the listener needs to be manually started, set autoListen to false. + * If the listener uses TLS, set tls to true. + */ + listener?: http.Server; + + /** + * Default value: { sampleInterval: 0 }. + * Server excessive load handling limits where: + * * sampleInterval - the frequency of sampling in milliseconds. When set to 0, the other load options are ignored. Defaults to 0 (no sampling). + * * maxHeapUsedBytes - maximum V8 heap size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). + * * maxRssBytes - maximum process RSS size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). + * * maxEventLoopDelay - maximum event loop delay duration in milliseconds over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). + */ + load?: { + /** the frequency of sampling in milliseconds. When set to 0, the other load options are ignored. Defaults to 0 (no sampling). */ + sampleInterval?: number; + + /** + * Max concurrent requests. + */ + concurrent?: number; + + /** maximum V8 heap size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). */ + maxHeapUsedBytes?: number; + /** + * maximum process RSS size over which incoming requests are rejected with an HTTP Server Timeout (503) response. Defaults to 0 (no limit). + */ + maxRssBytes?: number; + /** + * maximum event loop delay duration in milliseconds over which incoming requests are rejected with an HTTP Server Timeout (503) response. + * Defaults to 0 (no limit). + */ + maxEventLoopDelay?: number; + }; + + /** + * Default value: none. + * Options passed to the mimos module when generating the mime database used by the server (and accessed via server.mime): + * * override - an object hash that is merged into the built in mime information specified here. Each key value pair represents a single mime object. Each override value must contain: + * * key - the lower-cased mime-type string (e.g. 'application/javascript'). + * * value - an object following the specifications outlined here. Additional values include: + * * * type - specify the type value of result objects, defaults to key. + * * * predicate - method with signature function(mime) when this mime type is found in the database, this function will execute to allows customizations. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serveroptionsmime) + */ + mime?: MimosOptions; + + /** + * Default value: {}. + * Plugin-specific configuration which can later be accessed via server.settings.plugins. plugins is an object where each key is a plugin name and the value is the configuration. Note the + * difference between server.settings.plugins which is used to store static configuration values and server.plugins which is meant for storing run-time state. + */ + plugins?: PluginSpecificConfiguration; + + /** + * Default value: 0 (an ephemeral port). + * The TCP port the server will listen to. Defaults the next available port when the server is started (and assigned to server.info.port). + * If port is a string containing a '/' character, it is used as a UNIX domain socket path. If it starts with '\.\pipe', it is used as a Windows named pipe. + */ + port?: number | string; + + /** + * Default value: { isCaseSensitive: true, stripTrailingSlash: false }. + * Controls how incoming request URIs are matched against the routing table: + * * isCaseSensitive - determines whether the paths '/example' and '/EXAMPLE' are considered different resources. Defaults to true. + * * stripTrailingSlash - removes trailing slashes on incoming paths. Defaults to false. + */ + router?: { + isCaseSensitive?: boolean; + stripTrailingSlash?: boolean; + }; + + /** + * Default value: none. + * A route options object used as the default configuration for every route. + */ + routes?: RouteOptions; + + /** + * Default value: + * { + * strictHeader: true, + * ignoreErrors: false, + * isSecure: true, + * isHttpOnly: true, + * isSameSite: 'Strict', + * encoding: 'none' + * } + * Sets the default configuration for every state (cookie) set explicitly via server.state() or implicitly (without definition) using the state configuration object. + */ + // TODO I am not sure if I need to use all the server.state() definition (like the default value) OR only the options below. The v16 use "any" here. + // state?: ServerStateCookieOptions; + state?: { + strictHeader?: boolean, + ignoreErrors?: boolean, + isSecure?: boolean, + isHttpOnly?: boolean, + isSameSite?: false | 'Strict' | 'Lax', + encoding?: 'none' | 'base64' | 'base64json' | 'form' | 'iron' + }; + + /** + * Default value: none. + * Used to create an HTTPS connection. The tls object is passed unchanged to the node HTTPS server as described in the node HTTPS documentation. + */ + tls?: boolean | https.ServerOptions; + + /** + * Default value: constructed from runtime server information. + * The full public URI without the path (e.g. 'http://example.com:8080'). If present, used as the server server.info.uri, otherwise constructed from the server settings. + */ + uri?: string; +} + +/** + * The realm object contains sandboxed server settings specific to each plugin or authentication strategy. When registering a plugin or an authentication scheme, a server object reference is provided + * with a new server.realm container specific to that registration. It allows each plugin to maintain its own settings without leaking and affecting other plugins. For example, a plugin can set a + * default file path for local resources without breaking other plugins' configured paths. When calling server.bind(), the active realm's settings.bind property is set which is then used by routes + * and extensions added at the same level (server root or plugin). + * + * https://github.com/hapijs/hapi/blob/master/API.md#server.realm + */ +export interface ServerRealm { + /** when the server object is provided as an argument to the plugin register() method, modifiers provides the registration preferences passed the server.register() method and includes: */ + modifiers: { + /** routes preferences: */ + route: { + /** + * the route path prefix used by any calls to server.route() from the server. Note that if a prefix is used and the route path is set to '/', the resulting path will not include + * the trailing slash. + */ + prefix: string; + /** the route virtual host settings used by any calls to server.route() from the server. */ + vhost: string; + } + }; + /** the realm of the parent server object, or null for the root server. */ + parent: ServerRealm | null; + /** the active plugin name (empty string if at the server root). */ + plugin: string; + /** the plugin options object passed at registration. */ + pluginOptions: object; + /** plugin-specific state to be shared only among activities sharing the same active state. plugins is an object where each key is a plugin name and the value is the plugin state. */ + plugins: PluginsStates; + /** settings overrides */ + settings: { + files: { + relativeTo: string; + }; + bind: object; + }; +} + +/** + * Registration options (different from the options passed to the registration function): + * * once - if true, subsequent registrations of the same plugin are skipped without error. Cannot be used with plugin options. Defaults to false. If not set to true, an error will be thrown the + * second time a plugin is registered on the server. + * * routes - modifiers applied to each route added by the plugin: + * * * prefix - string added as prefix to any route path (must begin with '/'). If a plugin registers a child plugin the prefix is passed on to the child or is added in front of the child-specific + * prefix. + * * * vhost - virtual host string (or array of strings) applied to every route. The outer-most vhost overrides the any nested configuration. + * For reference [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-await-serverregisterplugins-options) + */ +export interface ServerRegisterOptions { + /** + * if true, subsequent registrations of the same plugin are skipped without error. Cannot be used with plugin options. Defaults to false. If not set to true, an error will be thrown the second + * time a plugin is registered on the server. + */ + once?: boolean; + /** + * modifiers applied to each route added by the plugin: + */ + routes?: { + /** + * string added as prefix to any route path (must begin with '/'). If a plugin registers a child plugin the prefix is passed on to the child or is added in front of the child-specific prefix. + */ + prefix: string; + /** + * virtual host string (or array of strings) applied to every route. The outer-most vhost overrides the any nested configuration. + */ + vhost?: string | string[]; + }; +} + +/** + * An object with the following: + * * plugin - a plugin object. + * * options - (optional) options passed to the plugin during registration. + * * once - if true, subsequent registrations of the same plugin are skipped without error. Cannot be used with plugin options. Defaults to false. If not set to true, an error will be thrown the + * second time a plugin is registered on the server. + * * routes - modifiers applied to each route added by the plugin: + * * * prefix - string added as prefix to any route path (must begin with '/'). If a plugin registers a child plugin the prefix is passed on to the child or is added in front of the child-specific + * prefix. + * * * vhost - virtual host string (or array of strings) applied to every route. The outer-most vhost overrides the any nested configuration. + * For reference [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-await-serverregisterplugins-options) + * + * The type parameter T is the type of the plugin configuration options. + */ +export interface ServerRegisterPluginObject extends ServerRegisterOptions { + /** + * a plugin object. + */ + plugin: Plugin; + /** + * options passed to the plugin during registration. + */ + options?: T; +} + +export interface ServerRegisterPluginObjectArray extends Array + | ServerRegisterPluginObject + | ServerRegisterPluginObject + | ServerRegisterPluginObject + | ServerRegisterPluginObject + | ServerRegisterPluginObject + | ServerRegisterPluginObject + | undefined> { + 0: ServerRegisterPluginObject; + 1?: ServerRegisterPluginObject; + 2?: ServerRegisterPluginObject; + 3?: ServerRegisterPluginObject; + 4?: ServerRegisterPluginObject; + 5?: ServerRegisterPluginObject; + 6?: ServerRegisterPluginObject; +} + +/* tslint:disable-next-line:no-empty-interface */ +export interface HandlerDecorations { +} + +/** + * A route configuration object or an array of configuration objects where each object contains: + * * path - (required) the absolute path used to match incoming requests (must begin with '/'). Incoming requests are compared to the configured paths based on the server's router configuration. The + * path can include named parameters enclosed in {} which will be matched against literal values in the request as described in Path parameters. + * * method - (required) the HTTP method. Typically one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', or 'OPTIONS'. Any HTTP method is allowed, except for 'HEAD'. Use '*' to match against any HTTP + * method (only when an exact match was not found, and any match with a specific method will be given a higher priority over a wildcard match). Can be assigned an array of methods which has the same + * result as adding the same route with different methods manually. + * * vhost - (optional) a domain string or an array of domain strings for limiting the route to only requests with a matching host header field. Matching is done against the hostname part of the + * header only (excluding the port). Defaults to all hosts. + * * handler - (required when handler is not set) the route handler function called to generate the response after successful authentication and validation. + * * options - additional route options. The options value can be an object or a function that returns an object using the signature function(server) where server is the server the route is being + * added to and this is bound to the current realm's bind option. + * * rules - route custom rules object. The object is passed to each rules processor registered with server.rules(). Cannot be used if route.options.rules is defined. + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverrouteroute) + */ +export interface ServerRoute { + /** + * (required) the absolute path used to match incoming requests (must begin with '/'). Incoming requests are compared to the configured paths based on the server's router configuration. The path + * can include named parameters enclosed in {} which will be matched against literal values in the request as described in Path parameters. For context [See + * docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverrouteroute) For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#path-parameters) + */ + path: string; + + /** + * (required) the HTTP method. Typically one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', or 'OPTIONS'. Any HTTP method is allowed, except for 'HEAD'. Use '*' to match against any HTTP method + * (only when an exact match was not found, and any match with a specific method will be given a higher priority over a wildcard match). Can be assigned an array of methods which has the same + * result as adding the same route with different methods manually. + */ + method: Util.HTTP_METHODS_PARTIAL | Util.HTTP_METHODS_PARTIAL[] | string | string[]; + + /** + * (optional) a domain string or an array of domain strings for limiting the route to only requests with a matching host header field. Matching is done against the hostname part of the header + * only (excluding the port). Defaults to all hosts. + */ + vhost?: string | string[]; + + /** + * (required when handler is not set) the route handler function called to generate the response after successful authentication and validation. + */ + handler?: Lifecycle.Method | HandlerDecorations; + + /** + * additional route options. The options value can be an object or a function that returns an object using the signature function(server) where server is the server the route is being added to + * and this is bound to the current realm's bind option. + */ + options?: RouteOptions | ((server: Server) => RouteOptions); + + /** + * route custom rules object. The object is passed to each rules processor registered with server.rules(). Cannot be used if route.options.rules is defined. + */ + rules?: object; +} + +/** + * Optional cookie settings + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverstatename-options) + */ +export interface ServerStateCookieOptions { + /** time-to-live in milliseconds. Defaults to null (session time-life - cookies are deleted when the browser is closed). */ + ttl?: number | null; + /** sets the 'Secure' flag. Defaults to true. */ + isSecure?: boolean; + /** sets the 'HttpOnly' flag. Defaults to true. */ + isHttpOnly?: boolean; + /** + * sets the 'SameSite' flag. The value must be one of: + * * false - no flag. + * * 'Strict' - sets the value to 'Strict' (this is the default value). + * * 'Lax' - sets the value to 'Lax'. + */ + isSameSite?: false | 'Strict' | 'Lax'; + /** the path scope. Defaults to null (no path). */ + path?: string | null; + /** the domain scope. Defaults to null (no domain). */ + domain?: string | null; + + /** + * if present and the cookie was not received from the client or explicitly set by the route handler, the + * cookie is automatically added to the response with the provided value. The value can be + * a function with signature async function(request) where: + */ + autoValue?(request: Request): void; + + /** + * encoding performs on the provided value before serialization. Options are: + * * 'none' - no encoding. When used, the cookie value must be a string. This is the default value. + * * 'base64' - string value is encoded using Base64. + * * 'base64json' - object value is JSON-stringified then encoded using Base64. + * * 'form' - object value is encoded using the x-www-form-urlencoded method. + * * 'iron' - Encrypts and sign the value using iron. + */ + encoding?: 'none' | 'base64' | 'base64json' | 'form' | 'iron'; + /** + * an object used to calculate an HMAC for cookie integrity validation. This does not provide privacy, only a mean + * to verify that the cookie value was generated by the server. Redundant when 'iron' encoding is used. Options are: + * * integrity - algorithm options. Defaults to require('iron').defaults.integrity. + * * password - password used for HMAC key generation (must be at least 32 characters long). + */ + sign?: { + integrity?: SealOptionsSub; + password: string; + }; + /** password used for 'iron' encoding (must be at least 32 characters long). */ + password?: string; + /** options for 'iron' encoding. Defaults to require('iron').defaults. */ + iron?: SealOptions; + /** if true, errors are ignored and treated as missing cookies. */ + ignoreErrors?: boolean; + /** if true, automatically instruct the client to remove invalid cookies. Defaults to false. */ + clearInvalid?: boolean; + /** if false, allows any cookie value including values in violation of RFC 6265. Defaults to true. */ + strictHeader?: boolean; + /** used by proxy plugins (e.g. h2o2). */ + passThrough?: any; +} + +/** + * A single object or an array of object where each contains: + * * name - the cookie name. + * * value - the cookie value. + * * options - cookie configuration to override the server settings. + */ +export interface ServerStateFormat { + name: string; + value: string; + options: ServerStateCookieOptions; +} + +/** + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverstatename-options) + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serveroptionsstate) + */ +export interface ServerState { + /** + * The server cookies manager. + * Access: read only and statehood public interface. + */ + readonly states: object; + + /** + * The server cookies manager settings. The settings are based on the values configured in [server.options.state](https://github.com/hapijs/hapi/blob/master/API.md#server.options.state). + */ + readonly settings: ServerStateCookieOptions; + + /** + * An object containing the configuration of each cookie added via [server.state()](https://github.com/hapijs/hapi/blob/master/API.md#server.state()) where each key is the + * cookie name and value is the configuration object. + */ + readonly cookies: { + [key: string]: ServerStateCookieOptions; + }; + + /** + * An array containing the names of all configued cookies. + */ + readonly names: string[]; + + /** + * Same as calling [server.state()](https://github.com/hapijs/hapi/blob/master/API.md#server.state()). + */ + add(name: string, options?: ServerStateCookieOptions): void; + + /** + * Formats an HTTP 'Set-Cookie' header based on the server.options.state where: + * @param cookies - a single object or an array of object where each contains: + * * name - the cookie name. + * * value - the cookie value. + * * options - cookie configuration to override the server settings. + * @return Return value: a header string. + * Note that this utility uses the server configuration but does not change the server state. It is provided for manual cookie formating (e.g. when headers are set manually). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-async-serverstatesformatcookies) + */ + format(cookies: ServerStateFormat | ServerStateFormat[]): Promise; + + /** + * Parses an HTTP 'Cookies' header based on the server.options.state where: + * @param header - the HTTP header. + * @return Return value: an object where each key is a cookie name and value is the parsed cookie. + * Note that this utility uses the server configuration but does not change the server state. It is provided for manual cookie parsing (e.g. when server parsing is disabled). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-async-serverstatesparseheader) + */ + parse(header: string): Promise>; +} + +/** + * The method function can have a defaults object or function property. If the property is set to an object, that object is used as the default route config for routes using this handler. + * If the property is set to a function, the function uses the signature function(method) and returns the route default configuration. + */ +export interface HandlerDecorationMethod { + (route: RouteOptions, options: any): Lifecycle.Method; + defaults?: RouteOptions | ((method: any) => RouteOptions); +} + +/** + * The general case for decorators added via server.decorate. + */ +export type DecorationMethod = (this: T, ...args: any[]) => any; + +/** + * An empty interface to allow typings of custom plugin properties. + */ +/* tslint:disable-next-line:no-empty-interface */ +export interface PluginProperties { +} + +export type DecorateName = string | symbol; + +/** + * The server object is the main application container. The server manages all incoming requests along with all + * the facilities provided by the framework. Each server supports a single connection (e.g. listen to port 80). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#server) + */ +export class Server { + /** + * Creates a new server object + * @param options server configuration object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serveroptions) + */ + constructor(options?: ServerOptions); + + /** + * Provides a safe place to store server-specific run-time application data without potential conflicts with + * the framework internals. The data can be accessed whenever the server is accessible. + * Initialized with an empty object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverapp) + */ + app: ApplicationState; + + /** + * Server Auth: properties and methods + */ + readonly auth: ServerAuth; + + /** + * Links another server to the initialize/start/stop state of the current server by calling the + * controlled server `initialize()`/`start()`/`stop()` methods whenever the current server methods + * are called, where: + */ + control(server: Server): void; + + /** + * Provides access to the decorations already applied to various framework interfaces. The object must not be + * modified directly, but only through server.decorate. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverdecorations) + */ + readonly decorations: { + /** + * decorations on the request object. + */ + request: string[], + /** + * decorations on the response toolkit. + */ + toolkit: string[], + /** + * decorations on the server object. + */ + server: string[] + }; + + /** + * Register custom application events where: + * @param events must be one of: + * * an event name string. + * * an event options object with the following optional keys (unless noted otherwise): + * * * name - the event name string (required). + * * * channels - a string or array of strings specifying the event channels available. Defaults to no channel restrictions (event updates can specify a channel or not). + * * * clone - if true, the data object passed to server.events.emit() is cloned before it is passed to the listeners (unless an override specified by each listener). Defaults to false (data is + * passed as-is). + * * * spread - if true, the data object passed to server.event.emit() must be an array and the listener method is called with each array element passed as a separate argument (unless an override + * specified by each listener). This should only be used when the emitted data structure is known and predictable. Defaults to false (data is emitted as a single argument regardless of its + * type). + * * * tags - if true and the criteria object passed to server.event.emit() includes tags, the tags are mapped to an object (where each tag string is the key and the value is true) which is + * appended to the arguments list at the end. A configuration override can be set by each listener. Defaults to false. + * * * shared - if true, the same event name can be registered multiple times where the second registration is ignored. Note that if the registration config is changed between registrations, only + * the first configuration is used. Defaults to false (a duplicate registration will throw an error). + * * a podium emitter object. + * * an array containing any of the above. + * @return Return value: none. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverevents) + */ + event(events: ServerEventsApplication | ServerEventsApplication[]): void; + + /** + * Access: podium public interface. + * The server events emitter. Utilizes the podium with support for event criteria validation, channels, and filters. + * Use the following methods to interact with server.events: + * [server.events.emit(criteria, data)](https://github.com/hapijs/hapi/blob/master/API.md#server.events.emit()) - emit server events. + * [server.events.on(criteria, listener)](https://github.com/hapijs/hapi/blob/master/API.md#server.events.on()) - subscribe to all events. + * [server.events.once(criteria, listener)](https://github.com/hapijs/hapi/blob/master/API.md#server.events.once()) - subscribe to + * Other methods include: server.events.removeListener(name, listener), server.events.removeAllListeners(name), and server.events.hasListeners(name). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverevents) + */ + events: ServerEvents; + + /** + * An object containing information about the server where: + * * id - a unique server identifier (using the format '{hostname}:{pid}:{now base36}'). + * * created - server creation timestamp. + * * started - server start timestamp (0 when stopped). + * * port - the connection port based on the following rules: + * * host - The host configuration value. + * * address - the active IP address the connection was bound to after starting. Set to undefined until the server has been started or when using a non TCP port (e.g. UNIX domain socket). + * * protocol - the protocol used: + * * 'http' - HTTP. + * * 'https' - HTTPS. + * * 'socket' - UNIX domain socket or Windows named pipe. + * * uri - a string representing the connection (e.g. 'http://example.com:8080' or 'socket:/unix/domain/socket/path'). Contains the uri value if set, otherwise constructed from the available + * settings. If no port is configured or is set to 0, the uri will not include a port component until the server is started. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverinfo) + */ + readonly info: ServerInfo; + + /** + * Access: read only and listener public interface. + * The node HTTP server object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverlistener) + */ + listener: http.Server; + + /** + * An object containing the process load metrics (when load.sampleInterval is enabled): + * * eventLoopDelay - event loop delay milliseconds. + * * heapUsed - V8 heap usage. + * * rss - RSS memory usage. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverload) + */ + readonly load: { + /** + * event loop delay milliseconds. + */ + eventLoopDelay: number; + + /** + * Max concurrent requests. + */ + concurrent: number + /** + * V8 heap usage. + */ + heapUsed: number; + /** + * RSS memory usage. + */ + rss: number; + }; + + /** + * Server methods are functions registered with the server and used throughout the application as a common utility. + * Their advantage is in the ability to configure them to use the built-in cache and share across multiple request + * handlers without having to create a common module. + * sever.methods is an object which provides access to the methods registered via server.method() where each + * server method name is an object property. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servermethods + */ + readonly methods: Util.Dictionary; + + /** + * Provides access to the server MIME database used for setting content-type information. The object must not be + * modified directly but only through the [mime](https://github.com/hapijs/hapi/blob/master/API.md#server.options.mime) server setting. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servermime) + */ + mime: any; + + /** + * An object containing the values exposed by each registered plugin where each key is a plugin name and the values + * are the exposed properties by each plugin using server.expose(). Plugins may set the value of + * the server.plugins[name] object directly or via the server.expose() method. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverplugins) + */ + plugins: PluginProperties; + + /** + * The realm object contains sandboxed server settings specific to each plugin or authentication strategy. When + * registering a plugin or an authentication scheme, a server object reference is provided with a new server.realm + * container specific to that registration. It allows each plugin to maintain its own settings without leaking + * and affecting other plugins. + * For example, a plugin can set a default file path for local resources without breaking other plugins' configured + * paths. When calling server.bind(), the active realm's settings.bind property is set which is then used by + * routes and extensions added at the same level (server root or plugin). + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverrealm) + */ + readonly realm: ServerRealm; + + /** + * An object of the currently registered plugins where each key is a registered plugin name and the value is + * an object containing: + * * version - the plugin version. + * * name - the plugin name. + * * options - (optional) options passed to the plugin during registration. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverregistrations) + */ + readonly registrations: PluginsListRegistered; + + /** + * The server configuration object after defaults applied. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serversettings) + */ + readonly settings: ServerOptions; + + /** + * The server cookies manager. + * Access: read only and statehood public interface. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverstates) + */ + readonly states: ServerState; + + /** + * A string indicating the listener type where: + * * 'socket' - UNIX domain socket or Windows named pipe. + * * 'tcp' - an HTTP listener. + */ + readonly type: 'socket' | 'tcp'; + + /** + * The hapi module version number. + */ + readonly version: string; + + /** + * Sets a global context used as the default bind object when adding a route or an extension where: + * @param context - the object used to bind this in lifecycle methods such as the route handler and extension methods. The context is also made available as h.context. + * @return Return value: none. + * When setting a context inside a plugin, the context is applied only to methods set up by the plugin. Note that the context applies only to routes and extensions added after it has been set. + * Ignored if the method being bound is an arrow function. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverbindcontext) + */ + bind(context: object): void; + + /** + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servercacheoptions) + */ + cache: ServerCache; + + /** + * Registers a custom content decoding compressor to extend the built-in support for 'gzip' and 'deflate' where: + * @param encoding - the decoder name string. + * @param decoder - a function using the signature function(options) where options are the encoding specific options configured in the route payload.compression configuration option, and the + * return value is an object compatible with the output of node's zlib.createGunzip(). + * @return Return value: none. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverdecoderencoding-decoder) + */ + decoder(encoding: string, decoder: ((options: PayloadCompressionDecoderSettings) => zlib.Gunzip)): void; + + /** + * Extends various framework interfaces with custom methods where: + * @param type - the interface being decorated. Supported types: + * 'handler' - adds a new handler type to be used in routes handlers. + * 'request' - adds methods to the Request object. + * 'server' - adds methods to the Server object. + * 'toolkit' - adds methods to the response toolkit. + * @param property - the object decoration key name. + * @param method - the extension function or other value. + * @param options - (optional) supports the following optional settings: + * apply - when the type is 'request', if true, the method function is invoked using the signature function(request) where request is the current request object and the returned value is assigned + * as the decoration. extend - if true, overrides an existing decoration. The method must be a function with the signature function(existing) where: existing - is the previously set + * decoration method value. must return the new decoration function or value. cannot be used to extend handler decorations. + * @return void; + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverdecoratetype-property-method-options) + */ + decorate(type: 'handler', property: DecorateName, method: HandlerDecorationMethod, options?: {apply?: boolean, extend?: boolean}): void; + decorate(type: 'request', property: DecorateName, method: (existing: ((...args: any[]) => any)) => (request: Request) => DecorationMethod, options: {apply: true, extend: true}): void; + decorate(type: 'request', property: DecorateName, method: (request: Request) => DecorationMethod, options: {apply: true, extend?: boolean}): void; + decorate(type: 'request', property: DecorateName, method: DecorationMethod, options?: {apply?: boolean, extend?: boolean}): void; + decorate(type: 'toolkit', property: DecorateName, method: (existing: ((...args: any[]) => any)) => DecorationMethod, options: {apply?: boolean, extend: true}): void; + decorate(type: 'toolkit', property: DecorateName, method: DecorationMethod, options?: {apply?: boolean, extend?: boolean}): void; + decorate(type: 'server', property: DecorateName, method: (existing: ((...args: any[]) => any)) => DecorationMethod, options: {apply?: boolean, extend: true}): void; + decorate(type: 'server', property: DecorateName, method: DecorationMethod, options?: {apply?: boolean, extend?: boolean}): void; + + /** + * Used within a plugin to declare a required dependency on other plugins where: + * @param dependencies - plugins which must be registered in order for this plugin to operate. Plugins listed must be registered before the server is + * initialized or started. + * @param after - (optional) a function that is called after all the specified dependencies have been registered and before the server starts. The function is only called if the server is + * initialized or started. The function signature is async function(server) where: server - the server the dependency() method was called on. + * @return Return value: none. + * The after method is identical to setting a server extension point on 'onPreStart'. + * If a circular dependency is detected, an exception is thrown (e.g. two plugins each has an after function to be called after the other). + * The method does not provide version dependency which should be implemented using npm peer dependencies. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverdependencydependencies-after) + */ + dependency(dependencies: Dependencies, after?: ((server: Server) => Promise)): void; + + /** + * Registers a custom content encoding compressor to extend the built-in support for 'gzip' and 'deflate' where: + * @param encoding - the encoder name string. + * @param encoder - a function using the signature function(options) where options are the encoding specific options configured in the route compression option, and the return value is an object + * compatible with the output of node's zlib.createGzip(). + * @return Return value: none. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverencoderencoding-encoder) + */ + encoder(encoding: string, encoder: ((options: RouteCompressionEncoderSettings) => zlib.Gzip)): void; + + /** + * Used within a plugin to expose a property via server.plugins[name] where: + * @param key - the key assigned (server.plugins[name][key]). + * @param value - the value assigned. + * @return Return value: none. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverexposekey-value) + */ + expose(key: string, value: any): void; + + /** + * Merges an object into to the existing content of server.plugins[name] where: + * @param obj - the object merged into the exposed properties container. + * @return Return value: none. + * Note that all the properties of obj are deeply cloned into server.plugins[name], so avoid using this method + * for exposing large objects that may be expensive to clone or singleton objects such as database client + * objects. Instead favor server.expose(key, value), which only copies a reference to value. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverexposeobj) + */ + expose(obj: object): void; + + /** + * Registers an extension function in one of the request lifecycle extension points where: + * @param events - an object or array of objects with the following: + * * type - (required) the extension point event name. The available extension points include the request extension points as well as the following server extension points: + * * * 'onPreStart' - called before the connection listeners are started. + * * * 'onPostStart' - called after the connection listeners are started. + * * * 'onPreStop' - called before the connection listeners are stopped. + * * * 'onPostStop' - called after the connection listeners are stopped. + * * method - (required) a function or an array of functions to be executed at a specified point during request processing. The required extension function signature is: + * * * server extension points: async function(server) where: + * * * * server - the server object. + * * * * this - the object provided via options.bind or the current active context set with server.bind(). + * * * request extension points: a lifecycle method. + * * options - (optional) an object with the following: + * * * before - a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added. + * * * after - a string or array of strings of plugin names this method must execute after (on the same event). Otherwise, extension methods are executed in the order added. + * * * bind - a context object passed back to the provided method (via this) when called. Ignored if the method is an arrow function. + * * * sandbox - if set to 'plugin' when adding a request extension points the extension is only added to routes defined by the current plugin. Not allowed when configuring route-level + * extensions, or when adding server extensions. Defaults to 'server' which applies to any route added to the server the extension is added to. + * @return void + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverextevents) + */ + ext(events: ServerExtEventsObject | ServerExtEventsObject[] | ServerExtEventsRequestObject | ServerExtEventsRequestObject[]): void; + + /** + * Registers a single extension event using the same properties as used in server.ext(events), but passed as arguments. + * @return Return value: none. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverextevent-method-options) + */ + ext(event: ServerExtType, method: ServerExtPointFunction, options?: ServerExtOptions): void; + ext(event: ServerRequestExtType, method: Lifecycle.Method, options?: ServerExtOptions): void; + + /** + * Initializes the server (starts the caches, finalizes plugin registration) but does not start listening on the connection port. + * @return Return value: none. + * Note that if the method fails and throws an error, the server is considered to be in an undefined state and + * should be shut down. In most cases it would be impossible to fully recover as the various plugins, caches, and + * other event listeners will get confused by repeated attempts to start the server or make assumptions about the + * healthy state of the environment. It is recommended to abort the process when the server fails to start properly. + * If you must try to resume after an error, call server.stop() first to reset the server state. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-await-serverinitialize) + */ + initialize(): Promise; + + /** + * Injects a request into the server simulating an incoming HTTP request without making an actual socket connection. Injection is useful for testing purposes as well as for invoking routing logic + * internally without the overhead and limitations of the network stack. The method utilizes the shot module for performing injections, with some additional options and response properties: + * @param options - can be assigned a string with the requested URI, or an object with: + * * method - (optional) the request HTTP method (e.g. 'POST'). Defaults to 'GET'. + * * url - (required) the request URL. If the URI includes an authority (e.g. 'example.com:8080'), it is used to automatically set an HTTP 'Host' header, unless one was specified in headers. + * * headers - (optional) an object with optional request headers where each key is the header name and the value is the header content. Defaults to no additions to the default shot headers. + * * payload - (optional) an string, buffer or object containing the request payload. In case of an object it will be converted to a string for you. Defaults to no payload. Note that payload + * processing defaults to 'application/json' if no 'Content-Type' header provided. + * * credentials - (optional) an credentials object containing authentication information. The credentials are used to bypass the default authentication strategies, and are validated directly as + * if they were received via an authentication scheme. Defaults to no credentials. + * * artifacts - (optional) an artifacts object containing authentication artifact information. The artifacts are used to bypass the default authentication strategies, and are validated directly + * as if they were received via an authentication scheme. Ignored if set without credentials. Defaults to no artifacts. + * * app - (optional) sets the initial value of request.app, defaults to {}. + * * plugins - (optional) sets the initial value of request.plugins, defaults to {}. + * * allowInternals - (optional) allows access to routes with config.isInternal set to true. Defaults to false. + * * remoteAddress - (optional) sets the remote address for the incoming connection. + * * simulate - (optional) an object with options used to simulate client request stream conditions for testing: + * * error - if true, emits an 'error' event after payload transmission (if any). Defaults to false. + * * close - if true, emits a 'close' event after payload transmission (if any). Defaults to false. + * * end - if false, does not end the stream. Defaults to true. + * * split - indicates whether the request payload will be split into chunks. Defaults to undefined, meaning payload will not be chunked. + * * validate - (optional) if false, the options inputs are not validated. This is recommended for run-time usage of inject() to make it perform faster where input validation can be tested + * separately. + * @return Return value: a response object with the following properties: + * * statusCode - the HTTP status code. + * * headers - an object containing the headers set. + * * payload - the response payload string. + * * rawPayload - the raw response payload buffer. + * * raw - an object with the injection request and response objects: + * * req - the simulated node request object. + * * res - the simulated node response object. + * * result - the raw handler response (e.g. when not a stream or a view) before it is serialized for transmission. If not available, the value is set to payload. Useful for inspection and reuse + * of the internal objects returned (instead of parsing the response string). + * * request - the request object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-await-serverinjectoptions) + */ + inject(options: string | ServerInjectOptions): Promise; + + /** + * Logs server events that cannot be associated with a specific request. When called the server emits a 'log' event which can be used by other listeners or plugins to record the information or + * output to the console. The arguments are: + * @param tags - (required) a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive + * mechanism for describing and filtering events. Any logs generated by the server internally include the 'hapi' tag along with event-specific information. + * @param data - (optional) an message string or object with the application data being logged. If data is a function, the function signature is function() and it called once to generate (return + * value) the actual data emitted to the listeners. If no listeners match the event, the data function is not invoked. + * @param timestamp - (optional) an timestamp expressed in milliseconds. Defaults to Date.now() (now). + * @return Return value: none. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverlogtags-data-timestamp) + */ + log(tags: string | string[], data?: string | object | (() => any), timestamp?: number): void; + + /** + * Looks up a route configuration where: + * @param id - the route identifier. + * @return Return value: the route information if found, otherwise null. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverlookupid) + */ + lookup(id: string): RequestRoute | null; + + /** + * Looks up a route configuration where: + * @param method - the HTTP method (e.g. 'GET', 'POST'). + * @param path - the requested path (must begin with '/'). + * @param host - (optional) hostname (to match against routes with vhost). + * @return Return value: the route information if found, otherwise null. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servermatchmethod-path-host) + */ + match(method: Util.HTTP_METHODS, path: string, host?: string): RequestRoute | null; + + /** + * Registers a server method where: + * @param name - a unique method name used to invoke the method via server.methods[name]. + * @param method - the method function with a signature async function(...args, [flags]) where: + * * ...args - the method function arguments (can be any number of arguments or none). + * * flags - when caching is enabled, an object used to set optional method result flags: + * * * ttl - 0 if result is valid but cannot be cached. Defaults to cache policy. + * @param options - (optional) configuration object: + * * bind - a context object passed back to the method function (via this) when called. Defaults to active context (set via server.bind() when the method is registered. Ignored if the method is + * an arrow function. + * * cache - the same cache configuration used in server.cache(). The generateTimeout option is required. + * * generateKey - a function used to generate a unique key (for caching) from the arguments passed to the method function (the flags argument is not passed as input). The server will + * automatically generate a unique key if the function's arguments are all of types 'string', 'number', or 'boolean'. However if the method uses other types of arguments, a key generation + * function must be provided which takes the same arguments as the function and returns a unique string (or null if no key can be generated). + * @return Return value: none. + * Method names can be nested (e.g. utils.users.get) which will automatically create the full path under server.methods (e.g. accessed via server.methods.utils.users.get). + * When configured with caching enabled, server.methods[name].cache is assigned an object with the following properties and methods: - await drop(...args) - a function that can be used to clear + * the cache for a given key. - stats - an object with cache statistics, see catbox for stats documentation. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servermethodname-method-options) + */ + method(name: string, method: ServerMethod, options?: ServerMethodOptions): void; + + /** + * Registers a server method function as described in server.method() using a configuration object where: + * @param methods - an object or an array of objects where each one contains: + * * name - the method name. + * * method - the method function. + * * options - (optional) settings. + * @return Return value: none. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servermethodmethods) + */ + method(methods: ServerMethodConfigurationObject | ServerMethodConfigurationObject[]): void; + + /** + * Sets the path prefix used to locate static resources (files and view templates) when relative paths are used where: + * @param relativeTo - the path prefix added to any relative file path starting with '.'. + * @return Return value: none. + * Note that setting a path within a plugin only applies to resources accessed by plugin methods. If no path is set, the server default route configuration files.relativeTo settings is used. The + * path only applies to routes added after it has been set. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverpathrelativeto) + */ + path(relativeTo: string): void; + + /** + * Registers a plugin where: + * @param plugins - one or an array of: + * * a plugin object. + * * an object with the following: + * * * plugin - a plugin object. + * * * options - (optional) options passed to the plugin during registration. + * * * once, routes - (optional) plugin-specific registration options as defined below. + * @param options - (optional) registration options (different from the options passed to the registration function): + * * once - if true, subsequent registrations of the same plugin are skipped without error. Cannot be used with plugin options. Defaults to false. If not set to true, an error will be thrown the + * second time a plugin is registered on the server. + * * routes - modifiers applied to each route added by the plugin: + * * * prefix - string added as prefix to any route path (must begin with '/'). If a plugin registers a child plugin the prefix is passed on to the child or is added in front of the + * child-specific prefix. + * * * vhost - virtual host string (or array of strings) applied to every route. The outer-most vhost overrides the any nested configuration. + * @return Return value: none. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-await-serverregisterplugins-options) + */ + /* tslint:disable-next-line:no-unnecessary-generics */ + register(plugin: ServerRegisterPluginObject, options?: ServerRegisterOptions): Promise; + /* tslint:disable-next-line:no-unnecessary-generics */ + register(plugins: ServerRegisterPluginObjectArray, options?: ServerRegisterOptions): Promise; + register(plugins: Array>, options?: ServerRegisterOptions): Promise; + /* tslint:disable-next-line:unified-signatures */ + register(plugins: Plugin | Array>, options?: ServerRegisterOptions): Promise; + + /** + * Adds a route where: + * @param route - a route configuration object or an array of configuration objects where each object contains: + * * path - (required) the absolute path used to match incoming requests (must begin with '/'). Incoming requests are compared to the configured paths based on the server's router configuration. + * The path can include named parameters enclosed in {} which will be matched against literal values in the request as described in Path parameters. + * * method - (required) the HTTP method. Typically one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', or 'OPTIONS'. Any HTTP method is allowed, except for 'HEAD'. Use '*' to match against any HTTP + * method (only when an exact match was not found, and any match with a specific method will be given a higher priority over a wildcard match). Can be assigned an array of methods which has + * the same result as adding the same route with different methods manually. + * * vhost - (optional) a domain string or an array of domain strings for limiting the route to only requests with a matching host header field. Matching is done against the hostname part of the + * header only (excluding the port). Defaults to all hosts. + * * handler - (required when handler is not set) the route handler function called to generate the response after successful authentication and validation. + * * options - additional route options. The options value can be an object or a function that returns an object using the signature function(server) where server is the server the route is being + * added to and this is bound to the current realm's bind option. + * * rules - route custom rules object. The object is passed to each rules processor registered with server.rules(). Cannot be used if route.options.rules is defined. + * @return Return value: none. + * Note that the options object is deeply cloned (with the exception of bind which is shallowly copied) and cannot contain any values that are unsafe to perform deep copy on. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverrouteroute) + */ + route(route: ServerRoute | ServerRoute[]): void; + + /** + * Defines a route rules processor for converting route rules object into route configuration where: + * @param processor - a function using the signature function(rules, info) where: + * * rules - + * * info - an object with the following properties: + * * * method - the route method. + * * * path - the route path. + * * * vhost - the route virtual host (if any defined). + * * returns a route config object. + * @param options - optional settings: + * * validate - rules object validation: + * * * schema - joi schema. + * * * options - optional joi validation options. Defaults to { allowUnknown: true }. + * Note that the root server and each plugin server instance can only register one rules processor. If a route is added after the rules are configured, it will not include the rules config. + * Routes added by plugins apply the rules to each of the parent realms' rules from the root to the route's realm. This means the processor defined by the plugin override the config generated + * by the root processor if they overlap. The route config overrides the rules config if the overlap. + * @return void + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverrulesprocessor-options) + */ + rules(processor: (rules: object, info: {method: string, path: string, vhost?: string}) => object, options?: {validate: object}): void; // TODO needs implementation + + /** + * Starts the server by listening for incoming requests on the configured port (unless the connection was configured with autoListen set to false). + * @return Return value: none. + * Note that if the method fails and throws an error, the server is considered to be in an undefined state and should be shut down. In most cases it would be impossible to fully recover as the + * various plugins, caches, and other event listeners will get confused by repeated attempts to start the server or make assumptions about the healthy state of the environment. It is + * recommended to abort the process when the server fails to start properly. If you must try to resume after an error, call server.stop() first to reset the server state. If a started server + * is started again, the second call to server.start() is ignored. No events will be emitted and no extension points invoked. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-await-serverstart) + */ + start(): Promise; + + /** + * HTTP state management uses client cookies to persist a state across multiple requests. + * @param name - the cookie name string. + * @param options - are the optional cookie settings + * @return Return value: none. + * State defaults can be modified via the server default state configuration option. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverstatename-options) + */ + state(name: string, options?: ServerStateCookieOptions): void; + + /** + * Stops the server's listener by refusing to accept any new connections or requests (existing connections will continue until closed or timeout), where: + * @param options - (optional) object with: + * * timeout - overrides the timeout in millisecond before forcefully terminating a connection. Defaults to 5000 (5 seconds). + * @return Return value: none. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-await-serverstopoptions) + */ + stop(options?: {timeout: number}): Promise; + + /** + * Returns a copy of the routing table where: + * @param host - (optional) host to filter routes matching a specific virtual host. Defaults to all virtual hosts. + * @return Return value: an array of routes where each route contains: + * * settings - the route config with defaults applied. + * * method - the HTTP method in lower case. + * * path - the route path. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servertablehost) + */ + table(host?: string): RequestRoute[]; +} + +/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Utils + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ + +/** + * User-extensible type for application specific state. + */ + /* tslint:disable-next-line:no-empty-interface */ +export interface ApplicationState { +} + +export type PeekListener = (chunk: string, encoding: string) => void; + +export namespace Json { + /** + * @see {@link https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter} + */ + type StringifyReplacer = ((key: string, value: any) => any) | Array<(string | number)> | undefined; + + /** + * Any value greater than 10 is truncated. + */ + type StringifySpace = number | string; + + /** + * For context [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionsjson) + */ + interface StringifyArguments { + /** the replacer function or array. Defaults to no action. */ + replacer?: StringifyReplacer; + /** number of spaces to indent nested object keys. Defaults to no indentation. */ + space?: StringifySpace; + /* string suffix added after conversion to JSON string. Defaults to no suffix. */ + suffix?: string; + /* calls Hoek.jsonEscape() after conversion to JSON string. Defaults to false. */ + escape?: boolean; + } +} + +export namespace Lifecycle { + /** + * Lifecycle methods are the interface between the framework and the application. Many of the request lifecycle steps: + * extensions, authentication, handlers, pre-handler methods, and failAction function values are lifecyle methods + * provided by the developer and executed by the framework. + * Each lifecycle method is a function with the signature await function(request, h, [err]) where: + * * request - the request object. + * * h - the response toolkit the handler must call to set a response and return control back to the framework. + * * err - an error object availble only when the method is used as a failAction value. + */ + type Method = (request: Request, h: ResponseToolkit, err?: Error) => ReturnValue; + + /** + * Each lifecycle method must return a value or a promise that resolves into a value. If a lifecycle method returns + * without a value or resolves to an undefined value, an Internal Server Error (500) error response is sent. + * The return value must be one of: + * - Plain value: null, string, number, boolean + * - Buffer object + * - Error object: plain Error OR a Boom object. + * - Stream object + * - any object or array + * - a toolkit signal: + * - a toolkit method response: + * - a promise object that resolve to any of the above values + * For more info please [See docs](https://github.com/hapijs/hapi/blob/master/API.md#lifecycle-methods) + */ + type ReturnValue = ReturnValueTypes | (Promise); + type ReturnValueTypes = + (null | string | number | boolean) | + (Buffer) | + (Error | Boom) | + (stream.Stream) | + (object | object[]) | + symbol | + ResponseToolkit; + + /** + * Various configuration options allows defining how errors are handled. For example, when invalid payload is received or malformed cookie, instead of returning an error, the framework can be + * configured to perform another action. When supported the failAction option supports the following values: + * * 'error' - return the error object as the response. + * * 'log' - report the error but continue processing the request. + * * 'ignore' - take no action and continue processing the request. + * * a lifecycle method with the signature async function(request, h, err) where: + * * * request - the request object. + * * * h - the response toolkit. + * * * err - the error object. + * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-failaction-configuration) + */ + type FailAction = 'error' | 'log' | 'ignore' | Method; +} + +export namespace Util { + interface Dictionary { + [key: string]: T; + } + + type HTTP_METHODS_PARTIAL_LOWERCASE = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'options'; + type HTTP_METHODS_PARTIAL = + 'GET' + | 'POST' + | 'PUT' + | 'PATCH' + | 'DELETE' + | 'OPTIONS' + | HTTP_METHODS_PARTIAL_LOWERCASE; + type HTTP_METHODS = 'HEAD' | 'head' | HTTP_METHODS_PARTIAL; +} diff --git a/types/hapi/v17/test/request/auth.ts b/types/hapi/v17/test/request/auth.ts new file mode 100644 index 0000000000..cb6c04ad28 --- /dev/null +++ b/types/hapi/v17/test/request/auth.ts @@ -0,0 +1,18 @@ +import { Request } from 'hapi'; + +declare module 'hapi' { + interface UserCredentials { + a: number; + } + + interface AppCredentials { + b: number; + } +} + +const req: Request = {} as any; +const scope: string[] | undefined = req.auth.credentials.scope; +const user = req.auth.credentials.user!; +console.log(user.a); +const app = req.auth.credentials.app!; +console.log(app.b); diff --git a/types/hapi/v17/test/request/catch-all.ts b/types/hapi/v17/test/request/catch-all.ts new file mode 100644 index 0000000000..3ee4e74c42 --- /dev/null +++ b/types/hapi/v17/test/request/catch-all.ts @@ -0,0 +1,14 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#catch-all-route +import { Request, ResponseToolkit, Server, ServerOptions } from "hapi"; + +const options: ServerOptions = { + port: 8000, +}; +const server = new Server(options); + +server.route({ method: '*', path: '/{p*}', handler(request, h) { + return h.response('The page was not found').code(404); +}}); + +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/request/event-types.ts b/types/hapi/v17/test/request/event-types.ts new file mode 100644 index 0000000000..4d4f3f01ca --- /dev/null +++ b/types/hapi/v17/test/request/event-types.ts @@ -0,0 +1,67 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-servereventevents +// https://github.com/hapijs/hapi/blob/master/API.md#-requestevents +import { Lifecycle, Request, Server, ServerOptions, ServerRoute } from "hapi"; +import * as Crypto from 'crypto'; + +const options: ServerOptions = { + port: 8000, +}; + +const serverRoute: ServerRoute = { + path: '/', + method: 'GET', + handler(request) { + return 'ok: ' + request.path; + } +}; + +const onRequest: Lifecycle.Method = (request, h) => { + /* + * Server events + */ + request.server.events.on('request', (request: Request, event: any, tags: any) => { + console.log(request.paramsArray); + console.log(event); + console.log(tags); + }); + + request.server.events.on('response', (request: Request) => { + console.log('Response sent for request: ' + request.path); + }); + + request.server.events.on('start', () => { + console.log('Server started'); + }); + + request.server.events.once('stop', () => { + console.log('Server stoped'); + }); + + /* + * Request events + */ + const hash = Crypto.createHash('sha1'); + + request.events.on("peek", (chunk) => { + hash.update(chunk); + }); + + request.events.once("finish", () => { + console.log(hash.digest('hex')); + }); + + request.events.once("disconnect", () => { + console.error('request aborted'); + }); + + return h.continue; +}; + +const server = new Server(options); +server.route(serverRoute); +server.ext('onRequest', onRequest, { + before: 'test', +}); + +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/request/get-log.ts b/types/hapi/v17/test/request/get-log.ts new file mode 100644 index 0000000000..3ba2658136 --- /dev/null +++ b/types/hapi/v17/test/request/get-log.ts @@ -0,0 +1,29 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-requestlogtags-data +import { Lifecycle, Request, ResponseToolkit, Server, ServerOptions, ServerRoute } from "hapi"; + +const options: ServerOptions = { + port: 8000, +}; + +const handlerFn: Lifecycle.Method = (request, h) => { + request.log(['test', 'error'], 'Test event'); + return 'path: ' + request.path; +}; + +const serverRoute: ServerRoute = { + path: '/', + method: 'GET', + handler: handlerFn +}; + +const server = new Server(options); +server.route(serverRoute); +server.start(); +console.log('Server started at: ' + server.info.uri); + +server.events.on('request', (request: Request, event: any, tags: any) => { + console.log(tags); + if (tags.error) { + console.log(event); + } +}); diff --git a/types/hapi/v17/test/request/methods.ts b/types/hapi/v17/test/request/methods.ts new file mode 100644 index 0000000000..22b58aac7f --- /dev/null +++ b/types/hapi/v17/test/request/methods.ts @@ -0,0 +1,4 @@ +import { Request } from 'hapi'; + +declare const req: Request; +const act: boolean = req.active(); diff --git a/types/hapi/v17/test/request/parameters.ts b/types/hapi/v17/test/request/parameters.ts new file mode 100644 index 0000000000..3f19a02d45 --- /dev/null +++ b/types/hapi/v17/test/request/parameters.ts @@ -0,0 +1,37 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-requestparams +import { Lifecycle, Request, ResponseToolkit, Server, ServerOptions, ServerRoute } from "hapi"; + +const options: ServerOptions = { + port: 8000, +}; + +// Example 1 +// http://localhost:8000/album-name/song-optional +const getAlbum: Lifecycle.Method = (request, h) => { + console.log(request.params); + return 'ok: ' + request.path; +}; +const serverRoute1: ServerRoute = { + path: '/{album}/{song?}', + method: 'GET', + handler: getAlbum +}; + +// Example 2 +// http://localhost:8000/person/rafael/fijalkowski +const getPerson: Lifecycle.Method = (request, h) => { + const nameParts = request.params.name.split('/'); + return { first: nameParts[0], last: nameParts[1] }; +}; +const serverRoute2: ServerRoute = { + path: '/person/{name*2}', + method: 'GET', + handler: getPerson +}; + +const server = new Server(options); +server.route(serverRoute1); +server.route(serverRoute2); + +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/request/query.ts b/types/hapi/v17/test/request/query.ts new file mode 100644 index 0000000000..090ab3ae8d --- /dev/null +++ b/types/hapi/v17/test/request/query.ts @@ -0,0 +1,26 @@ +// Added test in addition to docs, for request.query +import { Lifecycle, Request, RequestQuery, ResponseToolkit, Server, ServerOptions, ServerRoute } from "hapi"; + +const options: ServerOptions = { + port: 8000, +}; + +const handlerFn: Lifecycle.Method = (request, h) => { + const query1 = request.query as string; + console.log(query1); + + const query2 = request.query as RequestQuery; + // http://localhost:8000/?name=test + return `You asked for ${query2.name}`; +}; + +const serverRoute: ServerRoute = { + path: '/', + method: 'GET', + handler: handlerFn +}; + +const server = new Server(options); +server.route(serverRoute); +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/response/continue.ts b/types/hapi/v17/test/response/continue.ts new file mode 100644 index 0000000000..15a0f5e35b --- /dev/null +++ b/types/hapi/v17/test/response/continue.ts @@ -0,0 +1,25 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverextevent-method-options +import { Request, ResponseToolkit, Server, ServerOptions, ServerRoute } from "hapi"; + +const options: ServerOptions = { + port: 8000, +}; + +const serverRoute: ServerRoute = { + path: '/test', + method: 'GET', + handler(request, h) { + return 'ok: ' + request.path; + } +}; + +const server = new Server(options); +server.route(serverRoute); + +server.ext("onRequest", (request, h) => { + request.setUrl('/test'); + return h.continue; +}); + +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/response/error.ts b/types/hapi/v17/test/response/error.ts new file mode 100644 index 0000000000..513f5fbbe5 --- /dev/null +++ b/types/hapi/v17/test/response/error.ts @@ -0,0 +1,30 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#errors +import { Request, ResponseToolkit, Server, ServerOptions, ServerRoute } from "hapi"; +import * as Boom from "boom"; + +const options: ServerOptions = { + port: 8000, +}; + +const serverRoutes: ServerRoute[] = [ + { + path: '/badRequest', + method: 'GET', + handler(request, h) { + throw Boom.badRequest('Unsupported parameter'); + } + }, + { + path: '/internal', + method: 'GET', + handler(request, h) { + throw new Error('unexpect error'); + } + }, +]; + +const server = new Server(options); +server.route(serverRoutes); + +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/response/redirect.ts b/types/hapi/v17/test/response/redirect.ts new file mode 100644 index 0000000000..dc1b904ce3 --- /dev/null +++ b/types/hapi/v17/test/response/redirect.ts @@ -0,0 +1,20 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-hredirecturi +import { Request, ResponseToolkit, Server, ServerOptions, ServerRoute } from "hapi"; + +const options: ServerOptions = { + port: 8000, +}; + +const serverRoute: ServerRoute = { + path: '/', + method: 'GET', + handler(request, h) { + return h.redirect('http://example.com'); + } +}; + +const server = new Server(options); +server.route(serverRoute); + +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/response/response-events.ts b/types/hapi/v17/test/response/response-events.ts new file mode 100644 index 0000000000..ec1b070b18 --- /dev/null +++ b/types/hapi/v17/test/response/response-events.ts @@ -0,0 +1,28 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-responseevents +import { Lifecycle, Request, ResponseObject, ResponseToolkit, Server, ServerOptions, ServerRoute } from "hapi"; +import * as Crypto from "crypto"; + +const preResponse: Lifecycle.Method = (request, h) => { + // In onPreResponse, the response object will be defined. + const response = request.response!; + + const hash = Crypto.createHash('sha1'); + response.events.on('peek', (chunk, encoding) => { + hash.update(chunk); + }); + + response.events.once('finish', () => { + console.log(hash.digest('hex')); + }); + + return h.continue; +}; + +const server = new Server({ + port: 8000, +}); + +server.ext('onPreResponse', preResponse); + +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/response/response.ts b/types/hapi/v17/test/response/response.ts new file mode 100644 index 0000000000..368b6fa80b --- /dev/null +++ b/types/hapi/v17/test/response/response.ts @@ -0,0 +1,36 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-hresponsevalue +import { Request, ResponseToolkit, Server, ServerOptions, ServerRoute } from "hapi"; + +const options: ServerOptions = { + port: 8000, +}; + +const serverRoutes: ServerRoute[] = [ + // Detailed notation + { + path: '/test1', + method: 'GET', + handler(request, h) { + const response = h.response('success'); + response.type('text/plain'); + response.header('X-Custom', 'some-value'); + return response; + } + }, + // Chained notation + { + path: '/test2', + method: 'GET', + handler(request, h) { + return h.response('success') + .type('text/plain') + .header('X-Custom', 'some-value'); + } + }, +]; + +const server = new Server(options); +server.route(serverRoutes); + +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/route/adding-routes.ts b/types/hapi/v17/test/route/adding-routes.ts new file mode 100644 index 0000000000..ac4c895842 --- /dev/null +++ b/types/hapi/v17/test/route/adding-routes.ts @@ -0,0 +1,38 @@ +// from https://hapijs.com/tutorials/getting-started#adding-routes +import { Request, ResponseToolkit, Server, ServerOptions, ServerRoute } from "hapi"; + +const options: ServerOptions = { + port: 8000, +}; + +const serverRoute: ServerRoute = { + path: '/', + method: 'GET', + handler(request, h) { + return 'ok: ' + request.path; + } +}; + +const serverRoutes: ServerRoute[] = [ + { + path: '/test1', + method: 'GET', + handler(request, h) { + return 'ok: ' + request.path; + } + }, + { + path: '/test2', + method: 'GET', + handler(request, h) { + return 'ok: ' + request.path; + } + }, +]; + +const server = new Server(options); +server.route(serverRoute); +server.route(serverRoutes); + +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/route/config.ts b/types/hapi/v17/test/route/config.ts new file mode 100644 index 0000000000..8cebaec269 --- /dev/null +++ b/types/hapi/v17/test/route/config.ts @@ -0,0 +1,52 @@ +import { Request, ResponseToolkit, RouteOptions, Server, ServerOptions, ServerRoute } from "hapi"; + +const options: ServerOptions = { + port: 8000, +}; + +// different methods +const routeConfig: ServerRoute = { + path: '/signin', + method: 'PUT', + vhost: 'site.coms', +}; +const routeConfigTest1: ServerRoute = { + path: '/signin', + method: '*' +}; +const routeConfigTest2: ServerRoute = { + path: '/signin', + method: ['OPTIONS', '*'] +}; + +// different handlers +const routeConfigTest3: ServerRoute = { + path: '/signin', + method: 'PUT', + handler(request, h) { + return 'ok'; + } +}; +const routeConfigTest4: ServerRoute = { + path: '/signin', + method: 'PUT', + handler(request, h) { + return 'ok'; + } +}; + +const server = new Server(options); +server.route(routeConfig); + +// Handler in config +const user: RouteOptions = { + cache: { expiresIn: 5000 }, + handler(request, h) { + return { name: 'John' }; + } +}; + +server.route({method: 'GET', path: '/user', options: user }); + +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/route/ext.ts b/types/hapi/v17/test/route/ext.ts new file mode 100644 index 0000000000..b8dff44699 --- /dev/null +++ b/types/hapi/v17/test/route/ext.ts @@ -0,0 +1,22 @@ +import { Server } from "hapi"; + +const server = new Server(); + +server.route({ + method: 'get', + path: "/test", + options: { + ext: { + onPreResponse: { + method(_request, h) { + return h.continue; + }, + }, + onPostHandler: [{ + method(_request, h) { + return h.continue; + }, + }], + } + } +}); diff --git a/types/hapi/v17/test/route/handler.ts b/types/hapi/v17/test/route/handler.ts new file mode 100644 index 0000000000..6fced10078 --- /dev/null +++ b/types/hapi/v17/test/route/handler.ts @@ -0,0 +1,9 @@ +import { Lifecycle, Request, ResponseToolkit } from "hapi"; + +const handler: Lifecycle.Method = (request, h) => { + return 'success'; +}; + +const strictHandler: Lifecycle.Method = (request, h) => { + return 123; +}; diff --git a/types/hapi/v17/test/route/route-options-pre.ts b/types/hapi/v17/test/route/route-options-pre.ts new file mode 100644 index 0000000000..897f4a8ef5 --- /dev/null +++ b/types/hapi/v17/test/route/route-options-pre.ts @@ -0,0 +1,42 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionspre +import { Lifecycle, Request, ResponseToolkit, Server } from "hapi"; + +const server = new Server({ + port: 8000, +}); + +const pre1: Lifecycle.Method = (request, h) => { + return 'Hello'; +}; + +const pre2: Lifecycle.Method = (request, h) => { + return 'World'; +}; + +const pre3: Lifecycle.Method = (request, h) => { + return `request.pre.m1 request.pre.m2`; +}; + +server.route({ + method: 'GET', + path: '/', + options: { + pre: [ + [ + // m1 and m2 executed in parallel + { method: pre1, assign: 'm1' }, + { method: pre2, assign: 'm2' } + ], + { method: pre3, assign: 'm3' }, + ], + handler(request, h) { + return request.pre.m3 + '!\n'; + } + } +}); + +server.start(); + +server.events.on('start', () => { + console.log('Server started at: ' + server.info.uri); +}); diff --git a/types/hapi/v17/test/route/route-options.ts b/types/hapi/v17/test/route/route-options.ts new file mode 100644 index 0000000000..438ef77d62 --- /dev/null +++ b/types/hapi/v17/test/route/route-options.ts @@ -0,0 +1,193 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#route-options +import { + Lifecycle, + Request, + ResponseToolkit, + RouteOptions, + RouteOptionsAccess, + RouteOptionsCors, + RouteOptionsPayload, + RouteOptionsResponse, + RouteOptionsValidate, + Server, + RouteOptionsSecureObject +} from "hapi"; + +const routeOptionsAccess: RouteOptionsAccess = { + access: [ + { + scope: false + }, + { + entity: 'user' + } + ], + scope: false, + entity: 'user', + mode: 'optional', + payload: 'optional', + strategies: ['', ''], + strategy: '' +}; + +const corsOption: RouteOptionsCors = { + origin: 'ignore', + maxAge: 5000, + headers: ['test', 'test', 'test'], + additionalHeaders: ['test', 'test', 'test'], + exposedHeaders: ['test', 'test', 'test'], + additionalExposedHeaders: ['test', 'test', 'test'], + credentials: false +}; + +const payloadOptions: RouteOptionsPayload = { + allow: 'string', + compression: { + test1: { + test: 2 + } + }, + defaultContentType: 'application/json', + failAction(request, h) { + return 'ok: ' + request.path; + }, + maxBytes: 1048576, + multipart: { + output: 'annotated' + }, + output: 'stream', + override: '', + parse: 'gunzip', + timeout: 5000, + uploads: 'dir/' +}; + +const pre1: Lifecycle.Method = (request, h) => { + return 'Hello'; +}; + +const pre2: Lifecycle.Method = (request, h) => { + return 'World'; +}; + +const pre3: Lifecycle.Method = (request, h) => { + return `request.pre.m1 request.pre.m2`; +}; + +const routeOptionsResponse: RouteOptionsResponse = { + emptyStatusCode: 200, + failAction(request, h) { + return 'ok: ' + request.path; + }, + modify: false, + options: undefined, + ranges: true, + sample: 100, + schema: true, + status: { + 200: true, + 302: true, + 404: false, + }, +}; + +const routeOptionSecure: RouteOptionsSecureObject = { + referrer: 'origin', + noSniff: true, + xframe: "deny", + hsts: { + includeSubdomains: true, + maxAge: 1111, + preload: false, + }, + noOpen: false, + xss: true, +}; + +const routeOptionsValidate: RouteOptionsValidate = { + errorFields: {}, + failAction(request, h) { + return 'ok: ' + request.path; + }, + headers: false, + options: {}, + params: false, + payload: true, + query: true, +}; + +declare module 'hapi' { + interface RouteOptionsApp { + one: number; + two: string; + } +} + +const routeOptions: RouteOptions = { + app: { + one: 1, + two: "2" + }, + auth: routeOptionsAccess, + bind: null, + cache: { + privacy: 'default', + statuses: [200], + otherwise: 'no-cache' + }, + compression: { + test1: { + test: 2 + } + }, + cors: corsOption, + description: 'description here', + ext: undefined, + files: { relativeTo: '.' }, + handler(request, h) { + return 'ok: ' + request.path; + }, + id: 'test', + isInternal: false, + json: undefined, + jsonp: 'callback', + log: { collect: false }, + notes: ['test', 'test', 'test'], + payload: payloadOptions, + plugins: { + plugin1: {}, + plugin2: {}, + }, + pre: [ + [ + // m1 and m2 executed in parallel + { method: pre1, assign: 'm1' }, + { method: pre2, assign: 'm2' } + ], + { method: pre3, assign: 'm3' }, + ], + response: routeOptionsResponse, + security: false, + state: { + parse: true, + failAction(request, h) { + return 'ok: ' + request.path; + }, + }, + tags: ['test', 'test', 'test'], + timeout: { + server: 10000, + socket: false + }, + validate: routeOptionsValidate +}; + +const server = new Server({ + port: 8000, + routes: routeOptions +}); +server.start(); + +server.events.on('start', () => { + console.log('Server started at: ' + server.info.uri); +}); diff --git a/types/hapi/v17/test/route/validation.ts b/types/hapi/v17/test/route/validation.ts new file mode 100644 index 0000000000..2151371c5f --- /dev/null +++ b/types/hapi/v17/test/route/validation.ts @@ -0,0 +1,48 @@ +// from https://hapijs.com/tutorials/validation?lang=en_US +import { Request, ResponseToolkit, RouteOptions, Server, ServerOptions, ServerRoute } from "hapi"; +import * as Joi from "joi"; + +const options: ServerOptions = { + port: 8000, +}; + +const routeOptions: RouteOptions = { + validate: { + payload: { + id: Joi.string().uuid().required(), + name: Joi.object({ + firstName: Joi.string().required(), + lastName: Joi.string().allow(null) + }), + firstName: Joi.ref("name.firstName") + }, + params: { + name: Joi.string().min(3).max(10), + nameRef: Joi.ref("name") + } + }, + response: { + schema: Joi.object({ + a: Joi.string(), + b: Joi.object({ + c: Joi.number() + }), + d: Joi.ref("b.c") + }) + } +}; + +const serverRoute: ServerRoute = { + path: '/', + method: 'GET', + handler(request, h) { + return 'ok: ' + request.path; + }, + options: routeOptions +}; + +const server = new Server(options); +server.route(serverRoute); + +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/server/server-app.ts b/types/hapi/v17/test/server/server-app.ts new file mode 100644 index 0000000000..69bac86e2f --- /dev/null +++ b/types/hapi/v17/test/server/server-app.ts @@ -0,0 +1,29 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverapp +import { Request, ResponseToolkit, Server, ServerOptions, ServerRoute } from "hapi"; + +const options: ServerOptions = { + port: 8000, +}; + +declare module "hapi" { + // Demonstrate augmenting the application state. + interface ApplicationState { + key?: string; + } +} + +const server = new Server(options); +server.app.key = 'value2'; + +const serverRoute: ServerRoute = { + path: '/', + method: 'GET', + handler(request, h) { + return 'key: ' + request.server.app.key; + } +}; + +server.route(serverRoute); + +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/server/server-auth-api.ts b/types/hapi/v17/test/server/server-auth-api.ts new file mode 100644 index 0000000000..4508c641c9 --- /dev/null +++ b/types/hapi/v17/test/server/server-auth-api.ts @@ -0,0 +1,40 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverauthapi +import { + Server, + ServerAuthScheme, +} from "hapi"; +import * as Boom from "boom"; + +declare module 'hapi' { + interface ServerAuthSchemeObjectApi { + settings: { + x: number; + }; + } +} + +const scheme: ServerAuthScheme = (server, options) => { + return { + api: { + settings: { + x: 5 + } + }, + authenticate(request, h) { + const authorization = request.headers.authorization; + if (!authorization) { + throw Boom.unauthorized(null, 'Custom'); + } + return h.authenticated({ credentials: { user: { a: 1 } } }); + } + }; +}; + +const server = new Server({ + port: 8000, +}); +server.auth.scheme('custom', scheme); +server.auth.strategy('default', 'custom'); +server.start(); + +console.log(server.auth.api.default.settings.x); // 5 diff --git a/types/hapi/v17/test/server/server-auth-default.ts b/types/hapi/v17/test/server/server-auth-default.ts new file mode 100644 index 0000000000..0a2da56efc --- /dev/null +++ b/types/hapi/v17/test/server/server-auth-default.ts @@ -0,0 +1,41 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverauthdefaultoptions +// https://github.com/hapijs/hapi/blob/master/API.md#-serverauthschemename-scheme +import { Request, ResponseToolkit, Server, ServerAuthScheme, ServerAuthSchemeOptions } from "hapi"; +import * as Boom from "boom"; + +declare module 'hapi' { + interface UserCredentials { + a: number; + } +} + +const server = new Server({ + port: 8000, +}); + +const scheme: ServerAuthScheme = (server, options) => { + return { + authenticate(request, h) { + const req = request.raw.req; + const authorization = req.headers.authorization; + if (!authorization) { + throw Boom.unauthorized(null, 'Custom'); + } + return h.authenticated({ credentials: { user: { a: 1 }, scope: ['test'] } }); + } + }; +}; + +server.auth.scheme('custom', scheme); +server.auth.strategy('default', 'custom'); +server.auth.default('default'); + +server.route({ + method: 'GET', + path: '/', + handler(request, h) { + return request.auth.credentials.user || 'not authed'; + } +}); + +server.start(); diff --git a/types/hapi/v17/test/server/server-auth-test.ts b/types/hapi/v17/test/server/server-auth-test.ts new file mode 100644 index 0000000000..4e2a175e1a --- /dev/null +++ b/types/hapi/v17/test/server/server-auth-test.ts @@ -0,0 +1,45 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-await-serverauthteststrategy-request +// https://github.com/hapijs/hapi/blob/master/API.md#-serverauthschemename-scheme +import { Request, ResponseToolkit, Server, ServerAuthScheme, ServerAuthSchemeOptions } from "hapi"; +import * as Boom from "boom"; + +declare module 'hapi' { + interface AuthCredentials { + name?: string; + } +} + +const server = new Server({ + port: 8000, +}); + +const scheme: ServerAuthScheme = (server, options) => { + return { + authenticate(request, h) { + const req = request.raw.req; + const authorization = req.headers.authorization; + if (!authorization) { + throw Boom.unauthorized(null, 'Custom'); + } + return h.authenticated({ credentials: { name: 'john', } }); + } + }; +}; + +server.auth.scheme('custom', scheme); +server.auth.strategy('default', 'custom'); + +server.route({ + method: 'GET', + path: '/', + handler: async (request: Request, h: ResponseToolkit) => { + try { + const credentials = await request.server.auth.test('default', request); + return { status: true, user: credentials.name }; + } catch (err) { + return { status: false }; + } + } +}); + +server.start(); diff --git a/types/hapi/v17/test/server/server-auth-verify.ts b/types/hapi/v17/test/server/server-auth-verify.ts new file mode 100644 index 0000000000..ec788fcb59 --- /dev/null +++ b/types/hapi/v17/test/server/server-auth-verify.ts @@ -0,0 +1,26 @@ +import { Request, Server, RequestAuth } from "hapi"; +import * as Boom from "boom"; + +const server = new Server({ + port: 8000, +}); + +server.auth.scheme('custom', () => ({ + authenticate() { + throw Boom.unauthorized(null, 'hurr'); + }, + async verify(_auth: RequestAuth) { + throw Boom.unauthorized(null, 'durr'); + } +})); +server.auth.strategy('default', 'custom'); + +server.route({ + method: 'GET', + path: '/', + async handler(request: Request) { + request.server.auth.verify(request); + } +}); + +server.start(); diff --git a/types/hapi/v17/test/server/server-bind.ts b/types/hapi/v17/test/server/server-bind.ts new file mode 100644 index 0000000000..1fbd37c4c2 --- /dev/null +++ b/types/hapi/v17/test/server/server-bind.ts @@ -0,0 +1,27 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverbindcontext +import { Lifecycle, Plugin, Request, ResponseToolkit, Server, ServerRegisterOptions } from "hapi"; + +const server = new Server({ + port: 8000, +}); +const handler: Lifecycle.Method = (request, h) => { + return h.context.message; // Or h.context.message +}; + +const plugin: Plugin = { + name: 'example', + register: async (server, options) => { + const bind = { + message: 'hello' + }; + server.bind(bind); + server.route({ method: 'GET', path: '/', handler }); + } +}; + +server.start(); +server.register(plugin); + +server.events.on('start', () => { + console.log('Server started at: ' + server.info.uri); +}); diff --git a/types/hapi/v17/test/server/server-cache-provision.ts b/types/hapi/v17/test/server/server-cache-provision.ts new file mode 100644 index 0000000000..8c28ca48de --- /dev/null +++ b/types/hapi/v17/test/server/server-cache-provision.ts @@ -0,0 +1,19 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-await-servercacheprovisionoptions +import { Server } from "hapi"; +import * as catbox from "catbox"; + +const server = new Server({ + port: 8000, +}); +server.initialize(); +server.cache.provision({engine: require('catbox-memory'), name: 'countries' }); + +const cache = server.cache({segment: 'countries', cache: 'countries', expiresIn: 60 * 60 * 1000 }); +cache.set('norway', 'oslo', 10 * 1000).then(() => {}); +const value = cache.get('norway').then(() => {}); + +server.start(); + +server.events.on('start', () => { + console.log('Server started at: ' + server.info.uri); +}); diff --git a/types/hapi/v17/test/server/server-cache.ts b/types/hapi/v17/test/server/server-cache.ts new file mode 100644 index 0000000000..0872b287df --- /dev/null +++ b/types/hapi/v17/test/server/server-cache.ts @@ -0,0 +1,23 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-servercacheoptions +import { Server, ServerOptionsCache } from "hapi"; +import * as catbox from "catbox"; + +const server = new Server({ + port: 8000, +}); + +const catboxOptions: ServerOptionsCache = { + segment: 'countries', + expiresIn: 60 * 60 * 1000 +}; +const cache = server.cache(catboxOptions); +cache.set('norway', 'oslo', 10 * 1000).then(() => {}); + +const value = cache.get('norway').then(() => {}); +console.log("Value: " + value); + +server.start(); + +server.events.on('start', () => { + console.log('Server started at: ' + server.info.uri); +}); diff --git a/types/hapi/v17/test/server/server-control.ts b/types/hapi/v17/test/server/server-control.ts new file mode 100644 index 0000000000..8b145f1388 --- /dev/null +++ b/types/hapi/v17/test/server/server-control.ts @@ -0,0 +1,3 @@ +import { Server } from "hapi"; + +new Server().control(new Server()); diff --git a/types/hapi/v17/test/server/server-decoder.ts b/types/hapi/v17/test/server/server-decoder.ts new file mode 100644 index 0000000000..965745ee7c --- /dev/null +++ b/types/hapi/v17/test/server/server-decoder.ts @@ -0,0 +1,8 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverdecoderencoding-decoder +import { Server } from "hapi"; +import * as Zlib from "zlib"; + +const server = new Server({ port: 80, routes: { payload: { compression: { special: { chunkSize: 16 * 1024 } } } } }); +server.decoder('special', (options) => Zlib.createGunzip(options)); + +server.start(); diff --git a/types/hapi/v17/test/server/server-decorations.ts b/types/hapi/v17/test/server/server-decorations.ts new file mode 100644 index 0000000000..7c060735a9 --- /dev/null +++ b/types/hapi/v17/test/server/server-decorations.ts @@ -0,0 +1,111 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverdecoratetype-property-method-options +import { Request, ResponseToolkit, Server } from "hapi"; + +declare module 'hapi' { + interface HandlerDecorations { + test?: { + test: number; + }; + } +} + +// Test basic types. + +const server = new Server({ + port: 8000, +}); + +server.start(); +server.decorate('toolkit', 'success', function() { + return this.response({ status: 'ok' }); +}); +server.decorate('handler', 'test', (route, options) => (req, h) => 123); +server.route({ + method: 'GET', + path: '/', + handler: { + test: { + test: 123, + }, + asd: 1, + } +}); + +console.log(server.decorations.toolkit); + +// Test decorators with additional arguments + +declare module 'hapi' { + interface Server { + withParams(x: number, y: string): string; + } + + interface ResponseToolkit { + withParams(x: number, y: string): string; + } +} + +function decorateServerWithParams(this: Server, x: number, y: string) { + return `${x} ${y}`; +} + +server.decorate('server', 'withParams', decorateServerWithParams); +server.withParams(1, "one"); + +function decorateToolkitWithParams(this: ResponseToolkit, x: number, y: string) { + return `${x} ${y}`; +} + +server.decorate('toolkit', 'withParams', decorateToolkitWithParams); + +server.decorate('toolkit', Symbol('hi'), decorateToolkitWithParams); + +server.route({ + method: 'GET', + path: '/toolkitWithParams', + handler: (r, h) => { + return h.withParams(1, "one"); + } +}); + +// Test request + apply option types + +declare module 'hapi' { + interface Request { + withApply(x: string, y: number): string; + } +} + +function decorateRequestWithApply(request: Request) { + return (x: string, y: number) => { + return `${x} ${y}`; + }; +} + +server.decorate('request', 'withApply', decorateRequestWithApply, {apply: true}); + +server.route({ + method: 'GET', + path: '/requestWithApply', + handler: (r, h) => { + return r.withApply("one", 1); + } +}); + +// Test extend option type + +declare module 'hapi' { + interface Server { + withExtend(x: string, y: number): string; + } +} + +const decorateServerWithExtend = (existing: () => void) => { + return (x: string, y: number) => { + existing(); + return `${x} ${y}`; + }; +}; + +server.decorate('server', 'withExtend', decorateServerWithExtend, {extend: true}); +server.withExtend("one", 1); diff --git a/types/hapi/v17/test/server/server-encoder.ts b/types/hapi/v17/test/server/server-encoder.ts new file mode 100644 index 0000000000..dd9f12f4db --- /dev/null +++ b/types/hapi/v17/test/server/server-encoder.ts @@ -0,0 +1,8 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverencoderencoding-encoder +import { Server } from "hapi"; +import * as Zlib from "zlib"; + +const server = new Server({ port: 80, routes: { payload: { compression: { special: { chunkSize: 16 * 1024 } } } } }); +server.encoder('special', (options) => Zlib.createGzip(options)); + +server.start(); diff --git a/types/hapi/v17/test/server/server-events-once.ts b/types/hapi/v17/test/server/server-events-once.ts new file mode 100644 index 0000000000..a4903ee6dc --- /dev/null +++ b/types/hapi/v17/test/server/server-events-once.ts @@ -0,0 +1,31 @@ +// from https://github.com/hapijs/hapi/blob/master/API.md#-servereventsoncecriteria-listener +import { Request, ResponseToolkit, Server, ServerRoute } from "hapi"; + +const serverRoute: ServerRoute = { + path: '/', + method: 'GET', + handler(request, h) { + return 'oks: ' + request.path; + } +}; + +declare module 'hapi' { + interface ServerEvents { + once(event: 'test1', listener: (update: string) => void): this; + once(event: 'test2', listener: (...updates: string[]) => void): this; + } +} + +const server = new Server({ + port: 8000, +}); +server.route(serverRoute); +server.event('test1'); +server.event('test2'); +server.events.once('test1', update => { console.log(update); }); +server.events.once('test2', (...args) => { console.log(args); }); +server.events.emit('test1', 'hello-1'); +server.events.emit('test2', 'hello-2'); // Ignored + +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/server/server-events.ts b/types/hapi/v17/test/server/server-events.ts new file mode 100644 index 0000000000..4e6d8103f1 --- /dev/null +++ b/types/hapi/v17/test/server/server-events.ts @@ -0,0 +1,24 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-servereventevents +import { Server, ServerEvents } from "hapi"; +import Podium = require('podium'); +import 'hapi/definitions/server/server'; + +declare module 'hapi' { + interface ServerEvents { + on(event: 'test', listener: (update: string) => void): this; + } +} + +const server = new Server({ + port: 8000, +}); + +server.events.on('route', route => { + console.log(route.path, route.vhost, route.realm, route.method, route.settings, route.fingerprint); +}); + +server.event('test'); +server.events.on('test', (update: any) => console.log(update)); +server.events.emit('test', 'hello'); + +server.start(); diff --git a/types/hapi/v17/test/server/server-expose.ts b/types/hapi/v17/test/server/server-expose.ts new file mode 100644 index 0000000000..43d6cfdaa6 --- /dev/null +++ b/types/hapi/v17/test/server/server-expose.ts @@ -0,0 +1,38 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverplugins +import { Plugin, Server, ServerRegisterOptions } from "hapi"; + +declare module 'hapi' { + interface PluginProperties { + example1: { + util(): void; + }; + example2: { + util(): void; + }; + } +} + +const plugin1: Plugin = { + name: 'example1', + async register(server: Server, options: ServerRegisterOptions) { + server.expose('util', () => console.log('something')); + } +}; + +const plugin2: Plugin = { + name: 'example2', + async register(server: Server, options: ServerRegisterOptions) { + server.expose('util', () => console.log('something')); + } +}; + +const server = new Server({ + port: 8000, +}); + +server.start(); +server.register(plugin1); +server.register(plugin2); + +server.plugins.example1.util(); +server.plugins.example2.util(); diff --git a/types/hapi/v17/test/server/server-info.ts b/types/hapi/v17/test/server/server-info.ts new file mode 100644 index 0000000000..58045b19da --- /dev/null +++ b/types/hapi/v17/test/server/server-info.ts @@ -0,0 +1,10 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverinfo +import { Server } from "hapi"; + +const server = new Server({ + port: 8000, +}); +server.start(); + +console.log(server.info); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/server/server-inject.ts b/types/hapi/v17/test/server/server-inject.ts new file mode 100644 index 0000000000..a2ae777a71 --- /dev/null +++ b/types/hapi/v17/test/server/server-inject.ts @@ -0,0 +1,32 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-await-serverinjectoptions +import { Request, ResponseToolkit, Server, ServerRoute } from "hapi"; + +const server = new Server({ + port: 8000, +}); + +const serverRoute: ServerRoute = { + path: '/', + method: 'GET', + handler(request, h) { + return 'Success!'; + } +}; + +server.route(serverRoute); +server.start(); + +server.inject('/').then(res => console.log(res.result)); + +declare module 'hapi' { + interface ApplicationState { + injectState?: number; + } +} + +server.inject({ + url: "test", + app: { + injectState: 1 + } +}); diff --git a/types/hapi/v17/test/server/server-listener.ts b/types/hapi/v17/test/server/server-listener.ts new file mode 100644 index 0000000000..160821f505 --- /dev/null +++ b/types/hapi/v17/test/server/server-listener.ts @@ -0,0 +1,14 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverlistener +import { Server } from "hapi"; +import * as SocketIO from "socket.io"; + +const server = new Server({ + port: 8000, +}); + +const io = SocketIO.listen(server.listener); +io.sockets.on('connection', (socket) => { + socket.emit('welcome'); +}); + +server.start(); diff --git a/types/hapi/v17/test/server/server-load.ts b/types/hapi/v17/test/server/server-load.ts new file mode 100644 index 0000000000..8ac89fa006 --- /dev/null +++ b/types/hapi/v17/test/server/server-load.ts @@ -0,0 +1,17 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverload +import { Server } from "hapi"; + +const server = new Server({ + port: 8000, + load: { + sampleInterval: 1000, + concurrent: 123, + } +}); +server.start(); + +setTimeout(() => { + console.log(server.load.rss); + console.log(server.load.eventLoopDelay); + console.log(server.load.heapUsed); +}, 5 * 1000); diff --git a/types/hapi/v17/test/server/server-lookup.ts b/types/hapi/v17/test/server/server-lookup.ts new file mode 100644 index 0000000000..2bbaf5713b --- /dev/null +++ b/types/hapi/v17/test/server/server-lookup.ts @@ -0,0 +1,20 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverlookupid +import { RequestRoute, Server } from "hapi"; + +const server = new Server({ + port: 8000, +}); + +server.route({ + path: '/', + method: 'GET', + options: { + id: 'root', + handler: () => 'ok' + } +}); + +const route: RequestRoute | null = server.lookup('root'); +console.log(route); + +server.start(); diff --git a/types/hapi/v17/test/server/server-match.ts b/types/hapi/v17/test/server/server-match.ts new file mode 100644 index 0000000000..5fc8605ad4 --- /dev/null +++ b/types/hapi/v17/test/server/server-match.ts @@ -0,0 +1,23 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-servermatchmethod-path-host +import { RequestRoute, Server } from "hapi"; + +const server = new Server({ + port: 8000, +}); + +server.route({ + path: '/', + method: 'GET', + options: { + id: 'root', + handler: () => 'ok' + } +}); + +const route: RequestRoute | null = server.match('get', '/'); + +if (route !== null) { + console.log(route.path); +} + +server.start(); diff --git a/types/hapi/v17/test/server/server-method.ts b/types/hapi/v17/test/server/server-method.ts new file mode 100644 index 0000000000..39c3fdb9d7 --- /dev/null +++ b/types/hapi/v17/test/server/server-method.ts @@ -0,0 +1,25 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-servermethodmethods +import { Server, ServerMethodConfigurationObject } from "hapi"; + +const server = new Server({ + port: 8000, +}); +server.start(); + +const add = (a: any, b: any): number => { + return a + b; +}; + +const methodObject: ServerMethodConfigurationObject = { + name: 'sum', + method: add, + options: { + cache: { + expiresIn: 2000, + generateTimeout: 100 + }, + generateKey: (a: string | undefined) => a === undefined ? null : a + } +}; + +server.method(methodObject); diff --git a/types/hapi/v17/test/server/server-methods.ts b/types/hapi/v17/test/server/server-methods.ts new file mode 100644 index 0000000000..f9a2d08e6c --- /dev/null +++ b/types/hapi/v17/test/server/server-methods.ts @@ -0,0 +1,11 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-servermethods +import { Server } from "hapi"; + +const server = new Server({ + port: 8000, +}); +server.start(); + +server.method('add', (a, b) => (a + b)); +const result = server.methods.add(1, 2); // 3 +console.log(result); diff --git a/types/hapi/v17/test/server/server-mime.ts b/types/hapi/v17/test/server/server-mime.ts new file mode 100644 index 0000000000..3a50da2154 --- /dev/null +++ b/types/hapi/v17/test/server/server-mime.ts @@ -0,0 +1,22 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-servermime +import { Server, ServerOptions } from "hapi"; + +const options: ServerOptions = { + port: 8000, + mime: { + override: { + 'node/module': { + source: 'steve', + compressible: false, + extensions: ['node', 'module', 'npm'], + type: 'node/module' + } + } + } +}; + +const server = new Server(options); +console.log(server.mime.path('code.js').type); // 'application/javascript' +console.log(server.mime.path('file.npm').type); // 'node/module' + +server.start(); diff --git a/types/hapi/v17/test/server/server-options.ts b/types/hapi/v17/test/server/server-options.ts new file mode 100644 index 0000000000..f72f98a55e --- /dev/null +++ b/types/hapi/v17/test/server/server-options.ts @@ -0,0 +1,114 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-server-options +import { Plugin, RouteOptions, Server, ServerOptions, ServerRegisterOptions } from "hapi"; +import { MimosOptions, MimosOptionsValue } from "mimos"; + +const mimeOptions: MimosOptions = { + override: { + 'node/module': { + source: 'iana', + compressible: true, + extensions: ['node', 'modsule', 'npm'], + type: 'node/module' + }, + 'application/javascript': { + source: 'iana', + charset: 'UTF-8', + compressible: true, + extensions: ['js', 'javascript'], + type: 'text/javascript' + }, + 'text/html': { + predicate: (mime: MimosOptionsValue) => { + if (1 === 1) { + // mime.foo = 'test'; + } else { + // mime.foo = 'bar'; + } + return mime; + } + } + } +}; + +const plugin: Plugin = { + name: 'example', + register: async (server: Server, options: ServerRegisterOptions) => { + server.expose('key', 'value'); + server.plugins.example.other = 'other'; + console.log(server.plugins.example.key); // 'value' + console.log(server.plugins.example.other); // 'other' + } +}; + +const routeOptions: RouteOptions = { + compression: { + test: { + some: 'option' + } + }, + files: { + relativeTo: __dirname + }, + cors: { + origin: ['http://test.example.com', 'http://www.example.com', 'http://*.a.com'] + }, +}; + +declare module 'hapi' { + interface ServerOptionsApp { + key1?: string; + key2?: string; + any_thing?: string; + } +} + +const options: ServerOptions = { + address: '0.0.0.0', + app: { + key1: 'value1', + key2: 'value2', + any_thing: 'any_value', + }, + autoListen: true, + cache: { + engine: require('catbox-memory'), + name: 'test', + shared: true, + partition: 'hapi-cache', + any_thing_1: 'any_thing_1', + any_thing_2: 'any_thing_2' + }, + compression: { + minBytes: 1024 + }, + debug: { + request: ['implementation'] + }, + host: 'localhost', + listener: undefined, + load: { sampleInterval: 0 }, + mime: mimeOptions, + plugins: plugin, + port: 8000, + router: { + isCaseSensitive: true, + stripTrailingSlash: false + }, + routes: routeOptions, + state: { + strictHeader: true, + ignoreErrors: false, + isSecure: true, + isHttpOnly: true, + isSameSite: 'Strict', + encoding: 'none' + }, + tls: true +}; + +const server = new Server(options); +server.start(); + +server.events.on('start', () => { + console.log('Server started at: ' + server.info.uri); +}); diff --git a/types/hapi/v17/test/server/server-path.ts b/types/hapi/v17/test/server/server-path.ts new file mode 100644 index 0000000000..8a2ebf85dc --- /dev/null +++ b/types/hapi/v17/test/server/server-path.ts @@ -0,0 +1,37 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverpathrelativeto +import { Plugin, Server, ServerRegisterOptions, ServerRoute } from "hapi"; + +const server = new Server({ + port: 8000, +}); + +// Definition for INERT +declare module 'hapi' { + interface HandlerDecorations { + file?: string; + } +} + +const serverRouteOption: ServerRoute = { + path: '/file', + method: 'GET', + handler: { + file: './test.html' + } +}; + +const plugin: Plugin = { + name: 'example', + register: async (server: Server, options: ServerRegisterOptions) => { + // Assuming the Inert plugin was registered previously + server.path(__dirname + '../static'); + server.route(serverRouteOption); + } +}; + +server.start(); +server.register(plugin); + +server.events.on('start', () => { + console.log('Server started at: ' + server.info.uri); +}); diff --git a/types/hapi/v17/test/server/server-plugins.ts b/types/hapi/v17/test/server/server-plugins.ts new file mode 100644 index 0000000000..03a3c76907 --- /dev/null +++ b/types/hapi/v17/test/server/server-plugins.ts @@ -0,0 +1,116 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverplugins +import { Plugin, Server, ServerRegisterOptions } from "hapi"; + +interface Plugin1 { + one: 1; +} + +interface Plugin2 { + two: 2; +} + +interface Plugin3 { + three: 3; +} + +interface Plugin4 { + four: 4; +} + +declare module 'hapi' { + interface PluginProperties { + example: { + other: string; + key: string; + }; + } +} + +const plugin1: Plugin = { + name: 'plugin1', + register: async (server: Server, options: Plugin1) => { + server.expose('key', 'value'); + server.plugins.example.other = 'other'; + console.log(server.plugins.example.key); // 'value' + console.log(server.plugins.example.other); // 'other' + }, +}; + +const plugin2: Plugin = { + name: 'plugin2', + register: async (server: Server, options: Plugin2) => {}, + dependencies: { + plugin1: '*', + }, + requirements: { + node: '>=8', + hapi: '>=1337', + }, +}; + +const plugin3: Plugin = { + name: 'plugin3', + register: async (server: Server, options: Plugin3) => {}, + dependencies: ['plugin2'], +}; + +const plugin4: Plugin = { + name: 'plugin4', + register: (server: Server, options: Plugin4) => {}, + dependencies: 'plugin3', +}; + +const server = new Server({ + port: 8000, +}); + +server.start(); +server.register(plugin1); + +server.register({ + plugin: plugin1, + options: {one: 1} +}); + +server.register([ + { + plugin: plugin2, + options: {two: 2} + }, + { + plugin: plugin3, + options: {three: 3} + }, + { + plugin: plugin1, + options: {one: 1} + }, + { + plugin: plugin2, + options: {two: 2} + }, + { + plugin: plugin3, + options: {three: 3} + }, + { + plugin: plugin1, + options: {one: 1} + }, + { + plugin: plugin2, + options: {two: 2} + }, + { + plugin: plugin3, + options: {three: 3} + }, + { + plugin: plugin1, + options: {one: 1} + }, + { + plugin: plugin4, + options: {four: 4} + } +]); diff --git a/types/hapi/v17/test/server/server-settings.ts b/types/hapi/v17/test/server/server-settings.ts new file mode 100644 index 0000000000..f0619d95da --- /dev/null +++ b/types/hapi/v17/test/server/server-settings.ts @@ -0,0 +1,18 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serversettings +import { Server } from "hapi"; + +declare module 'hapi' { + interface ServerOptionsApp { + key?: string; + } +} + +const server = new Server({ + port: 8000, + app: { + key: 'value' + } +}); +server.start(); + +console.log(server.settings.app); // { key: 'value' } diff --git a/types/hapi/v17/test/server/server-start.ts b/types/hapi/v17/test/server/server-start.ts new file mode 100644 index 0000000000..f41349e88c --- /dev/null +++ b/types/hapi/v17/test/server/server-start.ts @@ -0,0 +1,11 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-await-serverstart +import { Server } from "hapi"; + +const server = new Server({ + port: 8000, +}); +server.start(); + +server.events.on('start', () => { + console.log('Server started at: ' + server.info.uri); +}); diff --git a/types/hapi/v17/test/server/server-state.ts b/types/hapi/v17/test/server/server-state.ts new file mode 100644 index 0000000000..ba4ffe344c --- /dev/null +++ b/types/hapi/v17/test/server/server-state.ts @@ -0,0 +1,28 @@ +// from https://hapijs.com/tutorials/cookies?lang=en_US +import { Server, ServerOptions, ServerRoute, ServerStateCookieOptions } from "hapi"; + +const options: ServerOptions = { + port: 8000, +}; + +const serverRoute: ServerRoute = { + path: '/say-hello', + method: 'GET', + handler(_request, h) { + h.state('test', { test: true }); + return h.response('Hello').state('data', { firstVisit: false }); + } +}; + +const server = new Server(options); +server.route(serverRoute); + +const stateOption: ServerStateCookieOptions = { + ttl: 24 * 60 * 60 * 1000, // One day + isSecure: false, + isHttpOnly: false, + encoding: 'base64json', +}; +server.state('data', stateOption); +server.start(); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/server/server-stop.ts b/types/hapi/v17/test/server/server-stop.ts new file mode 100644 index 0000000000..7922fa944e --- /dev/null +++ b/types/hapi/v17/test/server/server-stop.ts @@ -0,0 +1,17 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-await-serverstopoptions +import { Server } from "hapi"; + +const server = new Server({ + port: 8000, +}); + +server.start(); +server.events.on('start', () => { + console.log('Server started at: ' + server.info.uri); +}); +server.events.on('stop', () => { + console.log('Server stoped.'); +}); +setTimeout(() => { + server.stop({ timeout: 10 * 1000 }); +}, 5 * 1000); diff --git a/types/hapi/v17/test/server/server-table.ts b/types/hapi/v17/test/server/server-table.ts new file mode 100644 index 0000000000..79726118b5 --- /dev/null +++ b/types/hapi/v17/test/server/server-table.ts @@ -0,0 +1,29 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-servertablehost +import { Request, ResponseToolkit, Server, ServerOptions } from "hapi"; + +const options: ServerOptions = { + port: 8000, +}; + +const server = new Server(options); +server.app.key = 'value2'; + +server.route({ + path: '/', + method: 'GET', + handler(request, h) { + return h.response("Hello World"); + } +}); + +server.start(); +const table = server.table(); +console.log(table); +console.log(table[0].method); +console.log(table[0].path); +console.log(table[0].vhost); +console.log(table[0].realm); +console.log(table[0].settings); +console.log(table[0].fingerprint); +console.log(table[0].auth); +console.log('Server started at: ' + server.info.uri); diff --git a/types/hapi/v17/test/server/server-version.ts b/types/hapi/v17/test/server/server-version.ts new file mode 100644 index 0000000000..b8e59497fc --- /dev/null +++ b/types/hapi/v17/test/server/server-version.ts @@ -0,0 +1,9 @@ +// https://github.com/hapijs/hapi/blob/master/API.md#-serverversion +import { Server } from "hapi"; + +const server = new Server({ + port: 8000, +}); + +server.start(); +console.log(server.version); // 17.x.x diff --git a/types/hapi/v17/tsconfig.json b/types/hapi/v17/tsconfig.json new file mode 100644 index 0000000000..c0e48eaa17 --- /dev/null +++ b/types/hapi/v17/tsconfig.json @@ -0,0 +1,79 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "hapi": [ + "hapi/v17" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "test/request/auth.ts", + "test/request/catch-all.ts", + "test/request/event-types.ts", + "test/request/get-log.ts", + "test/request/methods.ts", + "test/request/parameters.ts", + "test/request/query.ts", + "test/response/continue.ts", + "test/response/error.ts", + "test/response/redirect.ts", + "test/response/response-events.ts", + "test/response/response.ts", + "test/route/adding-routes.ts", + "test/route/config.ts", + "test/route/ext.ts", + "test/route/handler.ts", + "test/route/route-options-pre.ts", + "test/route/route-options.ts", + "test/route/validation.ts", + "test/server/server-app.ts", + "test/server/server-auth-api.ts", + "test/server/server-auth-default.ts", + "test/server/server-auth-test.ts", + "test/server/server-auth-verify.ts", + "test/server/server-bind.ts", + "test/server/server-cache-provision.ts", + "test/server/server-cache.ts", + "test/server/server-control.ts", + "test/server/server-decoder.ts", + "test/server/server-decorations.ts", + "test/server/server-encoder.ts", + "test/server/server-events-once.ts", + "test/server/server-events.ts", + "test/server/server-expose.ts", + "test/server/server-info.ts", + "test/server/server-inject.ts", + "test/server/server-listener.ts", + "test/server/server-load.ts", + "test/server/server-lookup.ts", + "test/server/server-match.ts", + "test/server/server-method.ts", + "test/server/server-methods.ts", + "test/server/server-mime.ts", + "test/server/server-options.ts", + "test/server/server-path.ts", + "test/server/server-plugins.ts", + "test/server/server-settings.ts", + "test/server/server-start.ts", + "test/server/server-state.ts", + "test/server/server-stop.ts", + "test/server/server-table.ts", + "test/server/server-version.ts" + ] +} diff --git a/types/hapi/v17/tslint.json b/types/hapi/v17/tslint.json new file mode 100644 index 0000000000..1c36270d47 --- /dev/null +++ b/types/hapi/v17/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-angle-bracket-type-assertion": false + } +} diff --git a/types/happypack/happypack-tests.ts b/types/happypack/happypack-tests.ts new file mode 100644 index 0000000000..c0ab2d77cf --- /dev/null +++ b/types/happypack/happypack-tests.ts @@ -0,0 +1,7 @@ +import * as happyPack from 'happypack'; + +const ref: happyPack = new happyPack({ + id: '1', + threads: 1, + loaders: ['ts-loader'] +}); diff --git a/types/happypack/index.d.ts b/types/happypack/index.d.ts new file mode 100644 index 0000000000..13c212a3f8 --- /dev/null +++ b/types/happypack/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for happypack 5.0 +// Project: https://github.com/amireh/happypack +// Definitions by: Akash Vishwakarma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Plugin } from 'webpack'; + +export = happypack; + +declare namespace happypack { + interface PluginOptions { + id?: string; + threads?: number; + loaders: any; + } +} + +declare class happypack extends Plugin { + constructor(options: happypack.PluginOptions); +} diff --git a/types/happypack/tsconfig.json b/types/happypack/tsconfig.json new file mode 100644 index 0000000000..bfd5e35551 --- /dev/null +++ b/types/happypack/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", + "happypack-tests.ts" + ] +} \ No newline at end of file diff --git a/types/happypack/tslint.json b/types/happypack/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/happypack/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/has-emoji/has-emoji-tests.ts b/types/has-emoji/has-emoji-tests.ts new file mode 100644 index 0000000000..f1453f4cf5 --- /dev/null +++ b/types/has-emoji/has-emoji-tests.ts @@ -0,0 +1,6 @@ +import hasEmoji = require('has-emoji'); + +// $ExpectType boolean +hasEmoji('Unicorn 🦄'); +// $ExpectType boolean +hasEmoji('Cat'); diff --git a/types/has-emoji/index.d.ts b/types/has-emoji/index.d.ts new file mode 100644 index 0000000000..2160e66497 --- /dev/null +++ b/types/has-emoji/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for has-emoji 1.0 +// Project: https://github.com/sindresorhus/has-emoji#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = hasEmoji; + +declare function hasEmoji(candidate: string): boolean; diff --git a/types/has-emoji/tsconfig.json b/types/has-emoji/tsconfig.json new file mode 100644 index 0000000000..646f983707 --- /dev/null +++ b/types/has-emoji/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", + "has-emoji-tests.ts" + ] +} diff --git a/types/has-emoji/tslint.json b/types/has-emoji/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/has-emoji/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/has-yarn/has-yarn-tests.ts b/types/has-yarn/has-yarn-tests.ts new file mode 100644 index 0000000000..925cfe3c43 --- /dev/null +++ b/types/has-yarn/has-yarn-tests.ts @@ -0,0 +1,4 @@ +import hasYarn = require('has-yarn'); + +// $ExpectType boolean +hasYarn('foo'); diff --git a/types/has-yarn/index.d.ts b/types/has-yarn/index.d.ts new file mode 100644 index 0000000000..378f1ee811 --- /dev/null +++ b/types/has-yarn/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for has-yarn 1.0 +// Project: https://github.com/sindresorhus/has-yarn#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = hasYarn; + +declare function hasYarn(cwd?: string): boolean; diff --git a/types/has-yarn/tsconfig.json b/types/has-yarn/tsconfig.json new file mode 100644 index 0000000000..824092017a --- /dev/null +++ b/types/has-yarn/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", + "has-yarn-tests.ts" + ] +} diff --git a/types/has-yarn/tslint.json b/types/has-yarn/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/has-yarn/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/hashtag-regex/hashtag-regex-tests.ts b/types/hashtag-regex/hashtag-regex-tests.ts new file mode 100644 index 0000000000..d0c9e3417d --- /dev/null +++ b/types/hashtag-regex/hashtag-regex-tests.ts @@ -0,0 +1,3 @@ +import hashtagRegex from "hashtag-regex"; + +hashtagRegex(); // $ExpectType RegExp diff --git a/types/hashtag-regex/index.d.ts b/types/hashtag-regex/index.d.ts new file mode 100644 index 0000000000..3540ce867b --- /dev/null +++ b/types/hashtag-regex/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for hashtag-regex 2.0 +// Project: https://github.com/mathiasbynens/hashtag-regex +// Definitions by: diogofcunha +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function createRegExp(): RegExp; +export = createRegExp; diff --git a/types/hashtag-regex/tsconfig.json b/types/hashtag-regex/tsconfig.json new file mode 100644 index 0000000000..5946da8371 --- /dev/null +++ b/types/hashtag-regex/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "hashtag-regex-tests.ts"] +} diff --git a/types/hashtag-regex/tslint.json b/types/hashtag-regex/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/hashtag-regex/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/hex-rgb/hex-rgb-tests.ts b/types/hex-rgb/hex-rgb-tests.ts new file mode 100644 index 0000000000..f9bbf5ea71 --- /dev/null +++ b/types/hex-rgb/hex-rgb-tests.ts @@ -0,0 +1,4 @@ +import hexRgb = require('hex-rgb'); + +hexRgb('#cd2222cc'); // $ExpectType RgbaObj +hexRgb('#cd2222cc', { format: 'array' }); // $ExpectType [number, number, number, number] diff --git a/types/hex-rgb/index.d.ts b/types/hex-rgb/index.d.ts new file mode 100644 index 0000000000..ab1de9bf24 --- /dev/null +++ b/types/hex-rgb/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for hex-rgb 3.0 +// Project: https://github.com/sindresorhus/hex-rgb#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = hexRgb; + +declare function hexRgb(hex: string): hexRgb.RgbaObj; +declare function hexRgb(hex: string, options: hexRgb.Options): hexRgb.RgbaArr; + +declare namespace hexRgb { + interface Options { + format: 'array'; + } + + interface RgbaObj { + red: number; + green: number; + blue: number; + alpha: number; + } + + type RgbaArr = [number, number, number, number]; +} diff --git a/types/hex-rgb/tsconfig.json b/types/hex-rgb/tsconfig.json new file mode 100644 index 0000000000..c20c71b94f --- /dev/null +++ b/types/hex-rgb/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", + "hex-rgb-tests.ts" + ] +} diff --git a/types/hex-rgb/tslint.json b/types/hex-rgb/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/hex-rgb/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/hibp/hibp-tests.ts b/types/hibp/hibp-tests.ts deleted file mode 100644 index cdcd1851bf..0000000000 --- a/types/hibp/hibp-tests.ts +++ /dev/null @@ -1,17 +0,0 @@ -import * as hibp from 'hibp'; - -hibp -.search('someAccountOrEmail') -.then(data => { - if (data.breaches || data.pastes) { - // Bummer... - console.log(data); - } else { - // Phew! We're clear. - console.log('Good news — no pwnage found!'); - } -}) -.catch(err => { - // Something went wrong. - console.log(err.message); -}); diff --git a/types/hibp/index.d.ts b/types/hibp/index.d.ts deleted file mode 100644 index 27819f1c96..0000000000 --- a/types/hibp/index.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -// Type definitions for hibp 7.2 -// Project: https://github.com/wkovacs64/hibp -// Definitions by: Silas Rech -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 - -/// - -export interface BreachOptions { - domain?: string; - truncate?: boolean; -} - -export interface Breach { - Name: string; - Title: string; - Domain: string; - BreachDate: string; - AddedDate: string; - ModifiedDate: string; - PwnCount: number; - Description: string; - LogoPath: string; - DataClasses: string[]; - IsVerified: boolean; - IsFabricated: boolean; - IsSensitive: boolean; - IsRetired: boolean; - IsSpamList: boolean; -} - -export interface Paste { - Id: string; - Source: string; - Title: string; - Date: string; - EmailCount: number; -} - -export interface Range { - suffix: string; - count: number; -} - -/** - * Fetches data for a specific breach event. - */ -export function breach(breachName: string): Promise; - -/** - * Fetches breach data for a specific account. - */ -export function breachedAccount(account: string, options?: BreachOptions): Promise; - -/** - * Fetches all breach events in the system. - */ -export function breaches(options?: { domain?: string }): Promise; - -/** - * Fetches all data classes in the system. - */ -export function dataClasses(): Promise; - -/** - * Fetches paste data for a specific email address. - */ -export function pasteAccount(email: string): Promise; - -/** - * Fetches the number of times the the given password has been exposed in a breach (0 indicating no exposure). - * The password is given in plain text, but only the first 5 characters of its SHA-1 hash will be submitted to the API. - */ -export function pwnedPassword(password: string): Promise; - -/** - * Fetches the SHA-1 hash suffixes for the given 5-character SHA-1 hash prefix. - * - * When a password hash with the same first 5 characters is found in the Pwned Passwords repository, - * the API will respond with an HTTP 200 and include the suffix of every hash beginning with the specified prefix, - * followed by a count of how many times it appears in the data set. - * - * This function parses the response and returns a more structured format. - */ -export function pwnedPasswordRange(prefix: string): Promise; - -/** - * Fetches all breaches and all pastes associated with the provided account (email address or username). - * - * Note that the remote API does not support querying pastes by username (only email addresses), - * so in the event the provided account is not a valid email address, - * only breach data is queried and the "pastes" field of the resulting object will always be null. - * - * This is exactly how searching via the current web interface behaves, which this convenience method is designed to mimic. - * - */ -export function search(account: string, options?: BreachOptions): Promise<{ breaches?: Breach[], pastes?: Paste[] }>; diff --git a/types/highcharts/index.d.ts b/types/highcharts/index.d.ts index c6aae1e77f..51028bd6af 100644 --- a/types/highcharts/index.d.ts +++ b/types/highcharts/index.d.ts @@ -2232,6 +2232,10 @@ declare namespace Highcharts { * The button that appears after a selection zoom, allowing the user to reset zoom. */ resetZoomButton?: ChartResetZoomButton; + /** + * Options for a scrollable plot area + */ + scrollablePlotArea?: ScrollablePropArea; /** * The background color of the marker square when selecting (zooming in on) an area of the chart. * @default 'rgba(69,114,167,0.25)' @@ -3495,6 +3499,11 @@ declare namespace Highcharts { update(options: TitleOptions): void; } + interface ScrollablePropArea { + minWidth?: number; + scrollPositionX?: number; + } + /** * Under which conditions the rule applies. */ diff --git a/types/highcharts/modules/bullet.d.ts b/types/highcharts/modules/bullet.d.ts new file mode 100644 index 0000000000..98819c1963 --- /dev/null +++ b/types/highcharts/modules/bullet.d.ts @@ -0,0 +1,5 @@ +import { Static } from 'highcharts'; + +declare function HighchartsBullet(H: Static): Static; +export = HighchartsBullet; +export as namespace HighchartsBullet; diff --git a/types/highcharts/modules/heatmap.d.ts b/types/highcharts/modules/heatmap.d.ts new file mode 100644 index 0000000000..46ae5ff3e1 --- /dev/null +++ b/types/highcharts/modules/heatmap.d.ts @@ -0,0 +1,5 @@ +import { Static } from 'highcharts'; + +declare function HighchartsHeatMap(H: Static): Static; +export = HighchartsHeatMap; +export as namespace HighchartsHeatMap; diff --git a/types/highcharts/modules/solid-gauge.d.ts b/types/highcharts/modules/solid-gauge.d.ts new file mode 100644 index 0000000000..4fa17d62cd --- /dev/null +++ b/types/highcharts/modules/solid-gauge.d.ts @@ -0,0 +1,5 @@ +import { Static } from 'highcharts'; + +declare function HighchartsSolidGauge(H: Static): Static; +export = HighchartsSolidGauge; +export as namespace HighchartsSolidGauge; diff --git a/types/highcharts/modules/treemap.d.ts b/types/highcharts/modules/treemap.d.ts new file mode 100644 index 0000000000..25a2c58f2e --- /dev/null +++ b/types/highcharts/modules/treemap.d.ts @@ -0,0 +1,5 @@ +import { Static } from 'highcharts'; + +declare function HighchartsTreeMap(H: Static): Static; +export = HighchartsTreeMap; +export as namespace HighchartsTreeMap; diff --git a/types/highcharts/modules/wordcloud.d.ts b/types/highcharts/modules/wordcloud.d.ts new file mode 100644 index 0000000000..f6a9141057 --- /dev/null +++ b/types/highcharts/modules/wordcloud.d.ts @@ -0,0 +1,5 @@ +import { Static } from 'highcharts'; + +declare function HighchartsWordcloud(H: Static): Static; +export = HighchartsWordcloud; +export as namespace HighchartsWordcloud; diff --git a/types/highcharts/test/bullet.ts b/types/highcharts/test/bullet.ts new file mode 100644 index 0000000000..6a82c891bf --- /dev/null +++ b/types/highcharts/test/bullet.ts @@ -0,0 +1 @@ +HighchartsBullet(Highcharts); diff --git a/types/highcharts/test/heatmap.ts b/types/highcharts/test/heatmap.ts new file mode 100644 index 0000000000..d42454d447 --- /dev/null +++ b/types/highcharts/test/heatmap.ts @@ -0,0 +1 @@ +HighchartsHeatMap(Highcharts); diff --git a/types/highcharts/test/solid-gauge.ts b/types/highcharts/test/solid-gauge.ts new file mode 100644 index 0000000000..3d5c2245dc --- /dev/null +++ b/types/highcharts/test/solid-gauge.ts @@ -0,0 +1 @@ +HighchartsSolidGauge(Highcharts); diff --git a/types/highcharts/test/treemap.ts b/types/highcharts/test/treemap.ts new file mode 100644 index 0000000000..c7772a4dbf --- /dev/null +++ b/types/highcharts/test/treemap.ts @@ -0,0 +1 @@ +HighchartsTreeMap(Highcharts); diff --git a/types/highcharts/test/wordcloud.ts b/types/highcharts/test/wordcloud.ts new file mode 100644 index 0000000000..037d54eb7f --- /dev/null +++ b/types/highcharts/test/wordcloud.ts @@ -0,0 +1 @@ +HighchartsWordcloud(Highcharts); diff --git a/types/highcharts/tsconfig.json b/types/highcharts/tsconfig.json index e69f0eeb57..60bbecc1fa 100644 --- a/types/highcharts/tsconfig.json +++ b/types/highcharts/tsconfig.json @@ -18,23 +18,33 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts", - "modules/map/index.d.ts", - "modules/boost.d.ts", - "modules/drilldown.d.ts", - "modules/exporting.d.ts", - "modules/no-data-to-display.d.ts", - "modules/offline-exporting.d.ts", "highcharts-more.d.ts", "highstock.d.ts", + "index.d.ts", "js/highcharts/index.d.ts", + "modules/boost.d.ts", + "modules/bullet.d.ts", + "modules/drilldown.d.ts", + "modules/exporting.d.ts", + "modules/heatmap.d.ts", + "modules/map/index.d.ts", + "modules/no-data-to-display.d.ts", + "modules/offline-exporting.d.ts", + "modules/solid-gauge.d.ts", + "modules/treemap.d.ts", + "modules/wordcloud.d.ts", "test/boost.ts", + "test/bullet.ts", "test/drilldown.ts", "test/exporting.ts", + "test/heatmap.ts", "test/highstock.ts", "test/index.ts", "test/more.ts", "test/no-data-to-display.ts", - "test/offline-exporting.ts" + "test/offline-exporting.ts", + "test/solid-gauge.ts", + "test/treemap.ts", + "test/wordcloud.ts" ] -} \ No newline at end of file +} diff --git a/types/highland/highland-tests.ts b/types/highland/highland-tests.ts index cc61fcf92d..07a71e22b0 100644 --- a/types/highland/highland-tests.ts +++ b/types/highland/highland-tests.ts @@ -305,7 +305,7 @@ barStream = barStreamStream.sequence(); barStream = fooStream.series(); -barStream = fooStream.through(x => bar); +bar = fooStream.through(x => bar); barStream = fooStream.through(readwritable); fooStream = fooStream.zip(fooStream); diff --git a/types/highland/index.d.ts b/types/highland/index.d.ts index b6372f799a..825c0a1a6b 100644 --- a/types/highland/index.d.ts +++ b/types/highland/index.d.ts @@ -1172,7 +1172,7 @@ declare namespace Highland { * console.log(err); // => SyntaxError: Unexpected token z * }); */ - through(f: (x: R) => U): Stream; + through(f: (x: R) => U): U; through(thru: NodeJS.ReadWriteStream): Stream; diff --git a/types/hls.js/hls.js-tests.ts b/types/hls.js/hls.js-tests.ts index 934ee1fd9c..90176ae6b7 100644 --- a/types/hls.js/hls.js-tests.ts +++ b/types/hls.js/hls.js-tests.ts @@ -23,7 +23,14 @@ class pLoader extends Hls.DefaultConfig.loader { if (Hls.isSupported()) { const video = document.getElementById('video'); - const hls = new Hls({ pLoader, startFragPrefetch: true }); + const hls = new Hls({ + pLoader, + startFragPrefetch: true, + debug: { + log: (...args: any[]) => console.log(...args) + } + }); + const version: string = Hls.version; hls.loadSource('http://www.streambox.fr/playlists/test_001/stream.m3u8'); hls.attachMedia(video); diff --git a/types/hls.js/index.d.ts b/types/hls.js/index.d.ts index 721f4a3dce..b5c3cdf3ba 100644 --- a/types/hls.js/index.d.ts +++ b/types/hls.js/index.d.ts @@ -1,8 +1,10 @@ -// Type definitions for hls.js 0.10 +// Type definitions for hls.js 0.12 // Project: https://github.com/video-dev/hls.js // Definitions by: John G. Gainfort, Jr. +// Johan Brook +// Adrián Caballero // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.4 // Event Keys type K_MEDIA_ATTACHING = "hlsMediaAttaching"; @@ -188,33 +190,65 @@ declare namespace Hls { */ interface Level { /** - * level url. might contain sever items if failover/redundant streams are found in the manifest + * attribute list */ - url: string[]; + attrs: LevelAttr[]; + /** + * audio codec + */ + audioCodec: string; /** * level bitrate */ bitrate: number; /** - * level name + * level details */ - name: string; + details?: LevelDetails; /** - * used codecs + * whether there is any error on the fragment */ - codecs: string; - /** - * video width - */ - width: number; + fragmentError?: boolean; /** * video height */ height: number; /** - * level details + * index of the level */ - details: LevelDetails; + level?: number; + /** + * error code + */ + loadError: number; + /** + * level name + */ + name: string; + /** + * array of unrecognized codecs + */ + unkownCodecs: string[]; + /** + * level url. might contain several items if failover/redundant streams are found in the manifest + */ + url: string[]; + /** + * index of current url from url[] array + */ + urlId: number; + /** + * video codec + */ + videoCodec: string; + /** + * video width + */ + width: number; + } + + interface LevelAttr { + [key: string]: string; } /** @@ -307,6 +341,16 @@ declare namespace Hls { // interface SubtitleTracks {} + type CustomLogger = (...args: any[]) => void; + + interface CustomLoggerObject { + warn?: CustomLogger; + info?: CustomLogger; + log?: CustomLogger; + debug?: CustomLogger; + error?: CustomLogger; + } + interface Config { /** * (default: false) @@ -319,7 +363,7 @@ declare namespace Hls { * setting config.debug = true; will turn on debug logs on JS console. * a logger object could also be provided for custom logging: config.debug = customLogger; */ - debug: boolean; + debug: boolean | CustomLoggerObject; /** * (default: true) * if set to true, start level playlist and first fragments will be loaded automatically, after triggering of Hls.Events.MANIFEST_PARSED event @@ -475,6 +519,14 @@ declare namespace Hls { * Android Google Chrome, etc. set this value to true. */ liveDurationInfinity: boolean; + /** + * (default: Infinity) + * Sets the maximum length of the buffer, in seconds, to keep during a live stream. Any video + * buffered past this time will be evicted. Infinity means no restriction on back buffer length; + * 0 keeps the minimum amount. The minimum amount is equal to the target duration of a segment + * to ensure that current playback is not interrupted. + */ + liveBackBufferLength: number; /** * (default: true) * Enable WebWorker (if available on browser) for TS demuxing/MP4 remuxing, to improve performance and avoid lag/frame drops. diff --git a/types/html-minifier/v1/tsconfig.json b/types/html-minifier/v1/tsconfig.json index 846fa3a1f6..2ea7965d25 100644 --- a/types/html-minifier/v1/tsconfig.json +++ b/types/html-minifier/v1/tsconfig.json @@ -16,11 +16,17 @@ "html-minifier": [ "html-minifier/v1" ], + "html-minifier/*": [ + "html-minifier/v1/*" + ], "uglify-js": [ "uglify-js/v2" ], - "html-minifier/*": [ - "html-minifier/v1/*" + "clean-css": [ + "clean-css/v3" + ], + "clean-css/*": [ + "clean-css/v3/*" ] }, "types": [], diff --git a/types/html-tags/html-tags-tests.ts b/types/html-tags/html-tags-tests.ts new file mode 100644 index 0000000000..802dbb665e --- /dev/null +++ b/types/html-tags/html-tags-tests.ts @@ -0,0 +1,9 @@ +import htmlTags = require('html-tags'); +import voidHtmlTags = require('html-tags/void'); +import htmlTagsJson = require('html-tags/html-tags.json'); +import voidHtmlTagsJson = require('html-tags/html-tags-void.json'); + +htmlTags; // $ExpectType string[] +voidHtmlTags; // $ExpectType string[] +htmlTagsJson; // $ExpectType string[] +voidHtmlTagsJson; // $ExpectType string[] diff --git a/types/html-tags/html-tags-void.json.d.ts b/types/html-tags/html-tags-void.json.d.ts new file mode 100644 index 0000000000..3e194ddf27 --- /dev/null +++ b/types/html-tags/html-tags-void.json.d.ts @@ -0,0 +1,3 @@ +export = voidHtmlTags; + +declare const voidHtmlTags: string[]; diff --git a/types/html-tags/html-tags.json.d.ts b/types/html-tags/html-tags.json.d.ts new file mode 100644 index 0000000000..888779dc9c --- /dev/null +++ b/types/html-tags/html-tags.json.d.ts @@ -0,0 +1,3 @@ +export = htmlTags; + +declare const htmlTags: string[]; diff --git a/types/html-tags/index.d.ts b/types/html-tags/index.d.ts new file mode 100644 index 0000000000..635ce4820f --- /dev/null +++ b/types/html-tags/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for html-tags 2.0 +// Project: https://github.com/sindresorhus/html-tags#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = htmlTags; + +declare const htmlTags: string[]; diff --git a/types/html-tags/tsconfig.json b/types/html-tags/tsconfig.json new file mode 100644 index 0000000000..971c9bb630 --- /dev/null +++ b/types/html-tags/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "void.d.ts", + "html-tags.json.d.ts", + "html-tags-void.json.d.ts", + "html-tags-tests.ts" + ] +} diff --git a/types/html-tags/tslint.json b/types/html-tags/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/html-tags/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/html-tags/void.d.ts b/types/html-tags/void.d.ts new file mode 100644 index 0000000000..3e194ddf27 --- /dev/null +++ b/types/html-tags/void.d.ts @@ -0,0 +1,3 @@ +export = voidHtmlTags; + +declare const voidHtmlTags: string[]; diff --git a/types/http-assert/index.d.ts b/types/http-assert/index.d.ts index e48d69fa59..c2a97dd949 100644 --- a/types/http-assert/index.d.ts +++ b/types/http-assert/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for http-assert 1.3 +// Type definitions for http-assert 1.4 // Project: https://github.com/jshttp/http-assert // Definitions by: jKey Lu +// Peter Squicciarini // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -22,6 +23,7 @@ declare namespace assert { const equal: Assert; const notEqual: Assert; + const ok: Assert; const strictEqual: Assert; const notStrictEqual: Assert; const deepEqual: Assert; diff --git a/types/http-cache-semantics/http-cache-semantics-tests.ts b/types/http-cache-semantics/http-cache-semantics-tests.ts new file mode 100644 index 0000000000..73de43b370 --- /dev/null +++ b/types/http-cache-semantics/http-cache-semantics-tests.ts @@ -0,0 +1,19 @@ +const req = { url: 'https://foo.bar', method: 'GET', headers: { foo: 'bar' } }; +const res = { status: 200, headers: { foo: 'bar' } }; + +import CachePolicy = require('http-cache-semantics'); + +const policy = new CachePolicy(req, res); +new CachePolicy(req, res, { shared: true }); +new CachePolicy(req, res, { cacheHeuristic: 0.1 }); +new CachePolicy(req, res, { immutableMinTimeToLive: 24 * 3600 * 1000 }); +new CachePolicy(req, res, { ignoreCargoCult: false }); +new CachePolicy(req, res, { trustServerDate: true }); + +policy.storable(); // $ExpectType boolean +policy.satisfiesWithoutRevalidation(req); // $ExpectType boolean +policy.responseHeaders(); // $ExpectType Headers +policy.timeToLive(); // $ExpectType number +CachePolicy.fromObject(policy.toObject()); // $ExpectType CachePolicy +policy.revalidationHeaders(req); // $ExpectType Headers +policy.revalidatedPolicy(req, res); // $ExpectType RevalidationPolicy diff --git a/types/http-cache-semantics/index.d.ts b/types/http-cache-semantics/index.d.ts new file mode 100644 index 0000000000..40545f3e0a --- /dev/null +++ b/types/http-cache-semantics/index.d.ts @@ -0,0 +1,170 @@ +// Type definitions for http-cache-semantics 4.0 +// Project: https://github.com/kornelski/http-cache-semantics#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = CachePolicy; + +declare class CachePolicy { + constructor(req: CachePolicy.Request, res: CachePolicy.Response, options?: CachePolicy.Options); + + /** + * Returns `true` if the response can be stored in a cache. + * If it's `false` then you MUST NOT store either the request or the response. + */ + storable(): boolean; + + /** + * This is the most important method. Use this method to check whether the cached response is still fresh + * in the context of the new request. + * + * If it returns `true`, then the given `request` matches the original response this cache policy has been + * created with, and the response can be reused without contacting the server. Note that the old response + * can't be returned without being updated, see `responseHeaders()`. + * + * If it returns `false`, then the response may not be matching at all (e.g. it's for a different URL or method), + * or may require to be refreshed first (see `revalidationHeaders()`). + */ + satisfiesWithoutRevalidation(newRequest: CachePolicy.Request): boolean; + + /** + * Returns updated, filtered set of response headers to return to clients receiving the cached response. + * This function is necessary, because proxies MUST always remove hop-by-hop headers (such as `TE` and `Connection`) + * and update response's `Age` to avoid doubling cache time. + * + * @example + * cachedResponse.headers = cachePolicy.responseHeaders(cachedResponse); + */ + responseHeaders(): CachePolicy.Headers; + + /** + * Returns approximate time in milliseconds until the response becomes stale (i.e. not fresh). + * + * After that time (when `timeToLive() <= 0`) the response might not be usable without revalidation. However, + * there are exceptions, e.g. a client can explicitly allow stale responses, so always check with + * `satisfiesWithoutRevalidation()`. + */ + timeToLive(): number; + + /** + * Chances are you'll want to store the `CachePolicy` object along with the cached response. + * `obj = policy.toObject()` gives a plain JSON-serializable object. + */ + toObject(): CachePolicy.CachePolicyObject; + + /** + * `policy = CachePolicy.fromObject(obj)` creates an instance from object created by `toObject()`. + */ + static fromObject(obj: CachePolicy.CachePolicyObject): CachePolicy; + + /** + * Returns updated, filtered set of request headers to send to the origin server to check if the cached + * response can be reused. These headers allow the origin server to return status 304 indicating the + * response is still fresh. All headers unrelated to caching are passed through as-is. + * + * Use this method when updating cache from the origin server. + * + * @example + * updateRequest.headers = cachePolicy.revalidationHeaders(updateRequest); + */ + revalidationHeaders(newRequest: CachePolicy.Request): CachePolicy.Headers; + + /** + * Use this method to update the cache after receiving a new response from the origin server. + */ + revalidatedPolicy( + revalidationRequest: CachePolicy.Request, + revalidationResponse: CachePolicy.Response + ): CachePolicy.RevalidationPolicy; +} + +declare namespace CachePolicy { + interface Request { + url?: string; + method?: string; + headers: Headers; + } + + interface Response { + status?: number; + headers: Headers; + } + + interface Options { + /** + * If `true`, then the response is evaluated from a perspective of a shared cache (i.e. `private` is not + * cacheable and `s-maxage` is respected). If `false`, then the response is evaluated from a perspective + * of a single-user cache (i.e. `private` is cacheable and `s-maxage` is ignored). + * `true` is recommended for HTTP clients. + * @default true + */ + shared?: boolean; + /** + * A fraction of response's age that is used as a fallback cache duration. The default is 0.1 (10%), + * e.g. if a file hasn't been modified for 100 days, it'll be cached for 100*0.1 = 10 days. + * @default 0.1 + */ + cacheHeuristic?: number; + /** + * A number of milliseconds to assume as the default time to cache responses with `Cache-Control: immutable`. + * Note that [per RFC](https://httpwg.org/specs/rfc8246.html#the-immutable-cache-control-extension) + * these can become stale, so `max-age` still overrides the default. + * @default 24*3600*1000 (24h) + */ + immutableMinTimeToLive?: number; + /** + * If `true`, common anti-cache directives will be completely ignored if the non-standard `pre-check` + * and `post-check` directives are present. These two useless directives are most commonly found + * in bad StackOverflow answers and PHP's "session limiter" defaults. + * @default false + */ + ignoreCargoCult?: boolean; + /** + * If `false`, then server's `Date` header won't be used as the base for `max-age`. This is against the RFC, + * but it's useful if you want to cache responses with very short `max-age`, but your local clock + * is not exactly in sync with the server's. + * @default true + */ + trustServerDate?: boolean; + } + + interface CachePolicyObject { + v: number; + t: number; + sh: boolean; + ch: number; + imm: number; + st: number; + resh: Headers; + rescc: { [key: string]: string }; + m: string; + u?: string; + h?: string; + a: boolean; + reqh: Headers | null; + reqcc: { [key: string]: string }; + } + + interface Headers { + [header: string]: string | string[] | undefined; + } + + interface RevalidationPolicy { + /** + * A new `CachePolicy` with HTTP headers updated from `revalidationResponse`. You can always replace + * the old cached `CachePolicy` with the new one. + */ + policy: CachePolicy; + /** + * Boolean indicating whether the response body has changed. + * + * - If `false`, then a valid 304 Not Modified response has been received, and you can reuse the old + * cached response body. + * - If `true`, you should use new response's body (if present), or make another request to the origin + * server without any conditional headers (i.e. don't use `revalidationHeaders()` this time) to get + * the new resource. + */ + modified: boolean; + matches: boolean; + } +} diff --git a/types/http-cache-semantics/tsconfig.json b/types/http-cache-semantics/tsconfig.json new file mode 100644 index 0000000000..9940b3d2e6 --- /dev/null +++ b/types/http-cache-semantics/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", + "http-cache-semantics-tests.ts" + ] +} diff --git a/types/http-cache-semantics/tslint.json b/types/http-cache-semantics/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/http-cache-semantics/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/http-proxy-middleware/http-proxy-middleware-tests.ts b/types/http-proxy-middleware/http-proxy-middleware-tests.ts index aae082a956..9967dedcd9 100644 --- a/types/http-proxy-middleware/http-proxy-middleware-tests.ts +++ b/types/http-proxy-middleware/http-proxy-middleware-tests.ts @@ -140,3 +140,6 @@ proxy({ proxy({ headers: {host: 'www.example.org'} }); + +// Shorthands +proxy('/'); diff --git a/types/http-proxy-middleware/index.d.ts b/types/http-proxy-middleware/index.d.ts index b48214b8f6..13f2669e5f 100644 --- a/types/http-proxy-middleware/index.d.ts +++ b/types/http-proxy-middleware/index.d.ts @@ -15,10 +15,10 @@ import * as httpProxy from "http-proxy"; import { Readable } from 'stream'; declare function proxy(config: proxy.Config): proxy.Proxy; -declare function proxy(contextOrUri: string | string[] | proxy.Filter, config: proxy.Config): proxy.Proxy; +declare function proxy(contextOrUri: string | string[] | proxy.Filter, config?: proxy.Config): proxy.Proxy; declare namespace proxy { - type Filter = (pathanme: string, req: http.IncomingMessage) => boolean; + type Filter = (pathname: string, req: http.IncomingMessage) => boolean; type Logger = (...args: any[]) => void; interface LogProvider { log: Logger; diff --git a/types/http-rx/http-rx-tests.ts b/types/http-rx/http-rx-tests.ts index 082585fdf9..b76ba67832 100644 --- a/types/http-rx/http-rx-tests.ts +++ b/types/http-rx/http-rx-tests.ts @@ -1,13 +1,14 @@ import { Observable } from 'rxjs'; import httpRx = require('http-rx'); +import request = require('request'); -const httpGet: Observable = httpRx.get(''); +const httpGet: Observable<{response: request.Response}> = httpRx.get(''); -const httpHead: Observable = httpRx.head(''); +const httpHead: Observable<{body: any}> = httpRx.head(''); -const httpPatch: Observable = httpRx.patch(''); +const httpPatch: Observable<{response: request.Response, body: any}> = httpRx.patch(''); -const httpPost: Observable = httpRx.post(''); +const httpPost: Observable<{response: request.Response, body: any}> = httpRx.post('', {json: true}); const httpPut: Observable<{}> = httpRx.put(''); diff --git a/types/http-rx/index.d.ts b/types/http-rx/index.d.ts index 3b0c734fb0..c752427b8a 100644 --- a/types/http-rx/index.d.ts +++ b/types/http-rx/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for http-rx 1.1 +// Type definitions for http-rx 2.0 // Project: https://github.com/JasonRammoray/HttpRx // Definitions by: L2jLiga // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -7,18 +7,23 @@ import { Observable } from 'rxjs'; import request = require('request'); +interface ResponseWrapper { + response: request.Response; + body: any; +} + interface HttpRx { - get(url: string, options?: request.CoreOptions): Observable; + get(url: string, options?: request.CoreOptions): Observable; - head(url: string, options?: request.CoreOptions): Observable; + head(url: string, options?: request.CoreOptions): Observable; - patch(url: string, options?: request.CoreOptions): Observable; + patch(url: string, options?: request.CoreOptions): Observable; - post(url: string, options?: request.CoreOptions): Observable; + post(url: string, options?: request.CoreOptions): Observable; - put(url: string, options?: request.CoreOptions): Observable; + put(url: string, options?: request.CoreOptions): Observable; - 'delete'(url: string, options?: request.CoreOptions): Observable; + delete(url: string, options?: request.CoreOptions): Observable; } declare const httpRx: HttpRx; diff --git a/types/humanize-url/humanize-url-tests.ts b/types/humanize-url/humanize-url-tests.ts new file mode 100644 index 0000000000..7556cfb1c4 --- /dev/null +++ b/types/humanize-url/humanize-url-tests.ts @@ -0,0 +1,4 @@ +import humanizeUrl = require('humanize-url'); + +// $ExpectType string +humanizeUrl('https://www.sindresorhus.com/'); diff --git a/types/humanize-url/index.d.ts b/types/humanize-url/index.d.ts new file mode 100644 index 0000000000..c00f5c982f --- /dev/null +++ b/types/humanize-url/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for humanize-url 2.0 +// Project: https://github.com/sindresorhus/humanize-url#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = humanizeUrl; + +declare function humanizeUrl(url: string): string; diff --git a/types/humanize-url/tsconfig.json b/types/humanize-url/tsconfig.json new file mode 100644 index 0000000000..dd9fec46b6 --- /dev/null +++ b/types/humanize-url/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", + "humanize-url-tests.ts" + ] +} diff --git a/types/humanize-url/tslint.json b/types/humanize-url/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/humanize-url/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/icon-gen/icon-gen-tests.ts b/types/icon-gen/icon-gen-tests.ts new file mode 100644 index 0000000000..ca02834c04 --- /dev/null +++ b/types/icon-gen/icon-gen-tests.ts @@ -0,0 +1,43 @@ +import icongen = require('icon-gen'); + +icongen('./sample.svg', './icons', { report: true }) + .then(results => { + results[0]; + }) + .catch(err => { + throw err; + }); + +icongen('./sample.svg', './icons') + .then(results => { + results[0]; + }) + .catch(err => { + throw err; + }); + +icongen('./sample.svg', './icons', { + favicon: { + ico: [16, 24, 32, 48, 64], + name: 'favicon-', + sizes: [32, 57, 72, 96, 120, 128, 144, 152, 195, 228], + }, + report: false, +}) + .then(results => { + results[0]; + }) + .catch(err => { + throw err; + }); + +icongen('./sample.svg', './icons', { + favicon: {}, + report: false, +}) + .then(results => { + results[0]; + }) + .catch(err => { + throw err; + }); diff --git a/types/icon-gen/index.d.ts b/types/icon-gen/index.d.ts new file mode 100644 index 0000000000..e7bd6aaa69 --- /dev/null +++ b/types/icon-gen/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for icon-gen 2.0 +// Project: https://github.com/akabekobeko/npm-icon-gen#readme +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace icongen { + interface Options { + favicon?: { + ico: number[]; + name: string; + sizes: number[]; + } | {}; + icns?: { + name: string; + sizes: number[]; + } | {}; + ico?: { + name: string; + sizes: number[]; + } | {}; + report?: boolean; + } +} + +declare function icongen(src: string, dest: string, options?: icongen.Options): Promise; + +export = icongen; diff --git a/types/icon-gen/tsconfig.json b/types/icon-gen/tsconfig.json new file mode 100644 index 0000000000..6b83993922 --- /dev/null +++ b/types/icon-gen/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", + "icon-gen-tests.ts" + ] +} diff --git a/types/icon-gen/tslint.json b/types/icon-gen/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/icon-gen/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/idyll-document/idyll-document-tests.ts b/types/idyll-document/idyll-document-tests.ts index 880e017013..7a08c0189d 100644 --- a/types/idyll-document/idyll-document-tests.ts +++ b/types/idyll-document/idyll-document-tests.ts @@ -1,5 +1,7 @@ import IdyllDocument, { IdyllDocumentProps } from "idyll-document"; -import { createElement } from "react"; +import { createElement, ReactElement } from "react"; -// $ExpectType ReactElement -createElement(IdyllDocument); +const doc = createElement(IdyllDocument); + +// $ExpectType true +type test = typeof doc extends ReactElement ? true : false; diff --git a/types/image-size/image-size-tests.ts b/types/image-size/image-size-tests.ts index 058ed7934f..633169105d 100644 --- a/types/image-size/image-size-tests.ts +++ b/types/image-size/image-size-tests.ts @@ -4,11 +4,11 @@ import sizeOf = require("image-size"); // Synchronous const dimensions = sizeOf("images/funny-cats.png"); -console.log(dimensions.width, dimensions.height); +console.log(dimensions.width, dimensions.height, dimensions.orientation); // Asynchronous sizeOf("images/funny-cats.png", (err, dimensions) => { - console.log(dimensions.width, dimensions.height); + console.log(dimensions.width, dimensions.height, dimensions.orientation); }); // From URL diff --git a/types/image-size/index.d.ts b/types/image-size/index.d.ts index 9e8681d514..443c319fb2 100644 --- a/types/image-size/index.d.ts +++ b/types/image-size/index.d.ts @@ -1,23 +1,20 @@ -// Type definitions for image-size +// Type definitions for image-size 0.7 // Project: https://github.com/image-size/image-size // Definitions by: Elisée MAURER // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// - - interface ImageInfo { width: number; height: number; type: string; + orientation?: number; } -declare function sizeOf(path: string): ImageInfo; +declare function sizeOf(pathOrBuffer: string | Buffer): ImageInfo; declare function sizeOf(path: string, callback: (err: Error, dimensions: ImageInfo) => void): void; -declare function sizeOf(buffer: Buffer): ImageInfo; - declare namespace sizeOf { } export = sizeOf; diff --git a/types/image-size/tsconfig.json b/types/image-size/tsconfig.json index 7a864603b7..7c8d0db7d1 100644 --- a/types/image-size/tsconfig.json +++ b/types/image-size/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/image-size/tslint.json b/types/image-size/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/image-size/tslint.json +++ b/types/image-size/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/immediate/immediate-tests.ts b/types/immediate/immediate-tests.ts new file mode 100644 index 0000000000..0a65b7a4a0 --- /dev/null +++ b/types/immediate/immediate-tests.ts @@ -0,0 +1,17 @@ +import immediate = require('immediate'); + +immediate(() => {}); +immediate(arg1 => {}); // $ExpectError + +immediate( + (arg1, arg2) => { + arg1; // $ExpectType string + arg2; // $ExpectType number + }, + 'foo', + 1 +); +// $ExpectError +immediate((arg1, arg2) => {}, 'foo'); +// $ExpectError +immediate((arg1: string, arg2: number) => {}, 'foo', 'bar'); diff --git a/types/immediate/index.d.ts b/types/immediate/index.d.ts new file mode 100644 index 0000000000..33aa267d74 --- /dev/null +++ b/types/immediate/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for immediate 3.2 +// Project: https://github.com/calvinmetcalf/immediate#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +export as namespace immediate; +export = immediate; + +declare function immediate( + task: (...args: TArgs) => void, + ...args: TArgs +): void; diff --git a/types/immediate/tsconfig.json b/types/immediate/tsconfig.json new file mode 100644 index 0000000000..c1e92227fc --- /dev/null +++ b/types/immediate/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", + "immediate-tests.ts" + ] +} diff --git a/types/immediate/tslint.json b/types/immediate/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/immediate/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/inboxsdk/inboxsdk-tests.ts b/types/inboxsdk/inboxsdk-tests.ts index 4f51bae92c..19329b9d63 100644 --- a/types/inboxsdk/inboxsdk-tests.ts +++ b/types/inboxsdk/inboxsdk-tests.ts @@ -571,6 +571,7 @@ InboxSDK.load(1, '1234').then((sdk: InboxSDK.InboxSDKInstance) => { InboxSDK.load(1, '1234').then((sdk: InboxSDK.InboxSDKInstance) => { sdk.Router.createLink('1234', {p1: 1, 0: 1}).toLowerCase(); sdk.Router.goto('1234', {p1: 1, 0: 1}); + sdk.Router.goto(sdk.Router.NativeRouteIDs.ALL_MAIL, {p1: 1, 0: 1}); const unregister1 = sdk.Router.handleCustomRoute('1234', customRouteView => { customRouteView.getParams(); @@ -591,7 +592,7 @@ InboxSDK.load(1, '1234').then((sdk: InboxSDK.InboxSDKInstance) => { unregister2(); - const unregister3 = sdk.Router.handleListRoute('ALL_MAIL', listRouteView => { + const unregister3 = sdk.Router.handleListRoute(sdk.Router.NativeListRouteIDs.DRAFTS, listRouteView => { const sectionDescriptor: SectionDescriptor = { contentElement: new HTMLElement(), footerLinkText: 'text', diff --git a/types/inboxsdk/index.d.ts b/types/inboxsdk/index.d.ts index 4ced3ce6bd..abdfe413bf 100644 --- a/types/inboxsdk/index.d.ts +++ b/types/inboxsdk/index.d.ts @@ -657,6 +657,9 @@ declare namespace InboxSDK { handleCustomListRoute(routeID: string, handler: (offset: number, max: number) => CustomListDescriptor | Promise): () => void; getCurrentRouteView(): RouteView; + + NativeListRouteIDs: typeof NativeListRouteIDs; + NativeRouteIDs: typeof NativeRouteIDs; } interface CustomListDescriptor { @@ -754,43 +757,45 @@ declare namespace InboxSDK { onClick?: () => void; } - type NativeRouteIDs = - 'INBOX' | - 'ALL_MAIL' | - 'SENT' | - 'STARRED' | - 'DRAFTS' | - 'SNOOZED' | - 'DONE' | - 'REMINDERS' | - 'LABEL' | - 'TRASH' | - 'SPAM' | - 'IMPORTANT' | - 'SEARCH' | - 'THREAD' | - 'CHATS' | - 'CHAT' | - 'CONTACTS' | - 'CONTACT' | - 'SETTINGS' | - 'ANY_LIST'; + enum NativeRouteIDs { + INBOX, + ALL_MAIL, + SENT, + STARRED, + DRAFTS, + SNOOZED, + DONE, + REMINDERS, + LABEL, + TRASH, + SPAM, + IMPORTANT, + SEARCH, + THREAD, + CHATS, + CHAT, + CONTACTS, + CONTACT, + SETTINGS, + ANY_LIST + } - type NativeListRouteIDs = - 'INBOX' - | 'ALL_MAIL' - | 'SENT' - | 'STARRED' - | 'DRAFTS' - | 'SNOOZED' - | 'DONE' - | 'REMINDERS' - | 'LABEL' - | 'TRASH' - | 'SPAM' - | 'IMPORTANT' - | 'SEARCH' - | 'ANY_LIST'; + enum NativeListRouteIDs { + INBOX, + ALL_MAIL, + SENT, + STARRED, + DRAFTS, + SNOOZED, + DONE, + REMINDERS, + LABEL, + TRASH, + SPAM, + IMPORTANT, + SEARCH, + ANY_LIST + } } export namespace NavMenu { diff --git a/types/indent-string/indent-string-tests.ts b/types/indent-string/indent-string-tests.ts index 296a05b414..737aba3b02 100644 --- a/types/indent-string/indent-string-tests.ts +++ b/types/indent-string/indent-string-tests.ts @@ -1,5 +1,7 @@ import indentString = require('indent-string'); +// $ExpectType string +indentString('Unicorns\nRainbows'); indentString('Unicorns\nRainbows', 4); // => ' Unicorns' // => ' Rainbows' @@ -7,3 +9,5 @@ indentString('Unicorns\nRainbows', 4); indentString('Unicorns\nRainbows', 4, '♥'); // => '♥♥♥♥Unicorns' // => '♥♥♥♥Rainbows' +indentString('Unicorns\nRainbows', 4, { indent: '♥' }); +indentString('Unicorns\nRainbows', 4, { includeEmptyLines: true }); diff --git a/types/indent-string/index.d.ts b/types/indent-string/index.d.ts index 5d4a01b7eb..038227b112 100644 --- a/types/indent-string/index.d.ts +++ b/types/indent-string/index.d.ts @@ -1,7 +1,20 @@ -// Type definitions for indent-string 3.0 +// Type definitions for indent-string 3.2 // Project: https://github.com/sindresorhus/indent-string#readme // Definitions by: Mohamed Hegazy +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export = indent_string; -declare function indent_string(str: string, count: number, indent?: string): string; +export = indentString; + +declare function indentString( + str: string, + count?: number, + indent?: string | indentString.Options +): string; + +declare namespace indentString { + interface Options { + indent?: string; + includeEmptyLines?: boolean; + } +} diff --git a/types/ink/index.d.ts b/types/ink/index.d.ts new file mode 100644 index 0000000000..23f4fe5d80 --- /dev/null +++ b/types/ink/index.d.ts @@ -0,0 +1,210 @@ +// Type definitions for ink 0.5 +// Project: https://github.com/vadimdemedes/ink#readme +// Definitions by: Carlos Precioso +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// + +import { ValidationMap } from "prop-types"; + +export interface InkElement { + component: InkComponent; + instance: Component | null; + ref: (ref: any) => void; + _props: any; + _children: InkNode[]; +} + +export type InkNode = + | ReadonlyArray + | InkElement + | string + | number + | null; + +export function h

>( + type: ComponentClass | StatelessComponent, + props: P, + ...children: InkNode[] +): InkElement; + +export function h( + type: T, + props: JSX.IntrinsicElements[T], + ...children: InkNode[] +): InkElement; + +export function render( + tree: InkElement, + stream?: NodeJS.WriteStream +): (() => void); +export function renderToString(tree: InkElement, prevTree?: InkElement): string; + +export type InkComponent

= {}> = + | ComponentClass + | StatelessComponent; + +export interface StatelessComponent< + P extends Record = {}, + C extends Record = {} +> { + (props: P, context: C): InkElement; + defaultProps?: Record; + propTypes?: ValidationMap>; +} + +export abstract class Component< + P extends Record = {}, + S extends Record = {}, + C extends Record = {} +> { + readonly props: P & { children?: InkNode }; + readonly context: C; + + setState( + nextState: + | Partial + | ((state: Component["state"]) => Partial), + callback?: () => void + ): void; +} + +export interface Component< + P extends Record = {}, + S extends Record = {}, + C extends Record = {} +> { + state: S; + + render( + props: Component["props"], + state: Component["state"], + context: Component["state"] + ): InkElement; + + componentWillMount?(): void; + componentDidMount?(): void; + componentWillUnmount?(): void; + componentWillReceiveProps?( + nextProps: Component["props"], + nextState: Component["state"] + ): void; + shouldComponentUpdate?( + nextProps: Component["props"], + nextState: Component["state"] + ): void; + componentWillUpdate?( + nextProps: Component["props"], + nextState: Component["state"] + ): void; + componentDidUpdate?(): void; + + getChildContext?(): (() => Record); +} + +export interface ComponentClass< + P extends Record = {}, + S extends Record = {}, + C extends Record = {} +> { + new (props: Component["props"], context: Component["state"]): Component< + P, + S, + C + >; + defaultProps?: Record; + propTypes?: ValidationMap>; +} + +export namespace h { + const Fragment: InkComponent; +} +export const Fragment: typeof h.Fragment; + +export const Color: ComponentClass<{ + rgb?: [number, number, number]; + hsl?: [number, number, number]; + hsv?: [number, number, number]; + hwb?: [number, number, number]; + hex?: string; + keyword?: string; + bgRgb?: [number, number, number]; + bgHsl?: [number, number, number]; + bgHsv?: [number, number, number]; + bgHwb?: [number, number, number]; + bgHex?: string; + bgKeyword?: string; + reset?: boolean; + bold?: boolean; + dim?: boolean; + italic?: boolean; + underline?: boolean; + inverse?: boolean; + hidden?: boolean; + strikethrough?: boolean; + visible?: boolean; + black?: boolean; + red?: boolean; + green?: boolean; + yellow?: boolean; + blue?: boolean; + magenta?: boolean; + cyan?: boolean; + white?: boolean; + gray?: boolean; + grey?: boolean; + blackBright?: boolean; + redBright?: boolean; + greenBright?: boolean; + yellowBright?: boolean; + blueBright?: boolean; + magentaBright?: boolean; + cyanBright?: boolean; + whiteBright?: boolean; + bgBlack?: boolean; + bgRed?: boolean; + bgGreen?: boolean; + bgYellow?: boolean; + bgBlue?: boolean; + bgMagenta?: boolean; + bgCyan?: boolean; + bgWhite?: boolean; + bgBlackBright?: boolean; + bgRedBright?: boolean; + bgGreenBright?: boolean; + bgYellowBright?: boolean; + bgBlueBright?: boolean; + bgMagentaBright?: boolean; + bgCyanBright?: boolean; + bgWhiteBright?: boolean; +}>; + +export const Bold: InkComponent; +export const Underline: InkComponent; + +declare global { + namespace JSX { + type Element = InkElement; + + type ElementClass = Component; + type FunctionalElement = StatelessComponent; + + interface ElementAttributesProperty { + props: {}; + } + interface ElementChildrenAttribute { + children: {}; + } + + interface IntrinsicClassAttributes { + ref?: (ref: T | null) => void; + } + + interface IntrinsicElements { + div: {}; + span: {}; + br: {}; + } + } +} diff --git a/types/ink/ink-tests.tsx b/types/ink/ink-tests.tsx new file mode 100644 index 0000000000..3d5d07febc --- /dev/null +++ b/types/ink/ink-tests.tsx @@ -0,0 +1,34 @@ +// @jsx h + +import { Color, Component, Fragment, render } from "ink"; + +class Counter extends Component<{}, { i: number }> { + timer = null as ReturnType | null; + state = { i: 0 }; + + constructor() { + super(); + } + + render() { + return ( + + {this.state.i} tests passed + + ); + } + + componentDidMount() { + this.timer = setInterval(() => { + this.setState({ + i: this.state.i + 1 + }); + }, 100); + } + + componentWillUnmount() { + clearInterval(this.timer!); + } +} + +render(); diff --git a/types/ink/tsconfig.json b/types/ink/tsconfig.json new file mode 100644 index 0000000000..7a37ab0861 --- /dev/null +++ b/types/ink/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "preserve" + }, + "files": ["index.d.ts", "ink-tests.tsx"] +} diff --git a/types/ink/tslint.json b/types/ink/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ink/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/insert-css/index.d.ts b/types/insert-css/index.d.ts new file mode 100644 index 0000000000..9f132c53b4 --- /dev/null +++ b/types/insert-css/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for insert-css 2.0 +// Project: https://github.com/substack/insert-css +// Definitions by: Heye Vöcking +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface InsertCssOptions { + container?: HTMLElement; + prepend?: boolean; +} + +export interface InsertCssStyleElement extends HTMLStyleElement { + styleSheet?: CSSStyleSheet; +} + +export function insertCss( + css: string, + options?: InsertCssOptions, +): InsertCssStyleElement; diff --git a/types/insert-css/insert-css-tests.ts b/types/insert-css/insert-css-tests.ts new file mode 100644 index 0000000000..a26e085626 --- /dev/null +++ b/types/insert-css/insert-css-tests.ts @@ -0,0 +1,27 @@ +import { insertCss } from 'insert-css'; + +insertCss('body{position:absolute}'); + +insertCss('body{position:absolute}', {}); + +insertCss('body{text-decoration:underline !important}', { + prepend: true, +}); + +insertCss('body{text-decoration:underline !important}', { + prepend: false, +}); + +insertCss('body{position:absolute}', { + container: document.createElement(''), +}); + +insertCss('body{text-decoration:underline !important}', { + prepend: true, + container: document.createElement(''), +}); + +insertCss('body{text-decoration:underline !important}', { + prepend: false, + container: document.createElement(''), +}); diff --git a/types/insert-css/tsconfig.json b/types/insert-css/tsconfig.json new file mode 100644 index 0000000000..eed90e2eeb --- /dev/null +++ b/types/insert-css/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "forceConsistentCasingInFileNames": true, + "lib": [ + "dom", + "es6" + ], + "module": "commonjs", + "noEmit": true, + "noImplicitAny": true, + "noImplicitAny": true, + "noImplicitThis": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "strictNullChecks": true, + "typeRoots": ["../"], + "types": [] + }, + "files": [ + "index.d.ts", + "insert-css-tests.ts" + ] +} diff --git a/types/insert-css/tslint.json b/types/insert-css/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/insert-css/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/internal-ip/index.d.ts b/types/internal-ip/index.d.ts index a82dd8c913..1bed7e9059 100644 --- a/types/internal-ip/index.d.ts +++ b/types/internal-ip/index.d.ts @@ -1,7 +1,12 @@ -// Type definitions for internal-ip 2.0 +// Type definitions for internal-ip 3.0 // Project: https://github.com/sindresorhus/internal-ip#readme // Definitions by: BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export function v6(): Promise; -export function v4(): Promise; +export const v6: IPGetterFn; +export const v4: IPGetterFn; + +export interface IPGetterFn { // tslint:disable-line:interface-name + (): Promise; + sync(): string | null; +} diff --git a/types/internal-ip/internal-ip-tests.ts b/types/internal-ip/internal-ip-tests.ts index e94ec9f510..1b383de2f3 100644 --- a/types/internal-ip/internal-ip-tests.ts +++ b/types/internal-ip/internal-ip-tests.ts @@ -1,10 +1,15 @@ import * as internalIp from 'internal-ip'; -let str: string; internalIp.v6().then(ip => { - str = ip; + // $ExpectType string | null + ip; }); +// $ExpectType string | null +internalIp.v6.sync(); internalIp.v4().then(ip => { - str = ip; + // $ExpectType string | null + ip; }); +// $ExpectType string | null +internalIp.v4.sync(); diff --git a/types/internal-ip/tsconfig.json b/types/internal-ip/tsconfig.json index 746718e07c..99d54932e0 100644 --- a/types/internal-ip/tsconfig.json +++ b/types/internal-ip/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "internal-ip-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/internal-ip/v2/index.d.ts b/types/internal-ip/v2/index.d.ts new file mode 100644 index 0000000000..a82dd8c913 --- /dev/null +++ b/types/internal-ip/v2/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for internal-ip 2.0 +// Project: https://github.com/sindresorhus/internal-ip#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function v6(): Promise; +export function v4(): Promise; diff --git a/types/internal-ip/v2/internal-ip-tests.ts b/types/internal-ip/v2/internal-ip-tests.ts new file mode 100644 index 0000000000..e94ec9f510 --- /dev/null +++ b/types/internal-ip/v2/internal-ip-tests.ts @@ -0,0 +1,10 @@ +import * as internalIp from 'internal-ip'; + +let str: string; +internalIp.v6().then(ip => { + str = ip; +}); + +internalIp.v4().then(ip => { + str = ip; +}); diff --git a/types/internal-ip/v2/tsconfig.json b/types/internal-ip/v2/tsconfig.json new file mode 100644 index 0000000000..bae5b7feb8 --- /dev/null +++ b/types/internal-ip/v2/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "internal-ip": [ + "internal-ip/v2" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "internal-ip-tests.ts" + ] +} diff --git a/types/internal-ip/v2/tslint.json b/types/internal-ip/v2/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/internal-ip/v2/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/intl-tel-input/index.d.ts b/types/intl-tel-input/index.d.ts index 667a210087..f0c8407f18 100644 --- a/types/intl-tel-input/index.d.ts +++ b/types/intl-tel-input/index.d.ts @@ -1,9 +1,21 @@ // Type definitions for intl-tel-input 14.0 // Project: https://github.com/jackocnr/intl-tel-input -// Definitions by: Fidan Hakaj , Leonard Thieu , Márton Molnár +// Definitions by: Fidan Hakaj +// Leonard Thieu +// Márton Molnár // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +export as namespace intlTelInput; + +export = IntlTelInput; + +/** + * initialise the plugin with optional options. + * @param options options that can be provided during initialization. + */ +declare function IntlTelInput(node: Element, options?: IntlTelInput.Options): IntlTelInput.Plugin; + declare namespace IntlTelInput { interface Static { /** @@ -25,6 +37,8 @@ declare namespace IntlTelInput { } interface Plugin { + promise: Promise; + /** * Remove the plugin from the input, and unbind any event listeners. */ @@ -386,16 +400,50 @@ declare namespace intlTelInputUtils { | "VOIP"; } -interface Window { - intlTelInputGlobals: IntlTelInput.Static; +declare global { + namespace intlTelInputUtils { + enum numberFormat { + E164 = 0, + INTERNATIONAL = 1, + NATIONAL = 2, + RFC3966 = 3 + } - /** - * initialise the plugin with optional options. - * @param options options that can be provided during initialization. - */ - intlTelInput(node: Element, options?: IntlTelInput.Options): IntlTelInput.Plugin; -} + enum numberType { + FIXED_LINE = 0, + MOBILE = 1, + FIXED_LINE_OR_MOBILE = 2, + TOLL_FREE = 3, + PREMIUM_RATE = 4, + SHARED_COST = 5, + VOIP = 6, + PERSONAL_NUMBER = 7, + PAGER = 8, + UAN = 9, + VOICEMAIL = 10, + UNKNOWN = -1 + } -interface JQuery { - intlTelInput: IntlTelInput.JQueryPlugin; + enum validationError { + IS_POSSIBLE = 0, + INVALID_COUNTRY_CODE = 1, + TOO_SHORT = 2, + TOO_LONG = 3, + NOT_A_NUMBER = 4 + } + } + + interface Window { + intlTelInputGlobals: IntlTelInput.Static; + + /** + * initialise the plugin with optional options. + * @param options options that can be provided during initialization. + */ + intlTelInput(node: Element, options?: IntlTelInput.Options): IntlTelInput.Plugin; + } + + interface JQuery { + intlTelInput: IntlTelInput.JQueryPlugin; + } } diff --git a/types/intl-tel-input/intl-tel-input-tests.ts b/types/intl-tel-input/intl-tel-input-tests.ts index ab6808bbed..6bb705cafb 100644 --- a/types/intl-tel-input/intl-tel-input-tests.ts +++ b/types/intl-tel-input/intl-tel-input-tests.ts @@ -1,5 +1,10 @@ /// +// Global + +// $ExpectType (node: Element, options?: Options) => Plugin +intlTelInput; + // Normal version const input = document.querySelector("#phone"); diff --git a/types/intl-tel-input/test/module-tests.ts b/types/intl-tel-input/test/module-tests.ts new file mode 100644 index 0000000000..4bfdd3c6a7 --- /dev/null +++ b/types/intl-tel-input/test/module-tests.ts @@ -0,0 +1,24 @@ +import intlTelInput = require('intl-tel-input'); + +function test_import() { + // $ExpectType (node: Element, options?: Options) => Plugin + intlTelInput; +} + +function test_IntlTelInput_not_visible() { + // $ExpectError + const options: IntlTelInput.Options = { + allowDropdown: true + }; +} + +function test_intlTelInputUtils_global() { + const input = document.querySelector('#phone'); + const iti = intlTelInput(input, { + utilsScript: 'node_modules/intl-tel-input/build/js/utils.js' + }); + + iti.promise.then(() => { + console.log(intlTelInputUtils.numberFormat.E164); + }); +} diff --git a/types/intl-tel-input/tsconfig.json b/types/intl-tel-input/tsconfig.json index e067880440..302c298ef8 100644 --- a/types/intl-tel-input/tsconfig.json +++ b/types/intl-tel-input/tsconfig.json @@ -19,6 +19,7 @@ }, "files": [ "index.d.ts", - "intl-tel-input-tests.ts" + "intl-tel-input-tests.ts", + "test/module-tests.ts" ] } diff --git a/types/intro.js/index.d.ts b/types/intro.js/index.d.ts index ec27d19439..40603bed1d 100644 --- a/types/intro.js/index.d.ts +++ b/types/intro.js/index.d.ts @@ -7,7 +7,11 @@ declare namespace IntroJs { interface Step { intro: string; element?: string|HTMLElement|Element; - position?: string; + position?: "top"|"left"|"right"|"bottom"|"bottom-left-aligned"|"bottom-middle-aligned"|"bottom-right-aligned"|"auto"; + tooltipClass?: string; + highlightClass?: string; + scrollTo?: "off"|"tooltip"|"element"; + disableInteraction?: boolean; } interface Hint { diff --git a/types/intro.js/intro.js-tests.ts b/types/intro.js/intro.js-tests.ts index d40fbe3f36..44b2f238d3 100644 --- a/types/intro.js/intro.js-tests.ts +++ b/types/intro.js/intro.js-tests.ts @@ -31,13 +31,22 @@ intro.setOptions({ position: 'left' }, { - element : '#step4', - intro : "Another step.", - position: 'bottom' + element : '#step4', + intro : "Another step.", + position : 'bottom', + tooltipClass : 'step4Class', + highlightClass: '' }, { - element: '#step5', - intro : 'Get it, use it.' + element : '#step4', + intro : "Another step.", + position: 'bottom', + scrollTo: 'tooltip' + }, + { + element : '#step5', + intro : 'Get it, use it.', + disableInteraction: true } ], hints: [ diff --git a/types/iobroker/index.d.ts b/types/iobroker/index.d.ts index cee6ce75a6..0479eceeb9 100644 --- a/types/iobroker/index.d.ts +++ b/types/iobroker/index.d.ts @@ -828,10 +828,12 @@ declare global { ca: Array; } + type MessagePayload = string | Record; + /** Callback information for a passed message */ interface MessageCallbackInfo { /** The original message payload */ - message: string | object; + message: MessagePayload; /** ID of this callback */ id: number; // ??? @@ -839,14 +841,13 @@ declare global { /** Timestamp of this message */ time: number; } - type MessageCallback = (result?: any) => void; /** A message being passed between adapter instances */ interface Message { /** The command to be executed */ command: string; /** The message payload */ - message: string | object; + message: MessagePayload; /** The source of this message */ from: string; /** ID of this message */ @@ -968,6 +969,11 @@ declare global { * @param callback - gets called when a free port is found */ getPort(port: number, callback: (port: number) => void): void; + /** + * Helper function that looks for first free TCP port starting with the given one. + * @param port - The port to start with + */ + getPortAsync(port: number): Promise; /** Stops the adapter. Note: Is not always defined. */ stop?: () => void; @@ -978,16 +984,52 @@ declare global { /** Validates username and password */ checkPassword(user: string, password: string, callback: (result: boolean) => void): void; checkPassword(user: string, password: string, options: unknown, callback: (result: boolean) => void): void; + /** Validates username and password */ + checkPasswordAsync(user: string, password: string, options?: unknown): Promise; /** Sets a new password for the given user */ - setPassword(user: string, password: string, options?: unknown, callback?: (err?: any) => void): void; + setPassword(user: string, password: string, callback?: (err?: any) => void): void; + setPassword(user: string, password: string, options: unknown, callback?: (err?: any) => void): void; + /** Sets a new password for the given user */ + setPasswordAsync(user: string, password: string, options?: unknown): Promise; /** Checks if a user exists and is in the given group. */ checkGroup(user: string, group: string, callback: (result: boolean) => void): void; checkGroup(user: string, group: string, options: unknown, callback: (result: boolean) => void): void; + /** Checks if a user exists and is in the given group. */ + checkGroupAsync(user: string, group: string, options?: unknown): Promise; /** Determines the users permissions */ calculatePermissions(user: string, commandsPermissions: CommandsPermissions, callback: (result: PermissionSet) => void): void; calculatePermissions(user: string, commandsPermissions: CommandsPermissions, options: unknown, callback: (result: PermissionSet) => void): void; + /** Determines the users permissions */ + calculatePermissionsAsync(user: string, commandsPermissions: CommandsPermissions, options?: unknown): Promise; /** Returns SSL certificates by name (private key, public cert and chained certificate) for creation of HTTPS servers */ getCertificates(publicName: string, privateName: string, chainedName: string, callback: (err: string | null, certs?: Certificates, useLetsEncryptCert?: boolean) => void): void; + // TODO: getCertificates cannot be represented with promises right now + + /** + * Terminates the adapter execution but does not disable the adapter + * @param reason (optional) A message to print into the log prior to termination + */ + terminate(reason?: string): never; + + /** Restarts the adapter */ + restart(): never; + + /** + * Disables and stops the adapter instance. + * It is recommended that you leave the current method (e.g. by using `return`) after calling this. + */ + disable(): void; + + /** + * Updates the adapter config with new values. Only a subset of the configuration has to be provided, + * since merging with the existing config is done automatically. + * + * After updating the configuration, the adapter is automatically restarted. It is recommended that you + * leave the current method (e.g. by using `return`) after calling this. + * + * @param newConfig The new config values to be stored + */ + updateConfig(newConfig: Partial): void; /** * Sends a message to a specific instance or all instances of some specific adapter. @@ -997,14 +1039,28 @@ declare global { * @param command (optional) Command name of the target instance. Default: "send" * @param message The message (e.g. params) to send. */ - sendTo(instanceName: string, message: string | object, callback?: MessageCallback | MessageCallbackInfo): void; - sendTo(instanceName: string, command: string, message: string | object, callback?: MessageCallback | MessageCallbackInfo): void; - + sendTo(instanceName: string, message: MessagePayload, callback?: MessageCallback | MessageCallbackInfo): void; + sendTo(instanceName: string, command: string, message: MessagePayload, callback?: MessageCallback | MessageCallbackInfo): void; + /** + * Sends a message to a specific instance or all instances of some specific adapter. + * @param instanceName The instance to send this message to. + * If the ID of an instance is given (e.g. "admin.0"), only this instance will receive the message. + * If the name of an adapter is given (e.g. "admin"), all instances of this adapter will receive it. + * @param command (optional) Command name of the target instance. Default: "send" + * @param message The message (e.g. params) to send. + */ + sendToAsync(instanceName: string, message: MessagePayload): Promise; + sendToAsync(instanceName: string, command: string, message: MessagePayload): Promise; /** * Sends a message to a specific host or all hosts. */ - sendToHost(hostName: string, message: string | object, callback?: MessageCallback | MessageCallbackInfo): void; - sendToHost(hostName: string, command: string, message: string | object, callback?: MessageCallback | MessageCallbackInfo): void; + sendToHost(hostName: string, message: MessagePayload, callback?: MessageCallback | MessageCallbackInfo): void; + sendToHost(hostName: string, command: string, message: MessagePayload, callback?: MessageCallback | MessageCallbackInfo): void; + /** + * Sends a message to a specific host or all hosts. + */ + sendToHostAsync(hostName: string, message: MessagePayload): Promise; + sendToHostAsync(hostName: string, command: string, message: MessagePayload): Promise; /** Convert ID to {device: D, channel: C, state: S} */ idToDCS(id: string): { @@ -1019,109 +1075,175 @@ declare global { /** Reads an object from the object db */ getObject(id: string, callback: GetObjectCallback): void; getObject(id: string, options: unknown, callback: GetObjectCallback): void; + /** Reads an object from the object db */ + getObjectAsync(id: string, options?: unknown): Promise>; /** Creates or overwrites an object in the object db */ setObject(id: string, obj: ioBroker.SettableObject, callback?: SetObjectCallback): void; setObject(id: string, obj: ioBroker.SettableObject, options: unknown, callback?: SetObjectCallback): void; + /** Creates or overwrites an object in the object db */ + setObjectAsync(id: string, obj: ioBroker.SettableObject, options?: unknown): Promise>; /** Creates an object in the object db. Existing objects are not overwritten. */ setObjectNotExists(id: string, obj: ioBroker.SettableObject, callback?: SetObjectCallback): void; setObjectNotExists(id: string, obj: ioBroker.SettableObject, options: unknown, callback?: SetObjectCallback): void; + /** Creates an object in the object db. Existing objects are not overwritten. */ + setObjectNotExistsAsync(id: string, obj: ioBroker.SettableObject, options?: unknown): Promise>; /** Get all states, channels and devices of this adapter */ getAdapterObjects(callback: (objects: Record) => void): void; + /** Get all states, channels and devices of this adapter */ + getAdapterObjectsAsync(): Promise>; /** Extend an object and create it if it might not exist */ extendObject(id: string, objPart: PartialObject, callback?: SetObjectCallback): void; extendObject(id: string, objPart: PartialObject, options: unknown, callback?: SetObjectCallback): void; + /** Extend an object and create it if it might not exist */ + extendObjectAsync(id: string, objPart: PartialObject, options?: unknown): Promise>; /** * Deletes an object from the object db * @param id - The id of the object without namespace */ delObject(id: string, callback?: ErrorCallback): void; delObject(id: string, options: unknown, callback?: ErrorCallback): void; + /** + * Deletes an object from the object db + * @param id - The id of the object without namespace + */ + delObjectAsync(id: string, options?: unknown): Promise; // ============================== // foreign objects - // tslint:disable:unified-signatures /** Reads an object (which might not belong to this adapter) from the object db */ getForeignObject(id: string, callback: GetObjectCallback): void; getForeignObject(id: string, options: unknown, callback: GetObjectCallback): void; + /** Reads an object (which might not belong to this adapter) from the object db */ + getForeignObjectAsync(id: string, options?: unknown): Promise>; /** Get foreign objects by pattern, by specific type and resolve their enums. */ + // tslint:disable:unified-signatures getForeignObjects(pattern: string, callback: GetObjectsCallback): void; getForeignObjects(pattern: string, options: unknown, callback: GetObjectsCallback): void; getForeignObjects(pattern: string, type: ObjectType, callback: GetObjectsCallback): void; getForeignObjects(pattern: string, type: ObjectType, enums: EnumList, callback: GetObjectsCallback): void; getForeignObjects(pattern: string, type: ObjectType, options: unknown, callback: GetObjectsCallback): void; getForeignObjects(pattern: string, type: ObjectType, enums: EnumList, options: unknown, callback: GetObjectsCallback): void; + // tslint:enable:unified-signatures + /** Get foreign objects by pattern, by specific type and resolve their enums. */ + getForeignObjectsAsync(pattern: string, options?: unknown): Promise>; + getForeignObjectsAsync(pattern: string, type: ObjectType, options?: unknown): Promise>; + getForeignObjectsAsync(pattern: string, type: ObjectType, enums: EnumList, options?: unknown): Promise>; /** Creates or overwrites an object (which might not belong to this adapter) in the object db */ setForeignObject(id: string, obj: ioBroker.SettableObject, callback?: SetObjectCallback): void; setForeignObject(id: string, obj: ioBroker.SettableObject, options: unknown, callback?: SetObjectCallback): void; + /** Creates or overwrites an object (which might not belong to this adapter) in the object db */ + setForeignObjectAsync(id: string, obj: ioBroker.SettableObject, options?: unknown): Promise>; /** Creates an object (which might not belong to this adapter) in the object db. Existing objects are not overwritten. */ setForeignObjectNotExists(id: string, obj: ioBroker.SettableObject, callback?: SetObjectCallback): void; setForeignObjectNotExists(id: string, obj: ioBroker.SettableObject, options: unknown, callback?: SetObjectCallback): void; + /** Creates an object (which might not belong to this adapter) in the object db. Existing objects are not overwritten. */ + setForeignObjectNotExistsAsync(id: string, obj: ioBroker.SettableObject, options?: unknown): Promise>; /** Extend an object (which might not belong to this adapter) and create it if it might not exist */ extendForeignObject(id: string, objPart: PartialObject, callback?: SetObjectCallback): void; extendForeignObject(id: string, objPart: PartialObject, options: unknown, callback?: SetObjectCallback): void; - // tslint:enable:unified-signatures + /** Extend an object (which might not belong to this adapter) and create it if it might not exist */ + extendForeignObjectAsync(id: string, objPart: PartialObject, options?: unknown): Promise>; /** * Finds an object by its ID or name * @param type - common.type of the state */ findForeignObject(idOrName: string, type: string, callback: FindObjectCallback): void; findForeignObject(idOrName: string, type: string, options: unknown, callback: FindObjectCallback): void; + /** + * Finds an object by its ID or name + * @param type - common.type of the state + */ + findForeignObjectAsync(idOrName: string, type: string): Promise<{ id: string, name: string }>; /** * Deletes an object (which might not belong to this adapter) from the object db * @param id - The id of the object including namespace */ delForeignObject(id: string, callback?: ErrorCallback): void; delForeignObject(id: string, options: unknown, callback?: ErrorCallback): void; + /** + * Deletes an object (which might not belong to this adapter) from the object db + * @param id - The id of the object including namespace + */ + delForeignObjectAsync(id: string, options?: unknown): Promise; // ============================== // states // Multiple signatures help understanding what the parameters are about - // tslint:disable:unified-signatures /** Writes a value into the states DB. */ + // tslint:disable:unified-signatures setState(id: string, state: string | number | boolean | State | Partial, callback?: SetStateCallback): void; setState(id: string, state: string | number | boolean | State | Partial, ack: boolean, callback?: SetStateCallback): void; setState(id: string, state: string | number | boolean | State | Partial, options: unknown, callback?: SetStateCallback): void; setState(id: string, state: string | number | boolean | State | Partial, ack: boolean, options: unknown, callback?: SetStateCallback): void; + /** Writes a value into the states DB. */ + setStateAsync(id: string, state: string | number | boolean | State | Partial, ack?: boolean): Promise>; + setStateAsync(id: string, state: string | number | boolean | State | Partial, options?: unknown): Promise>; + setStateAsync(id: string, state: string | number | boolean | State | Partial, ack: boolean, options: unknown): Promise>; /** Writes a value into the states DB only if it has changed. */ setStateChanged(id: string, state: string | number | boolean | State | Partial, callback?: SetStateChangedCallback): void; setStateChanged(id: string, state: string | number | boolean | State | Partial, ack: boolean, callback?: SetStateChangedCallback): void; setStateChanged(id: string, state: string | number | boolean | State | Partial, options: unknown, callback?: SetStateChangedCallback): void; setStateChanged(id: string, state: string | number | boolean | State | Partial, ack: boolean, options: unknown, callback?: SetStateChangedCallback): void; + /** Writes a value into the states DB only if it has changed. */ + setStateChangedAsync(id: string, state: string | number | boolean | State | Partial, ack?: boolean): Promise>; + setStateChangedAsync(id: string, state: string | number | boolean | State | Partial, options?: unknown): Promise>; + setStateChangedAsync(id: string, state: string | number | boolean | State | Partial, ack: boolean, options: unknown): Promise>; /** Writes a value (which might not belong to this adapter) into the states DB. */ setForeignState(id: string, state: string | number | boolean | State | Partial, callback?: SetStateCallback): void; setForeignState(id: string, state: string | number | boolean | State | Partial, ack: boolean, callback?: SetStateCallback): void; setForeignState(id: string, state: string | number | boolean | State | Partial, options: unknown, callback?: SetStateCallback): void; setForeignState(id: string, state: string | number | boolean | State | Partial, ack: boolean, options: unknown, callback?: SetStateCallback): void; + /** Writes a value (which might not belong to this adapter) into the states DB. */ + setForeignStateAsync(id: string, state: string | number | boolean | State | Partial, ack?: boolean): Promise>; + setForeignStateAsync(id: string, state: string | number | boolean | State | Partial, options?: unknown): Promise>; + setForeignStateAsync(id: string, state: string | number | boolean | State | Partial, ack: boolean, options: unknown): Promise>; /** Writes a value (which might not belong to this adapter) into the states DB only if it has changed. */ setForeignStateChanged(id: string, state: string | number | boolean | State | Partial, callback?: SetStateChangedCallback): void; setForeignStateChanged(id: string, state: string | number | boolean | State | Partial, ack: boolean, callback?: SetStateChangedCallback): void; setForeignStateChanged(id: string, state: string | number | boolean | State | Partial, options: unknown, callback?: SetStateChangedCallback): void; setForeignStateChanged(id: string, state: string | number | boolean | State | Partial, ack: boolean, options: unknown, callback?: SetStateChangedCallback): void; + /** Writes a value (which might not belong to this adapter) into the states DB only if it has changed. */ + setForeignStateChangedAsync(id: string, state: string | number | boolean | State | Partial, ack?: boolean): Promise>; + setForeignStateChangedAsync(id: string, state: string | number | boolean | State | Partial, options?: unknown): Promise>; + setForeignStateChangedAsync(id: string, state: string | number | boolean | State | Partial, ack: boolean, options: unknown): Promise>; // tslint:enable:unified-signatures /** Read a value from the states DB. */ getState(id: string, callback: GetStateCallback): void; getState(id: string, options: unknown, callback: GetStateCallback): void; + /** Read a value from the states DB. */ + getStateAsync(id: string, options?: unknown): Promise>; /** Read a value (which might not belong to this adapter) from the states DB. */ getForeignState(id: string, callback: GetStateCallback): void; getForeignState(id: string, options: unknown, callback: GetStateCallback): void; + /** Read a value (which might not belong to this adapter) from the states DB. */ + getForeignStateAsync(id: string, options?: unknown): Promise>; /** Read all states of this adapter which match the given pattern */ getStates(pattern: string, callback: GetStatesCallback): void; getStates(pattern: string, options: unknown, callback: GetStatesCallback): void; + /** Read all states of this adapter which match the given pattern */ + getStatesAsync(pattern: string, options?: unknown): Promise>; /** Read all states (which might not belong to this adapter) which match the given pattern */ getForeignStates(pattern: string, callback: GetStatesCallback): void; getForeignStates(pattern: string, options: unknown, callback: GetStatesCallback): void; + /** Read all states (which might not belong to this adapter) which match the given pattern */ + getForeignStatesAsync(pattern: string, options?: unknown): Promise>; /** Deletes a state from the states DB, but not the associated object. Consider using @link{deleteState} instead */ delState(id: string, callback?: ErrorCallback): void; delState(id: string, options: unknown, callback?: ErrorCallback): void; + /** Deletes a state from the states DB, but not the associated object. Consider using @link{deleteState} instead */ + delStateAsync(id: string, options?: unknown): Promise; /** Deletes a state from the states DB, but not the associated object */ delForeignState(id: string, callback?: ErrorCallback): void; delForeignState(id: string, options: unknown, callback?: ErrorCallback): void; + /** Deletes a state from the states DB, but not the associated object */ + delForeignStateAsync(id: string, options?: unknown): Promise; getHistory(id: string, options: GetHistoryOptions, callback: GetHistoryCallback): void; + // TODO: getHistoryAsync // MISSING: // pushFifo and similar https://github.com/ioBroker/ioBroker.js-controller/blob/master/lib/adapter.js#L4105 @@ -1138,6 +1260,13 @@ declare global { */ setBinaryState(id: string, binary: Buffer, callback: SetStateCallback): void; setBinaryState(id: string, binary: Buffer, options: unknown, callback: SetStateCallback): void; + /** + * Writes a binary state into Redis + * @param id The id of the state + * @param binary The data to be written + * @param options (optional) Some internal options. + */ + setBinaryStateAsync(id: string, binary: Buffer, options?: unknown): Promise>; /** * Reads a binary state from Redis * @param id The id of the state @@ -1146,6 +1275,12 @@ declare global { */ getBinaryState(id: string, callback: GetBinaryStateCallback): void; getBinaryState(id: string, options: unknown, callback: GetBinaryStateCallback): void; + /** + * Reads a binary state from Redis + * @param id The id of the state + * @param options (optional) Some internal options. + */ + getBinaryStateAsync(id: string, options?: unknown): Promise>; // ============================== // enums @@ -1154,64 +1289,155 @@ declare global { getEnum(callback: GetEnumCallback): void; getEnum(name: string, callback: GetEnumCallback): void; getEnum(name: string, options: unknown, callback: GetEnumCallback): void; + /** Returns the enum tree, filtered by the optional enum name */ + getEnumAsync(name: string, options?: unknown): Promise<{ result: Record, requestEnum: string }>; + /** Returns the enum tree, filtered by the optional enum name */ getEnums(callback: GetEnumsCallback): void; getEnums(enumList: EnumList, callback: GetEnumsCallback): void; getEnums(enumList: EnumList, options: unknown, callback: GetEnumsCallback): void; + /** Returns the enum tree, filtered by the optional enum name */ + getEnumsAsync(enumList: EnumList, options?: unknown): Promise>; - addChannelToEnum(enumName: string, addTo: string, parentDevice: string, channelName: string, options?: unknown, callback?: ErrorCallback): void; - deleteChannelFromEnum(enumName: string, parentDevice: string, channelName: string, options?: unknown, callback?: ErrorCallback): void; + addChannelToEnum(enumName: string, addTo: string, parentDevice: string, channelName: string, callback?: ErrorCallback): void; + addChannelToEnum(enumName: string, addTo: string, parentDevice: string, channelName: string, options: unknown, callback?: ErrorCallback): void; + addChannelToEnumAsync(enumName: string, addTo: string, parentDevice: string, channelName: string, options?: unknown): Promise; - addStateToEnum(enumName: string, addTo: string, parentDevice: string, parentChannel: string, stateName: string, options?: unknown, callback?: ErrorCallback): void; - deleteStateFromEnum(enumName: string, parentDevice: string, parentChannel: string, stateName: string, options?: unknown, callback?: ErrorCallback): void; + deleteChannelFromEnum(enumName: string, parentDevice: string, channelName: string, callback?: ErrorCallback): void; + deleteChannelFromEnum(enumName: string, parentDevice: string, channelName: string, options: unknown, callback?: ErrorCallback): void; + deleteChannelFromEnumAsync(enumName: string, parentDevice: string, channelName: string, options?: unknown): Promise; + + addStateToEnum(enumName: string, addTo: string, parentDevice: string, parentChannel: string, stateName: string, callback?: ErrorCallback): void; + addStateToEnum(enumName: string, addTo: string, parentDevice: string, parentChannel: string, stateName: string, options: unknown, callback?: ErrorCallback): void; + addStateToEnumAsync(enumName: string, addTo: string, parentDevice: string, parentChannel: string, stateName: string, options?: unknown): Promise; + + deleteStateFromEnum(enumName: string, parentDevice: string, parentChannel: string, stateName: string, callback?: ErrorCallback): void; + deleteStateFromEnum(enumName: string, parentDevice: string, parentChannel: string, stateName: string, options: unknown, callback?: ErrorCallback): void; + deleteStateFromEnumAsync(enumName: string, parentDevice: string, parentChannel: string, stateName: string, options?: unknown): Promise; // ============================== // subscriptions /** Subscribe to changes of objects in this instance */ - subscribeObjects(pattern: string, options?: unknown): void; + subscribeObjects(pattern: string, options?: unknown, callback?: ErrorCallback): void; /** Subscribe to changes of objects (which might not belong to this adapter) */ - subscribeForeignObjects(pattern: string, options?: unknown): void; + subscribeForeignObjects(pattern: string, options?: unknown, callback?: ErrorCallback): void; /** Unsubscribe from changes of objects in this instance */ - unsubscribeObjects(pattern: string, options?: unknown): void; + unsubscribeObjects(pattern: string, options?: unknown, callback?: ErrorCallback): void; /** Unsubscribe from changes of objects (which might not belong to this adapter) */ - unsubscribeForeignObjects(pattern: string, options?: unknown): void; + unsubscribeForeignObjects(pattern: string, options?: unknown, callback?: ErrorCallback): void; /** Subscribe to changes of states in this instance */ - subscribeStates(pattern: string, options?: unknown, callback?: ErrorCallback): void; + subscribeStates(pattern: string, callback?: ErrorCallback): void; + subscribeStates(pattern: string, options: unknown, callback?: ErrorCallback): void; + /** Subscribe to changes of states in this instance */ + subscribeStatesAsync(pattern: string, options?: unknown): Promise; + /** Subscribe to changes of states (which might not belong to this adapter) */ - subscribeForeignStates(pattern: string, options?: unknown, callback?: ErrorCallback): void; + subscribeForeignStates(pattern: string, callback?: ErrorCallback): void; + subscribeForeignStates(pattern: string, options: unknown, callback?: ErrorCallback): void; + /** Subscribe to changes of states (which might not belong to this adapter) */ + subscribeForeignStatesAsync(pattern: string, options?: unknown): Promise; + /** * Subscribe from changes of states in this instance * @param pattern - Must match the pattern used to subscribe */ - unsubscribeStates(pattern: string, options?: unknown, callback?: ErrorCallback): void; + unsubscribeStates(pattern: string, callback?: ErrorCallback): void; + unsubscribeStates(pattern: string, options: unknown, callback?: ErrorCallback): void; + /** + * Subscribe from changes of states in this instance + * @param pattern - Must match the pattern used to subscribe + */ + unsubscribeStatesAsync(pattern: string, options?: unknown): Promise; /** * Subscribe from changes of states (which might not belong to this adapter) * @param pattern - Must match the pattern used to subscribe */ - unsubscribeForeignStates(pattern: string, options?: unknown, callback?: ErrorCallback): void; + unsubscribeForeignStates(pattern: string, callback?: ErrorCallback): void; + unsubscribeForeignStates(pattern: string, options: unknown, callback?: ErrorCallback): void; + /** + * Subscribe from changes of states (which might not belong to this adapter) + * @param pattern - Must match the pattern used to subscribe + */ + unsubscribeForeignStatesAsync(pattern: string, options?: unknown): Promise; // ============================== // devices and channels + // tslint:disable:unified-signatures /** creates an object with type device */ - createDevice(deviceName: string, common?: any, native?: any, options?: unknown, callback?: SetObjectCallback): void; + createDevice(deviceName: string, callback?: SetObjectCallback): void; + createDevice(deviceName: string, common: Partial, callback?: SetObjectCallback): void; + createDevice(deviceName: string, common: Partial, native: Record, callback?: SetObjectCallback): void; + createDevice(deviceName: string, common: Partial, native: Record, options: unknown, callback?: SetObjectCallback): void; + /** creates an object with type device */ + createDeviceAsync(deviceName: string, common?: Partial): Promise>; + createDeviceAsync(deviceName: string, common: Partial, native?: Record): Promise>; + createDeviceAsync(deviceName: string, common: Partial, native: Record, options?: unknown): Promise>; /** deletes a device, its channels and states */ - deleteDevice(deviceName: string, options?: unknown, callback?: ErrorCallback): void; - /** gets the devices of this instance */ + deleteDevice(deviceName: string, callback?: ErrorCallback): void; + deleteDevice(deviceName: string, options: unknown, callback?: ErrorCallback): void; + /** deletes a device, its channels and states */ + deleteDeviceAsync(deviceName: string, options?: unknown): Promise; - /** creates an object with type channel */ - createChannel(parentDevice: string, channelName: string, roleOrCommon?: string | object, native?: any, options?: unknown, callback?: SetObjectCallback): void; - /** deletes a channel and its states */ + /** Creates an object with type channel. It must be located under a device */ + createChannel(parentDevice: string, channelName: string, callback?: SetObjectCallback): void; + createChannel(parentDevice: string, channelName: string, roleOrCommon: string | Partial, callback?: SetObjectCallback): void; + createChannel(parentDevice: string, channelName: string, roleOrCommon: string | Partial, native: Record, callback?: SetObjectCallback): void; + createChannel( + parentDevice: string, channelName: string, roleOrCommon: string | Partial, + native: Record, options: unknown, callback?: SetObjectCallback + ): void; + /** Creates an object with type channel. It must be located under a device */ + createChannelAsync(parentDevice: string, channelName: string, roleOrCommon?: string | Partial): Promise>; + createChannelAsync( + parentDevice: string, channelName: string, roleOrCommon: string | Partial, native?: Record + ): Promise>; + createChannelAsync( + parentDevice: string, channelName: string, roleOrCommon: string | Partial, native: Record, + options?: unknown + ): Promise>; + /** Deletes a channel and its states. It must have been created with `createChannel` */ deleteChannel(channelName: string, options?: unknown, callback?: ErrorCallback): void; deleteChannel(parentDevice: string, channelName: string, options?: unknown, callback?: ErrorCallback): void; + /** Deletes a channel and its states. It must have been created with `createChannel` */ + deleteChannelAsync(channelName: string, options?: unknown): Promise; + deleteChannelAsync(parentDevice: string, channelName: string, options?: unknown): Promise; - /** creates a state and the corresponding object */ - createState(parentDevice: string, parentChannel: string, stateName: string, roleOrCommon?: string | object, native?: any, options?: unknown, callback?: SetObjectCallback): void; - /** deletes a state */ + /** + * Creates a state and the corresponding object. It must be located in a channel under a device + */ + createState(parentDevice: string, parentChannel: string, stateName: string, callback?: SetObjectCallback): void; + createState(parentDevice: string, parentChannel: string, stateName: string, roleOrCommon: string | Partial, callback?: SetObjectCallback): void; + createState( + parentDevice: string, parentChannel: string, stateName: string, roleOrCommon: string | Partial, + native: Record, callback?: SetObjectCallback + ): void; + createState( + parentDevice: string, parentChannel: string, stateName: string, roleOrCommon: string | Partial, + native: Record, options: unknown, callback?: SetObjectCallback + ): void; + /** + * Creates a state and the corresponding object. It must be located in a channel under a device + */ + createStateAsync(parentDevice: string, parentChannel: string, stateName: string, roleOrCommon?: string | Partial): Promise>; + createStateAsync( + parentDevice: string, parentChannel: string, stateName: string, roleOrCommon: string | Partial, + native?: Record + ): Promise>; + createStateAsync( + parentDevice: string, parentChannel: string, stateName: string, roleOrCommon: string | Partial, + native: Record, options?: unknown + ): Promise>; + /** Deletes a state. It must have been created with `createState` */ deleteState(stateName: string, options?: unknown, callback?: ErrorCallback): void; deleteState(parentChannel: string, stateName: string, options?: unknown, callback?: ErrorCallback): void; deleteState(parentDevice: string, parentChannel: string, stateName: string, options?: unknown, callback?: ErrorCallback): void; + /** Deletes a state. It must have been created with `createState` */ + deleteStateAsync(stateName: string, options?: unknown): Promise; + deleteStateAsync(parentChannel: string, stateName: string, options?: unknown): Promise; + deleteStateAsync(parentDevice: string, parentChannel: string, stateName: string, options?: unknown): Promise; + // tslint:enable:unified-signatures /** * Returns a list of all devices in this adapter instance @@ -1220,6 +1446,12 @@ declare global { */ getDevices(callback: GetObjectsCallback3): void; getDevices(options: unknown, callback: GetObjectsCallback3): void; + /** + * Returns a list of all devices in this adapter instance + * @param options (optional) Some internal options. + * @param callback Is called when the operation has finished (successfully or not) + */ + getDevicesAsync(options?: unknown): Promise>>; /** * Returns a list of all channels in this adapter instance @@ -1228,8 +1460,8 @@ declare global { * @param callback Is called when the operation has finished (successfully or not) */ getChannels(callback: GetObjectsCallback3): void; - getChannels(parentDevice: string | null, callback: GetObjectsCallback3): void; - getChannels(parentDevice: string | null, options: unknown, callback: GetObjectsCallback3): void; + getChannels(parentDevice: string, callback: GetObjectsCallback3): void; + getChannels(parentDevice: string, options: unknown, callback: GetObjectsCallback3): void; /** * Returns a list of all channels in this adapter instance * @param parentDevice (optional) Name of the parent device to filter the channels by @@ -1237,8 +1469,16 @@ declare global { * @param callback Is called when the operation has finished (successfully or not) */ getChannelsOf(callback: GetObjectsCallback3): void; - getChannelsOf(parentDevice: string | null, callback: GetObjectsCallback3): void; - getChannelsOf(parentDevice: string | null, options: unknown, callback: GetObjectsCallback3): void; + getChannelsOf(parentDevice: string, callback: GetObjectsCallback3): void; + getChannelsOf(parentDevice: string, options: unknown, callback: GetObjectsCallback3): void; + /** + * Returns a list of all channels in this adapter instance + * @param parentDevice (optional) Name of the parent device to filter the channels by + * @param options (optional) Some internal options. + */ + getChannelsOfAsync(): Promise>>; + // tslint:disable-next-line:unified-signatures + getChannelsOfAsync(parentDevice: string, options?: unknown): Promise>>; /** * Returns a list of all states in this adapter instance @@ -1248,36 +1488,82 @@ declare global { * @param callback Is called when the operation has finished (successfully or not) */ getStatesOf(callback: GetObjectsCallback3): void; - getStatesOf(parentDevice: string | null, callback: GetObjectsCallback3): void; - getStatesOf(parentDevice: string | null, parentChannel: string | null, callback: GetObjectsCallback3): void; - getStatesOf(parentDevice: string | null, parentChannel: string | null, options: unknown, callback: GetObjectsCallback3): void; + getStatesOf(parentDevice: string, callback: GetObjectsCallback3): void; + getStatesOf(parentDevice: string, parentChannel: string, callback: GetObjectsCallback3): void; + getStatesOf(parentDevice: string, parentChannel: string, options: unknown, callback: GetObjectsCallback3): void; + /** + * Returns a list of all states in this adapter instance + * @param parentDevice (optional) Name of the parent device to filter the channels by + * @param parentChannel (optional) Name of the parent channel to filter the channels by + * @param options (optional) Some internal options. + */ + // tslint:disable:unified-signatures + getStatesOfAsync(): Promise>>; + getStatesOfAsync(parentDevice: string, parentChannel?: string): Promise>>; + getStatesOfAsync(parentDevice: string, parentChannel: string, options?: unknown): Promise>>; + // tslint:enable:unified-signatures // ============================== // filesystem /** * reads the content of directory from DB for given adapter and path - * @param adapter - adapter name. If adapter name is null, default will be the name of the current adapter. - * @param path - path to direcory without adapter name. E.g. If you want to read "/vis.0/main/views.json", here must be "/main/views.json" and _adapter must be equal to "vis.0". + * @param adapterName - adapter name. If adapter name is null, default will be the name of the current adapter. + * @param path - path to directory without adapter name. E.g. If you want to read "/vis.0/main/views.json", here must be "/main/views.json" and _adapter must be equal to "vis.0". */ - readDir(adapterName: string, path: string, callback: ReadDirCallback): void; - readDir(adapterName: string, path: string, options: unknown, callback: ReadDirCallback): void; - mkDir(adapterName: string, path: string, callback: ErrorCallback): void; - mkDir(adapterName: string, path: string, options: unknown, callback: ErrorCallback): void; + readDir(adapterName: string | null, path: string, callback: ReadDirCallback): void; + readDir(adapterName: string | null, path: string, options: unknown, callback: ReadDirCallback): void; + /** + * reads the content of directory from DB for given adapter and path + * @param adapterName - adapter name. If adapter name is null, default will be the name of the current adapter. + * @param path - path to directory without adapter name. E.g. If you want to read "/vis.0/main/views.json", here must be "/main/views.json" and _adapter must be equal to "vis.0". + */ + readDirAsync(adapterName: string | null, path: string, options?: unknown): Promise>; - readFile(adapterName: string, path: string, callback: ReadFileCallback): void; - readFile(adapterName: string, path: string, options: unknown, callback: ReadFileCallback): void; - writeFile(adapterName: string, path: string, data: Buffer | string, callback: ErrorCallback): void; + mkDir(adapterName: string | null, path: string, callback: ErrorCallback): void; + mkDir(adapterName: string | null, path: string, options: unknown, callback: ErrorCallback): void; + mkDirAsync(adapterName: string | null, path: string, options?: unknown): Promise; + + readFile(adapterName: string | null, path: string, callback: ReadFileCallback): void; + readFile(adapterName: string | null, path: string, options: unknown, callback: ReadFileCallback): void; + readFileAsync(adapterName: string | null, path: string, options?: unknown): Promise<{ file: string | Buffer, mimeType: string }>; + + writeFile(adapterName: string | null, path: string, data: Buffer | string, callback: ErrorCallback): void; // options see https://github.com/ioBroker/ioBroker.js-controller/blob/master/lib/objects/objectsInMemServer.js#L599 - writeFile(adapterName: string, path: string, data: Buffer | string, options: unknown, callback: ErrorCallback): void; + writeFile(adapterName: string | null, path: string, data: Buffer | string, options: unknown, callback: ErrorCallback): void; + writeFileAsync(adapterName: string | null, path: string, data: Buffer | string, options?: unknown): Promise; - delFile(adapterName: string, path: string, callback: ErrorCallback): void; - delFile(adapterName: string, path: string, options: unknown, callback: ErrorCallback): void; - unlink(adapterName: string, path: string, callback: ErrorCallback): void; - unlink(adapterName: string, path: string, options: unknown, callback: ErrorCallback): void; + /** + * Deletes a given file + * @param adapterName - adapter name. If adapter name is null, default will be the name of the current adapter. + * @param path - path to directory without adapter name. E.g. If you want to delete "/vis.0/main/views.json", here must be "/main/views.json" and _adapter must be equal to "vis.0". + */ + delFile(adapterName: string | null, path: string, callback: ErrorCallback): void; + delFile(adapterName: string | null, path: string, options: unknown, callback: ErrorCallback): void; + /** + * Deletes a given file + * @param adapterName - adapter name. If adapter name is null, default will be the name of the current adapter. + * @param path - path to directory without adapter name. E.g. If you want to delete "/vis.0/main/views.json", here must be "/main/views.json" and _adapter must be equal to "vis.0". + */ + delFileAsync(adapterName: string | null, path: string, options?: unknown): Promise; - rename(adapterName: string, oldName: string, newName: string, callback: ErrorCallback): void; - rename(adapterName: string, oldName: string, newName: string, options: unknown, callback: ErrorCallback): void; + /** + * Deletes a given file + * @param adapterName - adapter name. If adapter name is null, default will be the name of the current adapter. + * @param path - path to directory without adapter name. E.g. If you want to delete "/vis.0/main/views.json", here must be "/main/views.json" and _adapter must be equal to "vis.0". + */ + unlink(adapterName: string | null, path: string, callback: ErrorCallback): void; + unlink(adapterName: string | null, path: string, options: unknown, callback: ErrorCallback): void; + /** + * Deletes a given file + * @param adapterName - adapter name. If adapter name is null, default will be the name of the current adapter. + * @param path - path to directory without adapter name. E.g. If you want to delete "/vis.0/main/views.json", here must be "/main/views.json" and _adapter must be equal to "vis.0". + */ + unlinkAsync(adapterName: string | null, path: string, options?: unknown): Promise; + + rename(adapterName: string | null, oldName: string, newName: string, callback: ErrorCallback): void; + rename(adapterName: string | null, oldName: string, newName: string, options: unknown, callback: ErrorCallback): void; + renameAsync(adapterName: string | null, oldName: string, newName: string, options?: unknown): Promise; /** * Changes access rights of all files in the adapter directory @@ -1287,6 +1573,7 @@ declare global { * @param callback Is called when the operation has finished (successfully or not) */ chmodFile(adapter: string | null, path: string, options: { mode: number | string } | Record, callback: ChownFileCallback): void; + chmodFileAsync(adapter: string | null, path: string, options: { mode: number | string } | Record): Promise<{ entries: ChownFileResult[], id: string }>; // ============================== // formatting @@ -1325,6 +1612,8 @@ declare global { // TODO: Redefine callbacks as subclass of GenericCallback type GenericCallback = (err: string | null, result?: T) => void; + type MessageCallback = (response?: Message) => void; + type SetObjectCallback = (err: string | null, obj: { id: string }) => void; type GetObjectCallback = (err: string | null, obj: ioBroker.Object | null | undefined) => void; type GetEnumCallback = (err: string | null, enums: Record, requestedEnum: string) => void; @@ -1354,6 +1643,8 @@ declare global { // This is a version used by GetDevices/GetChannelsOf/GetStatesOf type GetObjectsCallback3 = (err: string | null, result?: Array>) => void; + type SecondParameterOf any> = T extends (arg0: any, arg1: infer R, ...args: any[]) => any ? R : never; + type CallbackReturnTypeOf any> = Exclude, null | undefined>; type GetStateCallback = (err: string | null, state: State | null | undefined) => void; type GetStatesCallback = (err: string | null, states: Record) => void; /** Version of the callback used by States.getStates */ diff --git a/types/iobroker/iobroker-tests.ts b/types/iobroker/iobroker-tests.ts index 997775c76f..21233e20fd 100644 --- a/types/iobroker/iobroker-tests.ts +++ b/types/iobroker/iobroker-tests.ts @@ -1,34 +1,7 @@ -// For now, this "utils" module is necessary, as it is included in every adapter -// Once this PR is merged and @types/iobroker is available, it will become part of -// `iobroker.adapter-core`, which brings typings for it -declare const utils: { - readonly controllerDir: string; - getConfig(): string; - - // tslint:disable:unified-signatures - adapter(adapterName: string): ioBroker.Adapter; - adapter(adapterOptions: ioBroker.AdapterOptions): ioBroker.Adapter; - // tslint:enable:unified-signatures -}; - declare function assertNever(val: never): never; // Let the tests begin -let adapter: ioBroker.Adapter; - -// Test constructors -adapter = utils.adapter("my-adapter-name"); -adapter = utils.adapter({ - name: "my-adapter-name" -}); -adapter = utils.adapter({ - name: "my-adapter-name", - ready: readyHandler, - stateChange: stateChangeHandler, - objectChange: objectChangeHandler, - message: messageHandler, - unload: unloadHandler, -}); +declare let adapter: ioBroker.Adapter; // Test EventEmitter definitions adapter @@ -126,7 +99,8 @@ function messageHandler(msg: ioBroker.Message) { msg.callback.time.toFixed(); msg.command.toLowerCase(); msg.from.toLowerCase(); - msg.message.toString(); + typeof msg.message === "object" && msg.message.anything; + typeof msg.message === "string" && msg.message.toLowerCase(); } function unloadHandler(callback: ioBroker.EmptyCallback) { @@ -141,37 +115,65 @@ adapter.setState("state.name", "value", (err, id) => { }); adapter.setState("state.name", { val: "value", ack: true }); adapter.setState("state.name", { val: "value", ack: true }, (err, id) => { }); +adapter.setStateAsync("state.name", "value").then(id => id.toLowerCase()); +adapter.setStateAsync("state.name", "value", true).then(id => id.toLowerCase()); +adapter.setStateAsync("state.name", { val: "value", ack: true }).then(id => id.toLowerCase()); + adapter.setStateChanged("state.name", "value"); adapter.setStateChanged("state.name", "value", true); adapter.setStateChanged("state.name", "value", (err, id) => { }); adapter.setStateChanged("state.name", { val: "value", ack: true }); adapter.setStateChanged("state.name", { val: "value", ack: true }, (err, id) => { }); +adapter.setStateChangedAsync("state.name", "value").then(id => id.toLowerCase()); +adapter.setStateChangedAsync("state.name", "value", true).then(id => id.toLowerCase()); +adapter.setStateChangedAsync("state.name", { val: "value", ack: true }).then(id => id.toLowerCase()); + adapter.setForeignState("state.name", "value"); adapter.setForeignState("state.name", "value", true); adapter.setForeignState("state.name", "value", (err, id) => { }); adapter.setForeignState("state.name", { val: "value", ack: true }); adapter.setForeignState("state.name", { val: "value", ack: true }, (err, id) => { }); +adapter.setForeignStateAsync("state.name", "value").then(id => id.toLowerCase()); +adapter.setForeignStateAsync("state.name", "value", true).then(id => id.toLowerCase()); +adapter.setForeignStateAsync("state.name", { val: "value", ack: true }).then(id => id.toLowerCase()); + adapter.setForeignStateChanged("state.name", "value"); adapter.setForeignStateChanged("state.name", "value", true); adapter.setForeignStateChanged("state.name", "value", (err, id) => { }); adapter.setForeignStateChanged("state.name", { val: "value", ack: true }); adapter.setForeignStateChanged("state.name", { val: "value", ack: true }, (err, id) => { }); +adapter.setForeignStateChangedAsync("state.name", "value").then(id => id.toLowerCase()); +adapter.setForeignStateChangedAsync("state.name", "value", true).then(id => id.toLowerCase()); +adapter.setForeignStateChangedAsync("state.name", { val: "value", ack: true }).then(id => id.toLowerCase()); + adapter.setObject("obj.id", { type: "state", common: { name: "foo" }, native: {} }); adapter.setObject("obj.id", { type: "state", common: { name: "foo" }, native: {} }, (err, id) => { }); adapter.setForeignObject("obj.id", { type: "state", common: { name: "foo" }, native: {} }); adapter.setForeignObject("obj.id", { type: "state", common: { name: "foo" }, native: {} }, (err, id) => { }); +adapter.setObjectAsync("obj.id", { type: "state", common: { name: "foo" }, native: {} }).then(({ id }) => id.toLowerCase()); +adapter.setForeignObjectAsync("obj.id", { type: "state", common: { name: "foo" }, native: {} }).then(({ id }) => id.toLowerCase()); + adapter.setObjectNotExists("obj.id", { type: "state", common: { name: "foo" }, native: {} }); adapter.setObjectNotExists("obj.id", { type: "state", common: { name: "foo" }, native: {} }, (err, id) => { }); adapter.setForeignObjectNotExists("obj.id", { type: "state", common: { name: "foo" }, native: {} }); adapter.setForeignObjectNotExists("obj.id", { type: "state", common: { name: "foo" }, native: {} }, (err, id) => { }); +adapter.setObjectNotExistsAsync("obj.id", { type: "state", common: { name: "foo" }, native: {} }).then(({ id }) => id.toLowerCase()); +adapter.setForeignObjectNotExistsAsync("obj.id", { type: "state", common: { name: "foo" }, native: {} }).then(({ id }) => id.toLowerCase()); + adapter.getObject("obj.id", (err, obj) => { }); adapter.getForeignObject("obj.id", (err, obj) => { }); +adapter.getObjectAsync("obj.id").then(obj => obj._id.toLowerCase()); +adapter.getForeignObjectAsync("obj.id").then(obj => obj._id.toLowerCase()); + +adapter.getForeignObjects("*", (err, objs) => objs["foo"]._id.toLowerCase()); +adapter.getForeignObjectsAsync("*").then(objs => objs["foo"]._id.toLowerCase()); + adapter.subscribeObjects("*"); adapter.subscribeStates("*"); adapter.subscribeForeignObjects("*"); @@ -197,3 +199,56 @@ switch (adapter.log.level) { default: assertNever(adapter.log.level); } + +adapter.sendTo("foo.0", "command", "message"); +adapter.sendTo("foo.0", "message"); +adapter.sendTo("foo.0", "command", {msg: "message"}); +adapter.sendTo("foo.0", {msg: "message"}); + +function handleMessageResponse(response?: ioBroker.Message) { + if (!response) return; + response._id.toFixed(); + response.callback.ack.valueOf(); + response.callback.id.toFixed(); + response.callback.message.toString(); + response.callback.time.toFixed(); + response.command.toLowerCase(); + response.from.toLowerCase(); + typeof response.message === "object" && response.message.anything; + typeof response.message === "string" && response.message.toLowerCase(); +} +adapter.sendTo("foo.0", "command", "message", handleMessageResponse); +adapter.sendTo("foo.0", "message", handleMessageResponse); +adapter.sendTo("foo.0", "command", {msg: "message"}, handleMessageResponse); +adapter.sendTo("foo.0", {msg: "message"}, handleMessageResponse); + +adapter.sendToAsync("foo.0", "command", "message").then(handleMessageResponse); +adapter.sendToAsync("foo.0", "message").then(handleMessageResponse); +adapter.sendToAsync("foo.0", "command", {msg: "message"}).then(handleMessageResponse); +adapter.sendToAsync("foo.0", {msg: "message"}).then(handleMessageResponse); + +adapter.sendToHost("host-foo", "command", "message"); +adapter.sendToHost("host-foo", "message"); +adapter.sendToHost("host-foo", "command", {msg: "message"}); +adapter.sendToHost("host-foo", {msg: "message"}); + +adapter.sendToHost("host-foo", "command", "message", handleMessageResponse); +adapter.sendToHost("host-foo", "message", handleMessageResponse); +adapter.sendToHost("host-foo", "command", {msg: "message"}, handleMessageResponse); +adapter.sendToHost("host-foo", {msg: "message"}, handleMessageResponse); + +adapter.sendToHostAsync("host-foo", "command", "message").then(handleMessageResponse); +adapter.sendToHostAsync("host-foo", "message").then(handleMessageResponse); +adapter.sendToHostAsync("host-foo", "command", {msg: "message"}).then(handleMessageResponse); +adapter.sendToHostAsync("host-foo", {msg: "message"}).then(handleMessageResponse); + +function handleError(err?: string) { } +adapter.subscribeStates("*", handleError); +adapter.subscribeForeignStates("*", handleError); +adapter.unsubscribeStates("*", handleError); +adapter.unsubscribeForeignStates("*", handleError); + +adapter.subscribeStatesAsync("*").catch(handleError); +adapter.subscribeForeignStatesAsync("*").catch(handleError); +adapter.unsubscribeStatesAsync("*").catch(handleError); +adapter.unsubscribeForeignStatesAsync("*").catch(handleError); diff --git a/types/iopipe__iopipe/index.d.ts b/types/iopipe__iopipe/index.d.ts new file mode 100644 index 0000000000..338de9ca58 --- /dev/null +++ b/types/iopipe__iopipe/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for iopipe__iopipe 1.12 +// Project: https://github.com/iopipe/iopipe (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.) +// Definitions by: Javon Harper +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function iopipe(config?: iopipe.LibraryConfig): iopipe.FunctionWrapper; + +declare namespace iopipe { + function label(label: string): void; + + function metric(label: string, value: number): void; + + namespace mark { + function start(label: string): void; + function end(label: string): void; + } + + interface LibraryConfig { + debug?: boolean; + token?: string; + networkTimeout?: number; + timeoutWindow?: number; + } + + type FunctionWrapper = (handler: any) => void; +} + +export = iopipe; diff --git a/types/iopipe__iopipe/iopipe__iopipe-tests.ts b/types/iopipe__iopipe/iopipe__iopipe-tests.ts new file mode 100644 index 0000000000..f5bd387dc8 --- /dev/null +++ b/types/iopipe__iopipe/iopipe__iopipe-tests.ts @@ -0,0 +1,17 @@ +import iopipe = require('iopipe__iopipe'); + +const config = { + token: "ABCDEFG" +}; + +function run(event: any, context: any, callback?: any) { + iopipe.label('my label'); + + iopipe.metric("magic number", 42); + + iopipe.mark.start("my-db-call"); + // an expensive database query + iopipe.mark.end("my-db-call"); +} + +iopipe(config)(run); diff --git a/types/iopipe__iopipe/tsconfig.json b/types/iopipe__iopipe/tsconfig.json new file mode 100644 index 0000000000..01d23ff29d --- /dev/null +++ b/types/iopipe__iopipe/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "iopipe__iopipe-tests.ts" + ], + "paths": { + "@iopipe/iopipe": ["iopipe__iopipe"] + } +} diff --git a/types/iopipe__iopipe/tslint.json b/types/iopipe__iopipe/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/iopipe__iopipe/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ioredis/index.d.ts b/types/ioredis/index.d.ts index acd380e7db..d5f829c8fe 100644 --- a/types/ioredis/index.d.ts +++ b/types/ioredis/index.d.ts @@ -10,6 +10,7 @@ // Dmitry Motovilov // Oleg Repin // Ting-Wai To +// Alex Petty // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -106,6 +107,7 @@ declare namespace IORedis { del(...keys: KeyType[]): Promise; exists(...keys: KeyType[]): Promise; + exists(key: KeyType, callback: (err: Error, res: number) => void): void; setbit(key: KeyType, offset: number, value: any, callback: (err: Error, res: number) => void): void; setbit(key: KeyType, offset: number, value: any): Promise; @@ -971,8 +973,13 @@ declare namespace IORedis { count?: number; } + type DNSLookupFunction = (hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void) => void; + interface NatMap { + [key: string]: {host: string, port: number}; + } + interface ClusterOptions { - clusterRetryStrategy?(times: number): number; + clusterRetryStrategy?(times: number, reason?: Error): number | null; enableOfflineQueue?: boolean; enableReadyCheck?: boolean; scaleReads?: string; @@ -980,7 +987,12 @@ declare namespace IORedis { retryDelayOnFailover?: number; retryDelayOnClusterDown?: number; retryDelayOnTryAgain?: number; + slotsRefreshTimeout?: number; + slotsRefreshInterval?: number; redisOptions?: RedisOptions; + lazyConnect?: boolean; + dnsLookup?: DNSLookupFunction; + natMap?: NatMap; } interface MultiOptions { diff --git a/types/ioredis/ioredis-tests.ts b/types/ioredis/ioredis-tests.ts index df8e37aca8..9950a8543f 100644 --- a/types/ioredis/ioredis-tests.ts +++ b/types/ioredis/ioredis-tests.ts @@ -38,6 +38,7 @@ redis.set('key', '100', ['EX', 10, 'NX'], (err, data) => {}); redis.setBuffer('key', '100', 'NX', 'EX', 10, (err, data) => {}); redis.exists('foo').then(result => result * 1); +redis.exists('foo', ((err, data) => data * 1)); // Should support usage of Buffer redis.set(Buffer.from('key'), '100'); @@ -192,3 +193,12 @@ redis.xread('STREAMS', 'streamName', '0-0'); redis.xreadgroup('GROUP', 'groupName', 'consumerName', 'STREAMS', 'streamName', '>'); redis.xrevrange('streamName', '+', '-', 'COUNT', 1); redis.xtrim('streamName', 'MAXLEN', '~', 1000); + +// ClusterRetryStrategy can return non-numbers to stop retrying +new Redis.Cluster([], { + clusterRetryStrategy: (times: number, reason?: Error) => null +}); + +new Redis.Cluster([], { + clusterRetryStrategy: (times: number, reason?: Error) => 1 +}); diff --git a/types/ioredis/v3/index.d.ts b/types/ioredis/v3/index.d.ts index ee2777c92c..b346f7cee3 100644 --- a/types/ioredis/v3/index.d.ts +++ b/types/ioredis/v3/index.d.ts @@ -7,6 +7,7 @@ // Shahar Mor // Whemoon Jang // Francis Gulotta +// Alex Petty // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -102,6 +103,7 @@ declare namespace IORedis { del(...keys: string[]): any; exists(...keys: string[]): Promise; + exists(key: string, callback: (err: Error, res: number) => void): void; setbit(key: string, offset: number, value: any, callback: (err: Error, res: number) => void): void; setbit(key: string, offset: number, value: any): Promise; @@ -894,7 +896,7 @@ declare namespace IORedis { } interface ClusterOptions { - clusterRetryStrategy?(times: number): number; + clusterRetryStrategy?(times: number): number | null; enableOfflineQueue?: boolean; enableReadyCheck?: boolean; scaleReads?: string; diff --git a/types/ioredis/v3/ioredis-tests.ts b/types/ioredis/v3/ioredis-tests.ts index b77192e3b8..6c16a338ea 100644 --- a/types/ioredis/v3/ioredis-tests.ts +++ b/types/ioredis/v3/ioredis-tests.ts @@ -32,6 +32,7 @@ redis.set('key', '100', ['EX', 10, 'NX'], (err, data) => {}); redis.setBuffer('key', '100', 'NX', 'EX', 10, (err, data) => {}); redis.exists('foo').then(result => result * 1); +redis.exists('foo', ((err, data) => data * 1)); new Redis(); // Connect to 127.0.0.1:6379 new Redis(6380); // 127.0.0.1:6380 @@ -153,3 +154,12 @@ new Redis.Cluster([{ host: 'localhost', port: 6379 }]); + +// ClusterRetryStrategy can return non-numbers to stop retrying +new Redis.Cluster([], { + clusterRetryStrategy: (times: number) => null +}); + +new Redis.Cluster([], { + clusterRetryStrategy: (times: number) => 1 +}); diff --git a/types/ip-regex/index.d.ts b/types/ip-regex/index.d.ts index c26cbaab3b..5e26927a98 100644 --- a/types/ip-regex/index.d.ts +++ b/types/ip-regex/index.d.ts @@ -1,12 +1,16 @@ -// Type definitions for ip-regex 2.0 +// Type definitions for ip-regex 3.0 // Project: https://github.com/sindresorhus/ip-regex -// Definitions by: Daniel Perez Alvarez +// Definitions by: Renārs Vilnis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/** Regular expression for matching IP addresses (IPv4 & IPv6). */ -declare function ipRegex(options?: { - /** Only match an exact string. Useful with RegExp#test to check if a string is an IP address. */ - exact?: boolean; -}): RegExp; +declare function ip(options?: ip.IpRegexOptions): RegExp; -export = ipRegex; +declare namespace ip { + interface IpRegexOptions { + exact?: boolean; + } + + function v4(options?: IpRegexOptions): RegExp; + function v6(options?: IpRegexOptions): RegExp; +} +export = ip; diff --git a/types/ip-regex/ip-regex-tests.ts b/types/ip-regex/ip-regex-tests.ts index dcaa72c72d..2743521b1d 100644 --- a/types/ip-regex/ip-regex-tests.ts +++ b/types/ip-regex/ip-regex-tests.ts @@ -1,7 +1,13 @@ import ipRegex = require('ip-regex'); -ipRegex().test('unicorn 192.168.0.1'); - -ipRegex({exact: true}).test('unicorn 192.168.0.1'); - +ipRegex().test('unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'); +ipRegex({exact: true}).test('unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'); 'unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex()); + +ipRegex.v4().test('unicorn 192.168.0.1'); +ipRegex.v4({exact: true}).test('unicorn 192.168.0.1'); +'unicorn 192.168.0.1'.match(ipRegex.v4()); + +ipRegex.v6().test('cake 1:2:3:4:5:6:7:8 rainbow'); +ipRegex.v6({exact: true}).test('cake 1:2:3:4:5:6:7:8 rainbow'); +'cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex.v6()); diff --git a/types/ip-regex/tsconfig.json b/types/ip-regex/tsconfig.json index e09382966a..4f7bd0410e 100644 --- a/types/ip-regex/tsconfig.json +++ b/types/ip-regex/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "ip-regex-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/ip-regex/v2/index.d.ts b/types/ip-regex/v2/index.d.ts new file mode 100644 index 0000000000..c26cbaab3b --- /dev/null +++ b/types/ip-regex/v2/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for ip-regex 2.0 +// Project: https://github.com/sindresorhus/ip-regex +// Definitions by: Daniel Perez Alvarez +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** Regular expression for matching IP addresses (IPv4 & IPv6). */ +declare function ipRegex(options?: { + /** Only match an exact string. Useful with RegExp#test to check if a string is an IP address. */ + exact?: boolean; +}): RegExp; + +export = ipRegex; diff --git a/types/ip-regex/v2/ip-regex-tests.ts b/types/ip-regex/v2/ip-regex-tests.ts new file mode 100644 index 0000000000..dcaa72c72d --- /dev/null +++ b/types/ip-regex/v2/ip-regex-tests.ts @@ -0,0 +1,7 @@ +import ipRegex = require('ip-regex'); + +ipRegex().test('unicorn 192.168.0.1'); + +ipRegex({exact: true}).test('unicorn 192.168.0.1'); + +'unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex()); diff --git a/types/ip-regex/v2/tsconfig.json b/types/ip-regex/v2/tsconfig.json new file mode 100644 index 0000000000..15e25228df --- /dev/null +++ b/types/ip-regex/v2/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, + "paths": { + "ip-regex": [ + "ip-regex/v2" + ] + } + }, + "files": [ + "index.d.ts", + "ip-regex-tests.ts" + ] +} diff --git a/types/ip-regex/v2/tslint.json b/types/ip-regex/v2/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ip-regex/v2/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/ip/index.d.ts b/types/ip/index.d.ts index ed9ba584bc..edcf3ba669 100644 --- a/types/ip/index.d.ts +++ b/types/ip/index.d.ts @@ -1,11 +1,12 @@ -// Type definitions for node-ip +// Type definitions for ip 1.1 // Project: https://github.com/indutny/node-ip // Definitions by: Peter Harris +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -interface SubnetInfo { +export interface SubnetInfo { networkAddress: string; firstAddress: string; lastAddress: string; @@ -17,110 +18,108 @@ interface SubnetInfo { contains(ip: string): boolean; } -declare module "ip" { - /** - * Check two IP address are the same. - **/ - export function isEqual(ip1: string, ip2: string): boolean; +/** + * Check two IP address are the same. + */ +export function isEqual(ip1: string, ip2: string): boolean; - /** - * Convert an IP string into a buffer. - **/ - export function toBuffer(ip: string, buffer?: Buffer, offset?: number): Buffer; +/** + * Convert an IP string into a buffer. + */ +export function toBuffer(ip: string, buffer?: Buffer, offset?: number): Buffer; - /** - * Convert an IP buffer into a string. - **/ - export function toString(ip: Buffer, offset?: number, length?: number): string; +/** + * Convert an IP buffer into a string. + */ +export function toString(ip: Buffer, offset?: number, length?: number): string; - /** - * Get the subnet mask from a CIDR prefix length. - * - * @param family The IP family is infered from the prefixLength, but can be explicity specified as either "ipv4" or "ipv6". - **/ - export function fromPrefixLen(prefixLength: number, family?:string): string; +/** + * Get the subnet mask from a CIDR prefix length. + * + * @param family The IP family is infered from the prefixLength, but can be explicity specified as either "ipv4" or "ipv6". + */ +export function fromPrefixLen(prefixLength: number, family?: 'ipv4' | 'ipv6'): string; - /** - * Get the network ID IP address from an IP address and its subnet mask. - **/ - export function mask(ip: string, mask: string): string; +/** + * Get the network ID IP address from an IP address and its subnet mask. + */ +export function mask(ip: string, mask: string): string; - /** - * Get the network ID IP address from an IP address in CIDR notation. - **/ - export function cidr(cidr: string): string; +/** + * Get the network ID IP address from an IP address in CIDR notation. + */ +export function cidr(cidr: string): string; - /** - * Get the bitwise inverse (NOT every octet) of an IP address or subnet mask. - **/ - export function not(ip: string): string; +/** + * Get the bitwise inverse (NOT every octet) of an IP address or subnet mask. + */ +export function not(ip: string): string; - /** - * Get the bitwise OR of two IP addresses (usually an IP address and a subnet mask). - **/ - export function or(ip: string, mask:string): string; +/** + * Get the bitwise OR of two IP addresses (usually an IP address and a subnet mask). + */ +export function or(ip: string, mask: string): string; - /** - * Check whether an IP is within a private IP address range. - **/ - export function isPrivate(ip: string): boolean; +/** + * Check whether an IP is within a private IP address range. + */ +export function isPrivate(ip: string): boolean; - /** - * Check whether an IP is within a public IP address range. - **/ - export function isPublic(ip: string): boolean; +/** + * Check whether an IP is within a public IP address range. + */ +export function isPublic(ip: string): boolean; - /** - * Check whether an IP is a loopback address. - **/ - export function isLoopback(ip: string): boolean; +/** + * Check whether an IP is a loopback address. + */ +export function isLoopback(ip: string): boolean; - /** - * Check whether an IP is a IPv4 address. - **/ - export function isV4Format(ip: string): boolean; +/** + * Check whether an IP is a IPv4 address. + */ +export function isV4Format(ip: string): boolean; - /** - * Check whether an IP is a IPv6 address. - **/ - export function isV6Format(ip: string): boolean; +/** + * Check whether an IP is a IPv6 address. + */ +export function isV6Format(ip: string): boolean; - /** - * Get the loopback address for an IP family. - * - * @param family The family can be either "ipv4" or "ipv6". Default: "ipv4". - **/ - export function loopback(family?: string): string; +/** + * Get the loopback address for an IP family. + * + * @param family The family can be either "ipv4" or "ipv6". Default: "ipv4". + */ +export function loopback(family?: 'ipv4' | 'ipv6'): string; - /** - * Get the address for the network interface on the current system with the specified 'name'. - * If no interface name is specified, the first IPv4 address or loopback address is returned. - * - * @param name The name can be any named interface, or 'public' or 'private'. - * @param family The family can be either "ipv4" or "ipv6". Default: "ipv4". - **/ - export function address(name?: string, family?: string):string; +/** + * Get the address for the network interface on the current system with the specified 'name'. + * If no interface name is specified, the first IPv4 address or loopback address is returned. + * + * @param name The name can be any named interface, or 'public' or 'private'. + * @param family The family can be either "ipv4" or "ipv6". Default: "ipv4". + */ +export function address(name?: 'public' | 'private' | string, family?: 'ipv4' | 'ipv6'): string; - /** - * Convert a string IPv4 IP address to the equivalent long numeric value. - **/ - export function toLong(ip: string): number; +/** + * Convert a string IPv4 IP address to the equivalent long numeric value. + */ +export function toLong(ip: string): number; - /** - * Convert an IPv4 IP address from its the long numeric value to a string. - **/ - export function fromLong(ip: number): string; +/** + * Convert an IPv4 IP address from its the long numeric value to a string. + */ +export function fromLong(ip: number): string; - /** - * Get the subnet information. - * @param ip IP address. - * @param subnet Subnet address. - */ - export function subnet(ip: string, subnet: string): SubnetInfo; +/** + * Get the subnet information. + * @param ip IP address. + * @param subnet Subnet address. + */ +export function subnet(ip: string, subnet: string): SubnetInfo; - /** - * Get the subnet information. - * @param cidr CIDR address. - */ - export function cidrSubnet(cidr: string): SubnetInfo; -} +/** + * Get the subnet information. + * @param cidr CIDR address. + */ +export function cidrSubnet(cidr: string): SubnetInfo; diff --git a/types/ip/ip-tests.ts b/types/ip/ip-tests.ts index f1fbf4726d..efbf1a574c 100644 --- a/types/ip/ip-tests.ts +++ b/types/ip/ip-tests.ts @@ -1,26 +1,24 @@ - - import ip = require('ip'); -var myIP = ip.address(); +const myIP = ip.address(); -ip.cidr("192.168.0.1/24"); +ip.cidr('192.168.0.1/24'); ip.fromLong(ip.toLong(myIP)); ip.fromPrefixLen(24); -ip.isEqual("192.168.0.1", myIP); -ip.isLoopback("127.0.0.1"); +ip.isEqual('192.168.0.1', myIP); +ip.isLoopback('127.0.0.1'); ip.isPrivate(myIP); ip.isPublic(myIP); -ip.loopback("ipv6"); -ip.mask("192.168.0.1", "255.255.255.0"); -ip.not("255.255.255.0"); -ip.or("192.168.0.1", "255.255.255.0"); -var buff:any = ip.toBuffer(myIP); +ip.loopback('ipv6'); +ip.mask('192.168.0.1', '255.255.255.0'); +ip.not('255.255.255.0'); +ip.or('192.168.0.1', '255.255.255.0'); +const buff: any = ip.toBuffer(myIP); ip.toString(buff); ip.subnet('192.168.1.134', '255.255.255.192'); ip.cidrSubnet('192.168.1.134/26'); ip.cidrSubnet('192.168.1.134/26').contains('192.168.1.134'); -var buf = new Buffer(128); -var offset = 64; +const buf = new Buffer(128); +const offset = 64; ip.toBuffer('127.0.0.1', buf, offset); ip.toString(buf, offset, 4); diff --git a/types/ip/tsconfig.json b/types/ip/tsconfig.json index a445ebefe8..ee6d3f766e 100644 --- a/types/ip/tsconfig.json +++ b/types/ip/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "ip-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/ip/tslint.json b/types/ip/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/ip/tslint.json +++ b/types/ip/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/ipify/index.d.ts b/types/ipify/index.d.ts new file mode 100644 index 0000000000..237b15dfcc --- /dev/null +++ b/types/ipify/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for ipify 2.0 +// Project: https://github.com/sindresorhus/ipify#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = ipify; + +declare function ipify(endpoint?: string): Promise; diff --git a/types/ipify/ipify-tests.ts b/types/ipify/ipify-tests.ts new file mode 100644 index 0000000000..f533f49282 --- /dev/null +++ b/types/ipify/ipify-tests.ts @@ -0,0 +1,4 @@ +import ipify = require('ipify'); + +// $ExpectType Promise +ipify(); diff --git a/types/ipify/tsconfig.json b/types/ipify/tsconfig.json new file mode 100644 index 0000000000..96f6f0600d --- /dev/null +++ b/types/ipify/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", + "ipify-tests.ts" + ] +} diff --git a/types/ipify/tslint.json b/types/ipify/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ipify/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-absolute/index.d.ts b/types/is-absolute/index.d.ts new file mode 100644 index 0000000000..e3bea4f8d3 --- /dev/null +++ b/types/is-absolute/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for is-absolute 1.0 +// Project: https://github.com/jonschlinkert/is-absolute +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isAbsolute; + +declare function isAbsolute(path: string): boolean; + +declare namespace isAbsolute { + function posix(path: string): boolean; + function win32(path: string): boolean; +} diff --git a/types/is-absolute/is-absolute-tests.ts b/types/is-absolute/is-absolute-tests.ts new file mode 100644 index 0000000000..737a65a9ea --- /dev/null +++ b/types/is-absolute/is-absolute-tests.ts @@ -0,0 +1,5 @@ +import isAbsolute = require('is-absolute'); + +isAbsolute('a/b/c.js'); // $ExpectType boolean +isAbsolute.posix('/foo/bar'); // $ExpectType boolean +isAbsolute.win32('c:\\'); // $ExpectType boolean diff --git a/types/is-absolute/tsconfig.json b/types/is-absolute/tsconfig.json new file mode 100644 index 0000000000..32d9ccaf3e --- /dev/null +++ b/types/is-absolute/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", + "is-absolute-tests.ts" + ] +} diff --git a/types/is-absolute/tslint.json b/types/is-absolute/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-absolute/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-array-sorted/index.d.ts b/types/is-array-sorted/index.d.ts new file mode 100644 index 0000000000..7c45437489 --- /dev/null +++ b/types/is-array-sorted/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for is-array-sorted 1.0 +// Project: https://github.com/sindresorhus/is-array-sorted#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isArraySorted; + +declare function isArraySorted( + array: ReadonlyArray, + comparator?: (a: T, b: T) => number +): boolean; diff --git a/types/is-array-sorted/is-array-sorted-tests.ts b/types/is-array-sorted/is-array-sorted-tests.ts new file mode 100644 index 0000000000..85291fb10c --- /dev/null +++ b/types/is-array-sorted/is-array-sorted-tests.ts @@ -0,0 +1,6 @@ +import isArraySorted = require('is-array-sorted'); + +// $ExpectType boolean +isArraySorted([1, 2, 3]); +// $ExpectType boolean +isArraySorted(['a', 'b', 'c'], (a, b) => a.localeCompare(b)); diff --git a/types/is-array-sorted/tsconfig.json b/types/is-array-sorted/tsconfig.json new file mode 100644 index 0000000000..5fb8aa9921 --- /dev/null +++ b/types/is-array-sorted/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", + "is-array-sorted-tests.ts" + ] +} diff --git a/types/is-array-sorted/tslint.json b/types/is-array-sorted/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-array-sorted/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-buffer/index.d.ts b/types/is-buffer/index.d.ts new file mode 100644 index 0000000000..075e4b4117 --- /dev/null +++ b/types/is-buffer/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for is-buffer 2.0 +// Project: https://github.com/feross/is-buffer#readme +// Definitions by: Junyoung Choi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +/// + +declare function isBuffer(obj: any): obj is Buffer; + +export = isBuffer; diff --git a/types/is-buffer/is-buffer-tests.ts b/types/is-buffer/is-buffer-tests.ts new file mode 100644 index 0000000000..24c3b4ef7a --- /dev/null +++ b/types/is-buffer/is-buffer-tests.ts @@ -0,0 +1,26 @@ +import isBuffer = require('is-buffer'); + +let booleanResult: boolean = isBuffer(Buffer.alloc(4)); +booleanResult = isBuffer(Buffer.allocUnsafeSlow(100)); +booleanResult = isBuffer(undefined); +booleanResult = isBuffer(null); +booleanResult = isBuffer(''); +booleanResult = isBuffer(true); +booleanResult = isBuffer(false); +booleanResult = isBuffer(0); +booleanResult = isBuffer(1); +booleanResult = isBuffer(1.0); +booleanResult = isBuffer('string'); +booleanResult = isBuffer({}); +booleanResult = isBuffer([]); +booleanResult = isBuffer(function foo() {}); +booleanResult = isBuffer({ isBuffer: null }); +booleanResult = isBuffer({ isBuffer() { throw new Error(); } }); + +// Typeguard test +const unknownValue: unknown = {}; +if (isBuffer(unknownValue)) { + const bufferValue: Buffer = unknownValue; +} else { + const bufferValue: Buffer = unknownValue; // $ExpectError +} diff --git a/types/is-buffer/tsconfig.json b/types/is-buffer/tsconfig.json new file mode 100644 index 0000000000..0da0f3cdc3 --- /dev/null +++ b/types/is-buffer/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", + "is-buffer-tests.ts" + ] +} diff --git a/types/is-buffer/tslint.json b/types/is-buffer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-buffer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-charging/index.d.ts b/types/is-charging/index.d.ts new file mode 100644 index 0000000000..7eb5dcfab0 --- /dev/null +++ b/types/is-charging/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-charging 2.0 +// Project: https://github.com/gillstrom/is-charging#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isCharging; + +declare function isCharging(): Promise; diff --git a/types/is-charging/is-charging-tests.ts b/types/is-charging/is-charging-tests.ts new file mode 100644 index 0000000000..f3c4a67fc0 --- /dev/null +++ b/types/is-charging/is-charging-tests.ts @@ -0,0 +1,4 @@ +import isCharging = require('is-charging'); + +// $ExpectType Promise +isCharging(); diff --git a/types/is-charging/tsconfig.json b/types/is-charging/tsconfig.json new file mode 100644 index 0000000000..6516f5c83e --- /dev/null +++ b/types/is-charging/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", + "is-charging-tests.ts" + ] +} diff --git a/types/is-charging/tslint.json b/types/is-charging/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-charging/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-dotdir/index.d.ts b/types/is-dotdir/index.d.ts new file mode 100644 index 0000000000..8c674b779f --- /dev/null +++ b/types/is-dotdir/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-dotdir 1.0 +// Project: https://github.com/jonschlinkert/is-dotdir +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isDotdir; + +declare function isDotdir(path: string): boolean; diff --git a/types/is-dotdir/is-dotdir-tests.ts b/types/is-dotdir/is-dotdir-tests.ts new file mode 100644 index 0000000000..28d51eebc9 --- /dev/null +++ b/types/is-dotdir/is-dotdir-tests.ts @@ -0,0 +1,3 @@ +import isDotdir = require('is-dotdir'); + +isDotdir('a/b/c/.gitignore'); // $ExpectType boolean diff --git a/types/is-dotdir/tsconfig.json b/types/is-dotdir/tsconfig.json new file mode 100644 index 0000000000..d05dc6ee53 --- /dev/null +++ b/types/is-dotdir/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", + "is-dotdir-tests.ts" + ] +} diff --git a/types/is-dotdir/tslint.json b/types/is-dotdir/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-dotdir/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-dotfile/index.d.ts b/types/is-dotfile/index.d.ts new file mode 100644 index 0000000000..a82957db4c --- /dev/null +++ b/types/is-dotfile/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-dotfile 2.0 +// Project: https://github.com/jonschlinkert/is-dotfile +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isDotfile; + +declare function isDotfile(path: string): boolean; diff --git a/types/is-dotfile/is-dotfile-tests.ts b/types/is-dotfile/is-dotfile-tests.ts new file mode 100644 index 0000000000..d87ae88d96 --- /dev/null +++ b/types/is-dotfile/is-dotfile-tests.ts @@ -0,0 +1,3 @@ +import isDotfile = require('is-dotfile'); + +isDotfile('a/b/c.js'); // $ExpectType boolean diff --git a/types/is-dotfile/tsconfig.json b/types/is-dotfile/tsconfig.json new file mode 100644 index 0000000000..bc25b58e1c --- /dev/null +++ b/types/is-dotfile/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", + "is-dotfile-tests.ts" + ] +} diff --git a/types/is-dotfile/tslint.json b/types/is-dotfile/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-dotfile/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-elevated/index.d.ts b/types/is-elevated/index.d.ts new file mode 100644 index 0000000000..c875437fde --- /dev/null +++ b/types/is-elevated/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-elevated 2.0 +// Project: https://github.com/sindresorhus/is-elevated#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isElevated; + +declare function isElevated(): Promise; diff --git a/types/is-elevated/is-elevated-tests.ts b/types/is-elevated/is-elevated-tests.ts new file mode 100644 index 0000000000..b2ba2f48fe --- /dev/null +++ b/types/is-elevated/is-elevated-tests.ts @@ -0,0 +1,3 @@ +import isElevated = require('is-elevated'); + +isElevated(); // $ExpectType Promise diff --git a/types/is-elevated/tsconfig.json b/types/is-elevated/tsconfig.json new file mode 100644 index 0000000000..ad48a57318 --- /dev/null +++ b/types/is-elevated/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", + "is-elevated-tests.ts" + ] +} diff --git a/types/is-elevated/tslint.json b/types/is-elevated/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-elevated/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-fullwidth-code-point/index.d.ts b/types/is-fullwidth-code-point/index.d.ts new file mode 100644 index 0000000000..e5e666ad30 --- /dev/null +++ b/types/is-fullwidth-code-point/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-fullwidth-code-point 2.0 +// Project: https://github.com/sindresorhus/is-fullwidth-code-point#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isFullwidthCodePoint; + +declare function isFullwidthCodePoint(input: number): boolean; diff --git a/types/is-fullwidth-code-point/is-fullwidth-code-point-tests.ts b/types/is-fullwidth-code-point/is-fullwidth-code-point-tests.ts new file mode 100644 index 0000000000..6d2b6a6882 --- /dev/null +++ b/types/is-fullwidth-code-point/is-fullwidth-code-point-tests.ts @@ -0,0 +1,4 @@ +import isFullwidthCodePoint = require('is-fullwidth-code-point'); + +const codePoint = '谢'.codePointAt(0) as number; +isFullwidthCodePoint(codePoint); // $ExpectType boolean diff --git a/types/is-fullwidth-code-point/tsconfig.json b/types/is-fullwidth-code-point/tsconfig.json new file mode 100644 index 0000000000..6915fd60a7 --- /dev/null +++ b/types/is-fullwidth-code-point/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", + "is-fullwidth-code-point-tests.ts" + ] +} diff --git a/types/is-fullwidth-code-point/tslint.json b/types/is-fullwidth-code-point/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-fullwidth-code-point/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-function/index.d.ts b/types/is-function/index.d.ts new file mode 100644 index 0000000000..841180173a --- /dev/null +++ b/types/is-function/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for is-function 1.0 +// Project: https://github.com/grncdr/js-is-function +// Definitions by: Evangelos Zotos +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isFunction; +declare function isFunction(fn: any): boolean; diff --git a/types/is-function/is-function-tests.ts b/types/is-function/is-function-tests.ts new file mode 100644 index 0000000000..d88d529710 --- /dev/null +++ b/types/is-function/is-function-tests.ts @@ -0,0 +1,9 @@ +import isFunction = require("is-function"); + +const a: boolean = isFunction("string"); +const b: boolean = isFunction(true); +const c: boolean = isFunction((x: number) => x * x); +const d: boolean = isFunction({ type: "number" }); +const e: boolean = isFunction(() => { + return "I am anounymous!"; +}); diff --git a/types/is-function/tsconfig.json b/types/is-function/tsconfig.json new file mode 100644 index 0000000000..ab7efbe2c7 --- /dev/null +++ b/types/is-function/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "is-function-tests.ts"] +} diff --git a/types/is-function/tslint.json b/types/is-function/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-function/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-git-url/index.d.ts b/types/is-git-url/index.d.ts new file mode 100644 index 0000000000..46bccb3946 --- /dev/null +++ b/types/is-git-url/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-git-url 1.0 +// Project: https://github.com/jonschlinkert/is-git-url +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isGitUrl; + +declare function isGitUrl(url: string): boolean; diff --git a/types/is-git-url/is-git-url-tests.ts b/types/is-git-url/is-git-url-tests.ts new file mode 100644 index 0000000000..c9acda4382 --- /dev/null +++ b/types/is-git-url/is-git-url-tests.ts @@ -0,0 +1,3 @@ +import isGitUrl = require('is-git-url'); + +isGitUrl('git://github.com/jonschlinkert/is-git-url.git'); // $ExpectType boolean diff --git a/types/is-git-url/tsconfig.json b/types/is-git-url/tsconfig.json new file mode 100644 index 0000000000..c761dd26d0 --- /dev/null +++ b/types/is-git-url/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", + "is-git-url-tests.ts" + ] +} diff --git a/types/is-git-url/tslint.json b/types/is-git-url/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-git-url/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-installed-globally/index.d.ts b/types/is-installed-globally/index.d.ts new file mode 100644 index 0000000000..130e44256e --- /dev/null +++ b/types/is-installed-globally/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-installed-globally 0.1 +// Project: https://github.com/sindresorhus/is-installed-globally#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isInstalledGlobally; + +declare const isInstalledGlobally: boolean; diff --git a/types/is-installed-globally/is-installed-globally-tests.ts b/types/is-installed-globally/is-installed-globally-tests.ts new file mode 100644 index 0000000000..8e64ec0c4b --- /dev/null +++ b/types/is-installed-globally/is-installed-globally-tests.ts @@ -0,0 +1,4 @@ +import isInstalledGlobally = require('is-installed-globally'); + +// $ExpectType boolean +isInstalledGlobally; diff --git a/types/is-installed-globally/tsconfig.json b/types/is-installed-globally/tsconfig.json new file mode 100644 index 0000000000..51a5701929 --- /dev/null +++ b/types/is-installed-globally/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", + "is-installed-globally-tests.ts" + ] +} diff --git a/types/is-installed-globally/tslint.json b/types/is-installed-globally/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-installed-globally/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-online/index.d.ts b/types/is-online/index.d.ts new file mode 100644 index 0000000000..04fa123c44 --- /dev/null +++ b/types/is-online/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for is-online 8.0 +// Project: https://github.com/sindresorhus/is-online#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isOnline; + +/** + * Check if the internet connection is up. + * + * The following checks are run in parallel: + * - Retrieve [icanhazip.com](https://github.com/major/icanhaz) via HTTPS + * - Query `myip.opendns.com` on OpenDNS (Node.js only) + * - Retrieve Apple's Captive Portal test page (Node.js only) + * + * When the first check succeeds, the returned Promise is resolved to `true`. + */ +declare function isOnline(options?: isOnline.Options): Promise; + +declare namespace isOnline { + interface Options { + /** + * Milliseconds to wait for a server to respond. + * @default 5000 + */ + timeout?: number; + /** + * Internet Protocol version to use. This is an advanced option that is usually not necessary to be set, + * but it can prove useful to specifically assert IPv6 connectivity. + * @default 'v4' + */ + version?: 'v4' | 'v6'; + } +} diff --git a/types/is-online/is-online-tests.ts b/types/is-online/is-online-tests.ts new file mode 100644 index 0000000000..74dbda5efa --- /dev/null +++ b/types/is-online/is-online-tests.ts @@ -0,0 +1,6 @@ +import isOnline = require('is-online'); + +isOnline(); // $ExpectType Promise +isOnline({ timeout: 10 }); // $ExpectType Promise +isOnline({ version: 'v4' }); // $ExpectType Promise +isOnline({ version: 'v6' }); // $ExpectType Promise diff --git a/types/is-online/tsconfig.json b/types/is-online/tsconfig.json new file mode 100644 index 0000000000..7009c26024 --- /dev/null +++ b/types/is-online/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", + "is-online-tests.ts" + ] +} diff --git a/types/is-online/tslint.json b/types/is-online/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-online/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-plain-obj/index.d.ts b/types/is-plain-obj/index.d.ts new file mode 100644 index 0000000000..89b5b5aae5 --- /dev/null +++ b/types/is-plain-obj/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-plain-obj 1.1 +// Project: https://github.com/sindresorhus/is-plain-obj +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isPlainObj; + +declare function isPlainObj(input: any): boolean; diff --git a/types/is-plain-obj/is-plain-obj-tests.ts b/types/is-plain-obj/is-plain-obj-tests.ts new file mode 100644 index 0000000000..15b402b8f5 --- /dev/null +++ b/types/is-plain-obj/is-plain-obj-tests.ts @@ -0,0 +1,3 @@ +import isPlainObj = require('is-plain-obj'); + +isPlainObj({ foo: 'bar' }); // $ExpectType boolean diff --git a/types/is-plain-obj/tsconfig.json b/types/is-plain-obj/tsconfig.json new file mode 100644 index 0000000000..43671920dd --- /dev/null +++ b/types/is-plain-obj/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", + "is-plain-obj-tests.ts" + ] +} diff --git a/types/is-plain-obj/tslint.json b/types/is-plain-obj/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-plain-obj/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-png/index.d.ts b/types/is-png/index.d.ts new file mode 100644 index 0000000000..c2c74bab6d --- /dev/null +++ b/types/is-png/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for is-png 1.1 +// Project: https://github.com/sindresorhus/is-png#readme +// Definitions by: James Wild +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** + * Check whether a buffer contains a PNG image. + * @remarks This only performs a header check, and the buffer may not parse as a PNG file. + * @param buffer The buffer to check. + * @returns Whether the given buffer contains a PNG image. + */ +declare function isPng(buffer: Uint8Array | Buffer): boolean; + +export = isPng; diff --git a/types/is-png/is-png-tests.ts b/types/is-png/is-png-tests.ts new file mode 100644 index 0000000000..263560f855 --- /dev/null +++ b/types/is-png/is-png-tests.ts @@ -0,0 +1,7 @@ +import isPng = require("is-png"); + +const uint8Array = new Uint8Array(0); +isPng(uint8Array); // $ExpectType boolean + +const buffer = Buffer.from(uint8Array); +isPng(buffer); // $ExpectType boolean diff --git a/types/is-png/tsconfig.json b/types/is-png/tsconfig.json new file mode 100644 index 0000000000..0885bb6abe --- /dev/null +++ b/types/is-png/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", + "is-png-tests.ts" + ] +} diff --git a/types/is-png/tslint.json b/types/is-png/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-png/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-progressive/index.d.ts b/types/is-progressive/index.d.ts new file mode 100644 index 0000000000..3c05ab6fdc --- /dev/null +++ b/types/is-progressive/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for is-progressive 3.0 +// Project: https://github.com/sindresorhus/is-progressive#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Readable } from 'stream'; + +/** + * Returns whether the `buffer` is a progressive JPEG image. + * @param buffer Buffer of a JPEG image. + * Must be at least `65535` bytes when the file is larger than that. + */ +export function buffer(buffer: Buffer): boolean; + +/** + * Returns a Promise for a boolean indicating whether the file stream is a progressive JPEG image. + * @param stream Data stream. + */ +export function stream(stream: Readable): Promise; + +/** + * Returns a Promise for a boolean indicating whether the file is a progressive JPEG image. + * @param filepath Filepath to the image. + */ +export function file(filepath: string): Promise; + +/** + * Returns whether the buffer is a progressive JPEG. + * @param filepath Filepath to the image. + */ +export function fileSync(filepath: string): boolean; diff --git a/types/is-progressive/is-progressive-tests.ts b/types/is-progressive/is-progressive-tests.ts new file mode 100644 index 0000000000..b5525962ad --- /dev/null +++ b/types/is-progressive/is-progressive-tests.ts @@ -0,0 +1,12 @@ +import https = require('https'); +import isProgressive = require('is-progressive'); + +isProgressive.file('baseline.jpg'); // $ExpectType Promise + +isProgressive.fileSync('progressive.jpg'); // $ExpectType boolean + +https.get('/', res => { + isProgressive.stream(res); // $ExpectType Promise +}); + +isProgressive.buffer(new Buffer(1)); // $ExpectType boolean diff --git a/types/is-progressive/tsconfig.json b/types/is-progressive/tsconfig.json new file mode 100644 index 0000000000..edc521b158 --- /dev/null +++ b/types/is-progressive/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", + "is-progressive-tests.ts" + ] +} diff --git a/types/is-progressive/tslint.json b/types/is-progressive/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-progressive/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-reachable/index.d.ts b/types/is-reachable/index.d.ts new file mode 100644 index 0000000000..6e2ea2d62f --- /dev/null +++ b/types/is-reachable/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for is-reachable 3.0 +// Project: https://github.com/sindresorhus/is-reachable#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isReachable; + +/** + * Check if servers are reachable. + * + * The Node.js version will do a TCP handshake with the target's port. It attempts to detect cases where a router + * redirects the request to itself. + * + * The browser version is limited by the fact that browsers cannot connect to arbitrary ports. It only supports + * HTTP and HTTPS and the check relies on the `/favicon.ico` path being present. + * + * @param targets One or more targets to check. Can either be a full [URL](https://nodejs.org/api/url.html) + * like `https://hostname`, `hostname:port` or just `hostname`. When the protocol is missing from a target + * `http` is assumed. + * + * [Well-known protocols](http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml) + * are supported (e.g. `ftp://`, `mysql://`, `redis://` and more). + * + * @returns A `Promise` for a `boolean` which is `true` if any of the `targets` are reachable. + */ +declare function isReachable( + targets: string | string[], + options?: isReachable.Options +): Promise; + +declare namespace isReachable { + interface Options { + /** + * Timeout in milliseconds after which a request is considered failed. + * @default 5000 + */ + timeout?: number; + } +} diff --git a/types/is-reachable/is-reachable-tests.ts b/types/is-reachable/is-reachable-tests.ts new file mode 100644 index 0000000000..d497d004f2 --- /dev/null +++ b/types/is-reachable/is-reachable-tests.ts @@ -0,0 +1,4 @@ +import isReachable = require('is-reachable'); + +isReachable('sindresorhus.com'); // $ExpectType Promise +isReachable('google.com:80', { timeout: 10 }); // $ExpectType Promise diff --git a/types/is-reachable/tsconfig.json b/types/is-reachable/tsconfig.json new file mode 100644 index 0000000000..c30236ebd5 --- /dev/null +++ b/types/is-reachable/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", + "is-reachable-tests.ts" + ] +} diff --git a/types/is-reachable/tslint.json b/types/is-reachable/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-reachable/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-relative/index.d.ts b/types/is-relative/index.d.ts new file mode 100644 index 0000000000..5012424128 --- /dev/null +++ b/types/is-relative/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-relative 1.0 +// Project: https://github.com/jonschlinkert/is-relative +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isRelative; + +declare function isRelative(path: string): boolean; diff --git a/types/is-relative/is-relative-tests.ts b/types/is-relative/is-relative-tests.ts new file mode 100644 index 0000000000..f21dbacd0a --- /dev/null +++ b/types/is-relative/is-relative-tests.ts @@ -0,0 +1,3 @@ +import isRelative = require('is-relative'); + +isRelative('README.md'); // $ExpectType boolean diff --git a/types/is-relative/tsconfig.json b/types/is-relative/tsconfig.json new file mode 100644 index 0000000000..a7c5e53de9 --- /dev/null +++ b/types/is-relative/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-relative-tests.ts" + ] +} diff --git a/types/is-relative/tslint.json b/types/is-relative/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-relative/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-trademarked/index.d.ts b/types/is-trademarked/index.d.ts new file mode 100644 index 0000000000..700e9b25f2 --- /dev/null +++ b/types/is-trademarked/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for is-trademarked 1.2 +// Project: https://github.com/egoist/is-trademarked#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isTrademarked; + +declare function isTrademarked( + searchTerm: string, + opts?: isTrademarked.Options +): Promise; + +declare namespace isTrademarked { + interface Options { + token?: string; + } + + interface TrademarkedData { + wordmark: string; + reg: Date; + description: string; + sn: string; + serviceCode: string; + } +} diff --git a/types/is-trademarked/is-trademarked-tests.ts b/types/is-trademarked/is-trademarked-tests.ts new file mode 100644 index 0000000000..52f7502435 --- /dev/null +++ b/types/is-trademarked/is-trademarked-tests.ts @@ -0,0 +1,6 @@ +import isTrademarked = require('is-trademarked'); + +// $ExpectType Promise +isTrademarked('unicorns'); +// $ExpectType Promise +isTrademarked('unicorns', { token: 'foo' }); diff --git a/types/is-trademarked/tsconfig.json b/types/is-trademarked/tsconfig.json new file mode 100644 index 0000000000..8121816b1a --- /dev/null +++ b/types/is-trademarked/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", + "is-trademarked-tests.ts" + ] +} diff --git a/types/is-trademarked/tslint.json b/types/is-trademarked/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-trademarked/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-typedarray/index.d.ts b/types/is-typedarray/index.d.ts new file mode 100644 index 0000000000..39f5f91368 --- /dev/null +++ b/types/is-typedarray/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for is-typedarray 1.0 +// Project: https://github.com/hughsk/is-typedarray +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +export = isTypedArray; + +declare function isTypedArray(candidate: any): candidate is isTypedArray.TypedArray; + +declare namespace isTypedArray { + function strict(candidate: any): candidate is TypedArray; + function loose(candidate: any): candidate is TypedArray; + + type TypedArray = + | Int8Array + | Int16Array + | Int32Array + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Float32Array + | Float64Array + | Buffer; +} diff --git a/types/is-typedarray/is-typedarray-tests.ts b/types/is-typedarray/is-typedarray-tests.ts new file mode 100644 index 0000000000..9597f23017 --- /dev/null +++ b/types/is-typedarray/is-typedarray-tests.ts @@ -0,0 +1,19 @@ +import isTypedArray = require('is-typedarray'); + +const buf: any = new Buffer(1); + +// $ExpectType any +buf; + +if (isTypedArray(buf)) { + // $ExpectType TypedArray + buf; +} +if (isTypedArray.strict(buf)) { + // $ExpectType TypedArray + buf; +} +if (isTypedArray.loose(buf)) { + // $ExpectType TypedArray + buf; +} diff --git a/types/is-typedarray/tsconfig.json b/types/is-typedarray/tsconfig.json new file mode 100644 index 0000000000..e8886f1236 --- /dev/null +++ b/types/is-typedarray/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", + "is-typedarray-tests.ts" + ] +} diff --git a/types/is-typedarray/tslint.json b/types/is-typedarray/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-typedarray/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-unc-path/index.d.ts b/types/is-unc-path/index.d.ts new file mode 100644 index 0000000000..b159a02541 --- /dev/null +++ b/types/is-unc-path/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-unc-path 1.0 +// Project: https://github.com/jonschlinkert/is-unc-path +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isUncPath; + +declare function isUncPath(path: string): boolean; diff --git a/types/is-unc-path/is-unc-path-tests.ts b/types/is-unc-path/is-unc-path-tests.ts new file mode 100644 index 0000000000..7061c66614 --- /dev/null +++ b/types/is-unc-path/is-unc-path-tests.ts @@ -0,0 +1,3 @@ +import isUncPath = require('is-unc-path'); + +isUncPath('\\/foo/bar'); // $ExpectType boolean diff --git a/types/is-unc-path/tsconfig.json b/types/is-unc-path/tsconfig.json new file mode 100644 index 0000000000..96771d30b8 --- /dev/null +++ b/types/is-unc-path/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-unc-path-tests.ts" + ] +} diff --git a/types/is-unc-path/tslint.json b/types/is-unc-path/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-unc-path/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-valid-glob/index.d.ts b/types/is-valid-glob/index.d.ts new file mode 100644 index 0000000000..88720851a2 --- /dev/null +++ b/types/is-valid-glob/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-valid-glob 1.0 +// Project: https://github.com/jonschlinkert/is-valid-glob +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = isValidGlob; + +declare function isValidGlob(input: any): input is string | string[]; diff --git a/types/is-valid-glob/is-valid-glob-tests.ts b/types/is-valid-glob/is-valid-glob-tests.ts new file mode 100644 index 0000000000..30ac526015 --- /dev/null +++ b/types/is-valid-glob/is-valid-glob-tests.ts @@ -0,0 +1,7 @@ +import isValidGlob = require('is-valid-glob'); + +const input: any = 'foo/*.js'; + +if (isValidGlob(input)) { + input; // $ExpectType string | string[] +} diff --git a/types/is-valid-glob/tsconfig.json b/types/is-valid-glob/tsconfig.json new file mode 100644 index 0000000000..a7dfd5f29f --- /dev/null +++ b/types/is-valid-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", + "is-valid-glob-tests.ts" + ] +} diff --git a/types/is-valid-glob/tslint.json b/types/is-valid-glob/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-valid-glob/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/is-valid-path/index.d.ts b/types/is-valid-path/index.d.ts new file mode 100644 index 0000000000..2aa54e3e99 --- /dev/null +++ b/types/is-valid-path/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-valid-path 0.1 +// Project: https://github.com/jonschlinkert/is-valid-path +// Definitions by: Zlatko Andonovski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function isValidPath(path?: string | null): boolean; + +export = isValidPath; diff --git a/types/is-valid-path/is-valid-path-tests.ts b/types/is-valid-path/is-valid-path-tests.ts new file mode 100644 index 0000000000..a0ca7ac1a9 --- /dev/null +++ b/types/is-valid-path/is-valid-path-tests.ts @@ -0,0 +1,18 @@ +// Tests are from the NPM README (https://www.npmjs.com/package/is-valid-path). + +import isValid = require('is-valid-path'); + +isValid('abc.js'); +isValid('abc/def/ghi.js'); +isValid('foo.js'); + +isValid(); +isValid(null); +isValid('!foo.js'); +isValid('*.js'); +isValid('**/abc.js'); +isValid('abc/*.js'); +isValid('abc/(aaa|bbb).js'); +isValid('abc/[a-z].js'); +isValid('abc/{a,b}.js'); +isValid('abc/?.js'); diff --git a/types/is-valid-path/tsconfig.json b/types/is-valid-path/tsconfig.json new file mode 100644 index 0000000000..da95d11317 --- /dev/null +++ b/types/is-valid-path/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-valid-path-tests.ts" + ] +} diff --git a/types/is-valid-path/tslint.json b/types/is-valid-path/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/is-valid-path/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/isexe/index.d.ts b/types/isexe/index.d.ts new file mode 100644 index 0000000000..87f460ebdf --- /dev/null +++ b/types/isexe/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for isexe 2.0 +// Project: https://github.com/isaacs/isexe#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export = isExe; + +declare function isExe(path: string, options?: isExe.Options): Promise; +declare function isExe( + path: string, + callback: (error: NodeJS.ErrnoException | undefined, isExe: boolean) => void +): void; +declare function isExe( + path: string, + options: isExe.Options, + callback: (error: NodeJS.ErrnoException | undefined, isExe: boolean) => void +): void; + +declare namespace isExe { + function sync(path: string, options?: Options): boolean; + + interface Options { + ignoreErrors?: boolean; + uid?: number; + gid?: number; + pathExt?: string; + } +} diff --git a/types/isexe/isexe-tests.ts b/types/isexe/isexe-tests.ts new file mode 100644 index 0000000000..4103c1fee7 --- /dev/null +++ b/types/isexe/isexe-tests.ts @@ -0,0 +1,18 @@ +import isexe = require('isexe'); + +isexe('some-file-name'); // $ExpectType Promise +isexe('some-file-name', { ignoreErrors: true }); // $ExpectType Promise +isexe('some-file-name', { uid: 123 }); // $ExpectType Promise +isexe('some-file-name', { gid: 123 }); // $ExpectType Promise +isexe('some-file-name', { pathExt: 'exe;bat' }); // $ExpectType Promise +isexe('some-file-name', (err, isExe) => { + err; // $ExpectType ErrnoException | undefined + isExe; // $ExpectType boolean +}); +isexe('some-file-name', { ignoreErrors: true }, (err, isExe) => { + err; // $ExpectType ErrnoException | undefined + isExe; // $ExpectType boolean +}); + +isexe.sync('some-file-name'); // $ExpectType boolean +isexe.sync('some-file-name', { ignoreErrors: true }); // $ExpectType boolean diff --git a/types/isexe/tsconfig.json b/types/isexe/tsconfig.json new file mode 100644 index 0000000000..8ddbc1ca71 --- /dev/null +++ b/types/isexe/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", + "isexe-tests.ts" + ] +} diff --git a/types/isexe/tslint.json b/types/isexe/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/isexe/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/issue-parser/index.d.ts b/types/issue-parser/index.d.ts new file mode 100644 index 0000000000..50f9fa304f --- /dev/null +++ b/types/issue-parser/index.d.ts @@ -0,0 +1,55 @@ +// Type definitions for issue-parser 3.0 +// Project: https://github.com/pvdlg/issue-parser#readme +// Definitions by: Leko +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare function issueParser( + authOptions?: issueParser.Options, + extension?: issueParser.Overrides +): issueParser.Parser; + +declare namespace issueParser { + type Parser = (text: string) => Result; + interface Overrides { + actions?: { + [type: string]: ReadonlyArray; + }; + delimiters?: string | ReadonlyArray; + mentionsPrefixes?: string | ReadonlyArray; + issuePrefixes?: string | ReadonlyArray; + hosts?: string | ReadonlyArray; + issueURLSegments?: string | ReadonlyArray; + overrides?: string | ReadonlyArray; + } + type Options = "github" | "gitlab" | "bitbucket" | "waffle" | Overrides; + interface Reference { + raw: string; + slug: string | undefined; + prefix: string | undefined; + issue: string; + } + interface Mention { + raw: string; + prefix: string; + user: string; + } + interface Action { + raw: string; + action: string; + slug: string | undefined; + prefix: string | undefined; + issue: string; + } + interface Actions { + [action: string]: ReadonlyArray; + } + interface Result { + refs: ReadonlyArray; + mentions: ReadonlyArray; + actions: Actions; + allRefs: Array; + } +} + +export = issueParser; diff --git a/types/issue-parser/issue-parser-tests.ts b/types/issue-parser/issue-parser-tests.ts new file mode 100644 index 0000000000..d25f1e06f6 --- /dev/null +++ b/types/issue-parser/issue-parser-tests.ts @@ -0,0 +1,72 @@ +import issueParser = require("issue-parser"); +import { Action } from "issue-parser"; + +// Without options +issueParser(); + +// With predefined options +issueParser("github"); +issueParser("bitbucket"); +issueParser("gitlab"); +issueParser("waffle"); + +// With custom format +issueParser({ + actions: { + fix: ["complete"], + hold: ["holds up"] + }, + issuePrefixes: ["🐛"] +}); + +// Extend existing format +issueParser("github", { + actions: { + parent: ["parent of"], + related: ["related to"] + } +}); + +const parse = issueParser("github"); +const result = parse("#1"); + +// Parse references +result.refs.forEach(ref => { + ref.issue; + ref.slug; + ref.raw; + ref.prefix; +}); + +// Parse closing keywords +result.actions.close.forEach(action => { + action.raw; + action.action; + action.slug; + action.prefix; + action.issue; +}); + +// Parse user mentions +result.mentions.forEach(mention => { + mention.raw; + mention.prefix; + mention.user; +}); + +// allRefs +const isAction = (ref: any): ref is Action => true; +result.allRefs.forEach(ref => { + if (isAction(ref)) { + ref.raw; + ref.action; + ref.slug; + ref.prefix; + ref.issue; + } else { + ref.raw; + ref.slug; + ref.prefix; + ref.issue; + } +}); diff --git a/types/issue-parser/tsconfig.json b/types/issue-parser/tsconfig.json new file mode 100644 index 0000000000..3d9ce3d939 --- /dev/null +++ b/types/issue-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", + "issue-parser-tests.ts" + ] +} diff --git a/types/issue-parser/tslint.json b/types/issue-parser/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/issue-parser/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/issue-regex/index.d.ts b/types/issue-regex/index.d.ts new file mode 100644 index 0000000000..110e6b06af --- /dev/null +++ b/types/issue-regex/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for issue-regex 2.0 +// Project: https://github.com/sindresorhus/issue-regex#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = issueRegex; + +declare function issueRegex(): RegExp; diff --git a/types/issue-regex/issue-regex-tests.ts b/types/issue-regex/issue-regex-tests.ts new file mode 100644 index 0000000000..7eb4b352ff --- /dev/null +++ b/types/issue-regex/issue-regex-tests.ts @@ -0,0 +1,5 @@ +import issueRegex = require('issue-regex'); + +// $ExpectType RegExp +issueRegex(); +'Fixes #143 and avajs/ava#1023'.match(issueRegex()); diff --git a/types/issue-regex/tsconfig.json b/types/issue-regex/tsconfig.json new file mode 100644 index 0000000000..46dd7f033b --- /dev/null +++ b/types/issue-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", + "issue-regex-tests.ts" + ] +} diff --git a/types/issue-regex/tslint.json b/types/issue-regex/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/issue-regex/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/istextorbinary/index.d.ts b/types/istextorbinary/index.d.ts new file mode 100644 index 0000000000..d41400f89b --- /dev/null +++ b/types/istextorbinary/index.d.ts @@ -0,0 +1,93 @@ +// Type definitions for istextorbinary 2.3 +// Project: https://github.com/bevry/istextorbinary +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** + * Is Text (Synchronous) + * Determine whether or not a file is a text or binary file. + * Determined by extension checks first, then if unknown extension, will fallback on encoding detection. + * We do that as encoding detection cannot guarantee everything, especially for chars between utf8 and utf16. + * We use the extensions from https://github.com/bevry/textextensions and https://github.com/bevry/binaryextensions + * @param filename the filename for the file/buffer if available + * @param buffer the buffer for the file if available + */ +export function isTextSync(filename: string, buffer?: Buffer): boolean; +export function isTextSync(filename: undefined, buffer: Buffer): boolean; + +/** + * Is Text + * Uses `isTextSync` behind the scenes. + * @param filename forwarded to `isTextSync` + * @param buffer forwarded to `isTextSync` + * @param next accepts arguments: (error: Error, result: Boolean) + */ +export function isText( + filename: string, + buffer: Buffer | undefined, + next: (err: null, result: boolean) => void +): void; +export function isText( + filename: undefined, + buffer: Buffer, + next: (err: null, result: boolean) => void +): void; + +/** + * Is Binary (Synchronous) + * Uses `isTextSync` behind the scenes. + * @param filename forwarded to `isTextSync` + * @param buffer forwarded to `isTextSync` + */ +export function isBinarySync(filename: string, buffer?: Buffer): boolean; +export function isBinarySync(filename: undefined, buffer: Buffer): boolean; + +/** + * Is Binary + * Uses `isText` behind the scenes. + * @param filename forwarded to `isText` + * @param buffer forwarded to `isText` + * @param next accepts arguments: (error: Error, result: Boolean) + */ +export function isBinary( + filename: string, + buffer: Buffer | undefined, + next: (err: null, result: boolean) => void +): void; +export function isBinary( + filename: undefined, + buffer: Buffer, + next: (err: null, result: boolean) => void +): void; + +/** + * Get the encoding of a buffer. + * We fetch a bunch chars from the start, middle and end of the buffer. + * We check all three, as doing only start was not enough, and doing only middle was not enough, so better safe than sorry. + * @param buffer + * @param [opts] + * @param [opts.chunkLength = 24] + * @param [opts.chunkBegin = 0] + * @returns either an Error instance if something went wrong, or if successful "utf8" or "binary" + */ +export function getEncodingSync(buffer: Buffer, opts?: Options): 'utf8' | 'binary'; + +/** + * Get the encoding of a buffer + * Uses `getEncodingSync` behind the scenes. + * @param buffer forwarded to `getEncodingSync` + * @param opts forwarded to `getEncodingSync` + * @param next accepts arguments: (error: Error, result: Boolean) + */ +export function getEncoding( + buffer: Buffer, + opts: Options | undefined, + next: (err: null, result: 'utf8' | 'binary') => void +): void; + +export interface Options { + chunkLength?: number; + chunkBegin?: number; +} diff --git a/types/istextorbinary/istextorbinary-tests.ts b/types/istextorbinary/istextorbinary-tests.ts new file mode 100644 index 0000000000..cf9c953711 --- /dev/null +++ b/types/istextorbinary/istextorbinary-tests.ts @@ -0,0 +1,67 @@ +import { + isTextSync, + isText, + isBinarySync, + isBinary, + getEncodingSync, + getEncoding, +} from 'istextorbinary'; + +isTextSync('foo.txt'); // $ExpectType boolean +isTextSync('foo.txt', new Buffer(1)); // $ExpectType boolean +isTextSync(undefined, new Buffer(1)); // $ExpectType boolean +isTextSync(); // $ExpectError +isTextSync(undefined); // $ExpectError +isTextSync(undefined, undefined); // $ExpectError + +isText('foo.txt', undefined, (err, result) => { + err; // $ExpectType null + result; // $ExpectType boolean +}); +isText('foo.txt', new Buffer(1), (err, result) => { + err; // $ExpectType null + result; // $ExpectType boolean +}); +isText(undefined, new Buffer(1), (err, result) => { + err; // $ExpectType null + result; // $ExpectType boolean +}); +isText(undefined, undefined, (err, result) => {}); // $ExpectError + +isBinarySync('foo.txt'); // $ExpectType boolean +isBinarySync('foo.txt', new Buffer(1)); // $ExpectType boolean +isBinarySync(undefined, new Buffer(1)); // $ExpectType boolean +isBinarySync(); // $ExpectError +isBinarySync(undefined); // $ExpectError +isBinarySync(undefined, undefined); // $ExpectError + +isBinary('foo.txt', undefined, (err, result) => { + err; // $ExpectType null + result; // $ExpectType boolean +}); +isBinary('foo.txt', new Buffer(1), (err, result) => { + err; // $ExpectType null + result; // $ExpectType boolean +}); +isBinary(undefined, new Buffer(1), (err, result) => { + err; // $ExpectType null + result; // $ExpectType boolean +}); +isBinary(undefined, undefined, (err, result) => {}); // $ExpectError + +getEncodingSync(new Buffer(1)); // $ExpectType "utf8" | "binary" +getEncodingSync(new Buffer(1), { chunkBegin: 0 }); // $ExpectType "utf8" | "binary" +getEncodingSync(new Buffer(1), { chunkLength: 10 }); // $ExpectType "utf8" | "binary" + +getEncoding(new Buffer(1), undefined, (err, result) => { + err; // $ExpectType null + result; // $ExpectType "utf8" | "binary" +}); +getEncoding(new Buffer(1), { chunkBegin: 0 }, (err, result) => { + err; // $ExpectType null + result; // $ExpectType "utf8" | "binary" +}); +getEncoding(new Buffer(1), { chunkLength: 10 }, (err, result) => { + err; // $ExpectType null + result; // $ExpectType "utf8" | "binary" +}); diff --git a/types/istextorbinary/tsconfig.json b/types/istextorbinary/tsconfig.json new file mode 100644 index 0000000000..7e5e7e256c --- /dev/null +++ b/types/istextorbinary/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", + "istextorbinary-tests.ts" + ] +} diff --git a/types/istextorbinary/tslint.json b/types/istextorbinary/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/istextorbinary/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jasmine-given/index.d.ts b/types/jasmine-given/index.d.ts index e2b630eccd..df2fe424a9 100644 --- a/types/jasmine-given/index.d.ts +++ b/types/jasmine-given/index.d.ts @@ -3,9 +3,17 @@ // Definitions by: Shai Reznik // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare function Given(func: (done?: () => void) => void): void; -declare function When(func: (done?: () => void) => void): void; -declare function Then(func: (done?: () => void) => void): void; -declare function Then(label: string, func: (done?: () => void) => void): void; -declare function And(func: (done?: () => void) => void): void; -declare function Invariant(func: (done?: () => void) => void): void; +/** Action method that should be called when the async work is complete */ +interface DoneFn { + (): void; + + /** fails the spec and indicates that it has completed. If the message is an Error, Error.message is used */ + fail: (message?: Error | string) => void; +} + +declare function Given(func: (done?: DoneFn) => void): void; +declare function When(func: (done?: DoneFn) => void): void; +declare function Then(func: (done?: DoneFn) => void): void; +declare function Then(label: string, func: (done?: DoneFn) => void): void; +declare function And(func: (done?: DoneFn) => void): void; +declare function Invariant(func: (done?: DoneFn) => void): void; diff --git a/types/jasmine-given/jasmine-given-tests.ts b/types/jasmine-given/jasmine-given-tests.ts index 7658502b68..10a6b824fe 100644 --- a/types/jasmine-given/jasmine-given-tests.ts +++ b/types/jasmine-given/jasmine-given-tests.ts @@ -39,3 +39,33 @@ Invariant((done) => { done(); } }); + +Given((done) => { + if (done) { + done.fail(); + } +}); + +When((done) => { + if (done) { + done.fail(); + } +}); + +Then('expected condition 2', (done) => { + if (done) { + done.fail(); + } +}); + +And((done) => { + if (done) { + done.fail(); + } +}); + +Invariant((done) => { + if (done) { + done.fail(); + } +}); diff --git a/types/jasmine/index.d.ts b/types/jasmine/index.d.ts index a87b8b3a86..f87dd67ece 100644 --- a/types/jasmine/index.d.ts +++ b/types/jasmine/index.d.ts @@ -8,17 +8,34 @@ // Boris Breuer // Chris Yungmann // Giles Roadnight +// Yaroslav Admin +// Domas Trijonis +// Peter Safranek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 // For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts +type ImplementationCallback = (() => Promise) | ((done: DoneFn) => void); + /** * Create a group of specs (often called a suite). * @param description Textual description of the group * @param specDefinitions Function for Jasmine to invoke that will define inner suites a specs */ declare function describe(description: string, specDefinitions: () => void): void; + +/** + * A focused `describe`. If suites or specs are focused, only those that are focused will be executed. + * @param description Textual description of the group + * @param specDefinitions Function for Jasmine to invoke that will define inner suites a specs + */ declare function fdescribe(description: string, specDefinitions: () => void): void; + +/** + * A temporarily disabled `describe`. Specs within an xdescribe will be marked pending and not executed. + * @param description Textual description of the group + * @param specDefinitions Function for Jasmine to invoke that will define inner suites a specs + */ declare function xdescribe(description: string, specDefinitions: () => void): void; /** @@ -28,23 +45,28 @@ declare function xdescribe(description: string, specDefinitions: () => void): vo * @param assertion Function that contains the code of your test. If not provided the test will be pending. * @param timeout Custom timeout for an async spec. */ -declare function it(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; +declare function it(expectation: string, assertion?: ImplementationCallback, timeout?: number): void; /** - * A focused it - * If suites or specs are focused, only those that are focused will be executed. - * @param expectation - * @param assertion - * @param timeout + * A focused `it`. If suites or specs are focused, only those that are focused will be executed. + * @param expectation Textual description of what this spec is checking + * @param assertion Function that contains the code of your test. If not provided the test will be pending. + * @param timeout Custom timeout for an async spec. */ -declare function fit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; -declare function xit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; +declare function fit(expectation: string, assertion?: ImplementationCallback, timeout?: number): void; + +/** + * A temporarily disabled `it`. The spec will report as pending and will not be executed. + * @param expectation Textual description of what this spec is checking + * @param assertion Function that contains the code of your test. If not provided the test will be pending. + * @param timeout Custom timeout for an async spec. + */ +declare function xit(expectation: string, assertion?: ImplementationCallback, timeout?: number): void; /** * Mark a spec as pending, expectation results will be ignored. * If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. - * @param reason - * @returns {} + * @param reason Reason the spec is pending. */ declare function pending(reason?: string): void; @@ -53,14 +75,14 @@ declare function pending(reason?: string): void; * @param action Function that contains the code to setup your specs. * @param timeout Custom timeout for an async beforeEach. */ -declare function beforeEach(action: (done: DoneFn) => void, timeout?: number): void; +declare function beforeEach(action: ImplementationCallback, timeout?: number): void; /** * Run some shared teardown after each of the specs in the describe in which it is called. * @param action Function that contains the code to teardown your specs. * @param timeout Custom timeout for an async afterEach. */ -declare function afterEach(action: (done: DoneFn) => void, timeout?: number): void; +declare function afterEach(action: ImplementationCallback, timeout?: number): void; /** * Run some shared setup once before all of the specs in the describe are run. @@ -68,7 +90,7 @@ declare function afterEach(action: (done: DoneFn) => void, timeout?: number): vo * @param action Function that contains the code to setup your specs. * @param timeout Custom timeout for an async beforeAll. */ -declare function beforeAll(action: (done: DoneFn) => void, timeout?: number): void; +declare function beforeAll(action: ImplementationCallback, timeout?: number): void; /** * Run some shared teardown once before all of the specs in the describe are run. @@ -76,22 +98,25 @@ declare function beforeAll(action: (done: DoneFn) => void, timeout?: number): vo * @param action Function that contains the code to teardown your specs. * @param timeout Custom timeout for an async afterAll */ -declare function afterAll(action: (done: DoneFn) => void, timeout?: number): void; +declare function afterAll(action: ImplementationCallback, timeout?: number): void; /** * Create an expectation for a spec. + * @checkReturnValue see https://tsetse.info/check-return-value * @param spy */ declare function expect(spy: Function): jasmine.Matchers; /** * Create an expectation for a spec. + * @checkReturnValue see https://tsetse.info/check-return-value * @param actual */ declare function expect(actual: ArrayLike): jasmine.ArrayLikeMatchers; /** * Create an expectation for a spec. + * @checkReturnValue see https://tsetse.info/check-return-value * @param actual Actual computed value to test expectations against. */ declare function expect(actual: T): jasmine.Matchers; @@ -101,13 +126,25 @@ declare function expect(actual: T): jasmine.Matchers; */ declare function expect(): jasmine.NothingMatcher; +/** + * Create an asynchronous expectation for a spec. Note that the matchers + * that are provided by an asynchronous expectation all return promises + * which must be either returned from the spec or waited for using `await` + * in order for Jasmine to associate them with the correct spec. + * @checkReturnValue see https://tsetse.info/check-return-value + * @param actual - Actual computed value to test expectations against. + */ +declare function expectAsync(actual: Promise): jasmine.AsyncMatchers; + /** * Explicitly mark a spec as failed. - * @param e + * @param e Reason for the failure */ declare function fail(e?: any): void; -/** Action method that should be called when the async work is complete */ +/** + * Action method that should be called when the async work is complete. + */ interface DoneFn extends Function { (): void; @@ -117,28 +154,37 @@ interface DoneFn extends Function { /** * Install a spy onto an existing object. - * @param object The object upon which to install the Spy - * @param method The name of the method to replace with a Spy. + * @param object The object upon which to install the `Spy`. + * @param method The name of the method to replace with a `Spy`. */ declare function spyOn(object: T, method: keyof T): jasmine.Spy; /** - * Install a spy on a property onto an existing object. - * @param object The object upon which to install the Spy - * @param property The name of the property to replace with a Spy - * @param accessType The access type (get|set) of the property to Spy on. + * Install a spy on a property installed with `Object.defineProperty` onto an existing object. + * @param object The object upon which to install the `Spy`. + * @param property The name of the property to replace with a `Spy`. + * @param accessType The access type (get|set) of the property to `Spy` on. */ declare function spyOnProperty(object: T, property: keyof T, accessType?: 'get' | 'set'): jasmine.Spy; +/** + * Installs spies on all writable and configurable properties of an object. + * @param object The object upon which to install the `Spy`s. + */ +declare function spyOnAllFunctions(object: object): jasmine.Spy; + declare function runs(asyncMethod: Function): void; declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void; declare function waits(timeout?: number): void; declare namespace jasmine { type Expected = T | ObjectContaining | Any | Spy; - type SpyObjMethodNames = T extends undefined ? (ReadonlyArray | {[methodName: string]: any}) : (ReadonlyArray | {[P in keyof T]?: ReturnType any ? T[P] : any>}); + type SpyObjMethodNames = + T extends undefined ? + (ReadonlyArray | {[methodName: string]: any}) : + (ReadonlyArray | {[P in keyof T]?: ReturnType any ? T[P] : any>}); - var clock: () => Clock; + function clock(): Clock; var matchersUtil: MatchersUtil; @@ -165,13 +211,12 @@ declare namespace jasmine { function addMatchers(matchers: CustomMatcherFactories): void; - function stringMatching(str: string): Any; - function stringMatching(str: RegExp): Any; + function stringMatching(str: string | RegExp): Any; function formatErrorMsg(domain: string, usage: string): (msg: string) => string; interface Any { - (...params: any[]):any; // jasmine.Any can also be a function + (...params: any[]): any; // jasmine.Any can also be a function new (expectedClass: any): any; jasmineMatches(other: any): boolean; @@ -199,7 +244,6 @@ declare namespace jasmine { } interface Block { - new (env: Env, func: SpecFunction, spec: Spec): any; execute(onComplete: () => void): void; @@ -249,12 +293,6 @@ declare namespace jasmine { } interface Env { - setTimeout: any; - clearTimeout: void; - setInterval: any; - clearInterval: void; - updateInterval: number; - currentSpec: Spec; matchersClass: Matchers; @@ -262,16 +300,15 @@ declare namespace jasmine { version(): any; versionString(): string; nextSpecId(): number; - addReporter(reporter: Reporter): void; - addReporter(reporter: CustomReporter): void; + addReporter(reporter: Reporter | CustomReporter): void; execute(): void; describe(description: string, specDefinitions: () => void): Suite; // ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these - beforeEach(beforeEachFunction: (done: DoneFn) => void, timeout?: number): void; - beforeAll(beforeAllFunction: (done: DoneFn) => void, timeout?: number): void; + beforeEach(beforeEachFunction: ImplementationCallback, timeout?: number): void; + beforeAll(beforeAllFunction: ImplementationCallback, timeout?: number): void; currentRunner(): Runner; - afterEach(afterEachFunction: (done: DoneFn) => void, timeout?: number): void; - afterAll(afterAllFunction: (done: DoneFn) => void, timeout?: number): void; + afterEach(afterEachFunction: ImplementationCallback, timeout?: number): void; + afterAll(afterAllFunction: ImplementationCallback, timeout?: number): void; xdescribe(desc: string, specDefinitions: () => void): XSuite; it(description: string, func: () => void): Spec; // iit(description: string, func: () => void): Spec; Not a part of jasmine. Angular team adds these @@ -294,7 +331,6 @@ declare namespace jasmine { } interface FakeTimer { - new (): any; reset(): void; @@ -373,7 +409,6 @@ declare namespace jasmine { } interface PrettyPrinter { - new (): any; format(value: any): void; @@ -389,7 +424,6 @@ declare namespace jasmine { } interface Queue { - new (env: any): any; env: Env; @@ -410,7 +444,6 @@ declare namespace jasmine { } interface Matchers { - new (env: Env, actual: T, spec: Env, isNot?: boolean): any; env: Env; @@ -423,7 +456,6 @@ declare namespace jasmine { * * @param expected the actual value to be === to the expected value. * @param expectationFailOutput - * @returns {} */ toBe(expected: Expected, expectationFailOutput?: any): boolean; @@ -431,7 +463,6 @@ declare namespace jasmine { * * @param expected the actual value to be equal to the expected, using deep equality comparison. * @param expectationFailOutput - * @returns {} */ toEqual(expected: Expected, expectationFailOutput?: any): boolean; toMatch(expected: string | RegExp, expectationFailOutput?: any): boolean; @@ -481,6 +512,43 @@ declare namespace jasmine { nothing(): void; } + interface AsyncMatchers { + /** + * Expect a promise to be resolved. + * @param expectationFailOutput + */ + toBeResolved(expectationFailOutput?: any): Promise; + + /** + * Expect a promise to be rejected. + * @param expectationFailOutput + */ + toBeRejected(expectationFailOutput?: any): Promise; + + /** + * Expect a promise to be resolved to a value equal to the expected, using deep equality comparison. + * @param expected - Value that the promise is expected to resolve to. + */ + toBeResolvedTo(expected: Expected): Promise; + + /** + * Expect a promise to be rejected with a value equal to the expected, using deep equality comparison. + * @param expected - Value that the promise is expected to be rejected with. + */ + toBeRejectedWith(expected: Expected): Promise; + + /** + * Add some context for an expect. + * @param message - Additional context to show when the matcher fails. + */ + withContext(message: string): AsyncMatchers; + + /** + * Invert the matcher following this expect. + */ + not: AsyncMatchers; + } + interface Reporter { reportRunnerStarting(runner: Runner): void; reportRunnerResults(runner: Runner): void; @@ -511,7 +579,6 @@ declare namespace jasmine { } interface PassedExpectation extends CustomReportExpectation { - } interface CustomReporterResult { @@ -526,7 +593,7 @@ declare namespace jasmine { interface RunDetails { failedExpectations: ExpectationResult[]; - order: jasmine.Order; + order: Order; } interface CustomReporter { @@ -539,7 +606,6 @@ declare namespace jasmine { } interface Runner { - new (env: Env): any; execute(): void; @@ -566,7 +632,6 @@ declare namespace jasmine { } interface Spec extends SuiteOrSpec { - new (env: Env, suite: Suite, description: string): any; suite: Suite; @@ -598,6 +663,8 @@ declare namespace jasmine { explodes(): void; spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy; spyOnProperty(object: any, property: string, accessType?: 'get' | 'set'): Spy; + spyOnAllFunctions(object: any): Spy; + removeAllSpies(): void; throwOnExpectationFailure: boolean; } @@ -608,7 +675,6 @@ declare namespace jasmine { } interface Suite extends SuiteOrSpec { - new (env: Env, description: string, specDefinitions: () => void, parentSuite: Suite): any; parentSuite: Suite; @@ -634,19 +700,18 @@ declare namespace jasmine { interface Spy { (...params: any[]): any; - identity: string; and: SpyAnd; calls: Calls; - mostRecentCall: { args: any[]; }; - argsForCall: any[]; withArgs(...args: any[]): Spy; } type SpyObj = T & { - [k in keyof T]: Spy; - } + [k in keyof T]: T[k] extends Function ? T[k] & Spy : T[k]; + }; interface SpyAnd { + identity: string; + /** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */ callThrough(): Spy; /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */ @@ -662,21 +727,21 @@ declare namespace jasmine { } interface Calls { - /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. **/ + /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. */ any(): boolean; - /** By chaining the spy with calls.count(), will return the number of times the spy was called **/ + /** By chaining the spy with calls.count(), will return the number of times the spy was called */ count(): number; - /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index **/ + /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index */ argsFor(index: number): any[]; - /** By chaining the spy with calls.allArgs(), will return the arguments to all calls **/ + /** By chaining the spy with calls.allArgs(), will return the arguments to all calls */ allArgs(): any[]; - /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls **/ + /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls */ all(): CallInfo[]; - /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call **/ + /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call */ mostRecent(): CallInfo; - /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call **/ + /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call */ first(): CallInfo; - /** By chaining the spy with calls.reset(), will clears all tracking for a spy **/ + /** By chaining the spy with calls.reset(), will clears all tracking for a spy */ reset(): void; } @@ -698,7 +763,6 @@ declare namespace jasmine { } interface JsApiReporter extends Reporter { - started: boolean; finished: boolean; result: any; @@ -722,10 +786,32 @@ declare namespace jasmine { util: Util; } - export var HtmlReporter: HtmlReporter; - export var HtmlSpecFilter: HtmlSpecFilter; - export var DEFAULT_TIMEOUT_INTERVAL: number; - export var MAX_PRETTY_PRINT_DEPTH: number; + var HtmlReporter: HtmlReporter; + var HtmlSpecFilter: HtmlSpecFilter; + + /** + * Default number of milliseconds Jasmine will wait for an asynchronous spec to complete. + */ + var DEFAULT_TIMEOUT_INTERVAL: number; + + /** + * Maximum number of array elements to display when pretty printing objects. + * This will also limit the number of keys and values displayed for an object. + * Elements past this number will be ellipised. + */ + var MAX_PRETTY_PRINT_ARRAY_LENGTH: number; + + /** + * Maximum number of charasters to display when pretty printing objects. + * Characters past this number will be ellipised. + */ + var MAX_PRETTY_PRINT_CHARS: number; + + /** + * Maximum object depth the pretty printer will print to. + * Set this to a lower value to speed up pretty printing if you have large objects. + */ + var MAX_PRETTY_PRINT_DEPTH: number; } declare module "jasmine" { diff --git a/types/jasmine/jasmine-tests.ts b/types/jasmine/jasmine-tests.ts index 92f9a21db8..66b98c4b0d 100644 --- a/types/jasmine/jasmine-tests.ts +++ b/types/jasmine/jasmine-tests.ts @@ -16,7 +16,6 @@ describe("A suite is just a function", () => { }); describe("The 'toBe' matcher compares with ===", () => { - it("and has a positive case", () => { expect(true).toBe(true); }); @@ -27,28 +26,26 @@ describe("The 'toBe' matcher compares with ===", () => { }); describe("Included matchers:", () => { - it("The 'toBe' matcher compares with ===", () => { - var a = 12; - var b = a; + const a = 12; + const b = a; expect(a).toBe(b); expect(a).not.toBe(24); }); describe("The 'toEqual' matcher", () => { - it("works for simple literals and variables", () => { - var a = 12; + const a = 12; expect(a).toEqual(12); }); it("should work for objects", () => { - var foo = { + const foo = { a: 12, b: 34 }; - var bar = { + const bar = { a: 12, b: 34 }; @@ -56,13 +53,13 @@ describe("Included matchers:", () => { }); it("should work for optional values", () => { - var opt: string | undefined = "s"; - expect(opt as (string | undefined)).toEqual(undefined); + const opt: string | undefined = Math.random() > .5 ? "s" : undefined; + expect(opt).toEqual(undefined); }); }); it("The 'toMatch' matcher is for regular expressions", () => { - var message = "foo bar baz"; + const message = "foo bar baz"; expect(message).toMatch(/bar/); expect(message).toMatch("bar"); @@ -70,7 +67,7 @@ describe("Included matchers:", () => { }); it("The 'toBeDefined' matcher compares against `undefined`", () => { - var a = { + const a = { foo: "foo" }; @@ -79,7 +76,7 @@ describe("Included matchers:", () => { }); it("The `toBeUndefined` matcher compares against `undefined`", () => { - var a = { + const a = { foo: "foo" }; @@ -88,8 +85,8 @@ describe("Included matchers:", () => { }); it("The 'toBeNull' matcher compares against null", () => { - var a: string | null = null; - var foo = "foo"; + const a: string | null = Math.random() > 0.5 ? "s" : null; + const foo = "foo"; expect(null).toBeNull(); expect(a).toBeNull(); @@ -97,72 +94,76 @@ describe("Included matchers:", () => { }); it("The 'toBeTruthy' matcher is for boolean casting testing", () => { - var a: string | undefined, foo = "foo"; + const a: string | undefined = Math.random() > 0.5 ? "s" : undefined; + const foo = "foo"; expect(foo).toBeTruthy(); expect(a).not.toBeTruthy(); }); it("The 'toBeFalsy' matcher is for boolean casting testing", () => { - var a: string | undefined, foo = "foo"; + const a: string | undefined = Math.random() > 0.5 ? "s" : undefined; + const foo = "foo"; expect(a).toBeFalsy(); expect(foo).not.toBeFalsy(); }); it("The 'toContain' matcher is for finding an item in an Array", () => { - var a = ["foo", "bar", "baz"]; + const a = ["foo", "bar", "baz"]; expect(a).toContain('foo'); expect(a).not.toContain("quux"); }); it("The 'toContain' matcher is also for finding an object containing distinct properties in an Array", () => { - var a = [{ a: "foo" }, { a: "bar" }, { b: "baz" }]; + const a = [{ a: "foo" }, { a: "bar" }, { b: "baz" }]; expect(a).toContain(jasmine.objectContaining({ a: "foo" })); expect(a).not.toContain({ a: "quux" }); }); it("The 'toBeLessThan' matcher is for mathematical comparisons", () => { - var pi = 3.1415926, - e = 2.78; + const pi = 3.1415926; + const e = 2.78; expect(e).toBeLessThan(pi); expect(pi).not.toBeLessThan(e); }); it("The 'toBeGreaterThan' is for mathematical comparisons", () => { - var pi = 3.1415926, - e = 2.78; + const pi = 3.1415926; + const e = 2.78; expect(pi).toBeGreaterThan(e); expect(e).not.toBeGreaterThan(pi); }); it("The 'toBeCloseTo' matcher is for precision math comparison", () => { - var pi = 3.1415926, - e = 2.78; + const pi = 3.1415926; + const e = 2.78; expect(pi).not.toBeCloseTo(e, 2); expect(pi).toBeCloseTo(e, 0); }); it("The 'toThrow' matcher is for testing if a function throws an exception", () => { - var foo = () => { + const foo = () => { return 1 + 2; }; - var bar = () => { - var a: any; - return a + 1; + const bar = () => { + throw new Error("message"); }; expect(foo).not.toThrow(); + expect(foo).toThrow(); + + expect(bar).not.toThrow(); expect(bar).toThrow(); }); it("The 'toThrowError' matcher is for testing a specific thrown exception", () => { - var foo = () => { + const foo = () => { throw new TypeError("foo bar baz"); }; @@ -171,12 +172,34 @@ describe("Included matchers:", () => { expect(foo).toThrowError(TypeError); expect(foo).toThrowError(TypeError, "foo bar baz"); }); + + it("async matchers", async () => { + const badness = new Error("badness"); + await expectAsync(Promise.resolve()).toBeResolved(); + await expectAsync(Promise.resolve()).toBeResolved("good job"); + await expectAsync(Promise.resolve(true)).toBeResolvedTo(true); + await expectAsync(Promise.reject(badness)).toBeRejected(); + await expectAsync(Promise.reject(badness)).toBeRejected("bad mojo"); + await expectAsync(Promise.reject(badness)).toBeRejectedWith(badness); + await expectAsync(Promise.resolve()).withContext("additional info").toBeResolved(); + }); + + it("async matchers - not", async () => { + const badness = new Error("badness"); + const malady = new Error("malady"); + await expectAsync(Promise.reject(badness)).not.toBeResolved(); + await expectAsync(Promise.resolve(true)).not.toBeResolvedTo(false); + await expectAsync(Promise.resolve()).not.toBeRejected(); + await expectAsync(Promise.reject(badness)).not.toBeRejectedWith(malady); + await expectAsync(Promise.reject(badness)).not.withContext("additional info").toBeResolved(); + await expectAsync(Promise.reject(badness)).withContext("additional info").not.toBeResolved(); + }); }); describe("toThrowMatching", () => { expect(() => { ({} as any).doSomething(); - }).toThrowMatching(error => error != undefined); + }).toThrowMatching(error => error !== undefined); }); describe("toBeNegativeInfinity", () => { @@ -284,7 +307,6 @@ xdescribe("A spec", () => { }); describe("Pending specs", () => { - xit("can be declared 'xit'", () => { expect(true).toBe(false); }); @@ -335,6 +357,12 @@ describe("A spy", () => { it("stops all execution on a function", () => { expect(bar).toBeNull(); }); + + it("tracks if it was called at all", function() { + foo.setBar(); + + expect(foo.setBar.calls.any()).toEqual(true); + }); }); describe("A spy, when configured to call through", () => { @@ -695,11 +723,25 @@ describe("A spy, when created manually", () => { }); describe("Multiple spies, when created manually", () => { - var tape: any; + class Tape { + private rewindTo: number; + play(): void { } + pause(): void { } + rewind(pos: number): void { + this.rewindTo = pos; + } + stop(): void { } + readonly isPlaying: boolean; // spy obj makes this writable + } + + var tape: Tape; + var tapeSpy: jasmine.SpyObj; var el: jasmine.SpyObj; beforeEach(() => { - tape = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); + tapeSpy = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); + tape = tapeSpy; + (tape as { isPlaying: boolean }).isPlaying = false; el = jasmine.createSpyObj('Element', ['hasAttribute']); el.hasAttribute.and.returnValue(false); @@ -708,6 +750,10 @@ describe("Multiple spies, when created manually", () => { tape.play(); tape.pause(); tape.rewind(0); + + tapeSpy.play.and.callThrough(); + tapeSpy.pause.and.callThrough(); + tapeSpy.rewind.and.callThrough(); }); it("creates spies for each requested function", () => { @@ -727,6 +773,27 @@ describe("Multiple spies, when created manually", () => { it("tracks all the arguments of its calls", () => { expect(tape.rewind).toHaveBeenCalledWith(0); }); + + it("read isPlaying property", () => { + expect(tape.isPlaying).toBe(false); + }); +}); + +describe("multiple spies, when created with spyOnAllFunctions", () => { + it("spies on all functions", () => { + const obj = { + x: (a: number) => a, + y: (a: number) => a, + }; + + spyOnAllFunctions(obj); + + obj.x(0); + obj.y(1); + + expect(obj.x).toHaveBeenCalled(); + expect(obj.y).toHaveBeenCalledWith(1); + }); }); describe("jasmine.nothing", () => { @@ -749,7 +816,7 @@ describe("jasmine.any", () => { const a: Test = { fn1: () => { }, - fn2: (param1: number) => { return param1; }, + fn2: (param1: number) => param1, }; const expected: Test = { @@ -762,7 +829,7 @@ describe("jasmine.any", () => { describe("when used with a spy", () => { it("is useful for comparing arguments", () => { - var foo = jasmine.createSpy('foo'); + const foo = jasmine.createSpy('foo'); foo(12, () => { return true; }); @@ -807,7 +874,7 @@ describe("jasmine.objectContaining", () => { describe("when used with a spy", () => { it("is useful for comparing arguments", () => { - var callback = jasmine.createSpy('callback'); + const callback = jasmine.createSpy('callback'); callback({ bar: "baz" @@ -824,7 +891,7 @@ describe("jasmine.objectContaining", () => { }); describe("jasmine.arrayContaining", () => { - var foo: Array; + var foo: number[]; beforeEach(() => { foo = [1, 2, 3, 4]; @@ -840,7 +907,7 @@ describe("jasmine.arrayContaining", () => { describe("when used with a spy", () => { it("is useful when comparing arguments", () => { - var callback = jasmine.createSpy('callback'); + const callback = jasmine.createSpy('callback'); callback([1, 2, 3, 4]); @@ -851,7 +918,7 @@ describe("jasmine.arrayContaining", () => { }); describe("jasmine.arrayWithExactContents", () => { - var foo: Array; + var foo: number[]; beforeEach(() => { foo = [1, 2, 3, 4]; @@ -867,7 +934,7 @@ describe("jasmine.arrayWithExactContents", () => { describe("when used with a spy", () => { it("is useful when comparing arguments", () => { - var callback = jasmine.createSpy('callback'); + const callback = jasmine.createSpy('callback'); callback([1, 2, 3, 4]); @@ -920,7 +987,7 @@ describe("Manually ticking the Jasmine Clock", () => { describe("Mocking the Date object", () => { it("mocks the Date object and sets it to a given time", () => { - var baseTime = new Date(2013, 9, 23); + const baseTime = new Date(2013, 9, 23); jasmine.clock().mockDate(baseTime); @@ -940,7 +1007,7 @@ describe("Asynchronous specs", () => { }); it("should support async execution of test preparation and expectations", (done: DoneFn) => { - value++; + value += 1; expect(value).toBeGreaterThan(0); done(); }); @@ -960,11 +1027,9 @@ describe("Asynchronous specs", () => { done(); }, 1000); }); - }); describe("Fail", () => { - it("should fail test when called without arguments", () => { fail(); }); @@ -976,12 +1041,11 @@ describe("Fail", () => { it("should fail test when called an error", () => { fail(new Error("The test failed with this error")); }); - }); // test based on http://jasmine.github.io/2.2/custom_equality.html describe("custom equality", () => { - var myCustomEquality: jasmine.CustomEqualityTester = function (first: any, second: any): boolean | void { + const myCustomEquality: jasmine.CustomEqualityTester = function(first: any, second: any): boolean | void { if (typeof first === "string" && typeof second === "string") { return first[0] === second[1]; } @@ -991,7 +1055,6 @@ describe("custom equality", () => { jasmine.addCustomEqualityTester(myCustomEquality); }); - it("should be custom equal", () => { expect("abc").toEqual("aaa"); }); @@ -1009,15 +1072,13 @@ var customMatchers: jasmine.CustomMatcherFactories = { if (expected === undefined) { expected = ''; } - var result: jasmine.CustomMatcherResult = { pass: false }; + const result: jasmine.CustomMatcherResult = { pass: false }; result.pass = util.equals(actual.hyuk, "gawrsh" + expected, customEqualityTesters); - if (result.pass) { - result.message = "Expected " + actual + " not to be quite so goofy"; - } else { - result.message = "Expected " + actual + " to be goofy, but it was not very goofy"; - } + result.message = result.pass ? + `Expected ${actual} not to be quite so goofy` : + `Expected ${actual} to be goofy, but it was not very goofy`; return result; } @@ -1050,8 +1111,8 @@ var customMatchers: jasmine.CustomMatcherFactories = { // } declare namespace jasmine { interface Matchers { - toBeGoofy(expected?: jasmine.Expected): boolean; - toBeWithinRange(expected?: jasmine.Expected, floor?: number, ceiling?: number): boolean; + toBeGoofy(expected?: Expected): boolean; + toBeWithinRange(expected?: Expected, floor?: number, ceiling?: number): boolean; } } @@ -1097,7 +1158,7 @@ describe("Custom matcher: 'toBeGoofy'", () => { const result = matcher.compare(actual, null); expect(result.pass).toBe(false); - expect(result.message).toBe("Expected " + actual + " to be goofy, but it was not very goofy"); + expect(result.message).toBe(`Expected ${actual} to be goofy, but it was not very goofy`); }); }); @@ -1108,17 +1169,17 @@ var myReporter: jasmine.CustomReporter = { }, suiteStarted: (result: jasmine.CustomReporterResult) => { - console.log("Suite started: " + result.description + " whose full description is: " + result.fullName); + console.log(`Suite started: ${result.description} whose full description is: ${result.fullName}`); }, specStarted: (result: jasmine.CustomReporterResult) => { - console.log("Spec started: " + result.description + " whose full description is: " + result.fullName); + console.log(`Spec started: ${result.description} whose full description is: ${result.fullName}`); }, specDone: (result: jasmine.CustomReporterResult) => { - console.log("Spec: " + result.description + " was " + result.status); - //tslint:disable-next-line:prefer-for-of - for (var i = 0; result.failedExpectations && i < result.failedExpectations.length; i++) { + console.log(`Spec: ${result.description} was ${result.status}`); + // tslint:disable-next-line:prefer-for-of + for (var i = 0; result.failedExpectations && i < result.failedExpectations.length; i += 1) { console.log("Failure: " + result.failedExpectations[i].message); console.log("Actual: " + result.failedExpectations[i].actual); console.log("Expected: " + result.failedExpectations[i].expected); @@ -1128,9 +1189,9 @@ var myReporter: jasmine.CustomReporter = { }, suiteDone: (result: jasmine.CustomReporterResult) => { - console.log('Suite: ' + result.description + ' was ' + result.status); - //tslint:disable-next-line:prefer-for-of - for (var i = 0; result.failedExpectations && i < result.failedExpectations.length; i++) { + console.log(`Suite: ${result.description} was ${result.status}`); + // tslint:disable-next-line:prefer-for-of + for (var i = 0; result.failedExpectations && i < result.failedExpectations.length; i += 1) { console.log('AfterAll ' + result.failedExpectations[i].message); console.log(result.failedExpectations[i].stack); } @@ -1147,24 +1208,24 @@ jasmine.getEnv().addReporter(myReporter); describe("Randomize Tests", () => { it("should allow randomization of the order of tests", () => { expect(() => { - var env = jasmine.getEnv(); - return env.randomizeTests(true); + const env = jasmine.getEnv(); + env.randomizeTests(true); }).not.toThrow(); }); it("should allow a seed to be passed in for randomization", () => { expect(() => { - var env = jasmine.getEnv(); + const env = jasmine.getEnv(); env.randomizeTests(true); return env.seed(1234); }).not.toThrow(); }); }); -//dest spces copied from jasmine project (https://github.com/jasmine/jasmine/blob/master/spec/core/SpecSpec.js) -describe("createSpyObj", function () { - it("should create an object with spy methods and corresponding return values when you call jasmine.createSpyObj() with an object", function () { - var spyObj = jasmine.createSpyObj('BaseName', { 'method1': 42, 'method2': 'special sauce' }); +// Dest spces copied from jasmine project (https://github.com/jasmine/jasmine/blob/master/spec/core/SpecSpec.js) +describe("createSpyObj", function() { + it("should create an object with spy methods and corresponding return values when you call jasmine.createSpyObj() with an object", function() { + const spyObj = jasmine.createSpyObj('BaseName', {method1: 42, method2: 'special sauce'}); expect(spyObj.method1()).toEqual(42); expect(spyObj.method1.and.identity()).toEqual('BaseName.method1'); @@ -1173,17 +1234,16 @@ describe("createSpyObj", function () { expect(spyObj.method2.and.identity()).toEqual('BaseName.method2'); }); - - it("should create an object with a bunch of spy methods when you call jasmine.createSpyObj()", function () { - var spyObj = jasmine.createSpyObj('BaseName', ['method1', 'method2']); + it("should create an object with a bunch of spy methods when you call jasmine.createSpyObj()", function() { + const spyObj = jasmine.createSpyObj('BaseName', ['method1', 'method2']); expect(spyObj).toEqual({ method1: jasmine.any(Function), method2: jasmine.any(Function) }); expect(spyObj.method1.and.identity()).toEqual('BaseName.method1'); expect(spyObj.method2.and.identity()).toEqual('BaseName.method2'); }); - it("should allow you to omit the baseName and takes only an object", function () { - var spyObj = jasmine.createSpyObj({ 'method1': 42, 'method2': 'special sauce' }); + it("should allow you to omit the baseName and takes only an object", function() { + const spyObj = jasmine.createSpyObj({method1: 42, method2: 'special sauce'}); expect(spyObj.method1()).toEqual(42); expect(spyObj.method1.and.identity()).toEqual('unknown.method1'); @@ -1192,22 +1252,22 @@ describe("createSpyObj", function () { expect(spyObj.method2.and.identity()).toEqual('unknown.method2'); }); - it("should allow you to omit the baseName and takes only a list of methods", function () { - var spyObj = jasmine.createSpyObj(['method1', 'method2']); + it("should allow you to omit the baseName and takes only a list of methods", function() { + const spyObj = jasmine.createSpyObj(['method1', 'method2']); expect(spyObj).toEqual({ method1: jasmine.any(Function), method2: jasmine.any(Function) }); expect(spyObj.method1.and.identity()).toEqual('unknown.method1'); expect(spyObj.method2.and.identity()).toEqual('unknown.method2'); }); - it("should throw if you pass an empty array argument", function () { - expect(function () { + it("should throw if you pass an empty array argument", function() { + expect(function() { jasmine.createSpyObj('BaseName', []); }).toThrow("createSpyObj requires a non-empty array or object of method names to create spies for"); }); - it("should throw if you pass an empty object argument", function () { - expect(function () { + it("should throw if you pass an empty object argument", function() { + expect(function() { jasmine.createSpyObj('BaseName', {}); }).toThrow("createSpyObj requires a non-empty array or object of method names to create spies for"); }); @@ -1215,17 +1275,17 @@ describe("createSpyObj", function () { (() => { // from boot.js - var env = jasmine.getEnv(); + const env = jasmine.getEnv(); - var htmlReporter = new jasmine.HtmlReporter(); + const htmlReporter = new jasmine.HtmlReporter(); env.addReporter(htmlReporter); - var specFilter = new jasmine.HtmlSpecFilter(); + const specFilter = new jasmine.HtmlSpecFilter(); env.specFilter = (spec) => { return specFilter.matches(spec.getFullName()); }; - var currentWindowOnload = window.onload; + const currentWindowOnload = window.onload; window.onload = () => { if (currentWindowOnload) { (currentWindowOnload as any)(null); @@ -1233,7 +1293,6 @@ describe("createSpyObj", function () { htmlReporter.initialize(); env.execute(); }; - })(); jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; diff --git a/types/jasmine/tslint.json b/types/jasmine/tslint.json index 2daeb51ad8..c540ba0129 100644 --- a/types/jasmine/tslint.json +++ b/types/jasmine/tslint.json @@ -1,80 +1,13 @@ { "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": true, - "eofline": false, - "export-just-namespace": false, - "file-name-casing": [true, "kebab-case"], - "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 + "only-arrow-functions": false } } diff --git a/types/jasmine/v2/index.d.ts b/types/jasmine/v2/index.d.ts index 40491f6875..e22aca8618 100644 --- a/types/jasmine/v2/index.d.ts +++ b/types/jasmine/v2/index.d.ts @@ -7,10 +7,14 @@ // Lukas Zech // Boris Breuer // Chris Yungmann +// Yaroslav Admin +// Domas Trijonis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 // For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts +type ImplementationCallback = (() => Promise) | ((done: DoneFn) => void); + /** * Create a group of specs (often called a suite). * @param description Textual description of the group @@ -27,7 +31,7 @@ declare function xdescribe(description: string, specDefinitions: () => void): vo * @param assertion Function that contains the code of your test. If not provided the test will be pending. * @param timeout Custom timeout for an async spec. */ -declare function it(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; +declare function it(expectation: string, assertion?: ImplementationCallback, timeout?: number): void; /** * A focused it @@ -36,8 +40,8 @@ declare function it(expectation: string, assertion?: (done: DoneFn) => void, tim * @param assertion * @param timeout */ -declare function fit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; -declare function xit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; +declare function fit(expectation: string, assertion?: ImplementationCallback, timeout?: number): void; +declare function xit(expectation: string, assertion?: ImplementationCallback, timeout?: number): void; /** * Mark a spec as pending, expectation results will be ignored. @@ -52,14 +56,14 @@ declare function pending(reason?: string): void; * @param action Function that contains the code to setup your specs. * @param timeout Custom timeout for an async beforeEach. */ -declare function beforeEach(action: (done: DoneFn) => void, timeout?: number): void; +declare function beforeEach(action: ImplementationCallback, timeout?: number): void; /** * Run some shared teardown after each of the specs in the describe in which it is called. * @param action Function that contains the code to teardown your specs. * @param timeout Custom timeout for an async afterEach. */ -declare function afterEach(action: (done: DoneFn) => void, timeout?: number): void; +declare function afterEach(action: ImplementationCallback, timeout?: number): void; /** * Run some shared setup once before all of the specs in the describe are run. @@ -67,7 +71,7 @@ declare function afterEach(action: (done: DoneFn) => void, timeout?: number): vo * @param action Function that contains the code to setup your specs. * @param timeout Custom timeout for an async beforeAll. */ -declare function beforeAll(action: (done: DoneFn) => void, timeout?: number): void; +declare function beforeAll(action: ImplementationCallback, timeout?: number): void; /** * Run some shared teardown once before all of the specs in the describe are run. @@ -75,7 +79,7 @@ declare function beforeAll(action: (done: DoneFn) => void, timeout?: number): vo * @param action Function that contains the code to teardown your specs. * @param timeout Custom timeout for an async afterAll */ -declare function afterAll(action: (done: DoneFn) => void, timeout?: number): void; +declare function afterAll(action: ImplementationCallback, timeout?: number): void; /** * Create an expectation for a spec. @@ -266,11 +270,11 @@ declare namespace jasmine { execute(): void; describe(description: string, specDefinitions: () => void): Suite; // ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these - beforeEach(beforeEachFunction: (done: DoneFn) => void, timeout?: number): void; - beforeAll(beforeAllFunction: (done: DoneFn) => void, timeout?: number): void; + beforeEach(beforeEachFunction: ImplementationCallback, timeout?: number): void; + beforeAll(beforeAllFunction: ImplementationCallback, timeout?: number): void; currentRunner(): Runner; - afterEach(afterEachFunction: (done: DoneFn) => void, timeout?: number): void; - afterAll(afterAllFunction: (done: DoneFn) => void, timeout?: number): void; + afterEach(afterEachFunction: ImplementationCallback, timeout?: number): void; + afterAll(afterAllFunction: ImplementationCallback, timeout?: number): void; xdescribe(desc: string, specDefinitions: () => void): XSuite; it(description: string, func: () => void): Spec; // iit(description: string, func: () => void): Spec; Not a part of jasmine. Angular team adds these @@ -623,18 +627,17 @@ declare namespace jasmine { interface Spy { (...params: any[]): any; - identity: string; and: SpyAnd; calls: Calls; - mostRecentCall: { args: any[]; }; - argsForCall: any[]; } type SpyObj = T & { - [k in keyof T]: Spy; + [k in keyof T]: T[k] extends Function ? T[k] & Spy : T[k]; } interface SpyAnd { + identity: string; + /** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */ callThrough(): Spy; /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */ diff --git a/types/jasmine/v2/jasmine-tests.ts b/types/jasmine/v2/jasmine-tests.ts index cef611ee17..167aca1981 100644 --- a/types/jasmine/v2/jasmine-tests.ts +++ b/types/jasmine/v2/jasmine-tests.ts @@ -311,6 +311,12 @@ describe("A spy", () => { it("stops all execution on a function", () => { expect(bar).toBeNull(); }); + + it("tracks if it was called at all", function () { + foo.setBar(); + + expect(foo.setBar.calls.any()).toEqual(true); + }); }); describe("A spy, when configured to call through", () => { @@ -637,11 +643,25 @@ describe("A spy, when created manually", () => { }); describe("Multiple spies, when created manually", () => { - var tape: any; + abstract class Tape { + private rewindTo: number; + play(): void { }; + pause(): void { }; + rewind(pos: number): void { + this.rewindTo = pos; + }; + stop(): void { }; + readonly isPlaying: boolean; // spy obj makes this writable + } + + var tape: Tape; + var tapeSpy: jasmine.SpyObj; var el: jasmine.SpyObj; beforeEach(() => { - tape = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); + tapeSpy = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); + tape = tapeSpy; + (tape as { isPlaying: boolean }).isPlaying = false; el = jasmine.createSpyObj('Element', ['hasAttribute']); el.hasAttribute.and.returnValue(false); @@ -650,6 +670,10 @@ describe("Multiple spies, when created manually", () => { tape.play(); tape.pause(); tape.rewind(0); + + tapeSpy.play.and.callThrough(); + tapeSpy.pause.and.callThrough(); + tapeSpy.rewind.and.callThrough(); }); it("creates spies for each requested function", () => { @@ -669,6 +693,10 @@ describe("Multiple spies, when created manually", () => { it("tracks all the arguments of its calls", () => { expect(tape.rewind).toHaveBeenCalledWith(0); }); + + it("read isPlaying property", () => { + expect(tape.isPlaying).toBe(false); + }) }); describe("jasmine.nothing", () => { @@ -882,7 +910,7 @@ describe("Asynchronous specs", () => { }); it("should support async execution of test preparation and expectations", (done: DoneFn) => { - value++; + value += 1; expect(value).toBeGreaterThan(0); done(); }); @@ -1060,7 +1088,7 @@ var myReporter: jasmine.CustomReporter = { specDone: (result: jasmine.CustomReporterResult) => { console.log("Spec: " + result.description + " was " + result.status); //tslint:disable-next-line:prefer-for-of - for (var i = 0; result.failedExpectations && i < result.failedExpectations.length; i++) { + for (var i = 0; result.failedExpectations && i < result.failedExpectations.length; i += 1) { console.log("Failure: " + result.failedExpectations[i].message); console.log("Actual: " + result.failedExpectations[i].actual); console.log("Expected: " + result.failedExpectations[i].expected); @@ -1072,7 +1100,7 @@ var myReporter: jasmine.CustomReporter = { suiteDone: (result: jasmine.CustomReporterResult) => { console.log('Suite: ' + result.description + ' was ' + result.status); //tslint:disable-next-line:prefer-for-of - for (var i = 0; result.failedExpectations && i < result.failedExpectations.length; i++) { + for (var i = 0; result.failedExpectations && i < result.failedExpectations.length; i += 1) { console.log('AfterAll ' + result.failedExpectations[i].message); console.log(result.failedExpectations[i].stack); } diff --git a/types/jest-when/index.d.ts b/types/jest-when/index.d.ts index f484502f4d..0579419425 100644 --- a/types/jest-when/index.d.ts +++ b/types/jest-when/index.d.ts @@ -6,22 +6,22 @@ /// -export interface PartialMockInstance { - mockReturnValue: jest.MockInstance['mockReturnValue']; - mockReturnValueOnce: jest.MockInstance['mockReturnValueOnce']; - mockResolvedValue: jest.MockInstance['mockResolvedValue']; - mockResolvedValueOnce: jest.MockInstance['mockResolvedValueOnce']; - mockRejectedValue: jest.MockInstance['mockRejectedValue']; - mockRejectedValueOnce: jest.MockInstance['mockRejectedValueOnce']; -} - export interface When { (fn: jest.Mocked | jest.Mock): When; + // due to no-unnecessary-generics lint rule, the generics have been replaced with 'any' // calledWith(...matchers: any[]): PartialMockInstance; // expectCalledWith(...matchers: any[]): PartialMockInstance; - calledWith(...matchers: any[]): PartialMockInstance; - expectCalledWith(...matchers: any[]): PartialMockInstance; + calledWith(...matchers: any[]): When; + + expectCalledWith(...matchers: any[]): When; + + mockReturnValue: (value: any) => jest.MockInstance['mockReturnValue'] & When; + mockReturnValueOnce: (value: any) => jest.MockInstance['mockReturnValue'] & When; + mockResolvedValue: (value: any) => jest.MockInstance['mockReturnValue'] & When; + mockResolvedValueOnce: (value: any) => jest.MockInstance['mockReturnValue'] & When; + mockRejectedValue: (value: any) => jest.MockInstance['mockReturnValue'] & When; + mockRejectedValueOnce: (value: any) => jest.MockInstance['mockReturnValue'] & When; } export const when: When; diff --git a/types/jest-when/jest-when-tests.ts b/types/jest-when/jest-when-tests.ts index 13da65928d..179ea2fae1 100644 --- a/types/jest-when/jest-when-tests.ts +++ b/types/jest-when/jest-when-tests.ts @@ -43,6 +43,37 @@ describe('mock-when test', () => { expect(fn(5)).toEqual(undefined); }); + it('Supports chained calls:', () => { + const fn = jest.fn(); + when(fn) + .calledWith(1).mockReturnValue('no') + .calledWith(2).mockReturnValue('way?') + .calledWith(3).mockReturnValue('yes') + .calledWith(4).mockReturnValue('way!'); + + expect(fn(1)).toEqual('no'); + expect(fn(2)).toEqual('way?'); + expect(fn(3)).toEqual('yes'); + expect(fn(4)).toEqual('way!'); + expect(fn(5)).toEqual(undefined); + }); + + it('Supports chained calls with defaults:', () => { + const fn = jest.fn(); + when(fn) + .mockReturnValue('nice') + .calledWith(1).mockReturnValue('no') + .calledWith(2).mockReturnValue('way?') + .calledWith(3).mockReturnValue('yes') + .calledWith(4).mockReturnValue('way!'); + + expect(fn(1)).toEqual('no'); + expect(fn(2)).toEqual('way?'); + expect(fn(3)).toEqual('yes'); + expect(fn(4)).toEqual('way!'); + expect(fn(5)).toEqual('nice'); + }); + it('Assert the args:', () => { const fn = jest.fn(); when(fn).expectCalledWith(1).mockReturnValue('x'); diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index d434b5e198..368ed83353 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -39,11 +39,15 @@ interface NodeRequire { /** * Returns the actual module instead of a mock, bypassing all checks on * whether the module should receive a mock implementation or not. + * + * @deprecated Use `jest.requireActual` instead. */ requireActual(moduleName: string): any; /** * Returns a mock module instead of the actual module, bypassing all checks * on whether the module should be required normally or not. + * + * @deprecated Use `jest.requireMock`instead. */ requireMock(moduleName: string): any; } @@ -67,8 +71,8 @@ declare namespace jest { */ function clearAllMocks(): typeof jest; /** - * Clears the mock.calls and mock.instances properties of all mocks. - * Equivalent to calling .mockClear() on every mocked function. + * Resets the state of all mocks. + * Equivalent to calling .mockReset() on every mocked function. */ function resetAllMocks(): typeof jest; /** @@ -127,6 +131,16 @@ declare namespace jest { * Mocks a module with an auto-mocked version when it is being required. */ function mock(moduleName: string, factory?: any, options?: MockOptions): typeof jest; + /** + * Returns the actual module instead of a mock, bypassing all checks on + * whether the module should receive a mock implementation or not. + */ + function requireActual(moduleName: string): any; + /** + * Returns a mock module instead of the actual module, bypassing all checks + * on whether the module should be required normally or not. + */ + function requireMock(moduleName: string): any; /** * Resets the module registry - the cache of all required modules. This is * useful to isolate modules where local state might conflict between tests. @@ -981,7 +995,7 @@ declare function pending(reason?: string): void; /** * Fails a test when called within one. */ -declare function fail(error?: any): void; +declare function fail(error?: any): never; declare namespace jasmine { let DEFAULT_TIMEOUT_INTERVAL: number; function clock(): Clock; diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts index de1ba90456..4164e009e4 100644 --- a/types/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -251,6 +251,12 @@ jest .useFakeTimers() .useRealTimers(); +// https://jestjs.io/docs/en/jest-object#jestrequireactualmodulename +jest.requireActual("./thisReturnsTheActualModule"); + +// https://jestjs.io/docs/en/jest-object#jestrequiremockmodulename +jest.requireMock("./thisAlwaysReturnsTheMock"); + /* Mocks and spies */ const mock1: jest.Mock = jest.fn(); diff --git a/types/jira-client/index.d.ts b/types/jira-client/index.d.ts index e92d2a2f64..59a92a2961 100644 --- a/types/jira-client/index.d.ts +++ b/types/jira-client/index.d.ts @@ -89,7 +89,7 @@ declare class JiraApi { createCustomField(field: JiraApi.FieldObject): Promise; - listFields(): Promise; + listFields(): Promise; createFieldOption(fieldKey: string, option: JiraApi.FieldOptionObject): Promise; diff --git a/types/johnny-five/index.d.ts b/types/johnny-five/index.d.ts index a770cd2126..53716f9b33 100644 --- a/types/johnny-five/index.d.ts +++ b/types/johnny-five/index.d.ts @@ -4,6 +4,7 @@ // Zoltan Ujvary // Simon Colmer // XtrimSystems +// Marcin Obiedziński // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -111,11 +112,10 @@ export declare class Board { io: any; id: string; - repl: any; + repl: Repl; isReady: boolean; pins: Array; port: string; - inject: Repl; on(event: string, cb: () => void): this; on(event: "ready", cb: () => void): this; diff --git a/types/joi/index.d.ts b/types/joi/index.d.ts index 096847a82c..8f5e7b7a2a 100644 --- a/types/joi/index.d.ts +++ b/types/joi/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for joi 14.0 +// Type definitions for joi 14.3 // Project: https://github.com/hapijs/joi // Definitions by: Bart van der Schoor // Laurence Dougal Myers @@ -110,9 +110,10 @@ export interface EmailOptions { export interface HexOptions { /** - * hex decoded representation must be byte aligned + * hex decoded representation must be byte aligned. + * @default false */ - byteAligned: boolean; + byteAligned?: boolean; } export interface IpOptions { @@ -211,6 +212,16 @@ export interface JoiObject { isJoi: boolean; } +export interface ErrorOptions { + /** + * Boolean value indicating whether the error handler should be used for all errors or only for errors occurring + * on this property (`true` value). + * This concept only makes sense for `array` or `object` schemas as other values don't have children. + * @default false + */ + self?: boolean; +} + export interface ValidationError extends Error, JoiObject { details: ValidationErrorItem[]; annotate(): string; @@ -266,6 +277,14 @@ export interface AnySchema extends JoiObject { allow(...values: any[]): this; allow(values: any[]): this; + /** + * By default, some Joi methods to function properly need to rely on the Joi instance they are attached to because + * they use `this` internally. + * So `Joi.string()` works but if you extract the function from it and call `string()` it won't. + * `bind()` creates a new Joi instance where all the functions relying on `this` are bound to the Joi instance. + */ + bind(): this; + /** * Adds the provided values into the allowed whitelist and marks them as the only valid values allowed. */ @@ -412,7 +431,7 @@ export interface AnySchema extends JoiObject { * override, that error will be returned and the override will be ignored (unless the `abortEarly` * option has been set to `false`). */ - error(err: Error | ValidationErrorFunction): this; + error(err: Error | ValidationErrorFunction, options?: ErrorOptions): this; /** * Returns a plain object representing the schema's rules and properties @@ -504,6 +523,11 @@ export interface NumberSchema extends AnySchema { */ integer(): this; + /** + * Allows the number to be outside of JavaScript's safety range (Number.MIN_SAFE_INTEGER & Number.MAX_SAFE_INTEGER). + */ + unsafe(enabled?: boolean): this; + /** * Specifies the maximum number of decimal places where: * @param limit - the maximum number of decimal places allowed. @@ -676,6 +700,12 @@ export interface SymbolSchema extends AnySchema { } export interface ArraySchema extends AnySchema { + /** + * Verifies that an assertion passes for at least one item in the array, where: + * `schema` - the validation rules required to satisfy the assertion. If the `schema` includes references, they are resolved against + * the array item being tested, not the value of the `ref` target. + */ + assertItem(schema: SchemaLike): this; /** * Allow this array to be sparse. * enabled can be used with a falsy value to go back to the default behavior. @@ -792,6 +822,13 @@ export interface ObjectSchema extends AnySchema { or(...peers: string[]): this; or(peers: string[]): this; + /** + * Defines an exclusive relationship between a set of keys where only one is allowed but none are required where: + * `peers` - the exclusive key names that must not appear together but where none are required. + */ + oxor(...peers: string[]): this; + oxor(peers: string[]): this; + /** * Defines an exclusive relationship between a set of keys. one of them is required but not at the same time where: */ diff --git a/types/joi/joi-tests.ts b/types/joi/joi-tests.ts index 716fc70c16..af85cab0ac 100644 --- a/types/joi/joi-tests.ts +++ b/types/joi/joi-tests.ts @@ -19,28 +19,28 @@ declare const expArr: RegExp[]; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -let schema: Joi.Schema = null; +let schema: Joi.Schema = Joi.any(); declare const schemaLike: Joi.SchemaLike; -let anySchema: Joi.AnySchema = null; -let numSchema: Joi.NumberSchema = null; -let strSchema: Joi.StringSchema = null; -let arrSchema: Joi.ArraySchema = null; -let boolSchema: Joi.BooleanSchema = null; -let binSchema: Joi.BinarySchema = null; -let dateSchema: Joi.DateSchema = null; -let funcSchema: Joi.FunctionSchema = null; -let objSchema: Joi.ObjectSchema = null; -let altSchema: Joi.AlternativesSchema = null; +let anySchema: Joi.AnySchema = Joi.any(); +let numSchema: Joi.NumberSchema = Joi.number(); +let strSchema: Joi.StringSchema = Joi.string(); +let arrSchema: Joi.ArraySchema = Joi.array(); +let boolSchema: Joi.BooleanSchema = Joi.boolean(); +let binSchema: Joi.BinarySchema = Joi.binary(); +let dateSchema: Joi.DateSchema = Joi.date(); +let funcSchema: Joi.FunctionSchema = Joi.func(); +let objSchema: Joi.ObjectSchema = Joi.object(); +let altSchema: Joi.AlternativesSchema = Joi.alternatives(); declare const schemaArr: Joi.Schema[]; -let ref: Joi.Reference = null; -let description: Joi.Description = null; +let ref: Joi.Reference = Joi.ref('test'); +let description: Joi.Description = {}; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -let validOpts: Joi.ValidationOptions = null; +let validOpts: Joi.ValidationOptions = {}; validOpts = { abortEarly: bool }; validOpts = { convert: bool }; @@ -72,7 +72,7 @@ validOpts = { // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -let renOpts: Joi.RenameOptions = null; +let renOpts: Joi.RenameOptions = {}; renOpts = { alias: bool }; renOpts = { multiple: bool }; @@ -81,7 +81,7 @@ renOpts = { ignoreUndefined: bool }; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -let emailOpts: Joi.EmailOptions = null; +let emailOpts: Joi.EmailOptions = {}; emailOpts = { errorLevel: num }; emailOpts = { errorLevel: bool }; @@ -91,13 +91,13 @@ emailOpts = { minDomainAtoms: num }; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -let hexOpts: Joi.HexOptions = null; +let hexOpts: Joi.HexOptions = {}; hexOpts = { byteAligned: bool }; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -let ipOpts: Joi.IpOptions = null; +let ipOpts: Joi.IpOptions = {}; ipOpts = { version: str }; ipOpts = { version: strArr }; @@ -105,7 +105,7 @@ ipOpts = { cidr: str }; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -let uriOpts: Joi.UriOptions = null; +let uriOpts: Joi.UriOptions = {}; uriOpts = { scheme: str }; uriOpts = { scheme: exp }; @@ -114,19 +114,21 @@ uriOpts = { scheme: expArr }; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -let base64Opts: Joi.Base64Options = null; +let base64Opts: Joi.Base64Options = {}; base64Opts = { paddingRequired: bool }; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -let dataUriOpts: Joi.DataUriOptions = null; +let dataUriOpts: Joi.DataUriOptions = {}; dataUriOpts = { paddingRequired: bool }; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -let whenOpts: Joi.WhenOptions = null; +let whenOpts: Joi.WhenOptions = { + is: Joi.any(), +}; whenOpts = { is: x }; whenOpts = { is: schema, then: schema }; @@ -135,7 +137,7 @@ whenOpts = { is: schemaLike, then: schemaLike, otherwise: schemaLike }; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -let whenSchemaOpts: Joi.WhenSchemaOptions = null; +let whenSchemaOpts: Joi.WhenSchemaOptions = {}; whenSchemaOpts = { then: schema }; whenSchemaOpts = { otherwise: schema }; @@ -143,14 +145,14 @@ whenSchemaOpts = { then: schemaLike, otherwise: schemaLike }; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -let refOpts: Joi.ReferenceOptions = null; +let refOpts: Joi.ReferenceOptions = {}; refOpts = { separator: str }; refOpts = { contextPrefix: str }; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -let stringRegexOpts: Joi.StringRegexOptions = null; +let stringRegexOpts: Joi.StringRegexOptions = {}; stringRegexOpts = { name: str }; stringRegexOpts = { invert: bool }; @@ -204,7 +206,7 @@ anySchema = objSchema; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -let schemaMap: Joi.SchemaMap = null; +let schemaMap: Joi.SchemaMap = {}; schemaMap = { a: numSchema, @@ -246,6 +248,7 @@ anySchema = Joi.any(); anySchema = anySchema.allow(x); anySchema = anySchema.allow(x, x); anySchema = anySchema.allow([x, x, x]); + anySchema = anySchema.bind(); anySchema = anySchema.valid(x); anySchema = anySchema.valid(x, x); anySchema = anySchema.valid([x, x, x]); @@ -302,12 +305,14 @@ anySchema = Joi.any(); anySchema = anySchema.error(err); anySchema = anySchema.error(validErrFunc); + anySchema = anySchema.error(validErrFunc, { self: true }); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- arrSchema = Joi.array(); +arrSchema = arrSchema.assertItem(Joi.any()); arrSchema = arrSchema.sparse(); arrSchema = arrSchema.sparse(bool); arrSchema = arrSchema.single(); @@ -618,6 +623,7 @@ numSchema = numSchema.greater(ref); numSchema = numSchema.less(num); numSchema = numSchema.less(ref); numSchema = numSchema.integer(); +numSchema = numSchema.unsafe(); numSchema = numSchema.precision(num); numSchema = numSchema.multiple(num); numSchema = numSchema.positive(); @@ -705,6 +711,11 @@ objSchema = objSchema.or(str, str); objSchema = objSchema.or(str, str, str); objSchema = objSchema.or(strArr); +objSchema = objSchema.oxor(str); +objSchema = objSchema.oxor(str, str); +objSchema = objSchema.oxor(str, str, str); +objSchema = objSchema.oxor(strArr); + objSchema = objSchema.xor(str); objSchema = objSchema.xor(str, str); objSchema = objSchema.xor(str, str, str); diff --git a/types/joi/tsconfig.json b/types/joi/tsconfig.json index 57e6c47881..09319363d5 100644 --- a/types/joi/tsconfig.json +++ b/types/joi/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/jpeg-autorotate/index.d.ts b/types/jpeg-autorotate/index.d.ts new file mode 100644 index 0000000000..d0b50c43ec --- /dev/null +++ b/types/jpeg-autorotate/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for jpeg-autorotate 4.0 +// Project: https://github.com/johansatge/jpeg-autorotate#readme +// Definitions by: Slessi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +export enum errors { + read_file = "read_file", + read_exif = "read_exif", + no_orientation = "no_orientation", + unknown_orientation = "unknown_orientation", + correct_orientation = "correct_orientation", + rotate_file = "rotate_file", +} + +export interface CustomError extends Error { + code: errors; +} + +export function rotate( + path_or_buffer: string | Buffer, + options?: { quality?: number }, + module_callback?: ( + error: CustomError | null, + buffer: Buffer | null, + orientation: number | null, + dimensions: { height: number; width: number } | null, + ) => void, +): void; diff --git a/types/jpeg-autorotate/jpeg-autorotate-tests.ts b/types/jpeg-autorotate/jpeg-autorotate-tests.ts new file mode 100644 index 0000000000..cdebb1a022 --- /dev/null +++ b/types/jpeg-autorotate/jpeg-autorotate-tests.ts @@ -0,0 +1,23 @@ +import * as jo from "jpeg-autorotate"; + +jo.rotate("img.jpg"); +jo.rotate(new Buffer("")); +jo.rotate(new Buffer(""), { quality: 50 }); +jo.rotate("img.jpg", { quality: 100 }, (error, buffer, orientation, dimensions) => { + if (error && error.code === jo.errors.correct_orientation) { + console.log("The orientation of this image is already correct!"); + } + + if (orientation) { + console.log("Orientation was: " + orientation); + } + + if (dimensions) { + console.log("Height after rotation: " + dimensions.height); + console.log("Width after rotation: " + dimensions.width); + } + + if (buffer) { + buffer.readInt8(0); + } +}); diff --git a/types/jpeg-autorotate/tsconfig.json b/types/jpeg-autorotate/tsconfig.json new file mode 100644 index 0000000000..da799d04ba --- /dev/null +++ b/types/jpeg-autorotate/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", + "jpeg-autorotate-tests.ts" + ] +} diff --git a/types/jpeg-autorotate/tslint.json b/types/jpeg-autorotate/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jpeg-autorotate/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jpm/jpm-tests.ts b/types/jpm/jpm-tests.ts index 34523f1a14..c6451aea9c 100644 --- a/types/jpm/jpm-tests.ts +++ b/types/jpm/jpm-tests.ts @@ -37,7 +37,7 @@ import * as prefs from "sdk/simple-prefs"; type prefType = {pref1: string}; (prefs.prefs as prefType)["pref1"] = "value"; prefs.on("pref1", () => console.log("pref1 changed")); -prefs.removeListener("pref1", new Function()); +prefs.removeListener("pref1", () => {}); import * as storage from "sdk/simple-storage"; storage.storage.value = 10; diff --git a/types/jquery.bbq/jquery.bbq-tests.ts b/types/jquery.bbq/jquery.bbq-tests.ts index 9762ee44d9..c7696373a4 100644 --- a/types/jquery.bbq/jquery.bbq-tests.ts +++ b/types/jquery.bbq/jquery.bbq-tests.ts @@ -26,9 +26,9 @@ $.param({ a: [2,3,4] }) // "a=2&a=3&a=4" $.param({ a: [2,3,4] }) // "a[]=2&a[]=3&a[]=4" // <=1.3.2: -$.param({ a: { b:1,c:2 }, d: [3,4,{ e:5 }] }) // "a=[object+Object]&d=3&d=4&d=[object+Object]" +$.param({ a: { b:1,c:2 }, d: [3,4,{ e:5 } as any] }) // "a=[object+Object]&d=3&d=4&d=[object+Object]" // >=1.4: -$.param({ a: { b:1,c:2 }, d: [3,4,{ e:5 }] }) // "a[b]=1&a[c]=2&d[]=3&d[]=4&d[2][e]=5" +$.param({ a: { b:1,c:2 }, d: [3,4,{ e:5 } as any] }) // "a[b]=1&a[c]=2&d[]=3&d[]=4&d[2][e]=5" // ************************************************************* // Not sure why this isn't set by default in qunit.js.. @@ -130,7 +130,7 @@ test( 'jQuery.param.sorted', function() { expected: 'a=3&a=2&a=1&b=6&b=5&b=4&x=2&z=1' }, { - obj: {a:[[4,[5,6]],[[7,8],9]]}, + obj: {a:[[4,[5,6] as any] as any,[[7,8] as any,9] as any]}, traditional: false, expected: 'a[0][]=4&a[0][1][]=5&a[0][1][]=6&a[1][0][]=7&a[1][0][]=8&a[1][]=9', expected_old: 'a=4,5,6&a=7,8,9' // obviously not great, but that's the way jQuery used to roll @@ -231,7 +231,7 @@ test( 'jQuery.param.querystring - build URL', function() { equal( current_url, pre + fake_encode( params ) + post, '$.param.querystring( url, Object, 2 )' ); }, - [ { a:'1', c:'2' }, 1 ], + [ { a:'1', c:'2' } as any, 1 ], function(result){ var params = old_jquery @@ -251,7 +251,7 @@ test( 'jQuery.param.querystring - build URL', function() { equal( current_url, pre + fake_encode( params ) + post, '$.param.querystring( url, String )' ); }, - [ 'foo=2&bar=3', 1 ], + [ 'foo=2&bar=3' as any, 1 ], function(result){ var params = old_jquery @@ -261,19 +261,19 @@ test( 'jQuery.param.querystring - build URL', function() { equal( current_url, pre + fake_encode( params ) + post, '$.param.querystring( url, String, 1 )' ); }, - [ 'http://example.com/test.html?/path/to/file.php#the-cow-goes-moo', 2 ], + [ 'http://example.com/test.html?/path/to/file.php#the-cow-goes-moo' as any, 2 ], function(result){ equal( current_url, pre + '?/path/to/file.php' + post, '$.param.querystring( url, String, 2 )' ); }, - [ '?another-example', 2 ], + [ '?another-example' as any, 2 ], function(result){ equal( current_url, pre + '?another-example' + post, '$.param.querystring( url, String, 2 )' ); }, - [ 'i_am_out_of_witty_strings', 2 ], + [ 'i_am_out_of_witty_strings' as any, 2 ], function(result){ equal( current_url, pre + '?i_am_out_of_witty_strings' + post, '$.param.querystring( url, String, 2 )' ); @@ -373,7 +373,7 @@ test( 'jQuery.param.fragment - build URL', function() { equal( current_url, pre + fake_encode( params ), '$.param.fragment( url, Object, 2 )' ); }, - [ { a:'1', c:'2' }, 1 ], + [ { a:'1', c:'2' } as any, 1 ], function(result){ var params = old_jquery @@ -393,7 +393,7 @@ test( 'jQuery.param.fragment - build URL', function() { equal( current_url, pre + fake_encode( params ), '$.param.fragment( url, String )' ); }, - [ 'foo=2&bar=3', 1 ], + [ 'foo=2&bar=3' as any, 1 ], function(result){ var params = old_jquery @@ -403,19 +403,19 @@ test( 'jQuery.param.fragment - build URL', function() { equal( current_url, pre + fake_encode( params ), '$.param.fragment( url, String, 1 )' ); }, - [ 'http://example.com/test.html?the-cow-goes-moo#/path/to/file.php', 2 ], + [ 'http://example.com/test.html?the-cow-goes-moo#/path/to/file.php' as any, 2 ], function(result){ equal( current_url, pre + '#/path/to/file.php', '$.param.fragment( url, String, 2 )' ); }, - [ '#another-example', 2 ], + [ '#another-example' as any, 2 ], function(result){ equal( current_url, pre + '#another-example', '$.param.fragment( url, String, 2 )' ); }, - [ 'i_am_out_of_witty_strings', 2 ], + [ 'i_am_out_of_witty_strings' as any, 2 ], function(result){ equal( current_url, pre + '#i_am_out_of_witty_strings', '$.param.fragment( url, String, 2 )' ); @@ -677,7 +677,7 @@ test( 'jQuery.fn.querystring', function() { equal( current_url, pre + fake_encode( params ) + post, '$.fn.querystring( url, Object, 2 )' ); }, - [ { a:'1', c:'2' }, 1 ], + [ { a:'1', c:'2' } as any, 1 ], function(result){ var params = old_jquery @@ -697,7 +697,7 @@ test( 'jQuery.fn.querystring', function() { equal( current_url, pre + fake_encode( params ) + post, '$.fn.querystring( url, String )' ); }, - [ 'foo=2&bar=3', 1 ], + [ 'foo=2&bar=3' as any, 1 ], function(result){ var params = old_jquery @@ -707,19 +707,19 @@ test( 'jQuery.fn.querystring', function() { equal( current_url, pre + fake_encode( params ) + post, '$.fn.querystring( url, String, 1 )' ); }, - [ 'http://example.com/test.html?/path/to/file.php#the-cow-goes-moo', 2 ], + [ 'http://example.com/test.html?/path/to/file.php#the-cow-goes-moo' as any, 2 ], function(result){ equal( current_url, pre + '?/path/to/file.php' + post, '$.fn.querystring( url, String, 2 )' ); }, - [ '?another-example', 2 ], + [ '?another-example' as any, 2 ], function(result){ equal( current_url, pre + '?another-example' + post, '$.fn.querystring( url, String, 2 )' ); }, - [ 'i_am_out_of_witty_strings', 2 ], + [ 'i_am_out_of_witty_strings' as any, 2 ], function(result){ equal( current_url, pre + '?i_am_out_of_witty_strings' + post, '$.fn.querystring( url, String, 2 )' ); @@ -776,7 +776,7 @@ test( 'jQuery.fn.fragment', function() { equal( current_url, pre + fake_encode( params ), '$.fn.fragment( url, Object, 2 )' ); }, - [ { a:'1', c:'2' }, 1 ], + [ { a:'1', c:'2' } as any, 1 ], function(result){ var params = old_jquery @@ -796,7 +796,7 @@ test( 'jQuery.fn.fragment', function() { equal( current_url, pre + fake_encode( params ), '$.fn.fragment( url, String )' ); }, - [ 'foo=2&bar=3', 1 ], + [ 'foo=2&bar=3' as any, 1 ], function(result){ var params = old_jquery @@ -806,19 +806,19 @@ test( 'jQuery.fn.fragment', function() { equal( current_url, pre + fake_encode( params ), '$.fn.fragment( url, String, 1 )' ); }, - [ 'http://example.com/test.html?the-cow-goes-moo#/path/to/file.php', 2 ], + [ 'http://example.com/test.html?the-cow-goes-moo#/path/to/file.php' as any, 2 ], function(result){ equal( current_url, pre + '#/path/to/file.php', '$.fn.fragment( url, String, 2 )' ); }, - [ '#another-example', 2 ], + [ '#another-example' as any, 2 ], function(result){ equal( current_url, pre + '#another-example', '$.fn.fragment( url, String, 2 )' ); }, - [ 'i_am_out_of_witty_strings', 2 ], + [ 'i_am_out_of_witty_strings' as any, 2 ], function(result){ equal( current_url, pre + '#i_am_out_of_witty_strings', '$.fn.fragment( url, String, 2 )' ); @@ -1138,10 +1138,10 @@ test( 'jQuery.bbq.pushState(), jQuery.bbq.getState(), jQuery.bbq.removeState(), function(result){ var b_str = old_jquery ? '[object Object]' - : {x:['7'], y:'8', z:['9','0','true','false','undefined','']}, + : {x:['7'], y:'8', z:['9','0','true','false','undefined','']} as any, b_coerce = old_jquery ? '[object Object]' - : {x:[7], y:8};//z:[9,0,true,false,undefined,'']}; + : {x:[7], y:8} as any;//z:[9,0,true,false,undefined,'']}; equal( hash_actual, '#!' + hash, 'hash should begin with #!' ); deepEqual( obj.str, { a:['4','5','6'], b:b_str }, '$.bbq.getState()' ); @@ -1156,15 +1156,15 @@ test( 'jQuery.bbq.pushState(), jQuery.bbq.getState(), jQuery.bbq.removeState(), } }, - [ { a:'1', c:'2' }, 1 ], + [ { a:'1', c:'2' } as any, 1 ], function(result){ var b_str = old_jquery ? '[object Object]' - : {x:['7'], y:'8', z:['9','0','true','false','undefined','']}, + : {x:['7'], y:'8', z:['9','0','true','false','undefined','']} as any, b_coerce = old_jquery ? '[object Object]' - : {x:[7], y:8};//, z:[9,0,true,false,undefined,'']}; + : {x:[7], y:8} as any;//, z:[9,0,true,false,undefined,'']}; equal( hash_actual, '#!' + hash, 'hash should begin with #!' ); deepEqual( obj.str, { a:['4','5','6'], b:b_str, c:'2' }, '$.bbq.getState()' ); @@ -1175,7 +1175,7 @@ test( 'jQuery.bbq.pushState(), jQuery.bbq.getState(), jQuery.bbq.removeState(), } }, - [ '#/path/to/file.php', 2 ], + [ '#/path/to/file.php' as any, 2 ], function(result){ equal( hash_actual, '#!' + hash, 'hash should begin with #!' ); @@ -1201,7 +1201,7 @@ test( 'jQuery.bbq.pushState(), jQuery.bbq.getState(), jQuery.bbq.removeState(), }); }, - [ '#omg_ponies', 2 ], + [ '#omg_ponies' as any, 2 ], function(result){ equal( hash, 'omg_ponies', 'event handler 1: $.param.fragment()' ); @@ -1220,7 +1220,7 @@ test( 'jQuery.bbq.pushState(), jQuery.bbq.getState(), jQuery.bbq.removeState(), $(window).unbind( 'hashchange' ); }, - [ '#almost_done?not_search', 2 ], + [ '#almost_done?not_search' as any, 2 ], function(result){ equal( hash, '', 'event handler 1: $.param.fragment()' ); diff --git a/types/jquery.soap/index.d.ts b/types/jquery.soap/index.d.ts index 36674a677b..9a802163e4 100644 --- a/types/jquery.soap/index.d.ts +++ b/types/jquery.soap/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jQuery.SOAP 1.6.7 +// Type definitions for jQuery.SOAP 1.7 // Project: https://github.com/doedje/jquery.soap // Definitions by: Roland Greim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/ @@ -72,6 +72,7 @@ declare namespace JQuerySOAP { SOAPHeader?: Object; statusCode?: Object; success?: (SOAPResponse: SOAPResponse) => void; + timeout?: number; url?: string; wss?: Object; } diff --git a/types/jquery.soap/tslint.json b/types/jquery.soap/tslint.json index a41bf5d19a..a0357daa61 100644 --- a/types/jquery.soap/tslint.json +++ b/types/jquery.soap/tslint.json @@ -7,7 +7,6 @@ "ban-types": false, "callable-types": false, "comment-format": false, - "dt-header": false, "eofline": false, "export-just-namespace": false, "import-spacing": false, diff --git a/types/jquery/JQuery.d.ts b/types/jquery/JQuery.d.ts index 123fad3b34..ed0147a89f 100644 --- a/types/jquery/JQuery.d.ts +++ b/types/jquery/JQuery.d.ts @@ -83,6 +83,7 @@ $( document.body ) * @since 1.4 */ add(selector: JQuery.Selector, context: Element): this; + // TODO: The return type should reflect newly selected types. /** * Create a new jQuery object with elements added to the set of matched elements. * @param selector_elements_html_selection _@param_ `selector_elements_html_selection` @@ -226,7 +227,7 @@ collection.css( "background", "yellow" ); ``` */ - add(selector_elements_html_selection: JQuery.Selector | JQuery.TypeOrArray | JQuery.htmlString | JQuery): this; + add(selector_elements_html_selection: JQuery.Selector | JQuery.TypeOrArray | JQuery.htmlString | JQuery | JQuery.Node): this; /** * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. * @param selector A string containing a selector expression to match the current set of elements against. @@ -2090,7 +2091,7 @@ $( "#frameDemo" ).contents().find( "a" ).css( "background-color", "#BADA55" ); ``` */ - contents(): JQuery; + contents(): JQuery; /** * Bind an event handler to the "contextmenu" JavaScript event, or trigger that event on an element. * @param eventData An object containing data that will be passed to the event handler. @@ -5141,7 +5142,9 @@ $( "div b" ) ``` */ - html(htmlString_function: JQuery.htmlString | ((this: TElement, index: number, oldhtml: JQuery.htmlString) => JQuery.htmlString)): this; + html(htmlString_function: JQuery.htmlString | + JQuery.Node | + ((this: TElement, index: number, oldhtml: JQuery.htmlString) => JQuery.htmlString | JQuery.Node)): this; /** * Get the HTML contents of the first element in the set of matched elements. * @see \`{@link https://api.jquery.com/html/ }\` @@ -7304,10 +7307,12 @@ $( "body" ).on( "click", "p", foo ); $( "body" ).off( "click", "p", foo ); ``` */ - off(events: string, + off( + events: TType, selector: JQuery.Selector, - handler: JQuery.TypeEventHandler | - false): this; + handler: JQuery.TypeEventHandler | + false + ): this; /** * Remove an event handler. * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as @@ -7337,10 +7342,12 @@ $( "form" ).on( "keypress.validator", "input[type='text']", validate ); $( "form" ).off( ".validator" ); ``` */ - off(events: string, + off( + events: TType, selector_handler?: JQuery.Selector | - JQuery.TypeEventHandler | - false): this; + JQuery.TypeEventHandler | + false + ): this; /** * Remove an event handler. * @param events An object where the string keys represent one or more space-separated event types and optional @@ -9986,7 +9993,14 @@ $( "button" ).on( "click", function() { ``` */ - replaceWith(newContent_function: JQuery.htmlString | JQuery | JQuery.TypeOrArray | ((this: TElement) => any)): this; + replaceWith(newContent_function: JQuery.htmlString | + JQuery | + JQuery.TypeOrArray | + JQuery.Node | + ((this: TElement, index: number, oldhtml: JQuery.htmlString) => JQuery.htmlString | + JQuery | + JQuery.TypeOrArray | + JQuery.Node)): this; /** * Bind an event handler to the "resize" JavaScript event, or trigger that event on an element. * @param eventData An object containing data that will be passed to the event handler. @@ -11968,9 +11982,10 @@ $( "p" ).bind( "click", foo ); // ... Now foo will be called when paragraphs are $( "p" ).unbind( "click", foo ); // ... foo will no longer be called. ``` */ - unbind(event: string, - handler: JQuery.TypeEventHandler | - false + unbind( + event: TType, + handler: JQuery.TypeEventHandler | + false ): this; /** * Remove a previously-attached event handler from the elements. @@ -12062,10 +12077,11 @@ $( "body" ).delegate( "p", "click", foo ); $( "body" ).undelegate( "p", "click", foo ); ``` */ - undelegate(selector: JQuery.Selector, - eventType: string, - handler: JQuery.TypeEventHandler | - false + undelegate( + selector: JQuery.Selector, + eventType: TType, + handler: JQuery.TypeEventHandler | + false ): this; /** * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. diff --git a/types/jquery/JQueryStatic.d.ts b/types/jquery/JQueryStatic.d.ts index 20d3a9e8c5..4ba7653e69 100644 --- a/types/jquery/JQueryStatic.d.ts +++ b/types/jquery/JQueryStatic.d.ts @@ -148,21 +148,26 @@ $( "div", xml.responseXML ); $( document.body ).css( "background", "black" ); ``` */ - // Using a unified signature is not possible due to a TypeScript 2.4 bug (DefinitelyTyped#27810) - (element: T): JQuery; + // NOTE: `HTMLSelectElement` is both an Element and an Array-Like Object but jQuery treats it as an Element. + (element: HTMLSelectElement): JQuery; /** * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string. - * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. + * @param element_elementArray _@param_ `element_elementArray` + *
+ * * `element` — A DOM element to wrap in a jQuery object.
+ * * `elementArray` — An array containing a set of DOM elements to wrap in a jQuery object. * @see \`{@link https://api.jquery.com/jQuery/ }\` * @since 1.0 + * @example ​ ````Set the background color of the page to black. +```javascript +$( document.body ).css( "background", "black" ); +``` * @example ​ ````Hide all the input elements within a form. ```javascript $( myForm.elements ).hide(); ``` */ - // Using a unified signature is not possible due to a TypeScript 2.4 bug (DefinitelyTyped#27810) - // tslint:disable-next-line:unified-signatures - (elementArray: T[]): JQuery; + (element_elementArray: T | ArrayLike): JQuery; /** * Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string. * @param selection An existing jQuery object to clone. diff --git a/types/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts index c533f1b235..0acf6e0d24 100644 --- a/types/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -160,6 +160,9 @@ function JQueryStatic() { // $ExpectType JQuery $([new HTMLSelectElement()]); + // $ExpectType JQuery + $(document.querySelectorAll('p')); + // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/19597#issuecomment-378218432 function issue_19597_378218432() { const myDiv = $(document.createElement('div')); @@ -3969,12 +3972,17 @@ function JQuery() { function customData(this: HTMLElement, event: JQuery.TriggeredEvent) { } + function specificEventType(this: HTMLElement, event: JQuery.MouseDownEvent) { } + // $ExpectType JQuery $('table').off('myEvent', 'td', defaultData); // $ExpectType JQuery $('table').off('myEvent', 'td', customData); + // $ExpectType JQuery + $('table').off('mousedown', 'td', specificEventType); + // $ExpectType JQuery $('table').off('myEvent', 'td', false); @@ -3987,6 +3995,9 @@ function JQuery() { // $ExpectType JQuery $('table').off('myEvent', customData); + // $ExpectType JQuery + $('table').off('mousedown', specificEventType); + // $ExpectType JQuery $('table').off('myEvent', false); @@ -4244,6 +4255,19 @@ function JQuery() { event; } }); + + // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31124 + function issue_31124(el: Element, mouseX: number) { + $(el) + .on("mousedown touchstart", (evt) => { + // tslint:disable-next-line:prefer-conditional-expression + if (evt.type === "mousedown") { + mouseX = (evt.originalEvent as MouseEvent).clientX; + } else { + mouseX = (evt.originalEvent as TouchEvent).touches[0].clientX; + } + }); + } } function one() { @@ -4473,12 +4497,17 @@ function JQuery() { function customData(this: HTMLElement, event: JQuery.TriggeredEvent) { } + function specificEventType(this: HTMLElement, event: JQuery.MouseDownEvent) { } + // $ExpectType JQuery $('p').unbind('myEvent', defaultData); // $ExpectType JQuery $('p').unbind('myEvent', customData); + // $ExpectType JQuery + $('p').unbind('mousedown', specificEventType); + // $ExpectType JQuery $('p').unbind('myEvent', false); @@ -4498,12 +4527,17 @@ function JQuery() { function customData(this: HTMLElement, event: JQuery.TriggeredEvent) { } + function specificEventType(this: HTMLElement, event: JQuery.MouseDownEvent) { } + // $ExpectType JQuery $('table').undelegate('td', 'click', defaultData); // $ExpectType JQuery $('table').undelegate('td', 'click', customData); + // $ExpectType JQuery + $('table').undelegate('td', 'mousedown', specificEventType); + // $ExpectType JQuery $('table').undelegate('td', 'click', false); @@ -5531,11 +5565,21 @@ function JQuery() { $('p').replaceWith([new HTMLElement()]); // $ExpectType JQuery - $('p').replaceWith(function() { + $('p').replaceWith(document.createTextNode('bar')); + + // $ExpectType JQuery + $('p').replaceWith(document.createComment('bar')); + + // $ExpectType JQuery + $('p').replaceWith(function(index, oldhtml) { // $ExpectType HTMLElement this; + // $ExpectType number + index; + // $ExpectType string + oldhtml; - return this; + return undefined! as JQuery.htmlString | JQuery | JQuery.TypeOrArray | JQuery.Node; }); } @@ -5659,6 +5703,12 @@ function JQuery() { // $ExpectType JQuery $('p').html(''); + // $ExpectType JQuery + $('p').html(document.createTextNode('bar')); + + // $ExpectType JQuery + $('p').html(document.createComment('bar')); + // $ExpectType JQuery $('p').html(function(index, oldhtml) { // $ExpectType HTMLElement @@ -5668,7 +5718,12 @@ function JQuery() { // $ExpectType string oldhtml; - return oldhtml; + switch (index) { + case 0: return document.createTextNode('bar'); + case 1: return document.createComment('bar'); + + default: return oldhtml; + } }); // $ExpectType string @@ -5771,6 +5826,12 @@ function JQuery() { // $ExpectType JQuery $('p').add($('span')); + + // $ExpectType JQuery + $('p').add(document.createTextNode('bar')); + + // $ExpectType JQuery + $('p').add(document.createComment('bar')); } function closest() { diff --git a/types/jquery/legacy.d.ts b/types/jquery/legacy.d.ts index a3a98b936c..08c8a408f3 100644 --- a/types/jquery/legacy.d.ts +++ b/types/jquery/legacy.d.ts @@ -167,9 +167,12 @@ interface JQueryMouseEventObject extends JQueryInputEventObject { * @deprecated ​ Deprecated. Use \`{@link JQuery.Event }\`. */ interface JQueryKeyEventObject extends JQueryInputEventObject { - char: any; + /** @deprecated */ + char: string; + /** @deprecated */ charCode: number; - key: any; + key: string; + /** @deprecated */ keyCode: number; } /** diff --git a/types/jquery/misc.d.ts b/types/jquery/misc.d.ts index 481b79e037..ebba2f7a31 100644 --- a/types/jquery/misc.d.ts +++ b/types/jquery/misc.d.ts @@ -4710,6 +4710,7 @@ $( "button" ).click(function( event ) { ``` */ namespace?: string; + originalEvent?: _Event; /** * The last value returned by an event handler that was triggered by this event, unless the value was undefined. * @see \`{@link https://api.jquery.com/event.result/ }\` diff --git a/types/jquery/v1/index.d.ts b/types/jquery/v1/index.d.ts index 8cbc9c5789..89fe87bde8 100644 --- a/types/jquery/v1/index.d.ts +++ b/types/jquery/v1/index.d.ts @@ -592,6 +592,7 @@ interface BaseJQueryEventObject extends Event { pageY: number; /** * For key or mouse events, this property indicates the specific key or button that was pressed. + * @deprecated Use `key` for KeyEvents or `button` for MouseEvents instead. * @see {@link https://api.jquery.com/event.which/} */ which: number; @@ -622,9 +623,12 @@ interface JQueryMouseEventObject extends JQueryInputEventObject { } interface JQueryKeyEventObject extends JQueryInputEventObject { - char: any; + /** @deprecated */ + char: string; + /** @deprecated */ charCode: number; - key: any; + key: string; + /** @deprecated */ keyCode: number; } @@ -824,7 +828,7 @@ interface JQueryStatic { * @see {@link https://api.jquery.com/jQuery.ajaxTransport/} */ ajaxTransport(dataType: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; - + ajaxSettings: JQueryAjaxSettings; /** diff --git a/types/jquery/v1/jquery-tests.ts b/types/jquery/v1/jquery-tests.ts index bb13b8c215..2e12aba2d5 100644 --- a/types/jquery/v1/jquery-tests.ts +++ b/types/jquery/v1/jquery-tests.ts @@ -972,8 +972,8 @@ function test_trigger() { .trigger("click", ["foo", "bar"]); var event = jQuery.Event("logged"); - (event).user = "foo"; - (event).pass = "bar"; + (event as any).user = "foo"; + (event as any).pass = "bar"; $("body").trigger(event); // Adapted from jQuery documentation which may be wrong on this occasion @@ -1594,7 +1594,7 @@ function test_eventParams() { $('#log').html(e.type + ': ' + e.which); }); $(window).on('mousewheel', (e) => { - var delta = (e.originalEvent).deltaY; + var delta = (e.originalEvent as WheelEvent).deltaY; }); $( "p" ).click(function( event ) { alert( event.currentTarget === this ); // true diff --git a/types/jquery/v2/index.d.ts b/types/jquery/v2/index.d.ts index 1b1d9cf75f..068bbfc991 100644 --- a/types/jquery/v2/index.d.ts +++ b/types/jquery/v2/index.d.ts @@ -592,6 +592,7 @@ interface BaseJQueryEventObject extends Event { pageY: number; /** * For key or mouse events, this property indicates the specific key or button that was pressed. + * @deprecated Use `key` for KeyEvents or `button` for MouseEvents instead. * @see {@link https://api.jquery.com/event.which/} */ which: number; @@ -602,6 +603,14 @@ interface BaseJQueryEventObject extends Event { metaKey: boolean; } +interface JQueryCustomEventObject extends BaseJQueryEventObject { + /** + * @see {@link https://api.jquery.com/category/events/event-object/} + * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent} + */ + detail?: any; +} + interface JQueryInputEventObject extends BaseJQueryEventObject { altKey: boolean; ctrlKey: boolean; @@ -622,13 +631,16 @@ interface JQueryMouseEventObject extends JQueryInputEventObject { } interface JQueryKeyEventObject extends JQueryInputEventObject { - char: any; + /** @deprecated */ + char: string; + /** @deprecated */ charCode: number; - key: any; + key: string; + /** @deprecated */ keyCode: number; } -interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{ +interface JQueryEventObject extends BaseJQueryEventObject, JQueryCustomEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { } /** diff --git a/types/jquery/v2/jquery-tests.ts b/types/jquery/v2/jquery-tests.ts index 01a06c62a8..0429ec4c68 100644 --- a/types/jquery/v2/jquery-tests.ts +++ b/types/jquery/v2/jquery-tests.ts @@ -972,8 +972,8 @@ function test_trigger() { .trigger("click", ["foo", "bar"]); var event = jQuery.Event("logged"); - (event).user = "foo"; - (event).pass = "bar"; + (event as any).user = "foo"; + (event as any).pass = "bar"; $("body").trigger(event); // Adapted from jQuery documentation which may be wrong on this occasion @@ -1594,7 +1594,7 @@ function test_eventParams() { $('#log').html(e.type + ': ' + e.which); }); $(window).on('mousewheel', (e) => { - var delta = (e.originalEvent).deltaY; + var delta = (e.originalEvent as WheelEvent).deltaY; }); $( "p" ).click(function( event ) { alert( event.currentTarget === this ); // true diff --git a/types/jqueryui/index.d.ts b/types/jqueryui/index.d.ts index cc164360c0..c9764b8f6b 100644 --- a/types/jqueryui/index.d.ts +++ b/types/jqueryui/index.d.ts @@ -1056,6 +1056,7 @@ declare namespace JQueryUI { keyCode: KeyCode; menu: Menu; progressbar: Progressbar; + selectmenu: SelectMenu; slider: Slider; spinner: Spinner; tabs: Tabs; diff --git a/types/jqueryui/jqueryui-tests.ts b/types/jqueryui/jqueryui-tests.ts index 32712b8085..fa0f7b63a9 100644 --- a/types/jqueryui/jqueryui-tests.ts +++ b/types/jqueryui/jqueryui-tests.ts @@ -1862,6 +1862,7 @@ function test_ui() { $("aDialog").keypress(function (e) { return (e.keyCode == $.ui.keyCode.ENTER); }); + $(".selector").jQuery.ui.selectmenu({ disabled: true }); } function test_widget() { diff --git a/types/js-combinatorics/index.d.ts b/types/js-combinatorics/index.d.ts index 6a5fa8e249..8023aeff73 100644 --- a/types/js-combinatorics/index.d.ts +++ b/types/js-combinatorics/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for js-combinatorics v0.5.0 +// Type definitions for js-combinatorics v0.5.4 // Project: https://github.com/dankogai/js-combinatorics // Definitions by: Vasya Aksyonov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,7 +8,7 @@ declare namespace __Combinatorics { interface IGenerator { /** - * Returns the element or undefined if no more element is available. + * Returns the element or undefined if no more elements are available. */ next():T; @@ -18,24 +18,24 @@ declare namespace __Combinatorics { forEach(f:(item:T) => void):void; /** - * All elements at once with function applied to each element. + * Returns an array that is the output of calling the callback function separately on each element. */ map(f:(item:T) => TResult):TResult[]; /** - * Returns an array with elements that passes the filter function. + * Returns an array of elements that return `true` for the filter function. */ filter(predicate:(item:T) => boolean):T[]; /** - * All elements at once. + * Returns an array of all elements. */ toArray():T[]; /** - * Returns the number of elements to be generated which equals to generator.toArray().length - * but it is precalculated without actually generating elements. - * Handy when you prepare for large iteration. + * Returns the total number of elements to be generated. This equals the result of calling + * `generator.toArray().length` but it is precalculated without actually generating any elements. + * Handy when doing setup for a potentially long-running loop. */ length:number; @@ -44,7 +44,7 @@ declare namespace __Combinatorics { interface IPredictableGenerator extends IGenerator { /** - * Returns the nth element (starting 0). + * Returns the nth element (indexed from 0). */ nth(n:number):T; @@ -53,11 +53,10 @@ declare namespace __Combinatorics { interface ICartesianProductGenerator extends IPredictableGenerator { /** - * Arguments are coordinates in integer. - * Arguments can be out of bounds but it returns undefined in such cases. + * Arguments are integer coordinates. + * Arguments can be out of bounds but it returns `undefined` in such cases. */ get(...coordinates:number[]):T; - } /** @@ -76,38 +75,47 @@ declare namespace __Combinatorics { function factorial(n:number):number; /** - * Returns the factoradic representation of n in array, in least significant order. + * Returns the factoradic representation of `n` in an array, in + * least significant order. * See http://en.wikipedia.org/wiki/Factorial_number_system */ function factoradic(n:number):number[]; /** - * Generates the power set of array. + * Generates the power set of `a`. */ function power(a:T[]):IPredictableGenerator; /** - * Generates the combination of array with n elements. - * When n is ommited, the length of the array is used. + * Generates the combination of `a` with `n` elements. + * `n` defaults to the length of `a`. */ function combination(a:T[], n?:number):IGenerator; /** - * Generates the permutation of array with n elements. - * When n is ommited, the length of the array is used. + * Generates the combination of `a` with `n` elements, which + * also supports larger sets of elements. + * When `n` is ommited, the length of the array is used. + * Somewhat slower than `combination()` + */ + function bigCombination(a:T[], n?:number):IGenerator; + + /** + * Generates the permutation of `a` with `n` elements. + * `n` defaults to the length of `a`. */ function permutation(a:T[], n?:number):IGenerator; /** - * Generates the permutation of the combination of n. - * Equivalent to permutation(combination(a)), but more efficient. + * Generates the permutation of the combination of `a`. + * Equivalent to `permutation(combination(a))`, but more efficient. */ function permutationCombination(a:T[]):IGenerator; /** - * Generates n-digit "numbers" where each digit is an element in array. + * Generates `n`-digit "numbers" where each digit is an element in array. * Note this "number" is in the least significant order. - * When n is ommited, the length of the array is used. + * `n` defaults to the length of `a`. */ function baseN(a:T[], n?:number):IPredictableGenerator; diff --git a/types/js-combinatorics/js-combinatorics-tests.ts b/types/js-combinatorics/js-combinatorics-tests.ts index 68714ca17a..4162515bc2 100644 --- a/types/js-combinatorics/js-combinatorics-tests.ts +++ b/types/js-combinatorics/js-combinatorics-tests.ts @@ -25,6 +25,15 @@ const filteredCombinations:string[][] = combination.filter((i:string[]) => i.len const allCombinations:string[][] = combination.toArray(); const combinationsCount = combination.length; +const limitedBigCombination = Combinatorics.bigCombination(["a", "b", "c"], 2); +const bigCombination = Combinatorics.bigCombination(["a", "b", "c"]); +const nextBigCombination:string[] = bigCombination.next(); +bigCombination.forEach((i:string[]) => console.log(i)); +const bigCombinationsLengths:number[] = bigCombination.map((i:string[]) => i.length); +const filteredBigCombinations:string[][] = bigCombination.filter((i:string[]) => i.length > 0); +const allBigCombinations:string[][] = bigCombination.toArray(); +const bigCombinationsCount = bigCombination.length; + const limitedPermutation = Combinatorics.permutation(["a", "b", "c"], 2); const permutation = Combinatorics.permutation(["a", "b", "c"]); const nextPermutation:string[] = permutation.next(); diff --git a/types/js-levenshtein/index.d.ts b/types/js-levenshtein/index.d.ts new file mode 100644 index 0000000000..5b29d11026 --- /dev/null +++ b/types/js-levenshtein/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for js-levenshtein 1.1 +// Project: https://github.com/gustf/js-levenshtein +// Definitions by: Kallu609 +// Pyry Rouvila +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Calculates Levenshtein distance between two strings + */ +declare function levenshtein(compareFrom: string, compareTo: string): number; + +export = levenshtein; diff --git a/types/js-levenshtein/js-levenshtein-tests.ts b/types/js-levenshtein/js-levenshtein-tests.ts new file mode 100644 index 0000000000..539473ccf4 --- /dev/null +++ b/types/js-levenshtein/js-levenshtein-tests.ts @@ -0,0 +1,3 @@ +import levenshtein = require('js-levenshtein'); + +levenshtein('kittens', 'mittens'); // $ExpectType number diff --git a/types/js-levenshtein/tsconfig.json b/types/js-levenshtein/tsconfig.json new file mode 100644 index 0000000000..6df128481b --- /dev/null +++ b/types/js-levenshtein/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "js-levenshtein-tests.ts"] +} diff --git a/types/js-levenshtein/tslint.json b/types/js-levenshtein/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/js-levenshtein/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/js-types/index.d.ts b/types/js-types/index.d.ts new file mode 100644 index 0000000000..756680fd04 --- /dev/null +++ b/types/js-types/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for js-types 2.0 +// Project: https://github.com/sindresorhus/js-types#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = jsTypes; + +declare const jsTypes: string[]; diff --git a/types/js-types/js-types-tests.ts b/types/js-types/js-types-tests.ts new file mode 100644 index 0000000000..b7e5a4fe8b --- /dev/null +++ b/types/js-types/js-types-tests.ts @@ -0,0 +1,5 @@ +import jsTypes = require('js-types'); +import jsTypesJson = require('js-types/js-types.json'); + +jsTypes; // $ExpectType string[] +jsTypesJson; // $ExpectType string[] diff --git a/types/js-types/js-types.json.d.ts b/types/js-types/js-types.json.d.ts new file mode 100644 index 0000000000..83565f43d1 --- /dev/null +++ b/types/js-types/js-types.json.d.ts @@ -0,0 +1,3 @@ +export = jsTypes; + +declare const jsTypes: string[]; diff --git a/types/js-types/tsconfig.json b/types/js-types/tsconfig.json new file mode 100644 index 0000000000..1b81a82e27 --- /dev/null +++ b/types/js-types/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "js-types.json.d.ts", + "js-types-tests.ts" + ] +} diff --git a/types/js-types/tslint.json b/types/js-types/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/js-types/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/js-yaml/index.d.ts b/types/js-yaml/index.d.ts index 1dfa56c5a5..b59741e74e 100644 --- a/types/js-yaml/index.d.ts +++ b/types/js-yaml/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for js-yaml 3.11 +// Type definitions for js-yaml 3.12 // Project: https://github.com/nodeca/js-yaml // Definitions by: Bart van der Schoor , Sebastian Clausen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -39,37 +39,41 @@ export function safeDump(obj: any, opts?: DumpOptions): string; export function dump(obj: any, opts?: DumpOptions): string; export interface LoadOptions { - // string to be used as a file path in error/warning messages. + /** string to be used as a file path in error/warning messages. */ filename?: string; - // makes the loader to throw errors instead of warnings. - strict?: boolean; - // specifies a schema to use. - schema?: any; - // compatibility with JSON.parse behaviour. + /** function to call on warning messages. */ + onWarning?(this: null, e: YAMLException): void; + /** specifies a schema to use. */ + schema?: SchemaDefinition; + /** compatibility with JSON.parse behaviour. */ json?: boolean; } export interface DumpOptions { - // indentation width to use (in spaces). + /** indentation width to use (in spaces). */ indent?: number; - // do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types. + /** when true, will not add an indentation level to array elements */ + noArrayIndent?: boolean; + /** do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types. */ skipInvalid?: boolean; - // specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere + /** specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere */ flowLevel?: number; - // Each tag may have own set of styles. - "tag" => "style" map. + /** Each tag may have own set of styles. - "tag" => "style" map. */ styles?: { [x: string]: any; }; - // specifies a schema to use. - schema?: any; - // if true, sort keys when dumping YAML. If a function, use the function to sort the keys. (default: false) + /** specifies a schema to use. */ + schema?: SchemaDefinition; + /** if true, sort keys when dumping YAML. If a function, use the function to sort the keys. (default: false) */ sortKeys?: boolean | ((a: any, b: any) => number); - // set max line width. (default: 80) + /** set max line width. (default: 80) */ lineWidth?: number; - // if true, don't convert duplicate objects into references (default: false) + /** if true, don't convert duplicate objects into references (default: false) */ noRefs?: boolean; - // if true don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 (default: false) + /** if true don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 (default: false) */ noCompatMode?: boolean; - // if true flow sequences will be condensed, omitting the space between `key: value` or `a, b`. Eg. `'[a,b]'` or `{a:{b:c}}`. - // Can be useful when using yaml for pretty URL query params as spaces are %-encoded. (default: false) + /** + * if true flow sequences will be condensed, omitting the space between `key: value` or `a, b`. Eg. `'[a,b]'` or `{a:{b:c}}`. + * Can be useful when using yaml for pretty URL query params as spaces are %-encoded. (default: false). + */ condenseFlow?: boolean; } @@ -90,15 +94,15 @@ export interface SchemaDefinition { include?: Schema[]; } -// only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 +/** only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 */ export let FAILSAFE_SCHEMA: Schema; -// only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 +/** only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 */ export let JSON_SCHEMA: Schema; -// same as JSON_SCHEMA: http://www.yaml.org/spec/1.2/spec.html#id2804923 +/** same as JSON_SCHEMA: http://www.yaml.org/spec/1.2/spec.html#id2804923 */ export let CORE_SCHEMA: Schema; -// all supported YAML types, without unsafe ones (!!js/undefined, !!js/regexp and !!js/function): http://yaml.org/type/ +/** all supported YAML types, without unsafe ones (!!js/undefined, !!js/regexp and !!js/function): http://yaml.org/type/ */ export let DEFAULT_SAFE_SCHEMA: Schema; -// all supported YAML types. +/** all supported YAML types. */ export let DEFAULT_FULL_SCHEMA: Schema; export let MINIMAL_SCHEMA: Schema; export let SAFE_SCHEMA: Schema; diff --git a/types/js-yaml/js-yaml-tests.ts b/types/js-yaml/js-yaml-tests.ts index 2d67b99192..304da7731d 100644 --- a/types/js-yaml/js-yaml-tests.ts +++ b/types/js-yaml/js-yaml-tests.ts @@ -58,20 +58,23 @@ loadOpts = { filename: str }; loadOpts = { - strict: bool -}; -loadOpts = { - schema: bool + onWarning(e) { e.stack; } }; loadOpts = { json: bool }; +loadOpts = { + schema: yaml.DEFAULT_SAFE_SCHEMA +}; // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- dumpOpts = { indent: num }; +dumpOpts = { + noArrayIndent: bool +}; dumpOpts = { skipInvalid: bool }; @@ -84,6 +87,9 @@ dumpOpts = { dumpOpts = { schema: value }; +dumpOpts = { + schema: yaml.DEFAULT_FULL_SCHEMA +}; // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/types/jsdom/jsdom-tests.ts b/types/jsdom/jsdom-tests.ts index 1420723b8d..0b8be95052 100644 --- a/types/jsdom/jsdom-tests.ts +++ b/types/jsdom/jsdom-tests.ts @@ -1,4 +1,4 @@ -import { JSDOM, VirtualConsole, CookieJar, FromUrlOptions, FromFileOptions, DOMWindow, ResourceLoader, FetchOptions } from 'jsdom'; +import { JSDOM, VirtualConsole, CookieJar, FromUrlOptions, FromFileOptions, DOMWindow, ResourceLoader, FetchOptions, ConstructorOptions } from 'jsdom'; import { CookieJar as ToughCookieJar, MemoryCookieStore } from 'tough-cookie'; import { Script } from 'vm'; @@ -56,8 +56,9 @@ function test_cookieJar() { const store = {} as MemoryCookieStore; const options = {} as ToughCookieJar.Options; - const cookieJar = new CookieJar(store, options); - const dom = new JSDOM(``, { cookieJar }); + const cookieJar: CookieJar = new CookieJar(store, options); + const constructorOptions: ConstructorOptions = { cookieJar }; + const dom = new JSDOM(``, constructorOptions); } function test_beforeParse() { diff --git a/types/jsdom/package.json b/types/jsdom/package.json index ef0b8c56fc..51569954af 100644 --- a/types/jsdom/package.json +++ b/types/jsdom/package.json @@ -2,5 +2,13 @@ "private": true, "dependencies": { "parse5": "^4.0.0" + }, + "types": "index", + "typesVersions": { + ">=3.1.0-0": { + "*": [ + "ts3.1/*" + ] + } } } diff --git a/types/jsdom/ts3.1/index.d.ts b/types/jsdom/ts3.1/index.d.ts new file mode 100644 index 0000000000..e00b4a0d5f --- /dev/null +++ b/types/jsdom/ts3.1/index.d.ts @@ -0,0 +1,320 @@ +/// +/// + +import { EventEmitter } from "events"; +import { MarkupData } from "parse5"; +import * as tough from "tough-cookie"; +import { Script } from "vm"; + +export class JSDOM { + static fromURL(url: string, options?: FromUrlOptions): Promise; + + static fromFile(url: string, options?: FromFileOptions): Promise; + + static fragment(html: string): DocumentFragment; + + constructor( + html?: string | Buffer | BinaryData, + options?: ConstructorOptions + ); + + readonly window: DOMWindow; + readonly virtualConsole: VirtualConsole; + readonly cookieJar: CookieJar; + + /** + * The serialize() method will return the HTML serialization of the document, including the doctype. + */ + serialize(): string; + + /** + * The nodeLocation() method will find where a DOM node is within the source document, returning the parse5 location info for the node. + */ + nodeLocation(node: Node): MarkupData.ElementLocation | null; + + /** + * The built-in vm module of Node.js allows you to create Script instances, + * which can be compiled ahead of time and then run multiple times on a given "VM context". + * Behind the scenes, a jsdom Window is indeed a VM context. + * To get access to this ability, use the runVMScript() method. + */ + runVMScript(script: Script): void; + + reconfigure(settings: ReconfigureSettings): void; +} + +export interface Options { + /** + * referrer just affects the value read from document.referrer. + * It defaults to no referrer (which reflects as the empty string). + */ + referrer?: string; + /** + * userAgent affects the value read from navigator.userAgent, as well as the User-Agent header sent while fetching subresources. + * It defaults to `Mozilla/5.0 (${process.platform}) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/${jsdomVersion}`. + */ + userAgent?: string; + /** + * includeNodeLocations preserves the location info produced by the HTML parser, + * allowing you to retrieve it with the nodeLocation() method (described below). + * It defaults to false to give the best performance, + * and cannot be used with an XML content type since our XML parser does not support location info. + */ + includeNodeLocations?: boolean; + runScripts?: "dangerously" | "outside-only"; + resources?: "usable" | ResourceLoader; + virtualConsole?: VirtualConsole; + cookieJar?: CookieJar; + beforeParse?(window: DOMWindow): void; +} + +export type FromUrlOptions = Options; + +export type FromFileOptions = Options & { + /** + * url sets the value returned by window.location, document.URL, and document.documentURI, + * and affects things like resolution of relative URLs within the document + * and the same-origin restrictions and referrer used while fetching subresources. + * It will default to a file URL corresponding to the given filename, instead of to "about:blank". + */ + url?: string; + /** + * contentType affects the value read from document.contentType, and how the document is parsed: as HTML or as XML. + * Values that are not "text/html" or an XML mime type will throw. It will default to "application/xhtml+xml" if + * the given filename ends in .xhtml or .xml; otherwise it will continue to default to "text/html". + */ + contentType?: string; +}; + +export type ConstructorOptions = Options & { + /** + * url sets the value returned by window.location, document.URL, and document.documentURI, + * and affects things like resolution of relative URLs within the document + * and the same-origin restrictions and referrer used while fetching subresources. + * It defaults to "about:blank". + */ + url?: string; + /** + * contentType affects the value read from document.contentType, and how the document is parsed: as HTML or as XML. + * Values that are not "text/html" or an XML mime type will throw. It defaults to "text/html". + */ + contentType?: string; + /** + * jsdom does not have the capability to render visual content, and will act like a headless browser by default. + * It provides hints to web pages through APIs such as document.hidden that their content is not visible. + * + * When the pretendToBeVisual option is set to true, jsdom will pretend that it is rendering and displaying + * content. + */ + pretendToBeVisual?: boolean; + /** + * The maximum size in code units for the separate storage areas used by localStorage and sessionStorage. + * Attempts to store data larger than this limit will cause a DOMException to be thrown. By default, it is set + * to 5,000,000 code units per origin, as inspired by the HTML specification. + */ + storageQuota?: number; +}; + +export interface DOMWindow extends Window { + eval(script: string): void; + + /* node_modules/jsdom/living/index.js */ + DOMException: typeof DOMException; + Attr: typeof Attr; + Node: typeof Node; + Element: typeof Element; + DocumentFragment: typeof DocumentFragment; + Document: typeof Document; + HTMLDocument: typeof HTMLDocument; + XMLDocument: typeof XMLDocument; + CharacterData: typeof CharacterData; + Text: typeof Text; + CDATASection: typeof CDATASection; + ProcessingInstruction: typeof ProcessingInstruction; + Comment: typeof Comment; + DocumentType: typeof DocumentType; + DOMImplementation: typeof DOMImplementation; + NodeList: typeof NodeList; + HTMLCollection: typeof HTMLCollection; + HTMLOptionsCollection: typeof HTMLOptionsCollection; + DOMStringMap: typeof DOMStringMap; + DOMTokenList: typeof DOMTokenList; + Event: typeof Event; + CustomEvent: typeof CustomEvent; + MessageEvent: typeof MessageEvent; + ErrorEvent: typeof ErrorEvent; + HashChangeEvent: typeof HashChangeEvent; + FocusEvent: typeof FocusEvent; + PopStateEvent: typeof PopStateEvent; + UIEvent: typeof UIEvent; + MouseEvent: typeof MouseEvent; + KeyboardEvent: typeof KeyboardEvent; + TouchEvent: typeof TouchEvent; + ProgressEvent: typeof ProgressEvent; + CompositionEvent: typeof CompositionEvent; + WheelEvent: typeof WheelEvent; + EventTarget: typeof EventTarget; + Location: typeof Location; + History: typeof History; + Blob: typeof Blob; + File: typeof File; + FileList: typeof FileList; + DOMParser: typeof DOMParser; + FormData: typeof FormData; + XMLHttpRequestEventTarget: XMLHttpRequestEventTarget; + XMLHttpRequestUpload: typeof XMLHttpRequestUpload; + NodeIterator: typeof NodeIterator; + TreeWalker: typeof TreeWalker; + NamedNodeMap: typeof NamedNodeMap; + URL: typeof URL; + URLSearchParams: typeof URLSearchParams; + + /* node_modules/jsdom/living/register-elements.js */ + HTMLElement: typeof HTMLElement; + HTMLAnchorElement: typeof HTMLAnchorElement; + HTMLAppletElement: typeof HTMLAppletElement; + HTMLAreaElement: typeof HTMLAreaElement; + HTMLAudioElement: typeof HTMLAudioElement; + HTMLBaseElement: typeof HTMLBaseElement; + HTMLBodyElement: typeof HTMLBodyElement; + HTMLBRElement: typeof HTMLBRElement; + HTMLButtonElement: typeof HTMLButtonElement; + HTMLCanvasElement: typeof HTMLCanvasElement; + HTMLDataElement: typeof HTMLDataElement; + HTMLDataListElement: typeof HTMLDataListElement; + // HTMLDetailsElement: typeof HTMLDetailsElement; + // HTMLDialogElement: typeof HTMLDialogElement; + HTMLDirectoryElement: typeof HTMLDirectoryElement; + HTMLDivElement: typeof HTMLDivElement; + HTMLDListElement: typeof HTMLDListElement; + HTMLEmbedElement: typeof HTMLEmbedElement; + HTMLFieldSetElement: typeof HTMLFieldSetElement; + HTMLFontElement: typeof HTMLFontElement; + HTMLFormElement: typeof HTMLFormElement; + HTMLFrameElement: typeof HTMLFrameElement; + HTMLFrameSetElement: typeof HTMLFrameSetElement; + HTMLHeadingElement: typeof HTMLHeadingElement; + HTMLHeadElement: typeof HTMLHeadElement; + HTMLHRElement: typeof HTMLHRElement; + HTMLHtmlElement: typeof HTMLHtmlElement; + HTMLIFrameElement: typeof HTMLIFrameElement; + HTMLImageElement: typeof HTMLImageElement; + HTMLInputElement: typeof HTMLInputElement; + HTMLLabelElement: typeof HTMLLabelElement; + HTMLLegendElement: typeof HTMLLegendElement; + HTMLLIElement: typeof HTMLLIElement; + HTMLLinkElement: typeof HTMLLinkElement; + HTMLMapElement: typeof HTMLMapElement; + HTMLMarqueeElement: typeof HTMLMarqueeElement; + HTMLMediaElement: typeof HTMLMediaElement; + HTMLMenuElement: typeof HTMLMenuElement; + HTMLMetaElement: typeof HTMLMetaElement; + HTMLMeterElement: typeof HTMLMeterElement; + HTMLModElement: typeof HTMLModElement; + HTMLObjectElement: typeof HTMLObjectElement; + HTMLOListElement: typeof HTMLOListElement; + HTMLOptGroupElement: typeof HTMLOptGroupElement; + HTMLOptionElement: typeof HTMLOptionElement; + HTMLOutputElement: typeof HTMLOutputElement; + HTMLParagraphElement: typeof HTMLParagraphElement; + HTMLParamElement: typeof HTMLParamElement; + HTMLPictureElement: typeof HTMLPictureElement; + HTMLPreElement: typeof HTMLPreElement; + HTMLProgressElement: typeof HTMLProgressElement; + HTMLQuoteElement: typeof HTMLQuoteElement; + HTMLScriptElement: typeof HTMLScriptElement; + HTMLSelectElement: typeof HTMLSelectElement; + HTMLSourceElement: typeof HTMLSourceElement; + HTMLSpanElement: typeof HTMLSpanElement; + HTMLStyleElement: typeof HTMLStyleElement; + HTMLTableCaptionElement: typeof HTMLTableCaptionElement; + HTMLTableCellElement: typeof HTMLTableCellElement; + HTMLTableColElement: typeof HTMLTableColElement; + HTMLTableElement: typeof HTMLTableElement; + HTMLTimeElement: typeof HTMLTimeElement; + HTMLTitleElement: typeof HTMLTitleElement; + HTMLTableRowElement: typeof HTMLTableRowElement; + HTMLTableSectionElement: typeof HTMLTableSectionElement; + HTMLTemplateElement: typeof HTMLTemplateElement; + HTMLTextAreaElement: typeof HTMLTextAreaElement; + HTMLTrackElement: typeof HTMLTrackElement; + HTMLUListElement: typeof HTMLUListElement; + HTMLUnknownElement: typeof HTMLUnknownElement; + HTMLVideoElement: typeof HTMLVideoElement; + + /* node_modules/jsdom/level2/style.js */ + StyleSheet: typeof StyleSheet; + MediaList: typeof MediaList; + CSSStyleSheet: typeof CSSStyleSheet; + CSSRule: typeof CSSRule; + CSSStyleRule: typeof CSSStyleRule; + CSSMediaRule: typeof CSSMediaRule; + CSSImportRule: typeof CSSImportRule; + CSSStyleDeclaration: typeof CSSStyleDeclaration; + StyleSheetList: typeof StyleSheetList; + + /* node_modules/jsdom/level3/xpath.js */ + // XPathException: typeof XPathException; + XPathExpression: typeof XPathExpression; + XPathResult: typeof XPathResult; + XPathEvaluator: typeof XPathEvaluator; + + /* node_modules/jsdom/living/node-filter.js */ + NodeFilter: typeof NodeFilter; +} + +export type BinaryData = + | ArrayBuffer + | DataView + | Int8Array + | Uint8Array + | Uint8ClampedArray + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | Float32Array + | Float64Array; + +export class VirtualConsole extends EventEmitter { + on(method: K, callback: Console[K]): this; + on(event: "jsdomError", callback: (e: Error) => void): this; + + sendTo(console: Console, options?: VirtualConsoleSendToOptions): this; +} + +export interface VirtualConsoleSendToOptions { + omitJSDOMErrors: boolean; +} + +export class CookieJar extends tough.CookieJar {} + +export const toughCookie: typeof tough; + +export interface ReconfigureSettings { + windowTop?: DOMWindow; + url?: string; +} + +export interface FetchOptions { + cookieJar?: CookieJar; + referrer?: string; + accept?: string; + element?: + | HTMLScriptElement + | HTMLLinkElement + | HTMLIFrameElement + | HTMLImageElement; +} + +export interface ResourceLoaderConstructorOptions { + strictSSL?: boolean; + proxy?: string; + userAgent?: string; +} + +export class ResourceLoader { + fetch(url: string, options: FetchOptions): Promise | null; + + constructor(obj?: ResourceLoaderConstructorOptions); +} diff --git a/types/jsdom/ts3.1/jsdom-tests.ts b/types/jsdom/ts3.1/jsdom-tests.ts new file mode 100644 index 0000000000..d20232e36f --- /dev/null +++ b/types/jsdom/ts3.1/jsdom-tests.ts @@ -0,0 +1,184 @@ +import { JSDOM, VirtualConsole, CookieJar, FromUrlOptions, FromFileOptions, DOMWindow, ResourceLoader, FetchOptions } from 'jsdom'; +import { CookieJar as ToughCookieJar, MemoryCookieStore } from 'tough-cookie'; +import { Script } from 'vm'; + +function test_basic_usage() { + const dom = new JSDOM(`

Hello world

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

Hello, world!

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

Hello

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

Hello + +

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

Hello

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

Hello

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

Hello

" + } + } +} + +function test_custom_resource_loader() { + class CustomResourceLoader extends ResourceLoader { + fetch(url: string, options: FetchOptions) { + if (options.element) { + console.log(`Element ${options.element.localName} is requesting the url ${url}`); + } + + return super.fetch(url, options); + } + } + new JSDOM('', { resources: new CustomResourceLoader() }); +} diff --git a/types/jsdom/ts3.1/tsconfig.json b/types/jsdom/ts3.1/tsconfig.json new file mode 100644 index 0000000000..d3e0cbd06f --- /dev/null +++ b/types/jsdom/ts3.1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": ["../../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "parse5": ["parse5/v4"] + } + }, + "files": ["index.d.ts", "jsdom-tests.ts"] +} diff --git a/types/jsdom/ts3.1/tslint.json b/types/jsdom/ts3.1/tslint.json new file mode 100644 index 0000000000..523ff9bf74 --- /dev/null +++ b/types/jsdom/ts3.1/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // TODOs + "no-empty-interface": false, + "no-object-literal-type-assertion": false + } +} diff --git a/types/jsforce/describe-result.d.ts b/types/jsforce/describe-result.d.ts index f59df9ff59..80a1de7339 100644 --- a/types/jsforce/describe-result.d.ts +++ b/types/jsforce/describe-result.d.ts @@ -10,7 +10,7 @@ export interface DescribeSObjectResult { createable: boolean; custom: boolean; customSetting: boolean; - deleteable: boolean; + deletable: boolean; deprecatedAndHidden: boolean; feedEnabled: boolean; fields: Field[]; @@ -33,7 +33,7 @@ export interface DescribeSObjectResult { searchLayoutable: boolean; supportedScopes: ScopeInfo[]; triggerable: boolean; - undeleteable: boolean; + undeletable: boolean; updateable: boolean; urlDetail?: string; urlEdit?: string; diff --git a/types/jsforce/index.d.ts b/types/jsforce/index.d.ts index 65d5159f61..9aaba4e54b 100644 --- a/types/jsforce/index.d.ts +++ b/types/jsforce/index.d.ts @@ -6,6 +6,7 @@ // Tim Noonan // Abraham White // Borys Kupar +// Andrés Catalán // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/jsonabc/index.d.ts b/types/jsonabc/index.d.ts new file mode 100644 index 0000000000..41a785d015 --- /dev/null +++ b/types/jsonabc/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for jsonabc 2.3 +// Project: http://novicelab.org/jsonabc +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/** + * Sort the JSON (clean, parse, sort, stringify). + * @param noArray Sort or don't sort arrays + */ +export function sort(inputStr: string, noArray?: boolean): string; + +/** + * Sort the JSON (clean, parse, sort, stringify). + * @param noArray Sort or don't sort arrays + */ +export function sortObj(input: object, noArray?: boolean): object; + +/** Remove trailing commas */ +export function cleanJSON(input: string): string; diff --git a/types/jsonabc/jsonabc-tests.ts b/types/jsonabc/jsonabc-tests.ts new file mode 100644 index 0000000000..8d51d94bac --- /dev/null +++ b/types/jsonabc/jsonabc-tests.ts @@ -0,0 +1,9 @@ +import * as myJsonAbc from 'jsonabc'; + +myJsonAbc.sortObj({ c: 0, b: 1, a: 0 }); +myJsonAbc.sortObj({ c: 0, b: 1, a: 0 }, false); + +myJsonAbc.sort('{ c: 0, b: 1, a: 0 }'); +myJsonAbc.sort('{ c: 0, b: 1, a: 0 }', true); + +myJsonAbc.cleanJSON('{ c: 0, b: 1, a: 0 }'); diff --git a/types/jsonabc/tsconfig.json b/types/jsonabc/tsconfig.json new file mode 100644 index 0000000000..072c667a18 --- /dev/null +++ b/types/jsonabc/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsonabc-tests.ts" + ] +} diff --git a/types/jsonabc/tslint.json b/types/jsonabc/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsonabc/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jsonapi-serializer/index.d.ts b/types/jsonapi-serializer/index.d.ts new file mode 100644 index 0000000000..4d9344bc28 --- /dev/null +++ b/types/jsonapi-serializer/index.d.ts @@ -0,0 +1,111 @@ +// Type definitions for jsonapi-serializer 3.6 +// Project: https://github.com/SeyZ/jsonapi-serializer#readme +// Definitions by: Frank Chiang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// TypeScript Version: 2.2 + +export type RefFunction = (current: any, item: any) => string; + +export interface Relation { + ref: string | RefFunction; + attributes?: string[]; + included?: boolean; +} + +export interface SerializerOptions { + ref?: (() => void) | boolean | string; + included?: boolean; + id?: string; + attributes?: string[]; + topLevelLinks?: string[] | Array<() => void>; + dataLinks?: string[] | Array<() => void>; + dataMeta?: (() => void) | object; + relationshipLinks?: object; + relationshipMeta?: object; + ignoreRelationshipData?: boolean; + keyForAttribute?: string | KeyForAttribute; + nullIfMissing?: boolean; + pluralizeType?: boolean; + typeForAttribute?: TypeForAttribute; + meta?: object; + transform?: (() => void); +} + +export interface KeyForAttribute { + (attribute: string): string; +} + +export interface TypeForAttribute { + (attribute: string, object?: any): any; +} + +export interface Transform { + (record: any): any; +} + +export interface DeserializerOptions { + id?: string; + keyForAttribute?: + | "dash-case" + | "lisp-case" + | "spinal-case" + | "kebab-case" + | "underscore_case" + | "snake_case" + | "camelCase" + | "CamelCase"; + pluralizeType?: boolean; + typeAsAttribute?: boolean; + transform?: Transform; +} + +export interface DeserializerConstructor { + new (opts: DeserializerOptions): Deserializer; +} + +export interface SerializerConstructor { + new (collectionName: string, opts: SerializerOptions): Serializer; +} + +export interface ErrorConstructor { + new (opts: JSONAPIErrorOptions | JSONAPIErrorOptions[]): JSONAPIError; +} + +export interface JSONAPIError { + errors: any[]; +} + +export interface JSONAPIErrorOptions { + id?: string; + status?: string; + code?: string; + title?: string; + detail?: string; + source?: { + pointer?: string; + parameter?: string; + }; + links?: { + about?: string; + }; + meta?: any; +} + +export interface Serializer { + serialize(data: any): any; +} + +export interface Deserializer { + deserialize(data: any, callback: Callback): void; + + deserialize(data: any): Promise; +} + +export interface Callback { + (error: Error, response: any): any; +} + +export let Serializer: SerializerConstructor; +export let Deserializer: DeserializerConstructor; +export let Error: ErrorConstructor; diff --git a/types/jsonapi-serializer/jsonapi-serializer-tests.ts b/types/jsonapi-serializer/jsonapi-serializer-tests.ts new file mode 100644 index 0000000000..cd560cca77 --- /dev/null +++ b/types/jsonapi-serializer/jsonapi-serializer-tests.ts @@ -0,0 +1,37 @@ +import { Serializer, Deserializer, Error } from "jsonapi-serializer"; + +declare let firstName: string; +declare let lastName: string; + +const UserSerializer = new Serializer("users", { + id: "id", + attributes: ["firstName", "lastName"], + keyForAttribute: "camelCase", + pluralizeType: false +}); + +const users = UserSerializer.serialize({ firstName, lastName }); + +const UserDeserializer = new Deserializer({ + id: "id", + keyForAttribute: "camelCase", + pluralizeType: false, + typeAsAttribute: true +}); + +UserDeserializer.deserialize(users); + +new Error({ + code: "_code", + detail: "_detail", + id: "_id", + links: { + about: "_about" + }, + source: { + parameter: "_parameter", + pointer: "_pointer" + }, + status: "_status", + title: "_title" +}); diff --git a/types/jsonapi-serializer/tsconfig.json b/types/jsonapi-serializer/tsconfig.json new file mode 100644 index 0000000000..eeea88010a --- /dev/null +++ b/types/jsonapi-serializer/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "jsonapi-serializer-tests.ts"] +} diff --git a/types/jsonapi-serializer/tslint.json b/types/jsonapi-serializer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsonapi-serializer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jsonfile/index.d.ts b/types/jsonfile/index.d.ts index 62227c9e84..cc0009ece3 100644 --- a/types/jsonfile/index.d.ts +++ b/types/jsonfile/index.d.ts @@ -1,60 +1,71 @@ -// Type definitions for jsonfile 4.0 +// Type definitions for jsonfile 5.0 // Project: https://github.com/jprichardson/node-jsonfile#readme // Definitions by: Daniel Bowring +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// import { Url } from 'url'; +import { + PathLike, + readFile as fsReadFile, + readFileSync as fsReadFileSync, + writeFile as fsWriteFile, + writeFileSync as fsWriteFileSync, +} from 'fs'; -export type FSReadOptions = { - encoding?: null; - flag?: string; - } | null | undefined; -export type FSWriteOptions = string | { - encoding?: string | null; - mode?: string | number; - flag?: string; - } | null | undefined; - -export type ReadCallback = (err: NodeJS.ErrnoException | null, data: Buffer) => void; -export type WriteCallback = (err: NodeJS.ErrnoException) => void; -export type Path = string | number | Buffer | Url; +export type Path = PathLike | Url; export interface FS { - readFile(path: Path, options: FSReadOptions, callback: ReadCallback): void; - readFileSync(path: Path, options?: FSReadOptions): Buffer; - writeFile(path: Path, data: any, options: FSWriteOptions, callback: WriteCallback): void; - writeFileSync(path: Path, data: any, options?: FSWriteOptions): void; + readFile: typeof fsReadFile; + readFileSync: typeof fsReadFileSync; + writeFile: typeof fsWriteFile; + writeFileSync: typeof fsWriteFileSync; } -export type JFReadOptions = { - encoding?: null; - flag?: string; - throws?: boolean; - fs?: FS; - reviver?: (key: any, value: any) => any; - } | null | undefined; +export type JFReadOptions = + | { + encoding?: string | null; + flag?: string; + throws?: boolean; + fs?: FS; + reviver?: (key: any, value: any) => any; + } + | string + | null + | undefined; -export type JFWriteOptions = string | { - encoding?: string | null; - mode?: string | number; - flag?: string; - throws?: boolean; - fs?: FS; - EOL?: string; - spaces?: string | number; - replacer?: (key: string, value: any) => any; - } | null; +export type JFWriteOptions = + | { + encoding?: string | null; + mode?: string | number; + flag?: string; + fs?: FS; + EOL?: string; + spaces?: string | number; + replacer?: (key: string, value: any) => any; + } + | string + | null; -export type JFReadCallback = (err: NodeJS.ErrnoException | null, data: any) => void; +export type ReadCallback = (err: NodeJS.ErrnoException | null, data: any) => void; +export type WriteCallback = (err: NodeJS.ErrnoException) => void; -export function readFile(file: Path, options?: JFReadOptions, callback?: JFReadCallback): void; -export function readFile(file: Path, callback: JFReadCallback): void; +export function readFile(file: Path, options: JFReadOptions, callback: ReadCallback): void; +export function readFile(file: Path, callback: ReadCallback): void; +export function readFile(file: Path, options?: JFReadOptions): Promise; export function readFileSync(file: Path, options?: JFReadOptions): any; -export function writeFile(file: Path, obj: any, options?: JFWriteOptions, callback?: WriteCallback): void; +export function writeFile( + file: Path, + obj: any, + options: JFWriteOptions, + callback: WriteCallback +): void; export function writeFile(file: Path, obj: any, callback: WriteCallback): void; +export function writeFile(file: Path, obj: any, options?: JFWriteOptions): Promise; export function writeFileSync(file: Path, obj: any, options?: JFWriteOptions): void; diff --git a/types/jsonfile/jsonfile-tests.ts b/types/jsonfile/jsonfile-tests.ts index 675a32d8b9..4725e3c8a3 100644 --- a/types/jsonfile/jsonfile-tests.ts +++ b/types/jsonfile/jsonfile-tests.ts @@ -1,34 +1,67 @@ -// Following are lifted from the samples on the NPM page, modified to pass -// the linter - import * as jsonfile from 'jsonfile'; const file = '/tmp/data.json'; -const obj = {name: 'JP'}; +const obj = { name: 'JP' }; -jsonfile.readFile(file, (err: NodeJS.ErrnoException | null, obj: any) => { - console.dir(obj); +// $ExpectType void +jsonfile.readFile(file, { encoding: 'utf8', throws: true }, (err, obj) => { + // $ExpectType ErrnoException | null + err; + // $ExpectType any + obj; }); -console.dir(jsonfile.readFileSync(file)); - -jsonfile.writeFile(file, obj, (err: NodeJS.ErrnoException) => { - console.error(err); +// $ExpectType void +jsonfile.readFile(file, (err, obj) => { + // $ExpectType ErrnoException | null + err; + // $ExpectType any + obj; }); -jsonfile.writeFile(file, obj, {spaces: 2}, (err: NodeJS.ErrnoException) => { - console.error(err); +jsonfile.readFile(file).then(obj => { + // $ExpectType any + obj; +}); +jsonfile.readFile(file, { encoding: 'utf8', throws: true }).then(obj => { + // $ExpectType any + obj; }); -jsonfile.writeFile(file, obj, {spaces: 2, EOL: '\r\n'}, (err: NodeJS.ErrnoException) => { - console.error(err); +// $ExpectType any +jsonfile.readFileSync(file); +jsonfile.readFileSync(file, { encoding: 'utf8', throws: true }); + +// $ExpectType void +jsonfile.writeFile(file, obj, err => { + // $ExpectType ErrnoException + err; }); -jsonfile.writeFile(file, obj, {flag: 'a'}, (err: NodeJS.ErrnoException) => { - console.error(err); +// $ExpectType void +jsonfile.writeFile(file, obj, { spaces: 2 }, err => { + // $ExpectType ErrnoException + err; }); +// $ExpectType void +jsonfile.writeFile(file, obj, { spaces: 2, EOL: '\r\n' }, err => { + // $ExpectType ErrnoException + err; +}); + +// $ExpectType void +jsonfile.writeFile(file, obj, { flag: 'a' }, err => { + // $ExpectType ErrnoException + err; +}); + +// $ExpectType Promise +jsonfile.writeFile(file, obj); +// $ExpectType Promise +jsonfile.writeFile(file, obj, { flag: 'a' }); + jsonfile.writeFileSync(file, obj); -jsonfile.writeFileSync(file, obj, {spaces: 2}); -jsonfile.writeFileSync(file, obj, {spaces: 2, EOL: '\r\n'}); -jsonfile.writeFileSync(file, obj, {flag: 'a'}); +jsonfile.writeFileSync(file, obj, { spaces: 2 }); +jsonfile.writeFileSync(file, obj, { spaces: 2, EOL: '\r\n' }); +jsonfile.writeFileSync(file, obj, { flag: 'a' }); diff --git a/types/jsonfile/v4/index.d.ts b/types/jsonfile/v4/index.d.ts new file mode 100644 index 0000000000..62227c9e84 --- /dev/null +++ b/types/jsonfile/v4/index.d.ts @@ -0,0 +1,60 @@ +// Type definitions for jsonfile 4.0 +// Project: https://github.com/jprichardson/node-jsonfile#readme +// Definitions by: Daniel Bowring +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { Url } from 'url'; + +export type FSReadOptions = { + encoding?: null; + flag?: string; + } | null | undefined; +export type FSWriteOptions = string | { + encoding?: string | null; + mode?: string | number; + flag?: string; + } | null | undefined; + +export type ReadCallback = (err: NodeJS.ErrnoException | null, data: Buffer) => void; +export type WriteCallback = (err: NodeJS.ErrnoException) => void; +export type Path = string | number | Buffer | Url; + +export interface FS { + readFile(path: Path, options: FSReadOptions, callback: ReadCallback): void; + readFileSync(path: Path, options?: FSReadOptions): Buffer; + writeFile(path: Path, data: any, options: FSWriteOptions, callback: WriteCallback): void; + writeFileSync(path: Path, data: any, options?: FSWriteOptions): void; +} + +export type JFReadOptions = { + encoding?: null; + flag?: string; + throws?: boolean; + fs?: FS; + reviver?: (key: any, value: any) => any; + } | null | undefined; + +export type JFWriteOptions = string | { + encoding?: string | null; + mode?: string | number; + flag?: string; + throws?: boolean; + fs?: FS; + EOL?: string; + spaces?: string | number; + replacer?: (key: string, value: any) => any; + } | null; + +export type JFReadCallback = (err: NodeJS.ErrnoException | null, data: any) => void; + +export function readFile(file: Path, options?: JFReadOptions, callback?: JFReadCallback): void; +export function readFile(file: Path, callback: JFReadCallback): void; + +export function readFileSync(file: Path, options?: JFReadOptions): any; + +export function writeFile(file: Path, obj: any, options?: JFWriteOptions, callback?: WriteCallback): void; +export function writeFile(file: Path, obj: any, callback: WriteCallback): void; + +export function writeFileSync(file: Path, obj: any, options?: JFWriteOptions): void; diff --git a/types/jsonfile/v4/jsonfile-tests.ts b/types/jsonfile/v4/jsonfile-tests.ts new file mode 100644 index 0000000000..675a32d8b9 --- /dev/null +++ b/types/jsonfile/v4/jsonfile-tests.ts @@ -0,0 +1,34 @@ +// Following are lifted from the samples on the NPM page, modified to pass +// the linter + +import * as jsonfile from 'jsonfile'; + +const file = '/tmp/data.json'; +const obj = {name: 'JP'}; + +jsonfile.readFile(file, (err: NodeJS.ErrnoException | null, obj: any) => { + console.dir(obj); +}); + +console.dir(jsonfile.readFileSync(file)); + +jsonfile.writeFile(file, obj, (err: NodeJS.ErrnoException) => { + console.error(err); +}); + +jsonfile.writeFile(file, obj, {spaces: 2}, (err: NodeJS.ErrnoException) => { + console.error(err); +}); + +jsonfile.writeFile(file, obj, {spaces: 2, EOL: '\r\n'}, (err: NodeJS.ErrnoException) => { + console.error(err); +}); + +jsonfile.writeFile(file, obj, {flag: 'a'}, (err: NodeJS.ErrnoException) => { + console.error(err); +}); + +jsonfile.writeFileSync(file, obj); +jsonfile.writeFileSync(file, obj, {spaces: 2}); +jsonfile.writeFileSync(file, obj, {spaces: 2, EOL: '\r\n'}); +jsonfile.writeFileSync(file, obj, {flag: 'a'}); diff --git a/types/jsonfile/v4/tsconfig.json b/types/jsonfile/v4/tsconfig.json new file mode 100644 index 0000000000..e6505d789e --- /dev/null +++ b/types/jsonfile/v4/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "jsonfile": [ + "jsonfile/v4" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "jsonfile-tests.ts" + ] +} diff --git a/types/jsonfile/v4/tslint.json b/types/jsonfile/v4/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsonfile/v4/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jssha/index.d.ts b/types/jssha/index.d.ts index 45d6686aed..e717e23f17 100644 --- a/types/jssha/index.d.ts +++ b/types/jssha/index.d.ts @@ -1,81 +1,81 @@ -// Type definitions for jsSHA +// Type definitions for jsSHA 2.0 // Project: https://github.com/Caligatio/jsSHA -// Definitions by: David Li , Tobias Kahlert +// Definitions by: David Li +// Tobias Kahlert +// Kannan Goundan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - declare namespace jsSHA { + type StringDataFormat = 'HEX' | 'TEXT' | 'B64' | 'BYTES'; + type ArrayBufferDataFormat = 'ARRAYBUFFER'; - export interface EncodingOptions { - encoding? : string; + interface EncodingOptions { + encoding?: string; } - export interface Options extends EncodingOptions { - numRounds? : number; + interface Options extends EncodingOptions { + numRounds?: number; } - export interface OutputFormatOptions { - outputUpper? : boolean; - b64Pad? : string; + interface OutputFormatOptions { + outputUpper?: boolean; + b64Pad?: string; + shakeLen?: number; } - export interface jsSHA { + interface jsSHA { /** - * jsSHA is the workhorse of the library. Instantiate it with the string to - * be hashed as the parameter + * Create a Hasher object. * - * @param {string} variant The desired SHA variant (SHA-1, SHA-224, SHA-256, - * SHA-384, or SHA-512) - * @param {string} inputFormat The format of srcString: HEX, TEXT, B64, or BYTES - * @param {{encoding: (string|undefined), numRounds: (string|undefined)}=} - * options Optional values + * @param variant - The desired SHA variant (SHA-1, SHA-224, SHA-256, + * SHA-384, SHA-512, SHA3-224, SHA3-256, SHA3-384, SHA3-512, SHAKE128, or SHAKE256). + * @param inputFormat The format of srcString. */ - new (variant:string, inputFormat:string, options?:Options):jsSHA; + new(variant: string, inputFormat: StringDataFormat, options?: Options): Hasher; + new(variant: string, inputFormat: ArrayBufferDataFormat, options?: Options): Hasher; + } + + interface Hasher { + /** + * Sets the HMAC key for an eventual getHMAC call. Must be called + * immediately after jsSHA object instantiation + * + * @param key - The key used to calculate the HMAC. + * @param inputFormat - The format of key. + */ + setHMACKey(key: string, inputFormat: StringDataFormat, encodingOpts?: EncodingOptions): void; + setHMACKey(key: ArrayBuffer, inputFormat: ArrayBufferDataFormat, encodingOpts?: EncodingOptions): void; /** - * Sets the HMAC key for an eventual getHMAC call. Must be called - * immediately after jsSHA object instantiation - * - * @param {string} key The key used to calculate the HMAC - * @param {string} inputFormat The format of key, HEX, TEXT, B64, or BYTES - * @param {{encoding : (string|undefined)}=} encodingOpts Associative array - * of input format options - */ - setHMACKey(key:string, inputFormat:string, encodingOpts?:EncodingOptions):void; + * Takes strString and hashes as many blocks as possible. Stores the + * rest for either a future update or getHash call. + * + * @param srcString - The string to be hashed + */ + update(srcString: InputT): void; /** - * Takes strString and hashes as many blocks as possible. Stores the - * rest for either a future update or getHash call. - * - * @param {string} srcString The string to be hashed - */ - update(srcString:string):void; - + * Returns the desired SHA hash of the string specified at instantiation + * using the specified parameters + * + * @expose + * @param format - The desired output formatting. + * @returns The string representation of the hash + * in the format specified. + */ + getHash(format: StringDataFormat, outputFormatOpts?: OutputFormatOptions): string; + getHash(format: ArrayBufferDataFormat, outputFormatOpts?: OutputFormatOptions): ArrayBuffer; /** - * Returns the desired SHA hash of the string specified at instantiation - * using the specified parameters - * - * @param {string} format The desired output formatting (B64, HEX, or BYTES) - * @param {{outputUpper : (boolean|undefined), b64Pad : (string|undefined)}=} - * outputFormatOpts Hash list of output formatting options - * @return {string} The string representation of the hash in the format - * specified - */ - getHash(format:string, outputFormatOpts?:OutputFormatOptions):string; - - /** - * Returns the the HMAC in the specified format using the key given by - * a previous setHMACKey call. - * - * @param {string} format The desired output formatting - * (B64, HEX, or BYTES) - * @param {{outputUpper : (boolean|undefined), b64Pad : (string|undefined)}=} - * outputFormatOpts associative array of output formatting options - * @return {string} The string representation of the hash in the format - * specified - */ - getHMAC(format:string, outputFormatOpts?:OutputFormatOptions):string; + * Returns the the HMAC in the specified format using the key given by + * a previous setHMACKey call. + * + * @param format - The desired output formatting. + * @returns The string representation of the hash in the format + * specified + */ + getHMAC(format: StringDataFormat, outputFormatOpts?: OutputFormatOptions): string; + getHMAC(format: ArrayBufferDataFormat, outputFormatOpts?: OutputFormatOptions): ArrayBuffer; } } diff --git a/types/jssha/jssha-tests.ts b/types/jssha/jssha-tests.ts index bbff8dedca..c4df337ea8 100644 --- a/types/jssha/jssha-tests.ts +++ b/types/jssha/jssha-tests.ts @@ -1,53 +1,56 @@ import imported = require("jssha"); // constructor -let shaObj1 = new imported("SHA-512", "TEXT"); -let shaObj2 = new imported("SHA-512", "TEXT", { }); -let shaObj3 = new imported("SHA-512", "TEXT", { encoding: "UTF8" }); -let shaObj4 = new imported("SHA-512", "TEXT", { numRounds: 1 }); -let shaObj5 = new imported("SHA-512", "TEXT", { encoding: "UTF8", numRounds: 1 }); +const shaObj1 = new imported("SHA-512", "TEXT"); +const shaObj2 = new imported("SHA-512", "TEXT", { }); +const shaObj3 = new imported("SHA-512", "TEXT", { encoding: "UTF8" }); +const shaObj4 = new imported("SHA-512", "TEXT", { numRounds: 1 }); +const shaObj5 = new imported("SHA-512", "TEXT", { encoding: "UTF8", numRounds: 1 }); +const shakeObj = new imported("SHAKE256", "ARRAYBUFFER"); // setHMACKey shaObj1.setHMACKey("key", "TEXT"); shaObj2.setHMACKey("key", "TEXT", { }); shaObj3.setHMACKey("key", "TEXT", { encoding: "UTF8" }); +shaObj3.setHMACKey(new ArrayBuffer(10), "ARRAYBUFFER"); // update shaObj1.update("This is a test"); +shakeObj.update(new ArrayBuffer(10)); // getHash -let hash1:string = shaObj4.getHash("HEX"); -let hash2:string = shaObj4.getHash("HEX", {}); -let hash3:string = shaObj4.getHash("HEX", { b64Pad: "=" }); -let hash4:string = shaObj4.getHash("HEX", { outputUpper: true }); -let hash5:string = shaObj4.getHash("HEX", { outputUpper: true, b64Pad: '=' }); +const hash1: string = shaObj4.getHash("HEX"); +const hash2: string = shaObj4.getHash("HEX", {}); +const hash3: string = shaObj4.getHash("HEX", { b64Pad: "=" }); +const hash4: string = shaObj4.getHash("HEX", { outputUpper: true }); +const hash5: string = shaObj4.getHash("HEX", { outputUpper: true, b64Pad: '=' }); +const hash6: ArrayBuffer = shakeObj.getHash("ARRAYBUFFER", { shakeLen: 128 }); // getHMAC -let hmac1:string = shaObj1.getHMAC("HEX"); -let hmac2:string = shaObj1.getHMAC("HEX", {}); -let hmac3:string = shaObj1.getHMAC("HEX", { b64Pad: "=" }); -let hmac4:string = shaObj1.getHMAC("HEX", { outputUpper: true }); -let hmac5:string = shaObj1.getHMAC("HEX", { outputUpper: true, b64Pad: '=' }); - +const hmac1: string = shaObj1.getHMAC("HEX"); +const hmac2: string = shaObj1.getHMAC("HEX", {}); +const hmac3: string = shaObj1.getHMAC("HEX", { b64Pad: "=" }); +const hmac4: string = shaObj1.getHMAC("HEX", { outputUpper: true }); +const hmac5: string = shaObj1.getHMAC("HEX", { outputUpper: true, b64Pad: '=' }); +const hmac6: ArrayBuffer = shaObj1.getHMAC("ARRAYBUFFER", { shakeLen: 128 }); // examples from the readme.md (https://github.com/Caligatio/jsSHA/blob/v2.0.2/README.md) { - var shaObj = new imported("SHA-512", "TEXT"); + const shaObj = new imported("SHA-512", "TEXT"); shaObj.update("This is a test"); - var hash = shaObj.getHash("HEX"); + const hash = shaObj.getHash("HEX"); } - { - let shaObj = new imported("SHA-256", "TEXT"); + const shaObj = new imported("SHA-256", "TEXT"); shaObj.setHMACKey("abc", "TEXT"); shaObj.update("This is a test"); - let hmac = shaObj.getHMAC("HEX"); + const hmac = shaObj.getHMAC("HEX"); } // Browser global test { - var shaObj = new imported("SHA-512", "TEXT"); + const shaObj = new imported("SHA-512", "TEXT"); shaObj.update("This is a test"); - var hash = shaObj.getHash("HEX"); -} \ No newline at end of file + const hash = shaObj.getHash("HEX"); +} diff --git a/types/jssha/tsconfig.json b/types/jssha/tsconfig.json index 9e54d3c27a..c97f7cc2b8 100644 --- a/types/jssha/tsconfig.json +++ b/types/jssha/tsconfig.json @@ -10,7 +10,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "noEmit": true, "forceConsistentCasingInFileNames": true } -} \ No newline at end of file +} diff --git a/types/jssha/tslint.json b/types/jssha/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/jssha/tslint.json +++ b/types/jssha/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/junk/index.d.ts b/types/junk/index.d.ts new file mode 100644 index 0000000000..390847e1c0 --- /dev/null +++ b/types/junk/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for junk 2.1 +// Project: https://github.com/sindresorhus/junk#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Returns `true` if `filename` matches a junk file. + */ +export function is(filename: string): boolean; +/** + * Returns `true` if `filename` doesn't match a junk file. + */ +export function not(filename: string): boolean; +/** + * Regex used for matching. + */ +export const regex: RegExp; diff --git a/types/junk/junk-tests.ts b/types/junk/junk-tests.ts new file mode 100644 index 0000000000..848eded660 --- /dev/null +++ b/types/junk/junk-tests.ts @@ -0,0 +1,12 @@ +/// + +import fs = require('fs'); +import * as junk from 'junk'; + +junk.is('foo'); // $ExpectType boolean +junk.not('foo'); // $ExpectType boolean +junk.regex; // $ExpectType RegExp + +fs.readdir('some/path', (err, files) => { + files.filter(junk.not); +}); diff --git a/types/junk/tsconfig.json b/types/junk/tsconfig.json new file mode 100644 index 0000000000..06710a9591 --- /dev/null +++ b/types/junk/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "junk-tests.ts" + ] +} diff --git a/types/junk/tslint.json b/types/junk/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/junk/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts index 6481b59faf..91f0d455cc 100644 --- a/types/jwplayer/index.d.ts +++ b/types/jwplayer/index.d.ts @@ -1,481 +1,382 @@ -// Type definitions for JW Player V8.2 -// Project: https://github.com/jwplayer/jwplayer/ +// Type definitions for JW Player 8.2 +// Project: https://github.com/jwplayer/jwplayer // Definitions by: Martin Duparc // Tomer Kruvi // Philipp Gürtler // Daniel McGraw // Benjamin Dobson +// Be Birchall +// Daniel Cassidy +// Drew Wyatt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 // JW Player is the leading HTML5 & Flash video player, optimized for mobile and the desktop. Easy enough for beginners, advanced enough for pros. -interface Version { - version: string; - major: number; - minor: number +declare namespace jwplayer { + interface Version { + version: string; + major: number; + minor: number; + } + + interface Browser { + chrome: boolean; + edge: boolean; + facebook: boolean; + firefox: boolean; + ie: boolean; + msie: boolean; + safari: boolean; + version: Version; + } + + interface OS { + android: boolean; + androidNative: boolean; // Android native browser + iOS: boolean; + mobile: boolean; + mac: boolean; + iPad: boolean; + iPhone: boolean; + windows: boolean; + version: Version; + } + + interface Features { + flash: boolean; + flashVersion: number; + iframe: boolean; + } + + interface Environment { + Browser: Browser; + OS: OS; + Features: Features; + } + + interface AdProgressParam { + client: 'vast' | 'googima'; + creativetype: string; + tag: string; + } + + interface AdCompanionsParam { + companions: any[]; + tag: string; + } + + interface AdErrorParam { + message: string; + tag: string; + } + + interface AdRequestParam { + adposition: 'pre' | 'mid' | 'post'; + client: 'vast' | 'googima'; + offset: 'pre' | 'mid' | 'post'; + tag: string; + } + + interface AdImpressionParam { + adposition: 'pre' | 'mid' | 'post'; + adsystem: string; + adtitle: string; + clickThroughUrl: string; + client: 'vast' | 'googima'; + creativetype: string; + linear: string; + mediafile: any; + tag: string; + vastversion: number; + wrapper: any[]; + } + + interface AdScheduleParam { + tag: string; + client: string; + adbreaks: object[]; + } + + interface AdStartedParam { + creativetype: string; + tag: string; + } + + interface AdPlayParam { + creativetype: string; + newstate: string; + oldstate: string; + tag: string; + } + + interface BufferParam { + newstate: string; + oldstate: string; + reason: 'loading' | 'complete' | 'stalled' | 'error'; + } + + interface BufferChangeParam { + duration: number; + bufferPercent: number; + position: number; + metadata: any; + } + + interface AdTimeParam { + client: 'vast' | 'googima'; + creativetype: string; + duration: number; + position: number; + sequence: number; + tag: string; + } + + interface AudioTracksParam { + levels: any[]; + } + + interface CaptionsChangedParam { + currentTrack: number; + } + + interface CaptionsListParam { + tracks: any[]; + } + + interface AudioTrackChangedParam { + currentTrack: number; + } + + interface MetadataParam { + metadata: any; + } + + interface ControlsParam { + controls: boolean; + } + + interface ErrorParam { + message: string; + } + + interface FullscreenParam { + fullscreen: boolean; + } + + interface IdleParam { + oldstate: 'buffering' | 'playing' | 'paused'; + } + + interface LevelsChangedParam { + currentQuality: number; + } + + interface MuteParam { + mute: boolean; + } + + interface VolumeParam { + volume: boolean; + } + + interface PlayParam { + oldstate: 'buffering' | 'playing'; + viewable: 0 | 1; + } + + interface PlaylistParam { + playlist: any[]; + } + + interface PlaylistItemParam { + index: number; + item: any; + } + + interface ReadyParam { + setupTime: number; + viewable: 0 | 1; + } + + interface ResizeParam { + width: number; + height: number; + } + + interface VisualQualityParam { + mode: string; + label: string; + reason: string; + } + + interface LevelsParam { + width: number; + levels: any[]; + } + + interface SeekParam { + position: number; + offset: number; + } + + interface TimeParam { + duration: number; + position: number; + viewable: 0 | 1; + } + + interface FirstFrameParam { + loadTime: number; + viewable: 0 | 1; + } + + type EventCallback = (param: T) => void; + + interface Region { + x: 0; // x and y will always be 0 according to https://developer.jwplayer.com/jw-player/docs/javascript-api-reference/#jwplayergetsaferegion + y: 0; + width: number; + height: number; + } + + interface CaptionOptions { + color: string; + fontSize: number; + fontFamily: string; + fontOpacity: number; + backgroundColor: string; + backgroundOpacity: number; + edgeStyle: string; + windowColor: string; + windowOpacity: number; + } + + interface Level { + bitrate: number; + height: number; + width: number; + label: string; + } + + interface QualityLevel { + mode: 'auto' | 'manual'; + level: Level; + reason: 'auto' | 'api' | 'initial choice'; + } + + interface CastParam { + available: boolean; + active: boolean; + deviceName: string; + type: 'cast'; + } + + interface EventParams { + adClick: AdProgressParam; + adCompanions: AdCompanionsParam; + adComplete: AdProgressParam; + adSkipped: AdProgressParam; + adError: AdErrorParam; + adRequest: AdRequestParam; + adSchedule: AdScheduleParam; + adStarted: AdStartedParam; + adImpression: AdImpressionParam; + adPlay: AdPlayParam; + adPause: AdPlayParam; + adTime: AdTimeParam; + cast: CastParam; + meta: MetadataParam; + audioTracks: AudioTracksParam; + audioTrackChanged: AudioTrackChangedParam; + firstFrame: FirstFrameParam; + buffer: BufferParam; + bufferChange: BufferChangeParam; + captionsChanged: CaptionsChangedParam; + captionsList: CaptionsListParam; + controls: ControlsParam; + error: ErrorParam; + fullscreen: FullscreenParam; + idle: IdleParam; + levelsChanged: LevelsChangedParam; + mute: MuteParam; + volume: VolumeParam; + pause: PlayParam; + play: PlayParam; + playlist: PlaylistParam; + playlistItem: PlaylistItemParam; + ready: ReadyParam; + resize: ResizeParam; + visualQuality: VisualQualityParam; + levels: LevelsParam; + seek: SeekParam; + setupError: ErrorParam; + time: TimeParam; + } + + type NoParamEvent = 'adBlock' | 'beforeComplete' | 'complete' | 'beforePlay' | 'displayClick' | 'playlistComplete' + | 'seeked' | 'remove'; + + interface JWPlayer { + addButton(icon: string, label: string, handler: () => void, id: string): void; + getAudioTracks(): any[]; + getBuffer(): number; + getCaptionsList(): any[]; + getControls(): boolean; + getCurrentAudioTrack(): number; + getCurrentCaptions(): number; + getCurrentQuality(): number; + getDuration(): number; + getHeight(): number; + getFullscreen(): boolean; + getMute(): boolean; + getPlaylist(): any[]; + getPlaylistIndex(): number; + getPlaylistItem(index?: number): any; + getPosition(): number; + getQualityLevels(): any[]; + getRenderingMode(): string; + getSafeRegion(): Region; + getState(): string; + getVolume(): number; + getContainer(): HTMLElement; + getEnvironment(): Environment; + getWidth(): number; + getVisualQuality(): QualityLevel | undefined; + load(playlist: any[] | string): void; + on(event: TEvent, callback: EventCallback): void; + on(event: NoParamEvent, callback: () => void): void; + once(event: TEvent, callback: EventCallback): void; + once(event: NoParamEvent, callback: () => void): void; + off(event: keyof EventParams | NoParamEvent): void; + trigger(event: TEvent, args: EventParams[TEvent]): void; + trigger(event: NoParamEvent): void; + pause(state?: boolean): void; + play(state?: boolean): void; + playAd(tag: string): void; + playlistItem(index: number): void; + registerPlugin(id: string, target: string, jsPlugin: () => void, swfURL?: string): void; + remove(): void; + removeButton(id: string): void; + resize(width: number, height: number): void; + seek(position: number): void; + setControls(controls: boolean): void; + setCurrentAudioTrack(index: number): void; + setCurrentCaptions(index: number): void; + setCurrentQuality(index: number): void; + setFullscreen(state: boolean): void; + setMute(state?: boolean): void; + setup(options: any): JWPlayer; + setVolume(volume: number): void; + setCaptions(options: CaptionOptions): void; + stop(): void; + } + + interface JWPlayerStatic { + (query?: string | number | Element): JWPlayer; + key: string; + version: string; + } } -interface Browser { - chrome: boolean; - edge: boolean; - facebook: boolean; - firefox: boolean; - ie: boolean; - msie: boolean; - safari: boolean; - version: Version; -} - -interface OS { - android: boolean; - androidNative: boolean; // Android native browser - iOS: boolean; - mobile: boolean; - mac: boolean; - iPad: boolean; - iPhone: boolean; - windows: boolean; - version: Version; -} - -interface Features { - flash: boolean; - flashVersion: number; - iframe: boolean; -} - -interface Environment{ - Browser: Browser; - OS: OS; - Features: Features; -} - -interface CallbackParam { -} - -interface AdProgressParam extends CallbackParam { - client: 'vast' | 'googima'; - creativetype: string; - tag: string; -} - -interface AdCompanionsParam extends CallbackParam { - companions: any[]; - tag: string; -} - -interface AdErrorParam extends CallbackParam { - message: string; - tag: string; -} - -interface AdRequestParam extends CallbackParam { - adposition: 'pre' | 'mid' | 'post'; - client: 'vast' | 'googima'; - offset: 'pre' | 'mid' | 'post'; - tag: string; -} - -interface AdImpressionParam extends CallbackParam { - adposition: 'pre' | 'mid' | 'post'; - adsystem: string; - adtitle: string; - clickThroughUrl: string; - client: 'vast' | 'googima'; - creativetype: string; - linear: string; - mediafile: any; - tag: string; - vastversion: number; - wrapper: any[]; -} - -interface AdScheduleParam extends CallbackParam { - tag: string; - client: string; - adbreaks: object[]; -} - -interface AdStartedParam extends CallbackParam { - creativetype: string; - tag: string; -} - -interface AdPlayParam extends CallbackParam { - creativetype: string; - newstate: string; - oldstate: string; - tag: string; -} - -interface BufferParam extends CallbackParam { - newstate: string; - oldstate: string; - reason: 'loading' | 'complete' | 'stalled' | 'error'; -} - -interface BufferChangeParam extends CallbackParam { - duration: number; - bufferPercent: number; - position: number; - metadata: any; -} - -interface AdTimeParam extends CallbackParam { - client: 'vast' | 'googima'; - creativetype: string; - duration: number; - position: number; - sequence: number; - tag: string; -} - -interface AudioTracksParam extends CallbackParam { - levels: any[]; -} - -interface CaptionsChangedParam extends CallbackParam { - currentTrack: number; -} - -interface CaptionsListParam extends CallbackParam { - tracks: any[]; -} - -interface AudioTrackChangedParam extends CallbackParam { - currentTrack: number; -} - -interface MetadataParam extends CallbackParam { - metadata: any; -} - -interface ControlsParam extends CallbackParam { - controls: boolean; -} - -interface ErrorParam extends CallbackParam { - message: string; -} - -interface FullscreenParam extends CallbackParam { - fullscreen: boolean; -} - -interface IdleParam extends CallbackParam { - oldstate: 'buffering' | 'playing' | 'paused'; -} - -interface LevelsChangedParam extends CallbackParam { - currentQuality: number; -} - -interface MuteParam extends CallbackParam { - mute: boolean; -} - -interface VolumeParam extends CallbackParam { - volume: boolean; -} - -interface PlayParam extends CallbackParam { - oldstate: 'buffering' | 'playing'; - viewable: 0 | 1; -} - -interface PlaylistParam extends CallbackParam { - playlist: any[]; -} - -interface PlaylistItemParam extends CallbackParam { - index: number; - item: any; -} - -interface ReadyParam extends CallbackParam { - setupTime: number; - viewable: 0 | 1; -} - -interface ResizeParam extends CallbackParam { - width: number; - height: number; -} - -interface VisualQualityParam extends CallbackParam { - mode: string; - label: string; - reason: string; -} - -interface LevelsParam extends CallbackParam { - width: number; - levels: any[]; -} - -interface SeekParam extends CallbackParam { - position: number; - offset: number; -} - -interface TimeParam extends CallbackParam { - duration: number; - position: number; - viewable: 0 | 1; -} - -interface FirstFrameParam extends CallbackParam { - loadTime: number; - viewable: 0 | 1; -} - -interface EventCallback { - (param: T): void; -} - -interface Region { - x: 0; // x and y will always be 0 according to https://developer.jwplayer.com/jw-player/docs/javascript-api-reference/#jwplayergetsaferegion - y: 0; - width: number; - height: number; -} - -interface JWPlayer { - addButton(icon: string, label: string, handler: () => void, id: string): void; - getAudioTracks(): any[]; - getBuffer(): number; - getCaptionsList(): any[]; - getControls(): boolean; - getCurrentAudioTrack(): number; - getCurrentCaptions(): number; - getCurrentQuality(): number; - getDuration(): number; - getHeight(): number; - getFullscreen(): boolean; - getMute(): boolean; - getPlaylist(): any[]; - getPlaylistIndex(): number; - getPlaylistItem(index?: number): any; - getPosition(): number; - getQualityLevels(): any[]; - getRenderingMode(): string; - getSafeRegion(): Region; - getState(): string; - getVolume(): number; - getContainer(): HTMLElement; - getEnvironment(): Environment; - getWidth(): number; - load(playlist: any[]): void; - load(playlist: string): void; - on(event: 'adClick', callback: EventCallback): void; - once(event: 'adClick', callback: EventCallback): void; - off(event: 'adClick'): void; - trigger(event: 'adClick', args: AdProgressParam): void; - on(event: 'adCompanions', callback: EventCallback): void; - once(event: 'adCompanions', callback: EventCallback): void; - off(event: 'adCompanions'): void; - trigger(event: 'adCompanions', args: AdCompanionsParam): void; - on(event: 'adComplete', callback: EventCallback): void; - once(event: 'adComplete', callback: EventCallback): void; - off(event: 'adComplete'): void; - trigger(event: 'adComplete', args: AdProgressParam): void; - on(event: 'adSkipped', callback: EventCallback): void; - once(event: 'adSkipped', callback: EventCallback): void; - off(event: 'adSkipped'): void; - trigger(event: 'adSkipped', args: AdProgressParam): void; - on(event: 'adError', callback: EventCallback): void; - once(event: 'adError', callback: EventCallback): void; - off(event: 'adError'): void; - trigger(event: 'adError', args: AdErrorParam): void; - on(event: 'adBlock', callback: () => void): void; - once(event: 'adBlock', callback: () => void): void; - off(event: 'adBlock'): void; - trigger(event: 'adBlock'): void; - on(event: 'adRequest', callback: EventCallback): void; - once(event: 'adRequest', callback: EventCallback): void; - off(event: 'adRequest'): void; - trigger(event: 'adRequest', args: AdRequestParam): void; - on(event: 'adSchedule', callback: EventCallback): void; - once(event: 'adSchedule', callback: EventCallback): void; - off(event: 'adSchedule'): void; - trigger(event: 'adSchedule', args: AdScheduleParam): void; - on(event: 'adStarted', callback: EventCallback): void; - once(event: 'adStarted', callback: EventCallback): void; - off(event: 'adStarted'): void; - trigger(event: 'adStarted', args: AdStartedParam): void; - on(event: 'adImpression', callback: EventCallback): void; - once(event: 'adImpression', callback: EventCallback): void; - off(event: 'adImpression'): void; - trigger(event: 'adImpression', args: AdImpressionParam): void; - on(event: 'adPlay', callback: EventCallback): void; - once(event: 'adPlay', callback: EventCallback): void; - off(event: 'adPlay'): void; - trigger(event: 'adPlay', args: AdPlayParam): void; - on(event: 'adPause', callback: EventCallback): void; - once(event: 'adPause', callback: EventCallback): void; - off(event: 'adPause'): void; - trigger(event: 'adPause', args: AdPlayParam): void; - on(event: 'adTime', callback: EventCallback): void; - once(event: 'adTime', callback: EventCallback): void; - off(event: 'adTime'): void; - trigger(event: 'adTime', args: AdTimeParam): void; - on(event: 'meta', callback: EventCallback): void; - once(event: 'meta', callback: EventCallback): void; - off(event: 'meta'): void; - trigger(event: 'meta', args: MetadataParam): void; - on(event: 'audioTracks', callback: EventCallback): void; - once(event: 'audioTracks', callback: EventCallback): void; - off(event: 'audioTracks'): void; - trigger(event: 'audioTracks', args: AudioTracksParam): void; - on(event: 'audioTrackChanged', callback: EventCallback): void; - once(event: 'audioTrackChanged', callback: EventCallback): void; - off(event: 'audioTrackChanged'): void; - trigger(event: 'audioTrackChanged', args: AudioTrackChangedParam): void; - on(event: 'beforeComplete', callback: () => void): void; - once(event: 'beforeComplete', callback: () => void): void; - off(event: 'beforeComplete'): void; - trigger(event: 'beforeComplete'): void; - on(event: 'complete', callback: () => void): void; - once(event: 'complete', callback: () => void): void; - off(event: 'complete'): void; - trigger(event: 'complete'): void; - on(event: 'firstFrame', callback: EventCallback): void; - once(event: 'firstFrame', callback: EventCallback): void; - off(event: 'firstFrame'): void; - trigger(event: 'firstFrame', args: FirstFrameParam): void; - on(event: 'beforePlay', callback: () => void): void; - once(event: 'beforePlay', callback: () => void): void; - off(event: 'beforePlay'): void; - trigger(event: 'beforePlay'): void; - on(event: 'buffer', callback: EventCallback): void; - once(event: 'buffer', callback: EventCallback): void; - off(event: 'buffer'): void; - trigger(event: 'buffer', args: BufferParam): void; - on(event: 'bufferChange', callback: EventCallback): void; - once(event: 'bufferChange', callback: EventCallback): void; - off(event: 'bufferChange'): void; - trigger(event: 'bufferChange', args: BufferChangeParam): void; - on(event: 'captionsChanged', callback: EventCallback): void; - once(event: 'captionsChanged', callback: EventCallback): void; - off(event: 'captionsChanged'): void; - trigger(event: 'captionsChanged', args: CaptionsChangedParam): void; - on(event: 'captionsList', callback: EventCallback): void; - once(event: 'captionsList', callback: EventCallback): void; - off(event: 'captionsList'): void; - trigger(event: 'captionsList', args: CaptionsListParam): void; - on(event: 'controls', callback: EventCallback): void; - once(event: 'controls', callback: EventCallback): void; - off(event: 'controls'): void; - trigger(event: 'controls', args: ControlsParam): void; - on(event: 'displayClick', callback: () => void): void; - once(event: 'displayClick', callback: () => void): void; - off(event: 'displayClick'): void; - trigger(event: 'displayClick'): void; - on(event: 'error', callback: EventCallback): void; - once(event: 'error', callback: EventCallback): void; - off(event: 'error'): void; - trigger(event: 'error', args: ErrorParam): void; - on(event: 'fullscreen', callback: EventCallback): void; - once(event: 'fullscreen', callback: EventCallback): void; - off(event: 'fullscreen'): void; - trigger(event: 'fullscreen', args: FullscreenParam): void; - on(event: 'idle', callback: EventCallback): void; - once(event: 'idle', callback: EventCallback): void; - off(event: 'idle'): void; - trigger(event: 'idle', args: IdleParam): void; - on(event: 'levelsChanged', callback: EventCallback): void; - once(event: 'levelsChanged', callback: EventCallback): void; - off(event: 'levelsChanged'): void; - trigger(event: 'levelsChanged', args: LevelsChangedParam): void; - on(event: 'mute', callback: EventCallback): void; - once(event: 'mute', callback: EventCallback): void; - off(event: 'mute'): void; - trigger(event: 'mute', args: MuteParam): void; - on(event: 'volume', callback: EventCallback): void; - once(event: 'volume', callback: EventCallback): void; - off(event: 'volume'): void; - trigger(event: 'volume', args: VolumeParam): void; - on(event: 'pause', callback: EventCallback): void; - once(event: 'pause', callback: EventCallback): void; - off(event: 'pause'): void; - trigger(event: 'pause', args: PlayParam): void; - on(event: 'play', callback: EventCallback): void; - once(event: 'play', callback: EventCallback): void; - off(event: 'play'): void; - trigger(event: 'play', args: PlayParam): void; - on(event: 'playlist', callback: EventCallback): void; - once(event: 'playlist', callback: EventCallback): void; - off(event: 'playlist'): void; - trigger(event: 'playlist', args: PlaylistParam): void; - on(event: 'playlistItem', callback: EventCallback): void; - once(event: 'playlistItem', callback: EventCallback): void; - off(event: 'playlistItem'): void; - trigger(event: 'playlistItem', args: PlaylistItemParam): void; - on(event: 'playlistComplete', callback: () => void): void; - once(event: 'playlistComplete', callback: () => void): void; - off(event: 'playlistComplete'): void; - trigger(event: 'playlistComplete'): void; - on(event: 'ready', callback: EventCallback): void; - once(event: 'ready', callback: EventCallback): void; - off(event: 'ready'): void; - trigger(event: 'ready'): void; - on(event: 'resize', callback: EventCallback): void; - once(event: 'resize', callback: EventCallback): void; - off(event: 'resize'): void; - trigger(event: 'resize', args: ResizeParam): void; - on(event: 'visualQuality', callback: EventCallback): void; - once(event: 'visualQuality', callback: EventCallback): void; - off(event: 'visualQuality'): void; - trigger(event: 'visualQuality', args: VisualQualityParam): void; - on(event: 'levels', callback: EventCallback): void; - once(event: 'levels', callback: EventCallback): void; - off(event: 'levels'): void; - trigger(event: 'levels', args: LevelsParam): void; - on(event: 'seek', callback: EventCallback): void; - once(event: 'seek', callback: EventCallback): void; - off(event: 'seek'): void; - trigger(event: 'seek', args: SeekParam): void; - on(event: 'seeked', callback: () => void): void; - once(event: 'seeked', callback: () => void): void; - off(event: 'seeked'): void; - trigger(event: 'seeked'): void - on(event: 'setupError', callback: EventCallback): void; - once(event: 'setupError', callback: EventCallback): void; - off(event: 'setupError'): void; - trigger(event: 'setupError', args: ErrorParam): void; - on(event: 'remove', callback: () => void): void; - once(event: 'remove', callback: () => void): void; - off(event: 'remove'): void; - trigger(event: 'remove'): void; - on(event: 'time', callback: EventCallback): void; - once(event: 'time', callback: EventCallback): void; - off(event: 'time'): void; - trigger(event: 'time', args: TimeParam): void; - pause(state?: boolean): void; - play(state?: boolean): void; - playAd(tag: string): void; - playlistItem(index: number): void; - registerPlugin(id: string, target: string, jsPlugin: () => void, swfURL?: string): void; - remove(): void; - removeButton(id: string): void; - resize(width: number, height: number): void; - seek(position: number): void; - setControls(controls: boolean): void; - setCurrentAudioTrack(index: number): void; - setCurrentCaptions(index: number): void; - setCurrentQuality(index: number): void; - setFullscreen(state: boolean): void; - setMute(state?: boolean): void; - setup(options: any): JWPlayer; - setVolume(volume: number): void; - stop(): void; -} - -interface JWPlayerStatic { - (id: string): JWPlayer; - key: string; - version: string; -} - -declare const jwplayer:JWPlayerStatic; +declare const jwplayer: jwplayer.JWPlayerStatic; diff --git a/types/jwplayer/tslint.json b/types/jwplayer/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/jwplayer/tslint.json +++ b/types/jwplayer/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/karma-chai-sinon/index.d.ts b/types/karma-chai-sinon/index.d.ts index 0b14373a99..9a14f659e2 100644 --- a/types/karma-chai-sinon/index.d.ts +++ b/types/karma-chai-sinon/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/tubalmartin/karma-chai-sinon // Definitions by: Václav Ostrožlík // Definitions: https://github.com/borisyankov/DefinitelyTyped -// TypeScript Version: 3.0 +// TypeScript Version: 2.8 /// import Sinon = require('sinon'); diff --git a/types/katex/index.d.ts b/types/katex/index.d.ts index 19c7e79d06..ae126b3444 100644 --- a/types/katex/index.d.ts +++ b/types/katex/index.d.ts @@ -1,14 +1,90 @@ -// Type definitions for KaTeX 0.5 +// Type definitions for KaTeX 0.10 // Project: http://khan.github.io/KaTeX/ // Definitions by: Michael Randolph +// Kevin Nguyen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export as namespace katex; +/** Documentation: https://katex.org/docs/options.html */ export interface KatexOptions { + /** + * If `true`, math will be rendered in display mode + * (math in display style and center math on page) + * + * If `false`, math will be rendered in inline mode + * @default false + */ displayMode?: boolean; - breakOnUnsupportedCmds?: boolean; + /** + * If `true`, KaTeX will throw a `ParseError` when + * it encounters an unsupported command or invalid LaTex + * + * If `false`, KaTeX will render unsupported commands as + * text, and render invalid LaTeX as its source code with + * hover text giving the error, in color given by errorColor + * @default true + */ + throwOnError?: boolean; + /** + * A Color string given in format `#XXX` or `#XXXXXX` + */ errorColor?: string; + /** + * A collection of custom macros. + * + * See `src/macros.js` for its usage + */ + macros?: any; + /** + * If `true`, `\color` will work like LaTeX's `\textcolor` + * and takes 2 arguments + * + * If `false`, `\color` will work like LaTeX's `\color` + * and takes 1 argument + * + * In both cases, `\textcolor` works as in LaTeX + * + * @default false + */ + colorIsTextColor?: boolean; + /** + * All user-specified sizes will be caped to `maxSize` ems + * + * If set to Infinity, users can make elements and space + * arbitrarily large + * + * @default Infinity + */ + maxSize?: number; + /** + * Limit the number of macro expansions to specified number + * + * If set to `Infinity`, marco expander will try to fully expand + * as in LaTex + * + * @default 1000 + */ + maxExpand?: number; + /** + * Allowed protocols in `\href` + * + * Use `_relative` to allow relative urls + * + * Use `*` to allow all protocols + */ + allowedProtocols?: string[] + /** + * If `false` or `"ignore"`, allow features that make + * writing in LaTex convenient but not supported by LaTex + * + * If `true` or `"error"`, throw an error for such transgressions + * + * If `"warn"`, warn about behavior via `console.warn` + * + * @default "warn" + */ + strict?: boolean | string | Function; } export class ParseError implements Error { diff --git a/types/katex/katex-tests.ts b/types/katex/katex-tests.ts index 77e745d6a0..6fd614c82c 100644 --- a/types/katex/katex-tests.ts +++ b/types/katex/katex-tests.ts @@ -5,7 +5,7 @@ class KatexTest { katexLib.render('My Latex String', document.createElement('div')); try { - let options: katexLib.KatexOptions = { breakOnUnsupportedCmds: true }; + let options: katexLib.KatexOptions = { throwOnError: true }; let value: string = katexLib.renderToString('My Latex String', options); } catch (error) { if (error instanceof katexLib.ParseError) { diff --git a/types/kefir/index.d.ts b/types/kefir/index.d.ts index e892e1b291..05fd7a7aab 100644 --- a/types/kefir/index.d.ts +++ b/types/kefir/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for Kefir 3.7.3 +// Type definitions for Kefir 3.8.0 // Project: http://rpominov.github.io/kefir/ // Definitions by: Aya Morisawa // Piotr Hitori Bosak // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.7 /// @@ -11,7 +11,7 @@ export type ValueOfAnObservable> = T['']; export interface Subscription { unsubscribe(): void; - closed: boolean; // Actually, `readonly` but it's avaiable in tsc starting with 2.0.0 + readonly closed: boolean; } export interface Observer { @@ -20,21 +20,24 @@ export interface Observer { end?: () => void; } -export interface Subscription { - unsubscribe(): void; - closed: boolean; // Actually, `readonly` but it's avaiable in tsc starting with 2.0.0 +interface ESObserver { + start?: Function, + next?: (value: T) => any, + error?: (error: S) => any, + complete?: () => any, } -export interface Observer { - value?: (value: T) => void; - error?: (error: S) => void; - end?: () => void; +interface ESObservable { + subscribe(callbacks: ESObserver): { unsubscribe(): void }; } -export interface Observable { +export class Observable { '': T; // TypeScript hack to enable value unwrapping for combine/flatMap - toProperty(getCurrent?: () => T): Property; + toProperty(): Property; + toProperty(getCurrent?: () => T2): Property; + changes(): Observable; + // Subscribe / add side effects onValue(callback: (value: T) => void): this; offValue(callback: (value: T) => void): this; @@ -42,8 +45,8 @@ export interface Observable { offError(callback: (error: S) => void): this; onEnd(callback: () => void): this; offEnd(callback: () => void): this; - onAny(callback: (event: Event) => void): this; - offAny(callback: (event: Event) => void): this; + onAny(callback: (event: Event) => void): this; + offAny(callback: (event: Event) => void): this; log(name?: string): this; spy(name?: string): this; offLog(name?: string): this; @@ -51,7 +54,7 @@ export interface Observable { flatten(transformer?: (value: T) => U[]): Stream; toPromise(): Promise; toPromise>(PromiseConstructor: () => W): W; - toESObservable(): any; + toESObservable(): ESObservable; // This method is designed to replace all other methods for subscribing observe(params: Observer): Subscription; observe( @@ -61,172 +64,174 @@ export interface Observable { ): Subscription; setName(source: Observable, selfName: string): this; setName(selfName: string): this; -} -export interface Stream extends Observable { + thru(cb: (obs: Observable) => Observable): Observable; // Modify an stream - map(fn: (value: T) => U): Stream; - filter(predicate?: (value: T) => boolean): Stream; - take(n: number): Stream; - takeWhile(predicate?: (value: T) => boolean): Stream; - last(): Stream; - skip(n: number): Stream; - skipWhile(predicate?: (value: T) => boolean): Stream; - skipDuplicates(comparator?: (a: T, b: T) => boolean): Stream; - diff(fn?: (prev: T, next: T) => T, seed?: T): Stream; - scan(fn: (prev: T | W, next: T) => W): Stream; - scan(fn: (prev: W, next: T) => W, seed: W): Stream; - delay(wait: number): Stream; - throttle(wait: number, options?: { leading?: boolean, trailing?: boolean }): Stream; - debounce(wait: number, options?: { immediate: boolean }): Stream; - valuesToErrors(): Stream; - valuesToErrors(handler: (value: T) => { convert: boolean, error: U }): Stream; - errorsToValues(handler?: (error: S) => { convert: boolean, value: U }): Stream; - mapErrors(fn: (error: S) => U): Stream; - filterErrors(predicate?: (error: S) => boolean): Stream; - endOnError(): Stream; - takeErrors(n: number): Stream; - ignoreValues(): Stream; - ignoreErrors(): Stream; - ignoreEnd(): Stream; - beforeEnd(fn: () => U): Stream; - slidingWindow(max: number, mix?: number): Stream; - bufferWhile(predicate: (value: T) => boolean): Stream; - bufferWithCount(count: number, options?: { flushOnEnd: boolean }): Stream; - bufferWithTimeOrCount(interval: number, count: number, options?: { flushOnEnd: boolean }): Stream; - transduce(transducer: any): Stream; - withHandler(handler: (emitter: Emitter, event: Event) => void): Stream; + map(fn: (value: T) => U): Observable; + filter(fn: (value: T) => value is U): Observable + filter(predicate?: (value: T) => boolean): Observable; + take(n: number): Observable; + takeWhile(predicate?: (value: T) => boolean): Observable; + last(): Observable; + skip(n: number): Observable; + skipWhile(predicate?: (value: T) => boolean): Observable; + skipDuplicates(comparator?: (a: T, b: T) => boolean): Observable; + diff(fn?: (prev: T, next: T) => T, seed?: T): Observable; + scan(fn: (prev: T | W, next: T) => W): Observable; + scan(fn: (prev: W, next: T) => W, seed: W): Observable; + delay(wait: number): Observable; + throttle(wait: number, options?: { leading?: boolean, trailing?: boolean }): Observable; + debounce(wait: number, options?: { immediate: boolean }): Observable; + valuesToErrors(): Observable; + valuesToErrors(handler: (value: T) => { convert: boolean, error: U }): Observable; + errorsToValues(handler?: (error: S) => { convert: boolean, value: U }): Observable; + mapErrors(fn: (error: S) => U): Observable; + filterErrors(predicate?: (error: S) => boolean): Observable; + endOnError(): Observable; + takeErrors(n: number): Observable; + ignoreValues(): Observable; + ignoreErrors(): Observable; + ignoreEnd(): Observable; + beforeEnd(fn: () => U): Observable; + slidingWindow(max: number, mix?: number): Observable; + bufferWhile(predicate: (value: T) => boolean): Observable; + bufferWithCount(count: number, options?: { flushOnEnd: boolean }): Observable; + bufferWithTimeOrCount(interval: number, count: number, options?: { flushOnEnd: boolean }): Observable; + transduce(transducer: any): Observable; + withHandler(handler: (emitter: Emitter, event: Event) => void): Observable; // Combine streams - combine(otherObs: Stream, combinator?: (value: T, ...values: U[]) => W): Stream; - zip(otherObs: Stream, combinator?: (value: T, ...values: U[]) => W): Stream; - merge(otherObs: Stream): Stream; - concat(otherObs: Stream): Stream; - flatMap(transform: (value: T) => Stream): Stream; - flatMap>(): Stream, any>; - flatMapLatest(fn: (value: T) => Stream): Stream; - flatMapLatest>(): Stream, any>; - flatMapFirst(fn: (value: T) => Stream): Stream; - flatMapFirst>(): Stream, any>; - flatMapConcat(fn: (value: T) => Stream): Stream; - flatMapConcat>(): Stream, any>; - flatMapConcurLimit(fn: (value: T) => Stream, limit: number): Stream; - flatMapErrors(transform: (error: S) => Stream): Stream; + combine(otherObs: Observable, combinator?: (value: T, ...values: U[]) => W): Observable; + zip(otherObs: Observable, combinator?: (value: T, ...values: U[]) => W): Observable; + merge(otherObs: Observable): Observable; + concat(otherObs: Observable): Observable; + flatMap(transform: (value: T) => Observable): Observable; + flatMap>(): Observable, any>; + flatMapLatest(fn: (value: T) => Observable): Observable; + flatMapLatest>(): Observable, any>; + flatMapFirst(fn: (value: T) => Observable): Observable; + flatMapFirst>(): Observable, any>; + flatMapConcat(fn: (value: T) => Observable): Observable; + flatMapConcat>(): Observable, any>; + flatMapConcurLimit(fn: (value: T) => Observable, limit: number): Observable; + flatMapErrors(transform: (error: S) => Observable): Observable; // Combine two streams - filterBy(otherObs: Observable): Stream; - sampledBy(otherObs: Observable, combinator?: (a: T, b: U) => W): Stream; - skipUntilBy(otherObs: Observable): Stream; - takeUntilBy(otherObs: Observable): Stream; - bufferBy(otherObs: Observable, options?: { flushOnEnd: boolean }): Stream; - bufferWhileBy(otherObs: Observable, options?: { flushOnEnd?: boolean, flushOnChange?: boolean }): Stream; - awaiting(otherObs: Observable): Stream; + filterBy(otherObs: Observable): Observable; + sampledBy(otherObs: Observable): Observable; + sampledBy(otherObs: Observable, combinator: (a: T, b: U) => W): Observable; + skipUntilBy(otherObs: Observable): Observable; + takeUntilBy(otherObs: Observable): Observable; + bufferBy(otherObs: Observable, options?: { flushOnEnd: boolean }): Observable; + bufferWhileBy(otherObs: Observable, options?: { flushOnEnd?: boolean, flushOnChange?: boolean }): Observable; + awaiting(otherObs: Observable): Observable; } -export interface Property extends Observable { - changes(): Stream; - // Modify an property - map(fn: (value: T) => U): Property; - filter(predicate?: (value: T) => boolean): Property; - take(n: number): Property; - takeWhile(predicate?: (value: T) => boolean): Property; - last(): Property; - skip(n: number): Property; - skipWhile(predicate?: (value: T) => boolean): Property; - skipDuplicates(comparator?: (a: T, b: T) => boolean): Property; - diff(fn?: (prev: T, next: T) => T, seed?: T): Property; - scan(fn: (prev: T, next: T) => T, seed?: T): Property; - delay(wait: number): Property; - throttle(wait: number, options?: { leading?: boolean, trailing?: boolean }): Property; - debounce(wait: number, options?: { immediate: boolean }): Property; - valuesToErrors(handler?: (value: T) => { convert: boolean, error: U }): Property; - errorsToValues(handler?: (error: S) => { convert: boolean, value: U }): Property; - mapErrors(fn: (error: S) => U): Property; - filterErrors(predicate?: (error: S) => boolean): Property; - endOnError(): Property; - takeErrors(n: number): Stream; - ignoreValues(): Property; - ignoreErrors(): Property; - ignoreEnd(): Property; - beforeEnd(fn: () => U): Property; - slidingWindow(max: number, mix?: number): Property; - bufferWhile(predicate: (value: T) => boolean): Property; - bufferWithCount(count: number, options?: { flushOnEnd: boolean }): Property; - bufferWithTimeOrCount(interval: number, count: number, options?: { flushOnEnd: boolean }): Property; - transduce(transducer: any): Property; - withHandler(handler: (emitter: Emitter, event: Event) => void): Property; - // Combine properties - combine(otherObs: Property, combinator?: (value: T, ...values: U[]) => W): Property; - zip(otherObs: Property, combinator?: (value: T, ...values: U[]) => W): Property; - merge(otherObs: Property): Property; - concat(otherObs: Property): Property; - flatMap(transform: (value: T) => Property): Property; - flatMap>(): Property, any>; - flatMapLatest(fn: (value: T) => Property): Property; - flatMapLatest>(): Property, any>; - flatMapFirst(fn: (value: T) => Property): Property; - flatMapFirst>(): Property, any>; - flatMapConcat(fn: (value: T) => Property): Property; - flatMapConcurLimit(fn: (value: T) => Property, limit: number): Property; - flatMapErrors(transform: (error: S) => Property): Property; - // Combine two properties - filterBy(otherObs: Observable): Property; - sampledBy(otherObs: Observable, combinator?: (a: T, b: U) => W): Property; - skipUntilBy(otherObs: Observable): Property; - takeUntilBy(otherObs: Observable): Property; - bufferBy(otherObs: Observable, options?: { flushOnEnd: boolean }): Property; - bufferWhileBy(otherObs: Observable, options?: { flushOnEnd?: boolean, flushOnChange?: boolean }): Property; - awaiting(otherObs: Observable): Property; +export class Stream extends Observable { + } -export interface ObservablePool extends Observable { +export class Property extends Observable { + +} + +export class Pool extends Observable { plug(obs: Observable): this; - unPlug(obs: Observable): this; + unplug(obs: Observable): this; } -export interface Event { - type: string; - value: T; -} +export type Event = + { type: 'value', value: V } | + { type: 'error', value: E } | + { type: 'end', value: void }; -export interface Emitter { - emit(value: T): void; - error(error: S): void; +export interface Emitter { + value(value: V): boolean; + event(event: Event): boolean; + error(e: E): boolean; end(): void; - emitEvent(event: { type: string, value: T | S }): void; + + // Deprecated methods + emit(value: V): boolean; + emitEvent(event: Event): boolean; } // Create a stream -export declare function never(): Stream; -export declare function later(wait: number, value: T): Stream; -export declare function interval(interval: number, value: T): Stream; -export declare function sequentially(interval: number, values: T[]): Stream; -export declare function fromPoll(interval: number, fn: () => T): Stream; -export declare function withInterval(interval: number, handler: (emitter: Emitter) => void): Stream; -export declare function fromCallback(fn: (callback: (value: T) => void) => void): Stream; -export declare function fromNodeCallback(fn: (callback: (error: S, result: T) => void) => void): Stream; -export declare function fromEvents(target: EventTarget | NodeJS.EventEmitter | { on: Function, off: Function }, eventName: string, transform?: (value: T) => S): Stream; -export declare function stream(subscribe: (emitter: Emitter) => Function | void): Stream; -export declare function fromESObservable(observable: any): Stream +export function never(): Stream; +export function later(wait: number, value: T): Stream; +export function interval(interval: number, value: T): Stream; +export function sequentially(interval: number, values: T[]): Stream; +export function fromPoll(interval: number, fn: () => T): Stream; +export function withInterval(interval: number, handler: (emitter: Emitter) => void): Stream; +export function fromCallback(fn: (callback: (value: T) => void) => void): Stream; +export function fromNodeCallback(fn: (callback: (error: S, result: T) => void) => void): Stream; +export function fromEvents(target: EventTarget | NodeJS.EventEmitter | { on: Function, off: Function }, eventName: string, transform?: (value: T) => S): Stream; +export function stream(subscribe: (emitter: Emitter) => Function | void): Stream; +export function fromESObservable(observable: any): Stream // Create a property -export declare function constant(value: T): Property; -export declare function constantError(error: T): Property; -export declare function fromPromise(promise: Promise): Property; +export function constant(value: T): Property; +export function constantError(error: T): Property; +export function fromPromise(promise: Promise): Property; // Combine observables -export declare function combine(obss: Observable[], passiveObss: Observable[], combinator?: (...values: T[]) => U): Stream; -export declare function combine(obss: Observable[], combinator: (...values: T[]) => U): Stream; -export declare function combine }>(obss: T): Stream<{ [P in keyof T]: ValueOfAnObservable }, any>; -export declare function combine], P extends keyof T>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine, Observable, Observable, Observable, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine, Observable, Observable, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine, Observable, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable], any>; -export declare function combine]>(obss: T): Stream<[ValueOfAnObservable], any>; -export declare function combine(obss: T): Stream; -export declare function zip(obss: Observable[], passiveObss?: Observable[], combinator?: (...values: T[]) => U): Observable; -export declare function merge(obss: Observable[]): Observable; -export declare function concat(obss: Observable[]): Observable; -export declare function pool(): ObservablePool; -export declare function repeat(generator: (i: number) => Observable | boolean): Observable; +export function combine(obss: Observable[], passiveObss: Observable[], combinator?: (...values: T[]) => U): Stream; +export function combine(obss: Observable[], combinator: (...values: T[]) => U): Stream; +export function combine }>(obss: T): Stream<{ [P in keyof T]: ValueOfAnObservable }, any>; +export function combine], P extends keyof T>(obss: T): Stream<[ValueOfAnObservable], any>; +export function combine, Observable, Observable, Observable, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; +export function combine, Observable, Observable, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; +export function combine, Observable, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; +export function combine, Observable, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; +export function combine, Observable, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; +export function combine, Observable, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable, ValueOfAnObservable], any>; +export function combine, Observable]>(obss: T): Stream<[ValueOfAnObservable, ValueOfAnObservable], any>; +export function combine]>(obss: T): Stream<[ValueOfAnObservable], any>; +export function combine(obss: T): Stream; +export function combine], P extends [Observable], K>(obss: T, obssP: P, combinator: (a: T[0][''], b: P[0]['']) => K): Observable; +export function zip(obss: Observable[], passiveObss?: Observable[], combinator?: (...values: T[]) => U): Observable; +export function merge(obss: Observable[]): Observable; +export function concat(obss: Observable[]): Observable; +export function pool(): Pool; +export function repeat(generator: (i: number) => Observable | boolean): Observable; + +export var staticLand: { + Observable: { + ap(obsF: Observable<(x: A) => B, E1>, obsV: Observable): Observable; + bimap(fnE: (x: E1) => E2, fnV: (x: V1) => V2, obs: Observable): Observable; + chain(cb: (value: V) => Observable, s: Observable): Observable; + concat(obs1: Observable, obs2: Observable): Observable; + empty(): Observable; + map(cb: (value: V) => V2, s: Observable): Observable; + of(value: V): Observable; + } +} + +declare var kefir: { + Observable: typeof Observable; + Pool: typeof Pool; + Stream: typeof Stream; + Property: typeof Property; + + never: typeof never, + later: typeof later, + interval: typeof interval, + sequentially: typeof sequentially, + fromPoll: typeof fromPoll, + withInterval: typeof withInterval, + fromCallback: typeof fromCallback, + fromNodeCallback: typeof fromNodeCallback, + fromEvents: typeof fromEvents, + stream: typeof stream, + fromESObservable: typeof fromESObservable, + constant: typeof constant, + constantError: typeof constantError, + fromPromise: typeof fromPromise, + combine: typeof combine, + zip: typeof zip, + merge: typeof merge, + concat: typeof concat, + pool: typeof pool, + repeat: typeof repeat, + + staticLand: typeof staticLand +}; + +export default kefir; diff --git a/types/kefir/kefir-tests.ts b/types/kefir/kefir-tests.ts index d2dbd5835e..0fba9c5d21 100644 --- a/types/kefir/kefir-tests.ts +++ b/types/kefir/kefir-tests.ts @@ -1,6 +1,6 @@ import * as Kefir from 'kefir'; -import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'kefir'; +import { Observable, Pool, Stream, Property, Event, Emitter } from 'kefir'; //Create a stream { @@ -130,7 +130,7 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke var myTransducer: any; let observable28: Stream = Kefir.sequentially(100, [1, 2, 3, 4, 5, 6]).transduce(myTransducer); } - let observable28: Stream = Kefir.sequentially(100, [0, 1, 2, 3]).withHandler((emitter: Emitter, event: Event) => { + let observable28: Stream = Kefir.sequentially(100, [0, 1, 2, 3]).withHandler((emitter: Emitter, event: Event) => { if (event.type === 'end') { emitter.emit('bye'); emitter.end(); @@ -141,6 +141,9 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke } } }); + type First = 'first'; + type Second = 'second'; + let observable32: Stream = Kefir.sequentially(100, ['first', 'second']).filter((value): value is First => value === 'first'); } // Combine observables @@ -177,7 +180,7 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke let a: Stream = Kefir.sequentially(100, [0, 1, 2]); let b: Stream = Kefir.sequentially(100, [0, 1, 2]).delay(30); let c: Observable = Kefir.sequentially(100, [0, 1, 2]).delay(60); - let pool: ObservablePool = Kefir.pool(); + let pool: Pool = Kefir.pool(); pool.plug(a); pool.plug(b); pool.plug(c); @@ -207,7 +210,7 @@ import { Observable, ObservablePool, Stream, Property, Event, Emitter } from 'ke { let a: Property = Kefir.sequentially(200, [2, 3]).toProperty(() => 1); let b: Stream = Kefir.interval(100, 0).delay(40).take(5); - let observable02: Property = a.sampledBy(b) + let observable02: Property = a.sampledBy(b) } { let foo: Stream = Kefir.sequentially(100, [1, 2, 3, 4]); diff --git a/types/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts index 819e28404d..7ea79365ee 100644 --- a/types/kendo-ui/index.d.ts +++ b/types/kendo-ui/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Kendo UI Professional v2018.3.911 +// Type definitions for Kendo UI Professional v2019.1.115 // Project: http://www.telerik.com/kendo-ui // Definitions by: Telerik // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,7 +8,7 @@ /* * Please, submit Pull Requests in the telerik/kendo-ui-core repo at * https://github.com/telerik/kendo-ui-core/tree/master/typescript - * + * * See contributor instructions at * https://github.com/telerik/kendo-ui-core#how-to-contribute */ @@ -919,14 +919,13 @@ declare namespace kendo.data { } interface DataSourceTransport { - create?: DataSourceTransportCreate | ((options: DataSourceTransportOptions) => void); - destroy?: DataSourceTransportDestroy | ((options: DataSourceTransportOptions) => void); + create?: string | DataSourceTransportCreate | ((options: DataSourceTransportOptions) => void); + destroy?: string | DataSourceTransportDestroy | ((options: DataSourceTransportOptions) => void); push?: Function; submit?: Function; - read?: DataSourceTransportRead | ((options: DataSourceTransportOptions) => void); + read?: string | DataSourceTransportRead | ((options: DataSourceTransportOptions) => void); signalr?: DataSourceTransportSignalr | ((options: DataSourceTransportOptions) => void); - update?: DataSourceTransportUpdate | ((options: DataSourceTransportOptions) => void); - + update?: string | DataSourceTransportUpdate | ((options: DataSourceTransportOptions) => void); parameterMap?(data: DataSourceTransportParameterMapData, type: string): any; } @@ -1039,7 +1038,7 @@ declare namespace kendo.data { max?: any; minLength?: any; maxLength?: any; - [rule: string]: any; + [rule: string]: any; } class ObservableArray extends Observable { @@ -1124,6 +1123,7 @@ declare namespace kendo.data { query(options?: any): JQueryPromise; read(data?: any): JQueryPromise; remove(model: kendo.data.ObservableObject): void; + skip(): number; sort(sort: DataSourceSortItem): void; sort(sort: DataSourceSortItem[]): void; sort(): DataSourceSortItem[]; @@ -1301,7 +1301,7 @@ declare namespace kendo.data { type?: string; change? (e: DataSourceChangeEvent): void; error?(e: DataSourceErrorEvent): void; - push?(e: DataSourcePushEvent): void; + push?(e: DataSourcePushEvent): void; sync?(e: DataSourceEvent): void; requestStart?(e: DataSourceRequestStartEvent): void; requestEnd?(e: DataSourceRequestEndEvent): void; @@ -1331,9 +1331,9 @@ declare namespace kendo.data { node?: any; } - interface DataSourcePushEvent extends DataSourceEvent { + interface DataSourcePushEvent extends DataSourceEvent { items?: DataSourceItemOrGroup[]; - type?: string; + type?: string; } @@ -1550,7 +1550,7 @@ declare namespace kendo.mobile { statusBarStyle?: string; transition?: string; useNativeScrolling?: boolean; - init?(e: ApplicationEvent): void; + init?(e: ApplicationEvent): void; } interface ApplicationEvent { @@ -1819,6 +1819,7 @@ declare namespace kendo.ui { enable(enable: boolean): void; select(li: JQuery): void; select(li: number): void; + selectedIndices: Array; } @@ -2583,6 +2584,89 @@ declare namespace kendo.ui { interface DatePickerOpenEvent extends DatePickerEvent { } + class DateRangePicker extends kendo.ui.Widget { + + static fn: DateRangePicker; + + options: DateRangePickerOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): DateRangePicker; + + constructor(element: Element, options?: DateRangePickerOptions); + + + close(): void; + destroy(): void; + enable(enable: boolean): void; + readonly(readonly: boolean): void; + max(): Date; + max(value: Date): void; + max(value: string): void; + min(): Date; + min(value: Date): void; + min(value: string): void; + open(): void; + range(): any; + range(range: DateRangePickerRange): void; + setOptions(options: any): void; + + } + + interface DateRangePickerMessages { + startLabel?: string; + endLabel?: string; + } + + interface DateRangePickerMonth { + content?: string; + weekNumber?: string; + empty?: string; + } + + interface DateRangePickerRange { + start?: Date; + end?: Date; + } + + interface DateRangePickerOptions { + name?: string; + ARIATemplate?: string; + culture?: string; + dates?: any; + depth?: string; + disableDates?: any|Function; + footer?: string|Function; + format?: string; + max?: Date; + messages?: DateRangePickerMessages; + min?: Date; + month?: DateRangePickerMonth; + labels?: boolean; + weekNumber?: boolean; + range?: DateRangePickerRange; + start?: string; + change?(e: DateRangePickerChangeEvent): void; + close?(e: DateRangePickerCloseEvent): void; + open?(e: DateRangePickerOpenEvent): void; + } + interface DateRangePickerEvent { + sender: DateRangePicker; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface DateRangePickerChangeEvent extends DateRangePickerEvent { + } + + interface DateRangePickerCloseEvent extends DateRangePickerEvent { + } + + interface DateRangePickerOpenEvent extends DateRangePickerEvent { + } class DateTimePicker extends kendo.ui.Widget { @@ -2734,6 +2818,10 @@ declare namespace kendo.ui { promptInput?: string; } + interface DialogModal { + preventScroll?: string; + } + interface DialogOptions { name?: string; actions?: DialogAction[]; @@ -2747,10 +2835,11 @@ declare namespace kendo.ui { messages?: DialogMessages; minHeight?: number; minWidth?: number; - modal?: boolean; + modal?: boolean | DialogModal; title?: string|boolean; visible?: boolean; width?: number|string; + size?: string; close?(e: DialogCloseEvent): void; hide?(e: DialogEvent): void; initOpen?(e: DialogEvent): void; @@ -3429,6 +3518,7 @@ declare namespace kendo.ui { interface EditorOptions { name?: string; + placeholder?: string; deserialization?: EditorDeserialization; domain?: string; encoded?: boolean; @@ -4104,6 +4194,11 @@ declare namespace kendo.ui { ui?: string|Function; } + interface GridColumnGroupable { + compare?: Function; + dir?: string; + } + interface GridColumnSortable { allowUnsort?: boolean; compare?: Function; @@ -4122,7 +4217,7 @@ declare namespace kendo.ui { footerAttributes?: any; footerTemplate?: string|Function; format?: string; - groupable?: boolean; + groupable?: boolean | GridColumnGroupable; groupHeaderColumnTemplate?: string|Function; groupHeaderTemplate?: string|Function; groupFooterTemplate?: string|Function; @@ -4245,6 +4340,8 @@ declare namespace kendo.ui { enabled?: boolean; showFooter?: boolean; messages?: GridGroupableMessages; + compare?: Function; + dir?: string; } interface GridMessagesCommands { @@ -4370,7 +4467,7 @@ declare namespace kendo.ui { scrollable?: boolean | GridScrollable; selectable?: boolean|string; sortable?: boolean | GridSortable; - toolbar?: GridToolbarItem[]; + toolbar?: (string|GridToolbarItem)[]; beforeEdit?(e: GridBeforeEditEvent): void; cancel?(e: GridCancelEvent): void; cellClose?(e: GridCellCloseEvent): void; @@ -4404,6 +4501,7 @@ declare namespace kendo.ui { saveChanges?(e: GridSaveChangesEvent): void; sort?(e: GridSortEvent): void; } + interface GridEvent { sender: Grid; preventDefault: Function; @@ -5291,6 +5389,89 @@ declare namespace kendo.ui { item?: JQuery; } + class MultiViewCalendar extends kendo.ui.Widget { + + static fn: MultiViewCalendar; + + options: MultiViewCalendarOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): MultiViewCalendar; + + constructor(element: Element, options?: MultiViewCalendarOptions); + + + current(): Date; + destroy(): void; + max(): Date; + max(value: Date): void; + max(value: string): void; + min(): Date; + min(value: Date): void; + min(value: string): void; + navigate(value: Date, view: string): void; + navigateDown(value: Date): void; + navigateToFuture(): void; + navigateToPast(): void; + navigateUp(): void; + selectDates(): any; + selectDates(dates: any): void; + selectRange(): any; + selectRange(range: any): void; + value(): Date; + value(value: Date): void; + value(value: string): void; + view(): any; + + } + + interface MultiViewCalendarMessages { + weekColumnHeader?: string; + } + + interface MultiViewCalendarMonth { + content?: string; + weekNumber?: string; + empty?: string; + } + + interface MultiViewCalendarRange { + start?: Date; + end?: Date; + } + + interface MultiViewCalendarOptions { + name?: string; + culture?: string; + dates?: any; + depth?: string; + disableDates?: any|Function; + footer?: string|Function; + format?: string; + max?: Date; + messages?: MultiViewCalendarMessages; + min?: Date; + month?: MultiViewCalendarMonth; + views?: number; + range?: MultiViewCalendarRange; + selectable?: string; + selectDates?: any; + showViewHeader?: boolean; + weekNumber?: boolean; + start?: string; + value?: Date; + change?(e: MultiViewCalendarEvent): void; + navigate?(e: MultiViewCalendarEvent): void; + } + + interface MultiViewCalendarEvent { + sender: MultiViewCalendar; + preventDefault: Function; + isDefaultPrevented(): boolean; + } class Notification extends kendo.ui.Widget { @@ -6581,6 +6762,65 @@ declare namespace kendo.ui { event?: kendo.data.SchedulerEvent; } + class ScrollView extends kendo.ui.Widget { + + static fn: ScrollView; + + options: ScrollViewOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ScrollView; + + constructor(element: Element, options?: ScrollViewOptions); + + + content(content: string): void; + content(content: JQuery): void; + destroy(): void; + next(): void; + prev(): void; + refresh(): void; + scrollTo(page: number, instant: boolean): void; + setDataSource(dataSource: kendo.data.DataSource): void; + + } + + interface ScrollViewOptions { + name?: string; + autoBind?: boolean; + bounceVelocityThreshold?: number; + contentHeight?: number|string; + dataSource?: kendo.data.DataSource|any; + duration?: number; + emptyTemplate?: string; + enablePager?: boolean; + page?: number; + template?: string; + velocityThreshold?: number; + change?(e: ScrollViewChangeEvent): void; + refresh?(e: ScrollViewRefreshEvent): void; + } + interface ScrollViewEvent { + sender: ScrollView; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ScrollViewChangeEvent extends ScrollViewEvent { + currentPage?: number; + nextPage?: number; + element?: JQuery; + data?: any; + } + + interface ScrollViewRefreshEvent extends ScrollViewEvent { + pageCount?: number; + page?: number; + } class Slider extends kendo.ui.Widget { @@ -7180,6 +7420,52 @@ declare namespace kendo.ui { } + class Switch extends kendo.ui.Widget { + + static fn: Switch; + + options: SwitchOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Switch; + + constructor(element: Element, options?: SwitchOptions); + + check(): boolean; + check(check: boolean): void; + destroy(): void; + enable(enable: boolean): void; + toggle(): void; + setOptions(options: any): void; + } + + interface SwitchOptions { + name?: string; + checked?: boolean; + enabled?: boolean; + readonly?: boolean; + width?: number|string; + change?(e: SwitchChangeEvent): void; + } + + interface SwitchMessages { + checked?: string; + unchecked?: string; + } + + interface SwitchEvent { + sender: Switch; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SwitchChangeEvent extends SwitchEvent { + checked?: any; + } + class TabStrip extends kendo.ui.Widget { static fn: TabStrip; @@ -8652,6 +8938,10 @@ declare namespace kendo.ui { left?: number|string; } + interface WindowModal { + preventScroll?: boolean; + } + interface WindowRefreshOptions { url?: string; cache?: boolean; @@ -8661,6 +8951,12 @@ declare namespace kendo.ui { iframe?: boolean; } + interface WindowDraggable { + containment?: any|string; + dragHandle?: any|string; + axis?: string; + } + interface WindowOptions { name?: string; actions?: any; @@ -8668,14 +8964,14 @@ declare namespace kendo.ui { appendTo?: any|string; autoFocus?: boolean; content?: string | WindowContent; - draggable?: boolean; + draggable?: boolean | WindowDraggable; iframe?: boolean; height?: number|string; maxHeight?: number; maxWidth?: number; minHeight?: number; minWidth?: number; - modal?: boolean; + modal?: boolean | WindowModal; pinned?: boolean; position?: WindowPosition; resizable?: boolean; @@ -8683,6 +8979,7 @@ declare namespace kendo.ui { title?: string|boolean; visible?: boolean; width?: number|string; + size?: string; activate?(e: WindowEvent): void; close?(e: WindowCloseEvent): void; deactivate?(e: WindowEvent): void; @@ -9350,16 +9647,15 @@ declare namespace kendo.drawing { class Surface extends kendo.Observable { - - options: SurfaceOptions; - constructor(options?: SurfaceOptions); static create(element: JQuery, options?: any): kendo.drawing.Surface; static create(element: Element, options?: any): kendo.drawing.Surface; + element: JQuery; + clear(): void; draw(element: kendo.drawing.Element): void; eventTarget(e: any): kendo.drawing.Element; @@ -18436,6 +18732,10 @@ declare namespace kendo { namespace date { + var MS_PER_DAY: number; + var MS_PER_HOUR: number; + var MS_PER_MINUTE: number; + function setDayOfWeek(targetDate: Date, dayOfWeek: number, direction: number): void; function dayOfWeek(targetDate: Date, dayOfWeek: number, direction: number): Date; function weekInYear(date: Date, weekStart?: number): number; @@ -18453,7 +18753,7 @@ declare namespace kendo { function toInvariantTime(targetDate: Date): Date; function firstDayOfMonth(targetDate: Date): Date; function lastDayOfMonth(targetDate: Date): Date; - function getMilliseconds(targetDate: Date): Date; + function getMilliseconds(targetDate: Date): number; } namespace drawing { @@ -20495,16 +20795,15 @@ declare namespace kendo.dataviz.drawing { class Surface extends kendo.Observable { - - options: SurfaceOptions; - constructor(options?: SurfaceOptions); static create(element: JQuery, options?: any): kendo.drawing.Surface; static create(element: Element, options?: any): kendo.drawing.Surface; + element: JQuery; + clear(): void; draw(element: kendo.drawing.Element): void; eventTarget(e: any): kendo.drawing.Element; @@ -20936,15 +21235,6 @@ interface JQueryPromise { interface JQuery { - kendoDraggable(): JQuery; - kendoDraggable(options: kendo.ui.DraggableOptions): JQuery; - - kendoDropTarget(): JQuery; - kendoDropTarget(options: kendo.ui.DropTargetOptions): JQuery; - - kendoDropTargetArea(): JQuery; - kendoDropTargetArea(options: kendo.ui.DropTargetAreaOptions): JQuery; - data(key: any): any; kendoAlert(): JQuery; @@ -21011,6 +21301,10 @@ interface JQuery { kendoDatePicker(options: kendo.ui.DatePickerOptions): JQuery; data(key: "kendoDatePicker"): kendo.ui.DatePicker; + kendoDateRangePicker(): JQuery; + kendoDateRangePicker(options: kendo.ui.DateRangePickerOptions): JQuery; + data(key: "kendoDateRangePicker"): kendo.ui.DateRangePicker; + kendoDateTimePicker(): JQuery; kendoDateTimePicker(options: kendo.ui.DateTimePickerOptions): JQuery; data(key: "kendoDateTimePicker"): kendo.ui.DateTimePicker; @@ -21023,6 +21317,10 @@ interface JQuery { kendoDialog(options: kendo.ui.DialogOptions): JQuery; data(key: "kendoDialog"): kendo.ui.Dialog; + kendoDraggable(): JQuery; + kendoDraggable(options: kendo.ui.DraggableOptions): JQuery; + data(key: "kendoDraggable"): kendo.ui.Draggable; + kendoDropDownList(): JQuery; kendoDropDownList(options: kendo.ui.DropDownListOptions): JQuery; data(key: "kendoDropDownList"): kendo.ui.DropDownList; @@ -21031,6 +21329,14 @@ interface JQuery { kendoDropDownTree(options: kendo.ui.DropDownTreeOptions): JQuery; data(key: "kendoDropDownTree"): kendo.ui.DropDownTree; + kendoDropTarget(): JQuery; + kendoDropTarget(options: kendo.ui.DropTargetOptions): JQuery; + data(key: "kendoDropTarget"): kendo.ui.DropTarget; + + kendoDropTargetArea(): JQuery; + kendoDropTargetArea(options: kendo.ui.DropTargetAreaOptions): JQuery; + data(key: "kendoDropTargetArea"): kendo.ui.DropTargetArea; + kendoEditor(): JQuery; kendoEditor(options: kendo.ui.EditorOptions): JQuery; data(key: "kendoEditor"): kendo.ui.Editor; @@ -21167,6 +21473,10 @@ interface JQuery { kendoMultiSelect(options: kendo.ui.MultiSelectOptions): JQuery; data(key: "kendoMultiSelect"): kendo.ui.MultiSelect; + kendoMultiViewCalendar(): JQuery; + kendoMultiViewCalendar(options: kendo.ui.MultiViewCalendarOptions): JQuery; + data(key: "kendoMultiViewCalendar"): kendo.ui.MultiViewCalendar; + kendoNotification(): JQuery; kendoNotification(options: kendo.ui.NotificationOptions): JQuery; data(key: "kendoNotification"): kendo.ui.Notification; @@ -21223,6 +21533,10 @@ interface JQuery { kendoScheduler(options: kendo.ui.SchedulerOptions): JQuery; data(key: "kendoScheduler"): kendo.ui.Scheduler; + kendoScrollView(): JQuery; + kendoScrollView(options: kendo.ui.ScrollViewOptions): JQuery; + data(key: "kendoScrollView"): kendo.ui.ScrollView; + kendoSlider(): JQuery; kendoSlider(options: kendo.ui.SliderOptions): JQuery; data(key: "kendoSlider"): kendo.ui.Slider; @@ -21247,6 +21561,10 @@ interface JQuery { kendoStockChart(options: kendo.dataviz.ui.StockChartOptions): JQuery; data(key: "kendoStockChart"): kendo.dataviz.ui.StockChart; + kendoSwitch(): JQuery; + kendoSwitch(options: kendo.ui.SwitchOptions): JQuery; + data(key: "kendoSwitch"): kendo.ui.Switch; + kendoTabStrip(): JQuery; kendoTabStrip(options: kendo.ui.TabStripOptions): JQuery; data(key: "kendoTabStrip"): kendo.ui.TabStrip; diff --git a/types/keyboardjs/index.d.ts b/types/keyboardjs/index.d.ts index 037bf7189b..c97cda0741 100644 --- a/types/keyboardjs/index.d.ts +++ b/types/keyboardjs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for KeyboardJS v2.4.1 +// Type definitions for KeyboardJS v2.4.2 // Project: https://github.com/RobertWHurst/KeyboardJS // Definitions by: Vincent Bortone , // David Asmuth , @@ -92,14 +92,16 @@ declare namespace keyboardjs { /** * Triggers a key press. Stays in pressed state until released. - * @param keyCombo String of keys to be pressed to execute 'pressed' callbacks. + * @param keyCombo String of keys or keyCode to be pressed to execute 'pressed' callbacks. + * @param event The KeyEvent, can be null. */ - export function pressKey(keyCombo: string): void + export function pressKey(keyCombo: string | number, event?: KeyEvent): void; /** * Triggers a key release. - * @param keyCombo String of keys to be released to execute 'released' callbacks. + * @param keyCombo String of keys or keyCode to be released to execute 'released' callbacks. + * @param event The KeyEvent, can be null. */ - export function releaseKey(keyCombo: string): void; + export function releaseKey(keyCombo: string | number, event?: KeyEvent): void; /** * Releases all keys. */ diff --git a/types/keyv/index.d.ts b/types/keyv/index.d.ts index 69e644c2d9..d3ef77a9a3 100644 --- a/types/keyv/index.d.ts +++ b/types/keyv/index.d.ts @@ -1,49 +1,33 @@ -// Type definitions for keyv 3.0 +// Type definitions for keyv 3.1 // Project: https://github.com/lukechilds/keyv // Definitions by: AryloYeung +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 -/// -interface KeyvOptions { - /** Namespace for the current instance. */ - namespace?: string; - /** A custom serialization function. */ - serialize?: (data: any) => string; - /** A custom deserialization function. */ - deserialize?: (data: string) => any; - /** The connection string URI. */ - uri?: string; - /** The storage adapter instance to be used by Keyv. */ - store?: any; - /** Default TTL. Can be overridden by specififying a TTL on `.set()`. */ - ttl?: number; - /** Specify an adapter to use. e.g `'redis'` or `'mongodb'`. */ - adapter?: string; -} +// TypeScript Version: 2.3 -declare class Keyv extends NodeJS.EventEmitter { +/// + +declare class Keyv extends NodeJS.EventEmitter { /** * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options. */ - constructor(opts?: KeyvOptions); + constructor(opts?: Keyv.Options); /** * @param uri The connection string URI. * * Merged into the options object as options.uri. * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options. */ - constructor(uri?: string, opts?: KeyvOptions); - /** Returns the namespace of a key */ - _getKeyPrefix(key: string): string; + constructor(uri?: string, opts?: Keyv.Options); /** Returns the value. */ - get(key: string): Promise; + get(key: string): Promise; /** * Set a value. * * By default keys are persistent. You can set an expiry TTL in milliseconds. */ - set(key: string, value: any, ttl?: number): (Promise | undefined); + set(key: string, value: TValue, ttl?: number): Promise; /** * Deletes an entry. * @@ -54,4 +38,32 @@ declare class Keyv extends NodeJS.EventEmitter { clear(): Promise; } +declare namespace Keyv { + interface Options { + /** Namespace for the current instance. */ + namespace?: string; + /** A custom serialization function. */ + serialize?: (data: TValue) => string; + /** A custom deserialization function. */ + deserialize?: (data: string) => TValue; + /** The connection string URI. */ + uri?: string; + /** The storage adapter instance to be used by Keyv. */ + store?: Store; + /** Default TTL. Can be overridden by specififying a TTL on `.set()`. */ + ttl?: number; + /** Specify an adapter to use. e.g `'redis'` or `'mongodb'`. */ + adapter?: 'redis' | 'mongodb' | 'mongo' | 'sqlite' | 'postgresql' | 'postgres' | 'mysql'; + + [key: string]: any; + } + + interface Store { + get(key: string): TValue | Promise | undefined; + set(key: string, value: TValue, ttl?: number): any; + delete(key: string): boolean | Promise; + clear(): void | Promise; + } +} + export = Keyv; diff --git a/types/keyv/keyv-tests.ts b/types/keyv/keyv-tests.ts index 7ee4cac90e..d8b0ccd910 100644 --- a/types/keyv/keyv-tests.ts +++ b/types/keyv/keyv-tests.ts @@ -1,11 +1,31 @@ -import Keyv = require("keyv"); +import Keyv = require('keyv'); +import QuickLRU = require('quick-lru'); new Keyv({ uri: 'redis://user:pass@localhost:6379', - namespace: "redis" + namespace: 'redis', }); +new Keyv({ uri: 'redis://user:pass@localhost:6379' }); +new Keyv({ namespace: 'redis' }); +new Keyv({ ttl: 123 }); +new Keyv({ adapter: 'redis' }); +new Keyv({ adapter: 'mongo' }); +new Keyv({ adapter: 'mongodb' }); +new Keyv({ adapter: 'sqlite' }); +new Keyv({ adapter: 'postgres' }); +new Keyv({ adapter: 'postgresql' }); +new Keyv({ adapter: 'mysql' }); +new Keyv({ adapter: 'foo' }); // $ExpectError +new Keyv({ serialize: JSON.stringify }); +new Keyv({ deserialize: JSON.parse }); -new Keyv('mongodb://user:pass@localhost:27017/dbname'); +new Keyv({ store: new Map() }); + +const lru = new QuickLRU({ maxSize: 1000 }); +const opts: Keyv.Options = { store: lru }; +new Keyv(opts); + +new Keyv('mongodb://user:pass@localhost:27017/dbname', { namespace: 'mongodb' }); new Keyv('redis://user:pass@localhost:6379'); new Keyv('sqlite://path/to/database.sqlite'); new Keyv('postgresql://user:pass@localhost:5432/dbname'); @@ -13,13 +33,13 @@ new Keyv('mysql://user:pass@localhost:3306/dbname'); new Keyv(); (async () => { - const keyv = new Keyv(); + const keyv = new Keyv(); keyv.on('error', err => console.log('Connection Error', err)); - await keyv.set('foo', 'expires in 1 second', 1000); // true - await keyv.set('foo', 'never expires'); // true - await keyv.get('foo'); // 'never expires' - await keyv.delete('foo'); // true - await keyv.clear(); // undefined + await keyv.set('foo', 'expires in 1 second', 1000); // $ExpectType true + await keyv.set('foo', 'never expires'); // $ExpectType true + await keyv.get('foo'); // $ExpectType string | undefined + await keyv.delete('foo'); // $ExpectType boolean + await keyv.clear(); // $ExpectType void })(); diff --git a/types/keyv__mongo/index.d.ts b/types/keyv__mongo/index.d.ts new file mode 100644 index 0000000000..f468f3530b --- /dev/null +++ b/types/keyv__mongo/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for @keyv/mongo 1.0 +// Project: https://github.com/lukechilds/keyv-mongo +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import { Store } from 'keyv'; +import { EventEmitter } from 'events'; + +export = KeyvMongo; + +declare class KeyvMongo extends EventEmitter implements Store { + readonly ttlSupport: false; + namespace?: string; + + constructor(uri?: string); + constructor(options?: KeyvMongo.Options); // tslint:disable-line:unified-signatures + + get(key: string): Promise; + set(key: string, value: TValue, ttl?: number): Promise; + delete(key: string): Promise; + clear(): Promise; +} + +declare namespace KeyvMongo { + interface Options { + uri?: string; + url?: string; + collection?: string; + } +} diff --git a/types/keyv__mongo/keyv__mongo-tests.ts b/types/keyv__mongo/keyv__mongo-tests.ts new file mode 100644 index 0000000000..6e8d1ea971 --- /dev/null +++ b/types/keyv__mongo/keyv__mongo-tests.ts @@ -0,0 +1,12 @@ +import Keyv = require('keyv'); +import KeyvMongo = require('@keyv/mongo'); + +new Keyv('mongodb://user:pass@localhost:27017/dbname', { collection: 'cache' }); + +new KeyvMongo({ uri: 'mongodb://user:pass@localhost:27017/dbname' }); +new KeyvMongo({ url: 'mongodb://user:pass@localhost:27017/dbname' }); +new KeyvMongo({ collection: 'cache' }); +new KeyvMongo('mongodb://user:pass@localhost:27017/dbname'); + +const mongo = new KeyvMongo('mongodb://user:pass@localhost:27017/dbname'); +new Keyv({ store: mongo }); diff --git a/types/keyv__mongo/tsconfig.json b/types/keyv__mongo/tsconfig.json new file mode 100644 index 0000000000..ca38c4e787 --- /dev/null +++ b/types/keyv__mongo/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@keyv/mongo": [ + "keyv__mongo" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "keyv__mongo-tests.ts" + ] +} diff --git a/types/keyv__mongo/tslint.json b/types/keyv__mongo/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/keyv__mongo/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/keyv__mysql/index.d.ts b/types/keyv__mysql/index.d.ts new file mode 100644 index 0000000000..4aef9d06e0 --- /dev/null +++ b/types/keyv__mysql/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for @keyv/mysql 1.1 +// Project: https://github.com/lukechilds/keyv-mysql +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import { Store } from 'keyv'; +import { EventEmitter } from 'events'; + +export = KeyvMysql; + +declare class KeyvMysql extends EventEmitter implements Store { + readonly ttlSupport: false; + namespace?: string; + + constructor(uri?: string); + constructor(options?: KeyvMysql.Options); // tslint:disable-line:unified-signatures + + get(key: string): Promise; + set(key: string, value: string | undefined): Promise; + delete(key: string): Promise; + clear(): Promise; +} + +declare namespace KeyvMysql { + interface Options { + uri?: string; + table?: string; + keySize?: number; + } +} diff --git a/types/keyv__mysql/keyv__mysql-tests.ts b/types/keyv__mysql/keyv__mysql-tests.ts new file mode 100644 index 0000000000..5a1947710d --- /dev/null +++ b/types/keyv__mysql/keyv__mysql-tests.ts @@ -0,0 +1,12 @@ +import Keyv = require('keyv'); +import KeyvMysql = require('@keyv/mysql'); + +new Keyv('mysql://user:pass@localhost:3306/dbname', { table: 'cache' }); + +new KeyvMysql('mysql://user:pass@localhost:3306/dbname'); +new KeyvMysql({ uri: 'mysql://user:pass@localhost:3306/dbname' }); +new KeyvMysql({ table: 'cache' }); +new KeyvMysql({ keySize: 100 }); + +const mysql = new KeyvMysql({ uri: 'mysql://user:pass@localhost:3306/dbname' }); +new Keyv({ store: mysql }); diff --git a/types/keyv__mysql/tsconfig.json b/types/keyv__mysql/tsconfig.json new file mode 100644 index 0000000000..e50e632d7c --- /dev/null +++ b/types/keyv__mysql/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@keyv/mysql": [ + "keyv__mysql" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "keyv__mysql-tests.ts" + ] +} diff --git a/types/keyv__mysql/tslint.json b/types/keyv__mysql/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/keyv__mysql/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/keyv__postgres/index.d.ts b/types/keyv__postgres/index.d.ts new file mode 100644 index 0000000000..3431ce748f --- /dev/null +++ b/types/keyv__postgres/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for @keyv/postgres 1.0 +// Project: https://github.com/lukechilds/keyv-postgres +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import { Store } from 'keyv'; +import { EventEmitter } from 'events'; + +export = KeyvPostgres; + +declare class KeyvPostgres extends EventEmitter implements Store { + readonly ttlSupport: false; + namespace?: string; + + constructor(options?: KeyvPostgres.Options); + + get(key: string): Promise; + set(key: string, value: string | undefined): Promise; + delete(key: string): Promise; + clear(): Promise; +} + +declare namespace KeyvPostgres { + interface Options { + uri?: string; + table?: string; + keySize?: number; + } +} diff --git a/types/keyv__postgres/keyv__postgres-tests.ts b/types/keyv__postgres/keyv__postgres-tests.ts new file mode 100644 index 0000000000..1ad3d362d0 --- /dev/null +++ b/types/keyv__postgres/keyv__postgres-tests.ts @@ -0,0 +1,11 @@ +import Keyv = require('keyv'); +import KeyvPostgres = require('@keyv/postgres'); + +new Keyv('postgresql://user:pass@localhost:5432/dbname', { table: 'cache' }); + +new KeyvPostgres({ uri: 'postgresql://user:pass@localhost:5432/dbname' }); +new KeyvPostgres({ table: 'cache' }); +new KeyvPostgres({ keySize: 100 }); + +const postgres = new KeyvPostgres({ uri: 'postgresql://user:pass@localhost:5432/dbname' }); +new Keyv({ store: postgres }); diff --git a/types/keyv__postgres/tsconfig.json b/types/keyv__postgres/tsconfig.json new file mode 100644 index 0000000000..d793c92899 --- /dev/null +++ b/types/keyv__postgres/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@keyv/postgres": [ + "keyv__postgres" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "keyv__postgres-tests.ts" + ] +} diff --git a/types/keyv__postgres/tslint.json b/types/keyv__postgres/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/keyv__postgres/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/keyv__redis/index.d.ts b/types/keyv__redis/index.d.ts new file mode 100644 index 0000000000..bf009906f8 --- /dev/null +++ b/types/keyv__redis/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for @keyv/redis 1.3 +// Project: https://github.com/lukechilds/keyv-redis +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import { Store } from 'keyv'; +import { ClientOpts } from 'redis'; +import { EventEmitter } from 'events'; + +export = KeyvRedis; + +declare class KeyvRedis extends EventEmitter implements Store { + readonly ttlSupport: true; + namespace?: string; + + constructor(options?: KeyvRedis.Options); + constructor(uri: string, options?: KeyvRedis.Options); + + get(key: string): Promise; + set(key: string, value: string | undefined, ttl?: number): Promise; + delete(key: string): Promise; + clear(): Promise; +} + +declare namespace KeyvRedis { + interface Options extends ClientOpts { + uri?: string; + } +} diff --git a/types/keyv__redis/keyv__redis-tests.ts b/types/keyv__redis/keyv__redis-tests.ts new file mode 100644 index 0000000000..3f0187fd38 --- /dev/null +++ b/types/keyv__redis/keyv__redis-tests.ts @@ -0,0 +1,13 @@ +import Keyv = require('keyv'); +import KeyvRedis = require('@keyv/redis'); + +new Keyv('redis://user:pass@localhost:6379', { max_attempts: 1 }); + +new KeyvRedis({ uri: 'redis://user:pass@localhost:6379' }); +new KeyvRedis('redis://user:pass@localhost:6379', { max_attempts: 1 }); +new KeyvRedis('redis://user:pass@localhost:6379', { + uri: 'redis://user:pass@localhost:6379', + max_attempts: 1, +}); +const redis = new KeyvRedis('redis://user:pass@localhost:6379'); +new Keyv({ store: redis }); diff --git a/types/keyv__redis/tsconfig.json b/types/keyv__redis/tsconfig.json new file mode 100644 index 0000000000..bbd87dfade --- /dev/null +++ b/types/keyv__redis/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@keyv/redis": [ + "keyv__redis" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "keyv__redis-tests.ts" + ] +} diff --git a/types/keyv__redis/tslint.json b/types/keyv__redis/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/keyv__redis/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/keyv__sqlite/index.d.ts b/types/keyv__sqlite/index.d.ts new file mode 100644 index 0000000000..3a59e7b2b7 --- /dev/null +++ b/types/keyv__sqlite/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for @keyv/sqlite 2.0 +// Project: https://github.com/lukechilds/keyv-sqlite +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import { Store } from 'keyv'; +import { EventEmitter } from 'events'; + +export = KeyvSqlite; + +declare class KeyvSqlite extends EventEmitter implements Store { + readonly ttlSupport: false; + namespace?: string; + + constructor(options?: KeyvSqlite.Options); + + get(key: string): Promise; + set(key: string, value: string | undefined): Promise; + delete(key: string): Promise; + clear(): Promise; +} + +declare namespace KeyvSqlite { + interface Options { + uri?: string; + busyTimeout?: number; + table?: string; + keySize?: number; + } +} diff --git a/types/keyv__sqlite/keyv__sqlite-tests.ts b/types/keyv__sqlite/keyv__sqlite-tests.ts new file mode 100644 index 0000000000..e109dbf4a1 --- /dev/null +++ b/types/keyv__sqlite/keyv__sqlite-tests.ts @@ -0,0 +1,12 @@ +import Keyv = require('keyv'); +import KeyvSqlite = require('@keyv/sqlite'); + +new Keyv('sqlite://path/to/database.sqlite', { table: 'cache' }); + +new KeyvSqlite({ uri: 'sqlite://path/to/database.sqlite' }); +new KeyvSqlite({ busyTimeout: 10000 }); +new KeyvSqlite({ table: 'cache' }); +new KeyvSqlite({ keySize: 100 }); + +const sqlite = new KeyvSqlite({ uri: 'sqlite://path/to/database.sqlite' }); +new Keyv({ store: sqlite }); diff --git a/types/keyv__sqlite/tsconfig.json b/types/keyv__sqlite/tsconfig.json new file mode 100644 index 0000000000..5546f7acef --- /dev/null +++ b/types/keyv__sqlite/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@keyv/sqlite": [ + "keyv__sqlite" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "keyv__sqlite-tests.ts" + ] +} diff --git a/types/keyv__sqlite/tslint.json b/types/keyv__sqlite/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/keyv__sqlite/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/klaw-sync/index.d.ts b/types/klaw-sync/index.d.ts index 78ca30b2ff..707bdf094f 100644 --- a/types/klaw-sync/index.d.ts +++ b/types/klaw-sync/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for klaw-sync 5.0 +// Type definitions for klaw-sync 6.0 // Project: https://github.com/manidlou/node-klaw-sync // Definitions by: Brendan Forster // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -53,6 +53,17 @@ declare namespace klawSync { * @since v2.0.0 */ filter?: Filter + + /** + * @description traverse all subdirectories, regardless of `filter` option. + * + * When set to true, traverseAll produces similar behavior to the default + * behavior prior to `v4.0.0`. The current default of `traverseAll: false` + * is equivalent to the old `noRecurseOnFailedFilter: true`). + * + * @since v6.0.0 + */ + traverseAll?: boolean } } diff --git a/types/klaw-sync/klaw-sync-tests.ts b/types/klaw-sync/klaw-sync-tests.ts index 41719734bf..1a5729ed7e 100644 --- a/types/klaw-sync/klaw-sync-tests.ts +++ b/types/klaw-sync/klaw-sync-tests.ts @@ -18,7 +18,8 @@ const options: klawSync.Options = { return item.path.indexOf('node_modules') < 0 }, depthLimit: 5, - fs + fs, + traverseAll: true } klawSync('/some/dir', options).forEach(outputMessage) diff --git a/types/knockout/index.d.ts b/types/knockout/index.d.ts index e6d180c2c4..8bf99b79db 100644 --- a/types/knockout/index.d.ts +++ b/types/knockout/index.d.ts @@ -48,7 +48,7 @@ interface KnockoutObservableArrayFunctions extends KnockoutReadonlyObservable * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. * @param start The zero-based location in the array from which to start removing elements. * @param deleteCount The number of elements to remove. - * @param ...items Elements to insert into the array in place of the deleted elements. + * @param items Elements to insert into the array in place of the deleted elements. */ splice(start: number, deleteCount: number, ...items: T[]): T[]; /** @@ -57,7 +57,7 @@ interface KnockoutObservableArrayFunctions extends KnockoutReadonlyObservable pop(): T; /** * Adds a new item to the end of array. - * @param ...items Items to be added + * @param items Items to be added */ push(...items: T[]): void; /** @@ -66,7 +66,7 @@ interface KnockoutObservableArrayFunctions extends KnockoutReadonlyObservable shift(): T; /** * Inserts a new item at the beginning of the array. - * @param ...items Items to be added + * @param items Items to be added */ unshift(...items: T[]): number; /** @@ -96,7 +96,7 @@ interface KnockoutObservableArrayFunctions extends KnockoutReadonlyObservable */ remove(item: T): T[]; /** - * Removes all values and returns them as an array. + * Removes all values and returns them as an array. * @param removeFunction A function used to determine true if item should be removed and fasle otherwise */ remove(removeFunction: (item: T) => boolean): T[]; @@ -139,24 +139,70 @@ interface KnockoutSubscribableStatic { } interface KnockoutSubscription { + /** + * Terminates a subscription + */ dispose(): void; } interface KnockoutSubscribable extends KnockoutSubscribableFunctions { - subscribe(callback: (newValue: T) => void, target: any, event: "beforeChange"): KnockoutSubscription; + /** + * Registers to be notified after the observable's value changes + * @param callback Function that is called whenever the notification happens + * @param target Defines the value of 'this' in the callback function + * @param event The name of the event to receive notification for + */ subscribe(callback: (newValue: T) => void, target?: any, event?: "change"): KnockoutSubscription; + /** + * Registers to be notified before the observable's value changes + * @param callback Function that is called whenever the notification happens + * @param target Defines the value of 'this' in the callback function + * @param event The name of the event to receive notification for + */ + subscribe(callback: (newValue: T) => void, target: any, event: "beforeChange"): KnockoutSubscription; + /** + * Registers to be notified when the observable's value changes + * @param callback Function that is called whenever the notification happens + * @param target Defines the value of 'this' in the callback function + * @param event The name of the event to receive notification for + */ subscribe(callback: (newValue: TEvent) => void, target: any, event: string): KnockoutSubscription; - + /** + * Customizes observables basic functionality + * @param requestedExtenders Name of the extender feature and its value, e.g. { notify: 'always' }, { rateLimit: 50 } + */ extend(requestedExtenders: { [key: string]: any; }): KnockoutSubscribable; + /** + * Gets total number of subscribers + */ getSubscriptionsCount(): number; + /** + * Gets number of subscribers of a particular event + * @param event Event name + */ + getSubscriptionsCount(event: string): number; } interface KnockoutComputedStatic { fn: KnockoutComputedFunctions; + /** + * Creates computed observable + */ (): KnockoutComputed; - (func: () => T, context?: any, options?: any): KnockoutComputed; - (def: KnockoutComputedDefine, context?: any): KnockoutComputed; + /** + * Creates computed observable + * @param evaluatorFunction Function that computes the observable value + * @param context Defines the value of 'this' when evaluating the computed observable + * @param options An object with further properties for the computed observable + */ + (evaluatorFunction: () => T, context?: any, options?: KnockoutComputedOptions): KnockoutComputed; + /** + * Creates computed observable + * @param options An object that defines the computed observable options and behavior + * @param context Defines the value of 'this' when evaluating the computed observable + */ + (options: KnockoutComputedDefine, context?: any): KnockoutComputed; } interface KnockoutReadonlyComputed extends KnockoutReadonlyObservable { @@ -167,11 +213,24 @@ interface KnockoutReadonlyComputed extends KnockoutReadonlyObservable { interface KnockoutComputed extends KnockoutReadonlyComputed, KnockoutObservable, KnockoutComputedFunctions { fn: KnockoutComputedFunctions; - // It's possible for a to be undefined, since the equalityComparer is run on the initial - // computation with undefined as the first argument. This is user-relevant for deferred computeds. - equalityComparer(a: T | undefined, b: T): boolean; - + /** + * Manually disposes the computed observable, clearing all subscriptions to dependencies. + * This function is useful if you want to stop a computed observable from being updated or want to clean up memory for a + * computed observable that has dependencies on observables that won’t be cleaned. + */ dispose(): void; + /** + * Returns whether the computed observable may be updated in the future. A computed observable is inactive if it has no dependencies. + */ + isActive(): boolean; + /** + * Returns the current number of dependencies of the computed observable. + */ + getDependenciesCount(): number; + /** + * Customizes observables basic functionality + * @param requestedExtenders Name of the extender feature and it's value, e.g. { notify: 'always' }, { rateLimit: 50 } + */ extend(requestedExtenders: { [key: string]: any; }): KnockoutComputed; } @@ -222,6 +281,10 @@ interface KnockoutObservableStatic { interface KnockoutReadonlyObservable extends KnockoutSubscribable, KnockoutObservableFunctions { (): T; + + /** + * Returns the current value of the computed observable without creating a dependency + */ peek(): T; valueHasMutated?: { (): void; }; valueWillMutate?: { (): void; }; @@ -234,16 +297,45 @@ interface KnockoutObservable extends KnockoutReadonlyObservable { extend(requestedExtenders: { [key: string]: any; }): KnockoutObservable; } -interface KnockoutComputedDefine { - read(): T; +interface KnockoutComputedOptions { + /** + * Makes the computed observable writable. This is a function that receives values that other code is trying to write to your computed observable. + * It’s up to you to supply custom logic to handle the incoming values, typically by writing the values to some underlying observable(s). + * @param value + */ write?(value: T): void; + /** + * Disposal of the computed observable will be triggered when the specified DOM node is removed by KO. + * This feature is used to dispose computed observables used in bindings when nodes are removed by the template and control-flow bindings. + */ disposeWhenNodeIsRemoved?: Node; + /** + * This function is executed before each re-evaluation to determine if the computed observable should be disposed. + * A true-ish result will trigger disposal of the computed observable. + */ disposeWhen?(): boolean; + /** + * Defines the value of 'this' whenever KO invokes your 'read' or 'write' callbacks. + */ owner?: any; + /** + * If true, then the value of the computed observable will not be evaluated until something actually attempts to access its value or manually subscribes to it. + * By default, a computed observable has its value determined immediately during creation. + */ deferEvaluation?: boolean; + /** + * If true, the computed observable will be set up as a purecomputed observable. This option is an alternative to the ko.pureComputed constructor. + */ pure?: boolean; } +interface KnockoutComputedDefine extends KnockoutComputedOptions { + /** + * A function that is used to evaluate the computed observable’s current value. + */ + read(): T; +} + interface KnockoutBindingContext { $parent: any; $parents: any[]; @@ -491,7 +583,7 @@ interface KnockoutTemplateSources { // nativeTemplateEngine.js ////////////////////////////////// -interface KnockoutNativeTemplateEngine { +interface KnockoutNativeTemplateEngine extends KnockoutTemplateEngine { renderTemplateSource(templateSource: Object, bindingContext?: KnockoutBindingContext, options?: Object): any[]; } @@ -500,7 +592,7 @@ interface KnockoutNativeTemplateEngine { // templateEngine.js ////////////////////////////////// -interface KnockoutTemplateEngine extends KnockoutNativeTemplateEngine { +interface KnockoutTemplateEngine { createJavaScriptEvaluatorBlock(script: string): string; @@ -547,7 +639,17 @@ interface KnockoutStatic { observable: KnockoutObservableStatic; computed: KnockoutComputedStatic; + /** + * Creates a pure computed observable + * @param evaluatorFunction Function that computes the observable value + * @param context Defines the value of 'this' when evaluating the computed observable + */ pureComputed(evaluatorFunction: () => T, context?: any): KnockoutComputed; + /** + * Creates a pure computed observable + * @param options An object that defines the computed observable options and behavior + * @param context Defines the value of 'this' when evaluating the computed observable + */ pureComputed(options: KnockoutComputedDefine, context?: any): KnockoutComputed; observableArray: KnockoutObservableArrayStatic; @@ -557,14 +659,35 @@ interface KnockoutStatic { toJSON(viewModel: any, replacer?: Function, space?: any): string; toJS(viewModel: any): any; - + /** + * Determine if argument is an observable. Returns true for observables, observable arrays, and all computed observables. + * @param instance Object to be checked + */ isObservable(instance: any): instance is KnockoutObservable; + /** + * Determine if argument is an observable. Returns true for observables, observable arrays, and all computed observables. + * @param instance Object to be checked + */ isObservable(instance: KnockoutObservable | T): instance is KnockoutObservable; - + /** + * Determine if argument is a writable observable. Returns true for observables, observable arrays, and writable computed observables. + * @param instance Object to be checked + */ isWriteableObservable(instance: any): instance is KnockoutObservable; + /** + * Determine if argument is a writable observable. Returns true for observables, observable arrays, and writable computed observables. + * @param instance Object to be checked + */ isWriteableObservable(instance: KnockoutObservable | T): instance is KnockoutObservable; - + /** + * Determine if argument is a computed observable + * @param instance Object to be checked + */ isComputed(instance: any): instance is KnockoutComputed; + /** + * Determine if argument is a computed observable + * @param instance Object to be checked + */ isComputed(instance: KnockoutObservable | T): instance is KnockoutComputed; dataFor(node: any): any; @@ -575,6 +698,9 @@ interface KnockoutStatic { unwrap(value: KnockoutObservable | T): T; unwrap(value: KnockoutObservableArray | T[]): T[]; + /** + * Get information about the current computed property during the execution of a computed observable’s evaluator function. + */ computedContext: KnockoutComputedContext; ////////////////////////////////// @@ -656,7 +782,13 @@ interface KnockoutStatic { renderTemplateForEach(template: Function, arrayOrObservableArray: KnockoutObservable, options: Object, targetNode: Node, parentBindingContext: KnockoutBindingContext): any; renderTemplateForEach(template: any, arrayOrObservableArray: KnockoutObservable, options: Object, targetNode: Node, parentBindingContext: KnockoutBindingContext): any; - ignoreDependencies(callback: () => T): T; + /** + * Executes a callback function inside a computed observable, without creating a dependecy between it and the observables inside the function + * @param callback Function to be called. + * @param callbackTarget Defines the value of 'this' in the callback function + * @param callbackArgs Arguments for the callback Function + */ + ignoreDependencies(callback: () => T, callbackTarget?: any, callbackArgs?: any): T; expressionRewriting: { bindingRewriteValidators: any[]; @@ -731,7 +863,14 @@ interface KnockoutBindingProvider { } interface KnockoutComputedContext { + /** + * Returns the number of dependencies of the computed observable detected so far during the current evaluation. + */ getDependenciesCount(): number; + /** + * A function that returns true if called during the first ever evaluation of the current computed observable, or false otherwise. + * For pure computed observables, isInitial() is always undefined. + */ isInitial: () => boolean; isSleeping: boolean; } @@ -799,12 +938,33 @@ declare namespace KnockoutComponentTypes { } interface KnockoutComponents { - // overloads for register method: - register(componentName: string, config: KnockoutComponentTypes.Config | KnockoutComponentTypes.EmptyConfig): void; + /** + * Registers a component, in the default component loader, to be used by name in the component binding. + * @param componentName Component name. + * @param config Component configuration. + */ + register(componentName: string, config: KnockoutComponentTypes.Config | KnockoutComponentTypes.EmptyConfig): void; + /** + * Determine if a component with the specified name is already registered in the default component loader. + * @param componentName Component name. + */ isRegistered(componentName: string): boolean; + /** + * Removes the named component from the default component loader registry. Or if no such component was registered, does nothing. + * @param componentName Component name. + */ unregister(componentName: string): void; + /** + * Searchs each registered component loader by component name, and returns the viewmodel/template declaration via callback parameter + * @param componentName Component name. + * @param callback Function to be called with the viewmodel/template declaration parameter. + */ get(componentName: string, callback: (definition: KnockoutComponentTypes.Definition) => void): void; + /** + * Clears the cache knockout creates to speed up component loading, for a given component. + * @param componentName Component name. + */ clearCachedDefinition(componentName: string): void defaultLoader: KnockoutComponentTypes.Loader; loaders: KnockoutComponentTypes.Loader[]; diff --git a/types/known/index.d.ts b/types/known/index.d.ts new file mode 100644 index 0000000000..1ac8005894 --- /dev/null +++ b/types/known/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for known 2.0 +// Project: https://github.com/sindresorhus/known#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export = known; + +declare function known(object: T): T; diff --git a/types/known/known-tests.ts b/types/known/known-tests.ts new file mode 100644 index 0000000000..f07d8ec577 --- /dev/null +++ b/types/known/known-tests.ts @@ -0,0 +1,8 @@ +import known = require('known'); + +const obj = { foo: true }; + +const obj2 = known(obj); + +obj2.foo; +obj2.bar; // $ExpectError diff --git a/types/known/tsconfig.json b/types/known/tsconfig.json new file mode 100644 index 0000000000..8c29c6b462 --- /dev/null +++ b/types/known/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", + "known-tests.ts" + ] +} diff --git a/types/known/tslint.json b/types/known/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/known/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/koa-bouncer/index.d.ts b/types/koa-bouncer/index.d.ts index 7b881f2b5c..af3a8b6693 100644 --- a/types/koa-bouncer/index.d.ts +++ b/types/koa-bouncer/index.d.ts @@ -7,7 +7,7 @@ import { Middleware, Context } from 'koa'; declare namespace KoaBouncer { - export class ValidatorError extends Error { + export class ValidationError extends Error { name: string; message: string; bouncer: { @@ -88,4 +88,4 @@ declare module "koa" { } } -export = KoaBouncer; \ No newline at end of file +export = KoaBouncer; diff --git a/types/koa-pino-logger/index.d.ts b/types/koa-pino-logger/index.d.ts index 24f59b8925..04eea930ce 100644 --- a/types/koa-pino-logger/index.d.ts +++ b/types/koa-pino-logger/index.d.ts @@ -7,25 +7,18 @@ /// import { Middleware } from 'koa'; -import { LoggerOptions, Logger, Level } from 'pino'; +import { DestinationStream, LoggerOptions, Logger, Level } from 'pino'; +import { Options } from 'pino-http'; import * as stream from 'stream'; import * as http from 'http'; export = logger; declare function logger( - opts?: logger.HttpLoggerOptions, - stream?: stream.Writable | stream.Duplex | stream.Transform + opts?: Options, + stream?: DestinationStream ): Middleware; - -declare namespace logger { - interface HttpLoggerOptions extends LoggerOptions { - logger?: Logger; - genReqId?(req: http.IncomingMessage): number; - useLevel?: Level; - stream?: stream.Writable | stream.Duplex | stream.Transform; - } -} +declare function logger(stream?: DestinationStream): Middleware; declare module 'koa' { interface Context { diff --git a/types/koa-pino-logger/koa-pino-logger-tests.ts b/types/koa-pino-logger/koa-pino-logger-tests.ts index 5315ee5baa..e5b6514884 100644 --- a/types/koa-pino-logger/koa-pino-logger-tests.ts +++ b/types/koa-pino-logger/koa-pino-logger-tests.ts @@ -1,8 +1,12 @@ import koa = require('koa'); import logger = require('koa-pino-logger'); +import { Writable } from 'stream'; const app = new koa(); app.use(logger()); +app.use(logger(new Writable())); +app.use(logger({stream: new Writable()})); +app.use(logger({genReqId: () => 'foo'})); app.use((ctx) => { ctx.log.info('something else'); diff --git a/types/koa-ratelimit/index.d.ts b/types/koa-ratelimit/index.d.ts index 3a75e0a2ec..440de0eb25 100644 --- a/types/koa-ratelimit/index.d.ts +++ b/types/koa-ratelimit/index.d.ts @@ -7,7 +7,7 @@ import { Middleware, Context } from "koa"; import { RedisClient } from "redis"; -declare function ratelimit(options?: KoaRatelimit.MiddlewareOptions): Middleware; +declare function KoaRatelimit(options?: KoaRatelimit.MiddlewareOptions): Middleware; declare namespace KoaRatelimit { interface HeaderNameOptions { @@ -76,4 +76,4 @@ declare namespace KoaRatelimit { } } -export = ratelimit; +export = KoaRatelimit; diff --git a/types/koa-router/index.d.ts b/types/koa-router/index.d.ts index 8d8f35df6b..4df53d0e8b 100644 --- a/types/koa-router/index.d.ts +++ b/types/koa-router/index.d.ts @@ -19,12 +19,6 @@ import * as Koa from "koa"; -declare module "koa" { - interface Context { - params: any; - } -} - declare namespace Router { export interface IRouterOptions { /** @@ -49,7 +43,7 @@ declare namespace Router { strict?: boolean; } - export interface IRouterContext extends Koa.Context { + export interface IRouterParamContext { /** * url params */ @@ -57,15 +51,26 @@ declare namespace Router { /** * the router instance */ - router: Router; + router: Router; + /** + * Matched route + */ + _matchedRoute: string | RegExp | undefined; + _matchedRouteName: string | undefined; } - export interface IMiddleware { - (ctx: Router.IRouterContext, next: () => Promise): any; - } + export type RouterContext = + Koa.ParameterizedContext>; + + // For backward compatibility IRouterContext needs to be an interface + // But it's deprecated - please use `RouterContext` instead + export interface IRouterContext extends RouterContext {} + + export type IMiddleware = + Koa.Middleware> export interface IParamMiddleware { - (param: string, ctx: Router.IRouterContext, next: () => Promise): any; + (param: string, ctx: RouterContext, next: () => Promise): any; } export interface IRouterAllowedMethodsOptions { @@ -88,7 +93,7 @@ declare namespace Router { sensitive?: boolean; strict?: boolean; } - + export interface IUrlOptionsQuery { query: object | string; } @@ -154,7 +159,7 @@ declare namespace Router { } } -declare class Router { +declare class Router { params: Object; stack: Array; @@ -170,109 +175,195 @@ declare class Router { * sequentially, requests start at the first middleware and work their way * "down" the middleware stack. */ - use(...middleware: Array): Router; - use(path: string | string[] | RegExp, ...middleware: Array): Router; + use(...middleware: Array>): Router; + use( + path: string | string[] | RegExp, + ...middleware: Array> + ): Router; /** * HTTP get method */ - get(name: string, path: string | RegExp, ...middleware: Array): Router; - get(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + get( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + get( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * HTTP post method */ - post(name: string, path: string | RegExp, ...middleware: Array): Router; - post(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + post( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + post( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * HTTP put method */ - put(name: string, path: string | RegExp, ...middleware: Array): Router; - put(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; - + put( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + put( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; + /** * HTTP link method */ - link(name: string, path: string | RegExp, ...middleware: Array): Router; - link(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; - + link( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + link( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; + /** * HTTP unlink method */ - unlink(name: string, path: string | RegExp, ...middleware: Array): Router; - unlink(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; - + unlink( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + unlink( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * HTTP delete method */ - delete(name: string, path: string | RegExp, ...middleware: Array): Router; - delete(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + delete( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + delete( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * Alias for `router.delete()` because delete is a reserved word */ - del(name: string, path: string | RegExp, ...middleware: Array): Router; - del(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + del( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + del( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * HTTP head method */ - head(name: string, path: string | RegExp, ...middleware: Array): Router; - head(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + head( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + head( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * HTTP options method */ - options(name: string, path: string | RegExp, ...middleware: Array): Router; - options(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + options( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + options( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * HTTP path method */ - patch(name: string, path: string | RegExp, ...middleware: Array): Router; - patch(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + patch( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + patch( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * Register route with all methods. */ - all(name: string, path: string | RegExp, ...middleware: Array): Router; - all(path: string | RegExp | (string | RegExp)[], ...middleware: Array): Router; + all( + name: string, + path: string | RegExp, + ...middleware: Array> + ): Router; + all( + path: string | RegExp | (string | RegExp)[], + ...middleware: Array> + ): Router; /** * Set the path prefix for a Router instance that was already initialized. */ - prefix(prefix: string): Router; + prefix(prefix: string): Router; /** * Returns router middleware which dispatches a route matching the request. */ - routes(): Koa.Middleware; + routes(): Router.IMiddleware; /** * Returns router middleware which dispatches a route matching the request. */ - middleware(): Koa.Middleware; + middleware(): Router.IMiddleware; /** * Returns separate middleware for responding to `OPTIONS` requests with * an `Allow` header containing the allowed methods, as well as responding * with `405 Method Not Allowed` and `501 Not Implemented` as appropriate. */ - allowedMethods(options?: Router.IRouterAllowedMethodsOptions): Koa.Middleware; + allowedMethods( + options?: Router.IRouterAllowedMethodsOptions + ): Router.IMiddleware; /** * Redirect `source` to `destination` URL with optional 30x status `code`. * * Both `source` and `destination` can be route names. */ - redirect(source: string, destination: string, code?: number): Router; + redirect(source: string, destination: string, code?: number): Router; /** * Create and register a route. */ - register(path: string | RegExp, methods: string[], middleware: Router.IMiddleware, opts?: Object): Router.Layer; + register( + path: string | RegExp, + methods: string[], + middleware: Router.IMiddleware, + opts?: Object + ): Router.Layer; /** * Lookup route with given `name`. @@ -283,21 +374,21 @@ declare class Router { /** * Generate URL for route. Takes either map of named `params` or series of * arguments (for regular expression routes) - * + * * router = new Router(); * router.get('user', "/users/:id", ... - * + * * router.url('user', { id: 3 }); * // => "/users/3" - * + * * Query can be generated from third argument: - * + * * router.url('user', { id: 3 }, { query: { limit: 1 } }); * // => "/users/3?limit=1" - * + * * router.url('user', { id: 3 }, { query: "limit=1" }); * // => "/users/3?limit=1" - * + * */ url(name: string, params: any, options?: Router.IUrlOptionsQuery): string; url(name: string, params: any, options?: Router.IUrlOptionsQuery): Error; @@ -310,7 +401,7 @@ declare class Router { /** * Run middleware for named route parameters. Useful for auto-loading or validation. */ - param(param: string, middleware: Router.IParamMiddleware): Router; + param(param: string, middleware: Router.IParamMiddleware): Router; /** * Generate URL from url pattern and given `params`. diff --git a/types/koa-router/koa-router-tests.ts b/types/koa-router/koa-router-tests.ts index e1c90c636d..96fa0d1751 100644 --- a/types/koa-router/koa-router-tests.ts +++ b/types/koa-router/koa-router-tests.ts @@ -1,9 +1,15 @@ import Koa = require("koa"); +import { Context } from "koa"; +import compose = require("koa-compose"); +import etag = require("koa-etag"); import Router = require("koa-router"); -const app = new Koa(); +type MyState = {foo: string} +type MyContext = {bar: string} -const router = new Router({ +const app = new Koa<{}, {}>(); + +const router = new Router({ prefix: "/users" }); @@ -31,9 +37,10 @@ router } }) .post('/users', function (ctx, next) { - // ... + ctx.state.foo = 'foo'; }) .put('/users/:id', function (ctx, next) { + ctx.bar = 'bar'; ctx.body = ctx.params.id; }) .del('/users/:id', function () { @@ -49,7 +56,72 @@ const match = router.match('/users/:id', 'GET'); let layer: Router.Layer let layerOptions: Router.ILayerOptions -app.use(router.routes()); -app.use(router.allowedMethods()); +const mw: Router.IMiddleware = (ctx: Koa.ParameterizedContext, next: () => Promise) => { + ctx.body = "Ok"; +}; -app.listen(3000); +const mw2: Router.IMiddleware = (ctx: Router.IRouterContext, next: () => Promise) => { + ctx.body = "Ok"; +}; + +app.use(async (ctx: Koa.ParameterizedContext, next) => { + ctx.state.foo = 'foo'; + await next(); + }) + .use(router.routes()) + .use(router.allowedMethods()) + .use(async (ctx, next) => { + ctx.state.foo = '3'; + await next(); + }) + .listen(3000); + +const router3 = new Router(); +router3.get('/', (ctx) => { + ctx.foo = "bar"; + console.log(ctx.router.params); + ctx.body = "Hello World!"; +}); +router3.get('/foo', (ctx: Router.IRouterContext) => { + ctx.body = "Yup"; +}) +new Koa() + .use(async (ctx, next) => next()) + .use(router3.routes()) + .use(router.allowedMethods()) + .listen(3001); + +// It's from https://github.com/DefinitelyTyped/DefinitelyTyped/pull/31704#issuecomment-451075919, +// to make sure we don't break it again + +declare module "koa" { + interface Context { + name: string; + } +} + +const app2 = new Koa(); + +const conditional = async (ctx: Context, next: any) => { + await next(); + if (ctx.fresh) { + ctx.status = 304; + ctx.body = null; + } +}; + +const router2 = compose([conditional, etag()]); + +app2.use(router2); + +app2.use(async (ctx: Context, next: any) => { + ctx.name = "hello world"; + await next(); +}); + +app2.use((ctx: Context, next: any) => { + console.log(ctx.name); + ctx.body = ctx.name; +}); + +app2.listen(8000); diff --git a/types/koa-useragent/koa-useragent-tests.ts b/types/koa-useragent/koa-useragent-tests.ts index 579983786c..594b9b2206 100644 --- a/types/koa-useragent/koa-useragent-tests.ts +++ b/types/koa-useragent/koa-useragent-tests.ts @@ -5,7 +5,7 @@ const app = new Koa(); app.use(userAgent); -app.use((ctx, next) => { +app.use((ctx: Koa.Context, next) => { ctx.userAgent.isAuthoritative; // $ExpectType boolean ctx.userAgent.isMobile; // $ExpectType boolean ctx.userAgent.isTablet; // $ExpectType boolean diff --git a/types/koa/index.d.ts b/types/koa/index.d.ts index 802d6a242f..cc0fa86141 100644 --- a/types/koa/index.d.ts +++ b/types/koa/index.d.ts @@ -431,12 +431,12 @@ declare interface ContextDelegatedResponse { flushHeaders(): void; } -declare class Application extends EventEmitter { +declare class Application extends EventEmitter { proxy: boolean; - middleware: Application.Middleware[]; + middleware: Application.Middleware[]; subdomainOffset: number; env: string; - context: Application.BaseContext; + context: Application.BaseContext & CustomT; request: Application.BaseRequest; response: Application.BaseResponse; silent: boolean; @@ -497,7 +497,9 @@ declare class Application extends EventEmitter { * * Old-style middleware will be converted. */ - use(middleware: Application.Middleware): this; + use( + middleware: Application.Middleware, + ): Application; /** * Return a request handler callback @@ -510,10 +512,10 @@ declare class Application extends EventEmitter { * * @api private */ - createContext( + createContext( req: IncomingMessage, res: ServerResponse, - ): Application.Context; + ): Application.ParameterizedContext; /** * Default error handler. @@ -524,7 +526,7 @@ declare class Application extends EventEmitter { } declare namespace Application { - type Middleware = compose.Middleware; + type Middleware = compose.Middleware>; interface BaseRequest extends ContextDelegatedRequest { /** @@ -684,7 +686,7 @@ declare namespace Application { request: Request; } - interface Context extends BaseContext { + type ParameterizedContext = BaseContext & { app: Application; request: Request; response: Response; @@ -693,12 +695,14 @@ declare namespace Application { originalUrl: string; cookies: Cookies; accept: accepts.Accepts; - state: any; + state: StateT; /** * To bypass Koa's built-in response handling, you may explicitly set `ctx.respond = false;` */ respond?: boolean; - } + } & CustomT; + + interface Context extends ParameterizedContext {} } export = Application; diff --git a/types/koa/koa-tests.ts b/types/koa/koa-tests.ts index 2ddf9b41e2..c3d29298be 100644 --- a/types/koa/koa-tests.ts +++ b/types/koa/koa-tests.ts @@ -1,19 +1,18 @@ import Koa = require("koa"); -declare module 'koa' { - export interface BaseContext { - db(): void; - } - export interface Context { - user: {}; - } +interface DbBaseContext { + db(): void; } -const app = new Koa(); +interface UserContext { + user: {}; +} + +const app = new Koa<{}, DbBaseContext>(); app.context.db = () => {}; -app.use(async ctx => { +app.use<{}, UserContext>(async ctx => { console.log(ctx.db); ctx.user = {}; }); diff --git a/types/latest-semver/index.d.ts b/types/latest-semver/index.d.ts new file mode 100644 index 0000000000..761a487b88 --- /dev/null +++ b/types/latest-semver/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for latest-semver 1.0 +// Project: https://github.com/sindresorhus/latest-semver#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = latestSemver; + +declare function latestSemver(versions: string[]): string | undefined; diff --git a/types/latest-semver/latest-semver-tests.ts b/types/latest-semver/latest-semver-tests.ts new file mode 100644 index 0000000000..ec8312e467 --- /dev/null +++ b/types/latest-semver/latest-semver-tests.ts @@ -0,0 +1,4 @@ +import latestSemver = require('latest-semver'); + +// $ExpectType string | undefined +latestSemver(['v1.8.0-alpha.1', 'v1.3.16', 'v1.7.0', 'v1.6.9']); diff --git a/types/latest-semver/tsconfig.json b/types/latest-semver/tsconfig.json new file mode 100644 index 0000000000..54f1df51e2 --- /dev/null +++ b/types/latest-semver/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", + "latest-semver-tests.ts" + ] +} diff --git a/types/latest-semver/tslint.json b/types/latest-semver/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/latest-semver/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/latest-version/index.d.ts b/types/latest-version/index.d.ts new file mode 100644 index 0000000000..5127714c15 --- /dev/null +++ b/types/latest-version/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for latest-version 4.0 +// Project: https://github.com/sindresorhus/latest-version#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = latestVersion; + +declare function latestVersion(name: string, options?: latestVersion.Options): Promise; + +declare namespace latestVersion { + interface Options { + version?: string; + } +} diff --git a/types/latest-version/latest-version-tests.ts b/types/latest-version/latest-version-tests.ts new file mode 100644 index 0000000000..2cbd29b61f --- /dev/null +++ b/types/latest-version/latest-version-tests.ts @@ -0,0 +1,4 @@ +import latestVersion = require('latest-version'); + +latestVersion('ava'); // $ExpectType Promise +latestVersion('npm', { version: 'latest-5' }); // $ExpectType Promise diff --git a/types/latest-version/tsconfig.json b/types/latest-version/tsconfig.json new file mode 100644 index 0000000000..a62d14b69d --- /dev/null +++ b/types/latest-version/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", + "latest-version-tests.ts" + ] +} diff --git a/types/latest-version/tslint.json b/types/latest-version/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/latest-version/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts index 8177ba1aa6..96bcb3277a 100644 --- a/types/leaflet/index.d.ts +++ b/types/leaflet/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Leaflet.js 1.2 +// Type definitions for Leaflet.js 1.4 // Project: https://github.com/Leaflet/Leaflet // Definitions by: Alejandro Sánchez // Arne Schubert @@ -323,7 +323,7 @@ export abstract class Evented extends Class { * Note that if you passed a custom context to on, you must pass the same context * to off in order to remove the listener. */ - removeEventListener(type: string, fn: LeafletEventHandlerFn, context?: any): this; + removeEventListener(type: string, fn?: LeafletEventHandlerFn, context?: any): this; /** * Alias for off(...) @@ -1181,6 +1181,12 @@ export interface FitBoundsOptions extends ZoomOptions, PanOptions { maxZoom?: number; } +export interface PanInsideOptions { + paddingTopLeft?: PointExpression; + paddingBottomRight?: PointExpression; + padding?: PointExpression; +} + export interface LocateOptions { watch?: boolean; setView?: boolean; @@ -1355,6 +1361,7 @@ export class Map extends Evented { setMaxBounds(bounds: LatLngBoundsExpression): this; setMinZoom(zoom: number): this; setMaxZoom(zoom: number): this; + panInside(latLng: LatLngExpression, options?: PanInsideOptions): this; panInsideBounds(bounds: LatLngBoundsExpression, options?: PanOptions): this; /** * Boolean for animate or advanced ZoomPanOptions diff --git a/types/leaflet/leaflet-tests.ts b/types/leaflet/leaflet-tests.ts index 6debf6b0d6..a6c9b6ccc3 100644 --- a/types/leaflet/leaflet-tests.ts +++ b/types/leaflet/leaflet-tests.ts @@ -40,8 +40,8 @@ point = new L.Point(12, 13); point = new L.Point(12, 13, true); let distance: number; -point.distanceTo(point); -point.distanceTo(pointTuple); +distance = point.distanceTo(point); +distance = point.distanceTo(pointTuple); const transformation = new L.Transformation(1, 2, 3, 4); point = transformation.transform(point); @@ -163,6 +163,16 @@ map = new L.Map(htmlElement, mapOptions); let doesItHaveLayer: boolean; doesItHaveLayer = map.hasLayer(L.tileLayer('')); +map.off('moveend'); +map.off('moveend', () => {}); +map.off('moveend', () => {}, {}); + +map.removeEventListener('moveend'); +map.removeEventListener('moveend', () => {}); +map.removeEventListener('moveend', () => {}, {}); + +map.panInside(latLng, {padding: [50, 50], paddingBottomRight: point, paddingTopLeft: [100, 100]}); + // map.getRenderer let html: HTMLElement; diff --git a/types/leap-year/index.d.ts b/types/leap-year/index.d.ts new file mode 100644 index 0000000000..a3089b5b4b --- /dev/null +++ b/types/leap-year/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for leap-year 2.0 +// Project: https://github.com/sindresorhus/leap-year#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = leapYear; + +declare function leapYear(year?: number | Date): boolean; diff --git a/types/leap-year/leap-year-tests.ts b/types/leap-year/leap-year-tests.ts new file mode 100644 index 0000000000..88aa2ccff4 --- /dev/null +++ b/types/leap-year/leap-year-tests.ts @@ -0,0 +1,8 @@ +import leapYear = require('leap-year'); + +// $ExpectType boolean +leapYear(); +// $ExpectType boolean +leapYear(2016); +// $ExpectType boolean +leapYear(new Date()); diff --git a/types/leap-year/tsconfig.json b/types/leap-year/tsconfig.json new file mode 100644 index 0000000000..7a29e8116a --- /dev/null +++ b/types/leap-year/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", + "leap-year-tests.ts" + ] +} diff --git a/types/leap-year/tslint.json b/types/leap-year/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/leap-year/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/libsodium-wrappers-sumo/index.d.ts b/types/libsodium-wrappers-sumo/index.d.ts index ceeadd5980..5341cca299 100644 --- a/types/libsodium-wrappers-sumo/index.d.ts +++ b/types/libsodium-wrappers-sumo/index.d.ts @@ -7,10 +7,12 @@ export * from 'libsodium-wrappers'; import { - Uint8ArrayOutputFormat, - StringOutputFormat, + KeyPair, onetimeauth_state_address, state_address, + StringKeyPair, + StringOutputFormat, + Uint8ArrayOutputFormat, } from 'libsodium-wrappers'; export const crypto_auth_hmacsha256_BYTES: number; @@ -77,6 +79,12 @@ export const crypto_stream_xchacha20_KEYBYTES: number; export const crypto_stream_xchacha20_NONCEBYTES: number; +export const crypto_box_curve25519xchacha20poly1305_NONCEBYTES: number; + +export const crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES: number; + +export const crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES: number; + export function crypto_auth_hmacsha256( message: string | Uint8Array, key: Uint8Array, @@ -113,6 +121,18 @@ export function crypto_auth_hmacsha512_keygen(outputFormat?: StringOutputFormat export function crypto_auth_hmacsha512_verify(tag: Uint8Array, message: string | Uint8Array, key: Uint8Array): boolean; +export function crypto_box_curve25519xchacha20poly1305_keypair(publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): KeyPair; + +export function crypto_box_curve25519xchacha20poly1305_keypair(publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: StringOutputFormat | null): StringKeyPair; + +export function crypto_box_curve25519xchacha20poly1305_seal(message: Uint8Array, publicKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array; + +export function crypto_box_curve25519xchacha20poly1305_seal(message: Uint8Array, publicKey: Uint8Array, outputFormat?: StringOutputFormat | null): string; + +export function crypto_box_curve25519xchacha20poly1305_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array; + +export function crypto_box_curve25519xchacha20poly1305_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: StringOutputFormat | null): string; + export function crypto_hash_sha256( message: string | Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null, @@ -240,6 +260,10 @@ export function crypto_sign_ed25519_sk_to_seed( outputFormat?: StringOutputFormat | null, ): string; +export function crypto_stream_chacha20(outLength: number, key: Uint8Array, nonce: Uint8Array, outputFormat?: StringOutputFormat | null): string; + +export function crypto_stream_chacha20(outLength: number, key: Uint8Array, nonce: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array; + export function crypto_stream_chacha20_ietf_xor( input_message: string | Uint8Array, nonce: Uint8Array, diff --git a/types/libsodium-wrappers/index.d.ts b/types/libsodium-wrappers/index.d.ts index e9213da782..155448bcc2 100644 --- a/types/libsodium-wrappers/index.d.ts +++ b/types/libsodium-wrappers/index.d.ts @@ -886,30 +886,30 @@ export function crypto_secretstream_xchacha20poly1305_keygen(outputFormat?: Uint export function crypto_secretstream_xchacha20poly1305_keygen(outputFormat?: StringOutputFormat | null): string; export function crypto_secretstream_xchacha20poly1305_pull( - state_address?: secretstream_xchacha20poly1305_state_address, - cipher?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + cipher: string | Uint8Array, ad?: string | Uint8Array | null, outputFormat?: Uint8ArrayOutputFormat | null, -): { message: Uint8Array; tag: Uint8Array }; +): { message: Uint8Array; tag: number }; export function crypto_secretstream_xchacha20poly1305_pull( - state_address?: secretstream_xchacha20poly1305_state_address, - cipher?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + cipher: string | Uint8Array, ad?: string | Uint8Array | null, outputFormat?: StringOutputFormat | null, -): { message: string; tag: Uint8Array }; +): { message: string; tag: number }; export function crypto_secretstream_xchacha20poly1305_push( - state_address?: secretstream_xchacha20poly1305_state_address, - message_chunk?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + message_chunk: string | Uint8Array, ad?: string | Uint8Array | null, tag?: number, outputFormat?: Uint8ArrayOutputFormat | null, ): Uint8Array; export function crypto_secretstream_xchacha20poly1305_push( - state_address?: secretstream_xchacha20poly1305_state_address, - message_chunk?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + message_chunk: string | Uint8Array, ad?: string | Uint8Array | null, tag?: number, outputFormat?: StringOutputFormat | null, @@ -1031,7 +1031,7 @@ export function crypto_stream_keygen(outputFormat?: Uint8ArrayOutputFormat | nul export function crypto_stream_keygen(outputFormat?: StringOutputFormat | null): string; -export function from_base64(input: string, variant: base64_variants): Uint8Array; +export function from_base64(input: string, variant?: base64_variants): Uint8Array; export function from_hex(input: string): Uint8Array; @@ -1077,7 +1077,7 @@ export function sodium_version_string(): string; export function symbols(): string[]; -export function to_base64(input: string | Uint8Array, variant: base64_variants): string; +export function to_base64(input: string | Uint8Array, variant?: base64_variants): string; export function to_hex(input: string | Uint8Array): string; diff --git a/types/line-column-path/index.d.ts b/types/line-column-path/index.d.ts new file mode 100644 index 0000000000..6a42de54b8 --- /dev/null +++ b/types/line-column-path/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for line-column-path 1.0 +// Project: https://github.com/sindresorhus/line-column-path#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +export function parse(input: PathSpec): ParsedPath; +export function stringify(input: PathDescriptor, options?: StringifyOptions): string; + +export type PathSpec = string | PathDescriptor; + +export interface PathDescriptor { + file: string; + line?: number; + column?: number; +} + +export type ParsedPath = Required; + +export interface StringifyOptions { + file?: boolean; + column?: boolean; +} diff --git a/types/line-column-path/line-column-path-tests.ts b/types/line-column-path/line-column-path-tests.ts new file mode 100644 index 0000000000..5a3861476d --- /dev/null +++ b/types/line-column-path/line-column-path-tests.ts @@ -0,0 +1,20 @@ +import lineColumnPath = require('line-column-path'); + +const parsed = lineColumnPath.parse('unicorn.js:8:14'); +// $ExpectType Required +parsed; +// $ExpectType Required +lineColumnPath.parse({ file: 'unicorn.js' }); +// $ExpectType Required +lineColumnPath.parse({ file: 'unicorn.js', line: 1 }); +// $ExpectType Required +lineColumnPath.parse({ file: 'unicorn.js', column: 1 }); + +// $ExpectType string +lineColumnPath.stringify(parsed); +// $ExpectType string +lineColumnPath.stringify({ file: 'unicorn.js' }); +// $ExpectType string +lineColumnPath.stringify({ file: 'unicorn.js', line: 1 }); +// $ExpectType string +lineColumnPath.stringify({ file: 'unicorn.js', column: 1 }); diff --git a/types/line-column-path/tsconfig.json b/types/line-column-path/tsconfig.json new file mode 100644 index 0000000000..179e1e2167 --- /dev/null +++ b/types/line-column-path/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "line-column-path-tests.ts" + ] +} diff --git a/types/line-column-path/tslint.json b/types/line-column-path/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/line-column-path/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/linkify-issues/index.d.ts b/types/linkify-issues/index.d.ts new file mode 100644 index 0000000000..4c37a8f87a --- /dev/null +++ b/types/linkify-issues/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for linkify-issues 1.3 +// Project: https://github.com/sindresorhus/linkify-issues#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = linkifyIssues; + +declare function linkifyIssues(input: string, options?: linkifyIssues.TypeStringOptions): string; +declare function linkifyIssues( + input: string, + options: linkifyIssues.TypeDomOptions +): DocumentFragment; + +declare namespace linkifyIssues { + interface BaseOptions { + user: string; + repo: string; + attributes?: { [attrName: string]: string | number | boolean | Array }; + baseUrl?: string; + } + + interface TypeStringOptions extends BaseOptions { + type?: 'string'; + } + + interface TypeDomOptions extends BaseOptions { + type: 'dom'; + } +} diff --git a/types/linkify-issues/linkify-issues-tests.ts b/types/linkify-issues/linkify-issues-tests.ts new file mode 100644 index 0000000000..cdf2dd8be1 --- /dev/null +++ b/types/linkify-issues/linkify-issues-tests.ts @@ -0,0 +1,36 @@ +import linkifyIssues = require('linkify-issues'); + +// $ExpectType string +linkifyIssues('Fixes #143 and avajs/ava#1023', { + user: 'sindresorhus', + repo: 'dofle', +}); +// $ExpectType string +linkifyIssues('Fixes #143 and avajs/ava#1023', { + user: 'sindresorhus', + repo: 'dofle', + attributes: { + class: 'unicorn', + multiple: ['a', 'b'], + number: 1, + exclude: false, + include: true, + }, +}); +// $ExpectType string +linkifyIssues('Fixes #143 and avajs/ava#1023', { + user: 'sindresorhus', + repo: 'dofle', + type: 'string', +}); + +const fragment = linkifyIssues('Fixes #143 and avajs/ava#1023', { + user: 'sindresorhus', + repo: 'dofle', + type: 'dom', +}); + +// $ExpectType DocumentFragment +fragment; + +document.body.appendChild(fragment); diff --git a/types/linkify-issues/tsconfig.json b/types/linkify-issues/tsconfig.json new file mode 100644 index 0000000000..459076c4c0 --- /dev/null +++ b/types/linkify-issues/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", + "linkify-issues-tests.ts" + ] +} diff --git a/types/linkify-issues/tslint.json b/types/linkify-issues/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/linkify-issues/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/linkify-urls/index.d.ts b/types/linkify-urls/index.d.ts new file mode 100644 index 0000000000..cfc31e1527 --- /dev/null +++ b/types/linkify-urls/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for linkify-urls 3.0 +// Project: https://github.com/sindresorhus/linkify-urls#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = linkifyUrls; + +declare function linkifyUrls(input: string, options?: linkifyUrls.TypeStringOptions): string; +declare function linkifyUrls(input: string, options: linkifyUrls.TypeDomOptions): DocumentFragment; + +declare namespace linkifyUrls { + interface BaseOptions { + attributes?: { [attrName: string]: string | number | boolean | Array }; + value?: string | ((url: string) => string); + } + + interface TypeStringOptions extends BaseOptions { + type?: 'string'; + } + + interface TypeDomOptions extends BaseOptions { + type: 'dom'; + } +} diff --git a/types/linkify-urls/linkify-urls-tests.ts b/types/linkify-urls/linkify-urls-tests.ts new file mode 100644 index 0000000000..10e9c926de --- /dev/null +++ b/types/linkify-urls/linkify-urls-tests.ts @@ -0,0 +1,35 @@ +import linkifyUrls = require('linkify-urls'); + +// $ExpectType string +linkifyUrls('See https://sindresorhus.com', { + attributes: { + class: 'unicorn', + one: 1, + foo: true, + multiple: ['a', 'b'], + }, +}); +// $ExpectType string +linkifyUrls('See https://sindresorhus.com', { + value: 'foo', +}); +// $ExpectType string +linkifyUrls('See https://sindresorhus.com/foo', { + value: url => new URL(url).pathname, +}); +// $ExpectType string +linkifyUrls('See https://sindresorhus.com/foo', { + type: 'string', +}); + +const fragment = linkifyUrls('See https://sindresorhus.com', { + type: 'dom', + attributes: { + class: 'unicorn', + }, +}); + +// $ExpectType DocumentFragment +fragment; + +document.body.appendChild(fragment); diff --git a/types/linkify-urls/tsconfig.json b/types/linkify-urls/tsconfig.json new file mode 100644 index 0000000000..f498739dda --- /dev/null +++ b/types/linkify-urls/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", + "linkify-urls-tests.ts" + ] +} diff --git a/types/linkify-urls/tslint.json b/types/linkify-urls/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/linkify-urls/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/linkifyjs/index.d.ts b/types/linkifyjs/index.d.ts index 9c095a41f3..a036ab52c1 100644 --- a/types/linkifyjs/index.d.ts +++ b/types/linkifyjs/index.d.ts @@ -1,8 +1,11 @@ // Type definitions for linkifyjs 2.1 // Project: https://github.com/SoapBox/linkifyjs#readme // Definitions by: Sean Zhu +// Ovidiu Bute // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.8 + +import * as React from "react"; export type PossiblyFuncOfHrefAndType = | T @@ -26,9 +29,9 @@ export interface LinkifyOptions { * Also accepts a function that takes the unformatted href, the link type * (e.g., 'url', 'email', etc.) and returns the object. */ - attributes?: PossiblyFuncOfHrefAndType<{ - [attrName: string]: string; - }> | null; + attributes?: PossiblyFuncOfHrefAndType< + React.AnchorHTMLAttributes + > | null; /** * className diff --git a/types/linkifyjs/linkifyjs-tests.ts b/types/linkifyjs/linkifyjs-tests.ts deleted file mode 100644 index 5688f9f99f..0000000000 --- a/types/linkifyjs/linkifyjs-tests.ts +++ /dev/null @@ -1,141 +0,0 @@ -import linkifyHtml from "linkifyjs/html"; - -// From the docs here: https://soapbox.github.io/linkifyjs/docs/options.html - -/* attributes */ - -linkifyHtml("github.com", { - attributes: { - rel: "nofollow" - } -}); - -/* className */ - -linkifyHtml("github.com", { - className: "new-link--url" -}); - -linkifyHtml("github.com", { - className(href, type) { - return "new-link--" + type; - } -}); - -linkifyHtml("github.com", { - className: { - url: "new-link--url", - email(href: string) { - return "new-link--email"; - } - } -}); - -/* events */ - -linkifyHtml("", { - events: { - click(e) { - alert("Link clicked!"); - }, - mouseover(e) { - alert("Link hovered!"); - } - } -}); - -/* defaultProtocol */ - -/* format */ - -linkifyHtml("", { - format(value, type) { - if (type === "url" && value.length > 50) { - value = value.slice(0, 50) + "…"; - } - return value; - } -}); - -linkifyHtml("", { - format: { - url(value) { - return value.length > 50 ? value.slice(0, 50) + "…" : value; - } - } -}); - -/* formatHref */ - -linkifyHtml("This site is #rad", { - formatHref(href, type) { - if (type === "hashtag") { - href = "https://twitter.com/hashtag/" + href.substring(1); - } - return href; - } -}); - -linkifyHtml("Hey @dhh, check out issue #23", { - formatHref: { - mention(href) { - return "https://github.com" + href; - }, - ticket(href) { - return ( - "https://github.com/SoapBox/linkifyjs/issues/" + - href.substring(1) - ); - } - } -}); - -/* ignoreTags */ - -linkifyHtml( - // tslint:disable-next-line:prefer-template - 'Please ignore \n' + - "but do b.ca", - { - ignoreTags: ["script", "style"] - } -); - -/* nl2br */ - -/* tagName */ - -linkifyHtml("github.com", { - tagName: "span" -}); - -linkifyHtml("#swag", { - tagName: { - hashtag: "span" - } -}); - -/* target */ - -linkifyHtml("github.com", { - target: "_parent" -}); - -linkifyHtml("test-email@example.com", { - target: { - url: "_parent", - email: null - } -}); - -/* validate */ - -// Don't linkify links that don't begin in a protocol -// e.g., "http://google.com" will be linkified, but "google.com" will not. -linkifyHtml("www.google.com", { - validate: { - url(value) { - return /^(http|ftp)s?:\/\//.test(value); - } - } -}); diff --git a/types/linkifyjs/linkifyjs-tests.tsx b/types/linkifyjs/linkifyjs-tests.tsx new file mode 100644 index 0000000000..02d9d3b6d5 --- /dev/null +++ b/types/linkifyjs/linkifyjs-tests.tsx @@ -0,0 +1,227 @@ +import * as React from "react"; +import linkifyHtml from "linkifyjs/html"; +import Linkify from "linkifyjs/react"; + +declare function describe(desc: string, f: () => void): void; + +describe("linkifyjs/html", () => { + /** + * The following tests were taken directly from the documentation: + * https://soapbox.github.io/linkifyjs/docs/options.html + */ + + /* attributes */ + + linkifyHtml("github.com", { + attributes: { + rel: "nofollow" + } + }); + + /* className */ + + linkifyHtml("github.com", { + className: "new-link--url" + }); + + linkifyHtml("github.com", { + className(href, type) { + return "new-link--" + type; + } + }); + + linkifyHtml("github.com", { + className: { + url: "new-link--url", + email(href: string) { + return "new-link--email"; + } + } + }); + + /* events */ + + linkifyHtml("", { + events: { + click(e) { + alert("Link clicked!"); + }, + mouseover(e) { + alert("Link hovered!"); + } + } + }); + + /* defaultProtocol */ + + /* format */ + + linkifyHtml("", { + format(value, type) { + if (type === "url" && value.length > 50) { + value = value.slice(0, 50) + "…"; + } + return value; + } + }); + + linkifyHtml("", { + format: { + url(value) { + return value.length > 50 ? value.slice(0, 50) + "…" : value; + } + } + }); + + /* formatHref */ + + linkifyHtml("This site is #rad", { + formatHref(href, type) { + if (type === "hashtag") { + href = "https://twitter.com/hashtag/" + href.substring(1); + } + return href; + } + }); + + linkifyHtml("Hey @dhh, check out issue #23", { + formatHref: { + mention(href) { + return "https://github.com" + href; + }, + ticket(href) { + return ( + "https://github.com/SoapBox/linkifyjs/issues/" + + href.substring(1) + ); + } + } + }); + + /* ignoreTags */ + + linkifyHtml( + // tslint:disable-next-line:prefer-template + 'Please ignore \n' + + "but do b.ca", + { + ignoreTags: ["script", "style"] + } + ); + + /* nl2br */ + + /* tagName */ + + linkifyHtml("github.com", { + tagName: "span" + }); + + linkifyHtml("#swag", { + tagName: { + hashtag: "span" + } + }); + + /* target */ + + linkifyHtml("github.com", { + target: "_parent" + }); + + linkifyHtml("test-email@example.com", { + target: { + url: "_parent", + email: null + } + }); + + /* validate */ + + // Don't linkify links that don't begin in a protocol + // e.g., "http://google.com" will be linkified, but "google.com" will not. + linkifyHtml("www.google.com", { + validate: { + url(value) { + return /^(http|ftp)s?:\/\//.test(value); + } + } + }); +}); + +describe("linkifyjs/react", () => { + /** + * The following tests were taken directly from the documentation: + * https://soapbox.github.io/linkifyjs/docs/linkify-react.html + */ + + /* Usage */ + + { + // render() + const options = { + /* … */ + }; + const content = + "For help with GitHub.com, please email support@github.com"; + + {content} + ; + } + + /* Events */ + + { + const content = + "For help with GitHub.com, please email support@github.com"; + const linkProps = { + onClick: (event: any) => { + if (!confirm("Are you sure you want to leave this page?")) { + event.preventDefault(); + } + } + }; + {content}; + } + + /** + * The following tests were made specifically for DefinitelyTyped. + */ + + /* Default values for all props */ + { + const content = + "For help with GitHub.com, please email support@github.com"; + + {content} + ; + } + + /* Custom class name */ + + { + const content = + "For help with GitHub.com, please email support@github.com"; + + {content} + ; + } + + /* Custom tag name */ + + { + const content = + "For help with GitHub.com, please email support@github.com"; + + {content} + ; + } +}); diff --git a/types/linkifyjs/react.d.ts b/types/linkifyjs/react.d.ts new file mode 100644 index 0000000000..0631b6c460 --- /dev/null +++ b/types/linkifyjs/react.d.ts @@ -0,0 +1,11 @@ +import * as React from "react"; +import { LinkifyOptions } from "./index"; + +export interface LinkifyProps { + options?: LinkifyOptions; + tagName?: string; +} + +declare class Linkify extends React.Component {} + +export default Linkify; diff --git a/types/linkifyjs/tsconfig.json b/types/linkifyjs/tsconfig.json index 52b1940fcd..16becbcf0a 100644 --- a/types/linkifyjs/tsconfig.json +++ b/types/linkifyjs/tsconfig.json @@ -1,25 +1,17 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6", - "dom" - ], + "lib": ["es6", "dom"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "jsx": "preserve" }, - "files": [ - "index.d.ts", - "html.d.ts", - "linkifyjs-tests.ts" - ] + "files": ["index.d.ts", "html.d.ts", "react.d.ts", "linkifyjs-tests.tsx"] } diff --git a/types/list-git-remotes/index.d.ts b/types/list-git-remotes/index.d.ts new file mode 100644 index 0000000000..f544110753 --- /dev/null +++ b/types/list-git-remotes/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for list-git-remotes 1.0 +// Project: https://github.com/jonschlinkert/list-git-remotes +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { ExecException, ExecSyncOptions } from 'child_process'; + +export = listGitRemotes; + +declare function listGitRemotes(callback: listGitRemotes.Callback): void; +declare function listGitRemotes(cwd: string, callback: listGitRemotes.Callback): void; + +declare namespace listGitRemotes { + function sync(cwd?: string, options?: ExecSyncOptions): Remotes; + function sync(options: ExecSyncOptions): Remotes; + + type Callback = (err: ExecException | null, remotes: Remotes, stderr?: string) => void; + + interface Remotes { + [key: string]: string; + } +} diff --git a/types/list-git-remotes/list-git-remotes-tests.ts b/types/list-git-remotes/list-git-remotes-tests.ts new file mode 100644 index 0000000000..8114790ce6 --- /dev/null +++ b/types/list-git-remotes/list-git-remotes-tests.ts @@ -0,0 +1,17 @@ +import remotes = require('list-git-remotes'); + +remotes((err, res, stderr) => { + err; // $ExpectType ExecException | null + res; // $ExpectType Remotes + stderr; // $ExpectType string | undefined +}); +remotes('some/project', (err, res, stderr) => { + err; // $ExpectType ExecException | null + res; // $ExpectType Remotes + stderr; // $ExpectType string | undefined +}); + +remotes.sync(); // $ExpectType Remotes +remotes.sync('some/project'); // $ExpectType Remotes +remotes.sync('some/project', { shell: 'foo' }); // $ExpectType Remotes +remotes.sync({ cwd: 'some/project', shell: 'foo' }); // $ExpectType Remotes diff --git a/types/list-git-remotes/tsconfig.json b/types/list-git-remotes/tsconfig.json new file mode 100644 index 0000000000..28e46b572b --- /dev/null +++ b/types/list-git-remotes/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "list-git-remotes-tests.ts" + ] +} diff --git a/types/list-git-remotes/tslint.json b/types/list-git-remotes/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/list-git-remotes/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/load-google-maps-api/index.d.ts b/types/load-google-maps-api/index.d.ts new file mode 100644 index 0000000000..818957ff5f --- /dev/null +++ b/types/load-google-maps-api/index.d.ts @@ -0,0 +1,59 @@ +// Type definitions for load-google-maps-api 1.3 +// Project: https://github.com/yuanqing/load-google-maps-api#readme +// Definitions by: Oscar Busk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface Options { + /** + * Client usage reporting channel + * + * https://developers.google.com/maps/premium/reports/usage-reports#channels + */ + channel?: string; + /** + * Client ID + * + * https://developers.google.com/maps/documentation/javascript/get-api-key#specifying-a-client-id-when-loading-the-api + */ + client?: string; + /** + * Your API key + * + * https://developers.google.com/maps/documentation/javascript/get-api-key#step-2-add-the-api-key-to-your-application + */ + key?: string; + /** + * https://developers.google.com/maps/documentation/javascript/localization#Language + */ + language?: string; + /** + * Supplemental libraries to load + * + * Default Value `[]` + * + * https://developers.google.com/maps/documentation/javascript/libraries + */ + libraries?: string[]; + /** + * https://developers.google.com/maps/documentation/javascript/localization#Region + */ + region?: string; + /** + * Time in milliseconds before rejecting the Promise + * + * Default Value `10000` + */ + timeout?: number; + /** + * API Version + * + * https://developers.google.com/maps/documentation/javascript/versions + */ + v?: string; +} + +declare function loadGoogleMapsApi(options?: Options): Promise; + +export = loadGoogleMapsApi; diff --git a/types/load-google-maps-api/load-google-maps-api-tests.ts b/types/load-google-maps-api/load-google-maps-api-tests.ts new file mode 100644 index 0000000000..0d2495de64 --- /dev/null +++ b/types/load-google-maps-api/load-google-maps-api-tests.ts @@ -0,0 +1,38 @@ +import loadGoogleMapsApi = require('load-google-maps-api'); + +// Example from README.md https://github.com/yuanqing/load-google-maps-api#usage +loadGoogleMapsApi().then((googleMaps) => { + new googleMaps.Map(document.querySelector('.map'), { + center: { + lat: 40.7484405, + lng: -73.9944191 + }, + zoom: 12 + }); +}).catch((error) => { + console.error(error); +}); + +loadGoogleMapsApi({ libraries: 'drawing' }); // $ExpectError +loadGoogleMapsApi({ v: 3 }); // $ExpectError +loadGoogleMapsApi({ timeout: '1000' }); // $ExpectError + +loadGoogleMapsApi({ + channel: 'customer', + client: '12345', + key: 'abcde', + language: 'se', + libraries: [ + 'drawing', + 'geometry', + 'places', + 'visualization', + ], + region: 'SE', + timeout: 500, + v: '3.33', +}).then(gm => { + gm; // $ExpectType typeof maps + const map = new gm.Map(document.querySelector('.map')); // $ExpectType Map + const polygon = new gm.Polygon(); // $ExpectType Polygon +}); diff --git a/types/load-google-maps-api/tsconfig.json b/types/load-google-maps-api/tsconfig.json new file mode 100644 index 0000000000..7d3af9db08 --- /dev/null +++ b/types/load-google-maps-api/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "load-google-maps-api-tests.ts" + ] +} diff --git a/types/load-google-maps-api/tslint.json b/types/load-google-maps-api/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/load-google-maps-api/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/loadable__component/index.d.ts b/types/loadable__component/index.d.ts new file mode 100644 index 0000000000..c4877bd8a9 --- /dev/null +++ b/types/loadable__component/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for @loadable/component 5.2 +// Project: https://github.com/smooth-code/loadable-components +// Definitions by: Martynas Kadiša +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; + +export interface DefaultImportedComponent

{ + default: React.ComponentType

; +} + +export type DefaultComponent

= React.ComponentType

| DefaultImportedComponent

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

loading...
}); + + // Should allow passing `fallback` prop to loadable component + loading...} />; +} + +// lazy +{ + // Should infer props from imported component with default export + const LazyDefaultComponent = lazy(defaultImportComponentLoader); + ; + + // Should infer props from imported component without default export + const LazyComponent = lazy(importComponentLoader); + ; + + // Should allow passing fallback prop + loading...} />; +} + +// loadable.lib +{ + // Should infer types from module with default export and reflect them in children render prop + const LoadableDefaultLibrary = loadable.lib(defaultImportLibLoader); + + {({ default: { getTestObj } }) => getTestObj().foo} + ; + + // Should infer types from module without default export and reflect them in children render prop + const LoadableLibrary = loadable.lib(importLibLoader); + + {({ getTestObj }) => getTestObj().foo} + ; + + // Should allow passing fallback JSX element + loadable.lib(importLibLoader, { fallback:
loading lib...
}); + + // Should allow passing fallback prop + Loading library...}> + {({ getTestObj }) => getTestObj().foo} + ; + + // Should reflect inferred types from module in ref + const ref = React.createRef(); + ; + ref.current!.getTestObj().foo; +} + +// lazy.lib +{ + // Should infer types from module with default export and reflect them in children render prop + const LazyDefaultLibrary = lazy.lib(defaultImportLibLoader); + + {({ default: { getTestObj } }) => getTestObj().foo} + ; + + // Should infer types from module without default export and reflect them in children render prop + const LazyLibrary = lazy.lib(importLibLoader); + + {({ getTestObj }) => getTestObj().foo} + ; + + // Should allow passing fallback prop + Loading library...}> + {({ getTestObj }) => getTestObj().foo} + ; + + // Should reflect inferred types from module in ref + const ref = React.createRef(); + ; + ref.current!.getTestObj().foo; +} + +// loadableReady +{ + // Should allow passing callback argument + loadableReady(() => {}); + + // Should return a promise + loadableReady().then(() => {}); +} diff --git a/types/loadable__component/tsconfig.json b/types/loadable__component/tsconfig.json new file mode 100644 index 0000000000..440535e42b --- /dev/null +++ b/types/loadable__component/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "@loadable/component": [ + "loadable__component" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "loadable__component-tests.tsx" + ] +} diff --git a/types/loadable__component/tslint.json b/types/loadable__component/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/loadable__component/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/loadable__server/index.d.ts b/types/loadable__server/index.d.ts new file mode 100644 index 0000000000..eafbd7eec7 --- /dev/null +++ b/types/loadable__server/index.d.ts @@ -0,0 +1,86 @@ +// Type definitions for @loadable/server 5.2 +// Project: https://github.com/smooth-code/loadable-components +// Definitions by: Martynas Kadiša +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { ComponentType, ReactElement, Component } from 'react'; + +export type ChunkExtractorOptions = { + /** + * Webpack entrypoints to load (default to `["main"]`) + */ + entrypoints?: string | string[]; + /** + * Optional output path (only for `requireEntrypoint`) + */ + outputPath?: string; +} & ({ + /** + * Stats file path generated using `@loadable/webpack-plugin` + */ + statsFile: string; + } | { + /** + * Stats generated using `@loadable/webpack-plugin`. + */ + stats: object; + }); + +/** + * Used to collect chunks server-side and get them as script tags or script elements + */ +export class ChunkExtractor { + constructor(options: ChunkExtractorOptions); + + /** + * Wrap your application in a `ChunkExtractorManager` + */ + collectChunks( + /** + * JSX element that will be wrapped in `ChunkExtractorManager` + */ + element: JSX.Element + ): JSX.Element; + + /** + * Require the entrypoint of your application as a commonjs module. + */ + requireEntrypoint(name?: string): { default: ComponentType }; + + /** + * Get scripts as a string of `

{ * * Note: can only be called on a wrapper of a single node. */ - closest(component: ComponentClass): ReactWrapper; closest(statelessComponent: StatelessComponent): ReactWrapper; + closest(component: ComponentType): ReactWrapper; closest(props: EnzymePropSelector): ReactWrapper; closest(selector: string): ReactWrapper; diff --git a/types/es-feature-detection/es-feature-detection-tests.ts b/types/es-feature-detection/es-feature-detection-tests.ts index 13b779c1bb..3e769f6636 100644 --- a/types/es-feature-detection/es-feature-detection-tests.ts +++ b/types/es-feature-detection/es-feature-detection-tests.ts @@ -6,7 +6,7 @@ if (fns["Array.prototype.includes"]) { } const syntax = es.syntax(); if (syntax["Arrow function"]) { - new Function("() => {}"); + // new Function("() => {}"); } if (fns.es2017.__all && syntax.es2017.__all) { diff --git a/types/escape-goat/escape-goat-tests.ts b/types/escape-goat/escape-goat-tests.ts new file mode 100644 index 0000000000..cfc1808495 --- /dev/null +++ b/types/escape-goat/escape-goat-tests.ts @@ -0,0 +1,14 @@ +import * as escapeGoat from 'escape-goat'; + +// $ExpectType string +escapeGoat.escape('🦄 & 🐐'); + +// $ExpectType string +escapeGoat.unescape('🦄 & 🐐'); + +// $ExpectType string +escapeGoat.escape('Hello World'); + +const url = 'https://sindresorhus.com?x="🦄"'; +// $ExpectType string +escapeGoat.escapeTag`Unicorn`; diff --git a/types/escape-goat/index.d.ts b/types/escape-goat/index.d.ts new file mode 100644 index 0000000000..f76f384fb0 --- /dev/null +++ b/types/escape-goat/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for escape-goat 1.3 +// Project: https://github.com/sindresorhus/escape-goat#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function escape(input: string): string; +export function unescape(input: string): string; +export function escapeTag(template: TemplateStringsArray, ...substitutions: any[]): string; +export function unescapeTag(template: TemplateStringsArray, ...substitutions: any[]): string; diff --git a/types/escape-goat/tsconfig.json b/types/escape-goat/tsconfig.json new file mode 100644 index 0000000000..9715cb59e1 --- /dev/null +++ b/types/escape-goat/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", + "escape-goat-tests.ts" + ] +} diff --git a/types/escape-goat/tslint.json b/types/escape-goat/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/escape-goat/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/eslint/eslint-tests.ts b/types/eslint/eslint-tests.ts index ed211d220e..6d175716b3 100644 --- a/types/eslint/eslint-tests.ts +++ b/types/eslint/eslint-tests.ts @@ -539,4 +539,12 @@ ruleTester.run('my-rule', rule, { ] }); +ruleTester.run('simple-valid-test', rule, { + valid: [ + 'foo', + 'bar', + { code: 'foo', options: [{ allowFoo: true }] }, + ] +}); + //#endregion diff --git a/types/eslint/index.d.ts b/types/eslint/index.d.ts index 01f39ee83e..f1a585046c 100644 --- a/types/eslint/index.d.ts +++ b/types/eslint/index.d.ts @@ -540,7 +540,7 @@ export class RuleTester { name: string, rule: Rule.RuleModule, tests: { - valid?: RuleTester.ValidTestCase[]; + valid?: Array; invalid?: RuleTester.InvalidTestCase[]; }, ): void; diff --git a/types/ethereumjs-tx/index.d.ts b/types/ethereumjs-tx/index.d.ts index 1d52f5f8a4..a030edee1e 100644 --- a/types/ethereumjs-tx/index.d.ts +++ b/types/ethereumjs-tx/index.d.ts @@ -1,19 +1,37 @@ // Type definitions for ethereumjs-tx 1.0 // Project: https://github.com/ethereumjs/ethereumjs-tx // Definitions by: Leonid Logvinov +// David Mihal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +import BN = require("bn.js"); + declare class EthereumTx { raw: Buffer[]; r: Buffer; s: Buffer; v: Buffer; nonce: Buffer; + gasPrice: Buffer; + gasLimit: Buffer; + to: Buffer; + value: Buffer; + data: Buffer; serialize(): Buffer; sign(buffer: Buffer): void; + toJSON(): string | string[]; + toCreationAddress(): boolean; + hash(includeSignature?: boolean): Buffer; + getChainId(): Buffer; getSenderAddress(): Buffer; + getSenderPublicKey(): Buffer; + verifySignature(): boolean; + getDataFee(): BN; + getBaseFee(): BN; + getUpfrontCost(): BN; + validate(stringError?: boolean): string | boolean; constructor(txParams: any); } export = EthereumTx; diff --git a/types/eureka-js-client/eureka-js-client-tests.ts b/types/eureka-js-client/eureka-js-client-tests.ts index 109dab0278..f9382655cb 100644 --- a/types/eureka-js-client/eureka-js-client-tests.ts +++ b/types/eureka-js-client/eureka-js-client-tests.ts @@ -1,4 +1,4 @@ -import { Eureka } from 'eureka-js-client'; +import { Eureka, EurekaClient } from 'eureka-js-client'; // example configuration const client = new Eureka({ @@ -19,3 +19,74 @@ const client = new Eureka({ port: 32768, } }); + +// example configuration against newer Eureka (https://www.npmjs.com/package/eureka-js-client#400-bad-request-errors-from-eureka-server) +const newerClient = new Eureka({ + // application instance information + instance: { + app: 'jqservice', + hostName: 'localhost', + ipAddr: '127.0.0.1', + port: { + $: 443, + '@enabled': true + }, + vipAddress: 'jq.test.something.com', + dataCenterInfo: { + '@class': 'com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo', + name: 'MyOwn', + }, + }, + eureka: { + // eureka server host / port + host: '192.168.99.100', + port: 32768, + } +}); + +const ymlInitClient = new Eureka({ + cwd: `/opt/config`, + filename: 'eureka-config' +}); + +// Test callbacks +newerClient.start((err: Error) => {}); +newerClient.start(() => {}); +newerClient.start(); +newerClient.stop((err: Error) => {}); +newerClient.start(() => {}); +newerClient.stop(); + +const fakeInstanceResponse: EurekaClient.EurekaInstanceConfig[] = [ + { + instanceId: 'config-server:8888', + hostName: '10.10.10.10', + app: 'CONFIG-SERVER', + ipAddr: '10.10.10.10', + status: 'UP', + overriddenstatus: 'UNKNOWN', + port: { + $: 8888, + '@enabled': true + }, + securePort: { + $: 443, + '@enabled': true + }, + countryId: 1, + dataCenterInfo: { + '@class': 'com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo', + name: 'MyOwn' + }, + metadata: { '@class': 'java.util.Collections$EmptyMap' }, + homePageUrl: 'http://10.10.10.10:8888/', + statusPageUrl: 'http://10.10.10.10:8888/info', + healthCheckUrl: 'http://10.10.10.10:8888/v1/service-health', + vipAddress: 'config-server', + secureVipAddress: 'config-server', + isCoordinatingDiscoveryServer: false, + lastUpdatedTimestamp: 1544691255230, + lastDirtyTimestamp: 1544691254634, + actionType: 'ADDED' + } +]; diff --git a/types/eureka-js-client/index.d.ts b/types/eureka-js-client/index.d.ts index bfd9f10666..ff63b02340 100644 --- a/types/eureka-js-client/index.d.ts +++ b/types/eureka-js-client/index.d.ts @@ -1,14 +1,16 @@ -// Type definitions for eureka-js-client 4.3 +// Type definitions for eureka-js-client 4.4 // Project: https://github.com/jquatier/eureka-js-client // Definitions by: Ilko Hoffmann +// Karl O. +// Tom Barton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export class Eureka { - constructor(config: EurekaClient.EurekaConfig) - start(): void; - stop(): void; - getInstancesByAppId(appId: string): string[]; - getInstancesByVipAddress(vidAddress: string): string []; + constructor(config: EurekaClient.EurekaConfig | EurekaClient.EurekaYmlConfig) + start(cb?: (err: Error, ...rest: any[]) => void): void; + stop(cb?: (err: Error, ...rest: any[]) => void): void; + getInstancesByAppId(appId: string): EurekaClient.EurekaInstanceConfig[]; + getInstancesByVipAddress(vidAddress: string): EurekaClient.EurekaInstanceConfig[]; } export namespace EurekaClient { @@ -26,11 +28,11 @@ export namespace EurekaClient { ipAddr: string; vipAddress: string; dataCenterInfo: DataCenterInfo; - port?: number; + port?: number | PortWrapper | LegacyPortWrapper; instanceId?: string; appGroupName?: string; sid?: string; - securePort?: PortWrapper; + securePort?: number | PortWrapper | LegacyPortWrapper; homePageUrl?: string; statusPageUrl?: string; healthCheckUrl?: string; @@ -41,6 +43,12 @@ export namespace EurekaClient { overriddenstatus?: InstanceStatus; leaseInfo?: LeaseInfo; isCoordinatingDiscoveryServer?: boolean; + lastUpdatedTimestamp?: number; + lastDirtyTimestamp?: number; + actionType?: ActionType; + metadata?: { + [index: string]: string; + }; } interface EurekaClientConfig { host: string; @@ -60,16 +68,36 @@ export namespace EurekaClient { registerWithEureka?: boolean; useLocalMetadata?: boolean; preferIpAddress?: boolean; + shouldUseDelta?: boolean; + logger?: { + warn: (...args: any[]) => void; + info: (...args: any[]) => void; + debug: (...args: any[]) => void; + error: (...args: any[]) => void; + }; + } + interface EurekaYmlConfig { + cwd: string; + filename?: string; + } + interface LegacyPortWrapper { + '$': number; + '@enabled': boolean; } interface PortWrapper { enabled: boolean; port: number; } interface LeaseInfo { - renewalIntervalInSecs: number; - durationInSecs: number; + renewalIntervalInSecs?: number; + durationInSecs?: number; + registrationTimestamp?: number; + lastRenewalTimestamp?: number; + evictionTimestamp?: number; + serviceUpTimestamp?: number; } interface DataCenterInfo { name: DataCenterName; + '@class'?: string; } } diff --git a/types/event-emitter/index.d.ts b/types/event-emitter/index.d.ts index 1b5fb29c62..6cb71999e2 100644 --- a/types/event-emitter/index.d.ts +++ b/types/event-emitter/index.d.ts @@ -15,6 +15,6 @@ declare namespace ee { } } -declare function ee(obj: any): ee.Emitter; +declare function ee(obj?: any): ee.Emitter; export = ee; diff --git a/types/events/events-tests.ts b/types/events/events-tests.ts index 67fe352225..868ad8efde 100644 --- a/types/events/events-tests.ts +++ b/types/events/events-tests.ts @@ -16,6 +16,12 @@ const listener3 = (arg1: string) => { const listener4 = () => { console.log('type of number'); }; +const listener5 = () => { + console.log('prepend listener'); +}; +const listener6 = () => { + console.log('prepend once listener'); +}; emitter.setMaxListeners(100); @@ -29,12 +35,20 @@ emitter.once('send', listener); emitter.once(1, listener4); +emitter.prependListener('send', listener5); + +emitter.prependOnceListener('send', listener6); + emitter.listeners('send'); emitter.listenerCount('send'); +emitter.rawListeners('send'); EventEmitter.defaultMaxListeners = 100; console.log(`count(static): ${EventEmitter.listenerCount(emitter, 'send')}`); console.log(`ncount: ${emitter.listenerCount('send')}`); +console.log(`maxListeners: ${emitter.getMaxListeners()}`); +console.log(`eventNames: ${emitter.eventNames().join(', ')}`); +console.log(`rawListeners count: ${emitter.rawListeners('send').length}`); setTimeout(() => { console.log('\n'); @@ -47,6 +61,12 @@ setTimeout(() => { emitter.removeListener('send', listener2); }, 2000); +setTimeout(() => { + console.log('\n'); + emitter.emit('send'); + emitter.off('send', listener3); +}, 2000); + setTimeout(() => { console.log('\n'); emitter.emit('send', 'params1'); diff --git a/types/events/index.d.ts b/types/events/index.d.ts index c9b08a4575..a6cf834285 100644 --- a/types/events/index.d.ts +++ b/types/events/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for events 1.2 +// Type definitions for events 3.0 // Project: https://github.com/Gozala/events // Definitions by: Yasunori Ohoka +// Shenwei Wang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export type Listener = (...args: any[]) => void; @@ -9,13 +10,19 @@ export class EventEmitter { static listenerCount(emitter: EventEmitter, type: string | number): number; static defaultMaxListeners: number; + eventNames(): Array; setMaxListeners(n: number): this; + getMaxListeners(): number; emit(type: string | number, ...args: any[]): boolean; addListener(type: string | number, listener: Listener): this; on(type: string | number, listener: Listener): this; once(type: string | number, listener: Listener): this; + prependListener(type: string | number, listener: Listener): this; + prependOnceListener(type: string | number, listener: Listener): this; removeListener(type: string | number, listener: Listener): this; + off(type: string | number, listener: Listener): this; removeAllListeners(type?: string | number): this; listeners(type: string | number): Listener[]; listenerCount(type: string | number): number; + rawListeners(type: string | number): Listener[]; } diff --git a/types/eventsource/eventsource-tests.ts b/types/eventsource/eventsource-tests.ts index c1b53030cd..d06c79cdde 100644 --- a/types/eventsource/eventsource-tests.ts +++ b/types/eventsource/eventsource-tests.ts @@ -10,9 +10,9 @@ let openState: number = eventSource.OPEN; openState = EventSource.OPEN; let url: string = eventSource.url; let withCredentials: boolean = eventSource.withCredentials; -eventSource.onmessage = (event: Event) => {}; -eventSource.onerror = (event: Event) => {}; -eventSource.onopen = (event: Event) => {}; +eventSource.onmessage = (event: MessageEvent) => {}; +eventSource.onerror = (event: MessageEvent) => {}; +eventSource.onopen = (event: MessageEvent) => {}; eventSource.addEventListener = (type: string, listener: (e: Event) => void) => {}; eventSource.dispatchEvent = (event: Event) => true; eventSource.removeEventListener = (type: string, listener: (e: Event) => void) => {}; @@ -30,9 +30,9 @@ openState = eventSource.OPEN; openState = EventSource.OPEN; url = eventSourcePolyfill.url; withCredentials = eventSource.withCredentials; -eventSourcePolyfill.onmessage = (event: Event) => {}; -eventSourcePolyfill.onerror = (event: Event) => {}; -eventSourcePolyfill.onopen = (event: Event) => {}; +eventSourcePolyfill.onmessage = (event: MessageEvent) => {}; +eventSourcePolyfill.onerror = (event: MessageEvent) => {}; +eventSourcePolyfill.onopen = (event: MessageEvent) => {}; eventSourcePolyfill.addEventListener = (type: string, listener: (e: Event) => void) => {}; eventSourcePolyfill.dispatchEvent = (event: Event) => true; eventSourcePolyfill.removeEventListener = (type: string, listener: (e: Event) => void) => {}; diff --git a/types/eventsource/index.d.ts b/types/eventsource/index.d.ts index 1308515917..f0dcd7513f 100644 --- a/types/eventsource/index.d.ts +++ b/types/eventsource/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for eventsource 1.0 +// Type definitions for eventsource 1.1 // Project: http://github.com/EventSource/eventsource // Definitions by: Scott Lee Davis // Ali Afroozeh +// Pedro Gámez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -18,9 +19,9 @@ declare class EventSource { readonly url: string; readonly readyState: number; readonly withCredentials: boolean; - onopen: EventListener; - onmessage: EventListener; - onerror: EventListener; + onopen: (evt: MessageEvent) => any; + onmessage: (evt: MessageEvent) => any; + onerror: (evt: MessageEvent) => any; addEventListener(type: string, listener: EventListener): void; dispatchEvent(evt: Event): boolean; removeEventListener(type: string, listener?: EventListener): void; @@ -28,7 +29,7 @@ declare class EventSource { } declare namespace EventSource { - enum ReadyState {CONNECTING = 0, OPEN = 1, CLOSED = 2} + enum ReadyState { CONNECTING = 0, OPEN = 1, CLOSED = 2 } interface EventSourceInitDict { withCredentials?: boolean; diff --git a/types/eventsource/lib/eventsource-polyfill/index.d.ts b/types/eventsource/lib/eventsource-polyfill/index.d.ts index 86b82105cc..74e3e22faa 100644 --- a/types/eventsource/lib/eventsource-polyfill/index.d.ts +++ b/types/eventsource/lib/eventsource-polyfill/index.d.ts @@ -11,9 +11,9 @@ declare class EventSource { readonly url: string; readonly readyState: number; readonly withCredentials: boolean; - onopen: EventListener; - onmessage: EventListener; - onerror: EventListener; + onopen: (evt: MessageEvent) => any; + onmessage: (evt: MessageEvent) => any; + onerror: (evt: MessageEvent) => any; addEventListener(type: string, listener: EventListener): void; dispatchEvent(evt: Event): boolean; removeEventListener(type: string, listener?: EventListener): void; diff --git a/types/execall/execall-tests.ts b/types/execall/execall-tests.ts new file mode 100644 index 0000000000..8a9d3b7768 --- /dev/null +++ b/types/execall/execall-tests.ts @@ -0,0 +1,3 @@ +import execall = require('execall'); + +execall(/(\d+)/g, '$200 and $400'); // $ExpectType Match[] diff --git a/types/execall/index.d.ts b/types/execall/index.d.ts new file mode 100644 index 0000000000..29e7d3945e --- /dev/null +++ b/types/execall/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for execall 1.0 +// Project: https://github.com/sindresorhus/execall +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = execall; + +/** + * Find multiple RegExp matches in a string. Instead of having to iterate over + * `RegExp#exec`, immutable, and with a nicer result format. + * + * @param re Regular expression to match against the `input`. + * @returns An array of matches. + */ +declare function execall(re: RegExp, input: string): execall.Match[]; + +declare namespace execall { + interface Match { + match: string; + sub: string[]; + index: number; + } +} diff --git a/types/execall/tsconfig.json b/types/execall/tsconfig.json new file mode 100644 index 0000000000..70a42a9a18 --- /dev/null +++ b/types/execall/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", + "execall-tests.ts" + ] +} diff --git a/types/execall/tslint.json b/types/execall/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/execall/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/exif/exif-tests.ts b/types/exif/exif-tests.ts new file mode 100644 index 0000000000..57d29fc80b --- /dev/null +++ b/types/exif/exif-tests.ts @@ -0,0 +1,18 @@ +import Exif = require('exif'); +const ExifImage = Exif.ExifImage; + +new ExifImage({ image: 'myImage.jpg' }, (error, exifData) => { + if (error) { + console.log(`Error: ${error.message}`); + } else { + console.log(exifData); + } +}); + +Exif('myImage.jpg', (error, exifData, dataPath) => { + if (error) { + console.log(`Error: ${error.message}`); + } else { + console.log(exifData, dataPath); + } +}); diff --git a/types/exif/index.d.ts b/types/exif/index.d.ts new file mode 100644 index 0000000000..78a1859517 --- /dev/null +++ b/types/exif/index.d.ts @@ -0,0 +1,143 @@ +// Type definitions for exif 0.6 +// Project: https://github.com/gomfunkel/node-exif#readme +// Definitions by: Florian Keller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace Exif { + interface ExifData { + image: { + Copyright?: string; + ExifOffset?: number; + ImageHeight?: number; + ImageWidth?: number; + Make?: string; + Model?: string; + ModifyDate?: string; + Orientation?: number; + ResolutionUnit?: number; + Software?: string; + XResolution?: number; + YCbCrPositioning?: number; + YResolution?: number; + }; + thumbnail: { + Compression?: number; + Orientation?: number; + ResolutionUnit?: number; + ThumbnailLength?: number; + ThumbnailOffset?: number; + XResolution?: number; + YCbCrPositioning?: number; + YResolution?: number; + }; + exif: { + ApertureValue?: number; + BrightnessValue?: number; + ColorSpace?: number; + ComponentsConfiguration?: Buffer; + CompressedBitsPerPixel?: number; + CreateDate?: string; + DateTimeOriginal?: string; + ExifImageHeight?: number; + ExifImageWidth?: number; + ExifVersion?: Buffer; + ExposureCompensation?: number; + ExposureMode?: number; + ExposureProgram?: number; + ExposureTime?: number; + FileSource?: Buffer; + Flash?: number; + FlashpixVersion?: Buffer; + FNumber?: number; + FocalLength?: number; + FocalLengthIn35mmFormat?: number; + FocalPlaneResolutionUnit?: number; + FocalPlaneXResolution?: number; + FocalPlaneYResolution?: number; + ImageUniqueID?: string; + InteropOffset?: number; + ISO?: number; + MakerNote?: Buffer; + MaxApertureValue?: number; + MeteringMode?: number; + SceneCaptureType?: number; + SceneType?: Buffer; + SensingMethod?: number; + ShutterSpeedValue?: number; + UserComment?: Buffer; + WhiteBalance?: number; + }; + gps: { + GPSAltitude?: number; + GPSAltitudeRef?: number; + GPSDateStamp?: string; + GPSLatitude?: number[]; + GPSLatitudeRef?: string; + GPSLongitude?: number[]; + GPSLongitudeRef?: string; + GPSTimeStamp?: number[]; + GPSVersionId?: number[]; + }; + interoperability: { + InteropIndex?: string; + InteropVersion?: Buffer; + }; + makernote: { + AutoBracketing?: number; + BlurWarning?: number; + ExposureWarning?: number; + error?: string; + FlashExposureComp?: number; + FocusMode?: number; + FocusWarning?: number; + FujiFlashMode?: number; + Macro?: number; + Quality?: string; + Sharpness?: number; + SlowSync?: number; + Version?: Buffer; + WhiteBalance?: number; + }; + } + + interface ExifOptions { + agfaMaxEntries?: number; + epsonMaxEntries?: number; + /** node-exif corrects the thumbnail offset in order to have an offset from the start of the buffer/file. */ + fixThumbnailOffset?: boolean; + fujifilmMaxEntries?: number; + ifd0MaxEntries?: number; + ifd1MaxEntries?: number; + /** + * The image to get Exif data from can be either a filesystem path or a Buffer. + * + * If `image` is not specified, the developer must call `loadImage()` to parse the image. + */ + image?: string | Buffer; + /** Specifies the maximum entries to be parsed */ + maxEntries?: number; + maxGpsEntries?: number; + maxInteroperabilityEntries?: number; + noPadding?: boolean; + olympusMaxEntries?: number; + panasonicMaxEntries?: number; + sanyoMaxEntries?: number; + /** An object named "offsets" is added to exifData and contains lot of offsets needed to get thumbnail and other things. */ + tiffOffsets?: number; + } + + type ExifImageCallback = (error: Error | null, data: ExifData) => void; + type ExifCallback = (error: Error | null, data: ExifData, dataPath: string) => void; + + class ExifImage { + constructor(options: ExifOptions | string | Buffer, callback: ExifImageCallback); + constructor(); + loadImage(file: string | Buffer, callback: ExifImageCallback): void; + } +} + +declare function Exif(path: string, callback: Exif.ExifCallback): void; + +export = Exif; diff --git a/types/exif/tsconfig.json b/types/exif/tsconfig.json new file mode 100644 index 0000000000..4c0c12d69a --- /dev/null +++ b/types/exif/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", + "exif-tests.ts" + ] +} diff --git a/types/exif/tslint.json b/types/exif/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/exif/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index 75dee784de..62a7dcbb91 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { Text } from 'react-native'; +import { Text, AccessibilityInfo } from 'react-native'; import { Accelerometer, @@ -8,40 +8,48 @@ import { AdMobInterstitial, AdMobRewarded, Amplitude, - Asset, - AuthSession, - Audio, AppLoading, + Asset, + Audio, + AuthSession, BarCodeScanner, - BlurViewProps, BlurView, Brightness, + Calendar, Camera, CameraObject, + Constants, + Contacts, DocumentPicker, + EdgeInsets, + EdgePadding, + EventUserLocation, Facebook, FacebookAds, - FileSystem, - ImagePicker, - ImageManipulator, FaceDetector, - Linking, - Svg, + FileSystem, + Haptic, + ImageManipulator, + ImagePicker, IntentLauncherAndroid, KeepAwake, + KmlMapEvent, LinearGradient, + Linking, + Location, + MailComposer, + MapEvent, + MapStyleElement, + MapView, + MediaLibrary, Permissions, PublisherBanner, + Region, registerRootComponent, ScreenOrientation, - SQLite, - Calendar, - MailComposer, - Location, - Updates, - MediaLibrary, - Haptic, - Constants + SecureStore, + Svg, + Updates } from 'expo'; const reverseGeocode: Promise = Location.reverseGeocodeAsync({ @@ -254,13 +262,13 @@ async () => { ); -const barcodeReadCallback = () => {}; +const barCodeScannedCallback = () => {}; () => ( + onBarCodeScanned={barCodeScannedCallback} /> ); () => ( @@ -477,6 +485,30 @@ async () => { isString(queryParams2['y'] || ''); }; +// #region securestore +async () => { + await SecureStore.setItemAsync('some-key', 'some-val', { + keychainService: "some-service", + keychainAccessible: SecureStore.WHEN_PASSCODE_SET_THIS_DEVICE_ONLY, + }); + const result = await SecureStore.getItemAsync('some-key', { keychainService: "some-service" }); + if (result != null) { + result.slice() === 'some-val'; + } + await SecureStore.deleteItemAsync('some-key', { keychainService: "some-service" }); +}; + +const allSecureStoreKeychainAccessibleValues: number[] = [ + SecureStore.WHEN_UNLOCKED, + SecureStore.AFTER_FIRST_UNLOCK, + SecureStore.ALWAYS, + SecureStore.WHEN_UNLOCKED_THIS_DEVICE_ONLY, + SecureStore.WHEN_PASSCODE_SET_THIS_DEVICE_ONLY, + SecureStore.AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY, + SecureStore.ALWAYS_THIS_DEVICE_ONLY, +]; +// #endregion + () => ( { - const result = await Permissions.askAsync(Permissions.CAMERA); + const result = await Permissions.askAsync(Permissions.CAMERA, Permissions.CONTACTS); result.status === 'granted'; result.status === 'denied'; @@ -837,6 +868,100 @@ async () => { result.status === 'saved'; }; +// #region MapView +const initialRegion: Region = { + latitude: 0, + longitude: 0, + latitudeDelta: 0, + longitudeDelta: 0, +}; + +const edgePadding: EdgePadding = { + top: 0, + right: 0, + bottom: 0, + left: 0, +}; + +const edgeInsets: EdgeInsets = { + top: 0, + right: 0, + bottom: 0, + left: 0, +}; + +const mapStyleElements: MapStyleElement[] = [{ + featureType: 'featureType', + elementType: 'elementType', + stylers: [{}, {}], +}]; + +const mapEventCallback = (event: MapEvent) => console.log(event); +const regionCallback = (region: Region) => console.log(region); +const kmlCallback = (kml: KmlMapEvent) => console.log(kml); +const userLocationCallback = (event: EventUserLocation) => console.log(event); + +() => ( + ({})} + onKmlReady={kmlCallback} + onRegionChange={regionCallback} + onRegionChangeComplete={regionCallback} + onPress={mapEventCallback} + onLongPress={mapEventCallback} + onUserLocationChange={userLocationCallback} + onPanDrag={mapEventCallback} + onPoiClick={(event: MapEvent<{ placeId: string, name: string }>) => console.log(event)} + onMarkerPress={(event: MapEvent<{ action: 'marker-press', id: string }>) => console.log(event)} + onMarkerSelect={(event: MapEvent<{ action: 'marker-select', id: string }>) => console.log(event)} + onMarkerDeselect={(event: MapEvent<{ action: 'marker-deselect', id: string }>) => console.log(event)} + onCalloutPress={(event: MapEvent<{ action: 'callout-press' }>) => console.log(event)} + onMarkerDragStart={mapEventCallback} + onMarkerDrag={mapEventCallback} + onMarkerDragEnd={mapEventCallback} + + minZoomLevel={0} + maxZoomLevel={0} + kmlSrc="src" + style={{ flex: 1 }} + /> +); +// #endregion + async () => { const updateEventListener: Updates.UpdateEventListener = ({ type, manifest, message }) => { switch (type) { @@ -916,6 +1041,7 @@ async () => { return true; } }; + // #region MediaLibrary async () => { const mlAsset: MediaLibrary.Asset = await MediaLibrary.createAssetAsync('localUri'); @@ -967,3 +1093,172 @@ async () => { const userAgent: string = await Constants.getWebViewUserAgentAsync(); }; // #endregion + +// #region Contacts +Contacts.Fields.ID === 'id'; +Contacts.Fields.Name === 'name'; +Contacts.Fields.FirstName === 'firstName'; +Contacts.Fields.MiddleName === 'middleName'; +Contacts.Fields.LastName === 'lastName'; +Contacts.Fields.NamePrefix === 'namePrefix'; +Contacts.Fields.NameSuffix === 'nameSuffix'; +Contacts.Fields.PhoneticFirstName === 'phoneticFirstName'; +Contacts.Fields.PhoneticMiddleName === 'phoneticMiddleName'; +Contacts.Fields.PhoneticLastName === 'phoneticLastName'; +Contacts.Fields.Birthday === 'birthday'; +Contacts.Fields.Emails === 'emails'; +Contacts.Fields.PhoneNumbers === 'phoneNumbers'; +Contacts.Fields.Addresses === 'addresses'; +Contacts.Fields.InstantMessageAddresses === 'instantMessageAddresses'; +Contacts.Fields.UrlAddresses === 'urlAddresses'; +Contacts.Fields.Company === 'company'; +Contacts.Fields.JobTitle === 'jobTitle'; +Contacts.Fields.Department === 'department'; +Contacts.Fields.ImageAvailable === 'imageAvailable'; +Contacts.Fields.Image === 'image'; +Contacts.Fields.Note === 'note'; +Contacts.Fields.Dates === 'dates'; +Contacts.Fields.Relationships === 'relationships'; +Contacts.Fields.Nickname === 'nickname'; +Contacts.Fields.RawImage === 'rawImage'; +Contacts.Fields.MaidenName === 'maidenName'; +Contacts.Fields.ContactType === 'contactType'; +Contacts.Fields.SocialProfiles === 'socialProfiles'; +Contacts.Fields.NonGregorianBirthday === 'nonGregorianBirthday'; + +const contact: Contacts.Contact = { + [Contacts.Fields.ID]: 'id', + [Contacts.Fields.Name]: 'name', + [Contacts.Fields.FirstName]: 'firstName', + [Contacts.Fields.MiddleName]: 'middleName', + [Contacts.Fields.LastName]: 'lastName', + [Contacts.Fields.NamePrefix]: 'namePrefix', + [Contacts.Fields.NameSuffix]: 'nameSuffix', + [Contacts.Fields.PhoneticFirstName]: 'phoneticFirstName', + [Contacts.Fields.PhoneticMiddleName]: 'phoneticMiddleName', + [Contacts.Fields.PhoneticLastName]: 'phoneticLastName', + [Contacts.Fields.Birthday]: { + day: 1, + month: 1, + year: 2010, + format: Contacts.CalendarFormats.Gregorian, + id: 'id', + label: 'label' + }, + [Contacts.Fields.Emails]: [{ + email: 'email', + isPrimary: true, + id: 'id', + label: 'label' + }], + [Contacts.Fields.PhoneNumbers]: [{ + number: 'number', + isPrimary: true, + digits: 'digits', + countryCode: 'countryCode', + id: 'id', + label: 'label' + }], + [Contacts.Fields.Addresses]: [{ + street: 'street', + city: 'city', + country: 'country', + region: 'region', + neighborhood: 'neighborhood', + postalCode: 'postalCode', + poBox: 'poBox', + isoCountryCode: 'isoCountryCode', + id: 'id', + label: 'label' + }], + [Contacts.Fields.InstantMessageAddresses]: [{ + service: 'service', + username: 'username', + localizedProfile: 'localizedProfile', + id: 'id', + label: 'label' + }], + [Contacts.Fields.UrlAddresses]: [{ + url: 'url', + id: 'id', + label: 'label' + }], + [Contacts.Fields.Company]: 'company', + [Contacts.Fields.JobTitle]: 'jobTitle', + [Contacts.Fields.Department]: 'department', + [Contacts.Fields.ImageAvailable]: true, + [Contacts.Fields.Image]: { + uri: 'uri' + }, + [Contacts.Fields.Note]: 'note', + [Contacts.Fields.Dates]: [{ + day: 1, + month: 1, + year: 2010, + format: Contacts.CalendarFormats.Gregorian, + id: 'id', + label: 'label' + }], + [Contacts.Fields.Relationships]: [{ + name: 'name', + id: 'id', + label: 'label' + }], + [Contacts.Fields.Nickname]: 'nickname', + [Contacts.Fields.RawImage]: { + uri: 'uri' + }, + [Contacts.Fields.MaidenName]: 'maidenName', + [Contacts.Fields.ContactType]: Contacts.ContactTypes.Person, + [Contacts.Fields.SocialProfiles]: [{ + service: 'service', + username: 'username', + localizedProfile: 'localizedProfile', + url: 'url', + userId: 'userId', + id: 'id', + label: 'label' + }], + [Contacts.Fields.NonGregorianBirthday]: { + day: 1, + month: 1, + year: 2010, + format: Contacts.CalendarFormats.Hebrew, + id: 'id', + label: 'label' + } +}; + +async () => { + const response1: Contacts.ContactResponse = await Contacts.getContactsAsync(); + const response2: Contacts.ContactResponse = await Contacts.getContactsAsync({ id: 'contactId' }); + + const response3: Contacts.Contact = await Contacts.getContactByIdAsync('contactId'); + const response4: Contacts.Contact = await Contacts.getContactByIdAsync('contactId', [Contacts.Fields.Name]); + + const response5: string = await Contacts.addContactAsync(contact); + const response6: string = await Contacts.addContactAsync(contact, 'containerId'); + + const response7: string = await Contacts.updateContactAsync(contact); + await Contacts.removeContactAsync('contactId'); + const response8: string = await Contacts.writeContactToFileAsync({ id: 'contactId' }); + await Contacts.presentFormAsync('contactId'); + await Contacts.addExistingGroupToContainerAsync('groupId', 'containerId'); + + const response9: string = await Contacts.createGroupAsync('groupId'); + const response10: string = await Contacts.createGroupAsync('groupId', 'containerId'); + + await Contacts.updateGroupNameAsync('groupName', 'groupId'); + await Contacts.removeGroupAsync('groupId'); + await Contacts.addExistingContactToGroupAsync('contactId', 'groupId'); + await Contacts.removeContactFromGroupAsync('contactId', 'groupId'); + + const response11 = await Contacts.getGroupsAsync({ groupName: 'groupName' }); + response11.forEach((_: Contacts.Group) => _); + + const response12: string = await Contacts.getDefaultContainerIdAsync(); + + const response13 = await Contacts.getContainersAsync({ containerId: 'containerId' }); + response13.forEach((_: Contacts.Container) => _); +}; +// #endregion diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 9e48e391d8..c206bc12ff 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -13,25 +13,20 @@ // Martin Olsson // Levan Basharuli // Pavel Ihm +// Bartosz Dotryw +// Jason Killian // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 +export * from 'react-native-maps'; +export { default as MapView } from 'react-native-maps'; + import { EventSubscription } from 'fbemitter'; -import { Component, ComponentClass, Ref, ComponentType } from 'react'; -import { - ColorPropType, - ImageRequireSource, - ImageURISource, - LinkingStatic as ReactNativeLinkingStatic, - NativeEventEmitter, - ViewProps, - ViewStyle, - Permission, - StyleProp -} from 'react-native'; +import { Component, ComponentClass, ComponentType, Ref } from 'react'; +import { ImageRequireSource, ImageURISource, LinkingStatic as ReactNativeLinkingStatic, StyleProp, ViewProps, ViewStyle } from 'react-native'; export type Axis = number; -export type BarCodeReadCallback = (params: { type: string; data: string; }) => void; +export type BarCodeScannedCallback = (params: { type: string; data: string; }) => void; export type Md5 = string; export type Orientation = 'portrait' | 'landscape'; export type RequireSource = ImageRequireSource; @@ -716,7 +711,7 @@ export interface BarCodeScannerProps extends ViewProps { type?: 'front' | 'back'; torchMode?: 'on' | 'off'; barCodeTypes?: string[]; - onBarCodeRead?: BarCodeReadCallback; + onBarCodeScanned?: BarCodeScannedCallback; } export class BarCodeScanner extends Component { @@ -810,7 +805,7 @@ export interface CameraProps extends ViewProps { flashMode?: string | number; /** Distance to plane of sharpest focus. A value between `0` and `1`. `0`: infinity focus, `1`: focus as close as possible. Default: `0`. For Android this is available only for some devices and when `useCamera2Api` is set to `true`. */ focusDepth?: number; - onBarCodeRead?: BarCodeReadCallback; + onBarCodeScanned?: BarCodeScannedCallback; onCameraReady?: () => void; onFacesDetected?: (options: { faces: TrackedFaceFeature[] }) => void; onMountError?: () => void; @@ -1006,150 +1001,479 @@ export namespace Constants { * Contacts */ export namespace Contacts { - type PhoneNumbers = 'phoneNumbers'; - type Emails = 'emails'; - type Addresses = 'addresses'; - type Image = 'image'; - type Thumbnail = 'thumbnail'; - type Note = 'note'; - type Birthday = 'birthday'; - type NonGregorianBirthday = 'nonGregorianBirthday'; - type NamePrefix = 'namePrefix'; - type NameSuffix = 'nameSuffix'; - type PhoneticFirstName = 'phoneticFirstName'; - type PhoneticMiddleName = 'phoneticMiddleName'; - type PhoneticLastName = 'phoneticLastName'; - type SocialProfiles = 'socialProfiles'; - type InstantMessageAddresses = 'instantMessageAddresses'; - type UrlAddresses = 'urlAddresses'; - type Dates = 'dates'; - type Relationships = 'relationships'; + // Constants - const PHONE_NUMBERS: PhoneNumbers; - const EMAILS: Emails; - const ADDRESSES: Addresses; - const IMAGE: Image; - const THUMBNAIL: Thumbnail; - const NOTE: Note; - const BIRTHDAY: Birthday; - const NON_GREGORIAN_BIRTHDAY: NonGregorianBirthday; - const NAME_PREFIX: NamePrefix; - const NAME_SUFFIX: NameSuffix; - const PHONETIC_FIRST_NAME: PhoneticFirstName; - const PHONETIC_MIDDLE_NAME: PhoneticMiddleName; - const PHONETIC_LAST_NAME: PhoneticLastName; - const SOCIAL_PROFILES: SocialProfiles; - const IM_ADDRESSES: InstantMessageAddresses; - const URLS: UrlAddresses; - const DATES: Dates; - const RELATIONSHIPS: Relationships; + namespace Fields { + type ID = 'id'; + type Name = 'name'; + type FirstName = 'firstName'; + type MiddleName = 'middleName'; + type LastName = 'lastName'; + type NamePrefix = 'namePrefix'; + type NameSuffix = 'nameSuffix'; + type PhoneticFirstName = 'phoneticFirstName'; + type PhoneticMiddleName = 'phoneticMiddleName'; + type PhoneticLastName = 'phoneticLastName'; + type Birthday = 'birthday'; + type Emails = 'emails'; + type PhoneNumbers = 'phoneNumbers'; + type Addresses = 'addresses'; + type InstantMessageAddresses = 'instantMessageAddresses'; + type UrlAddresses = 'urlAddresses'; + type Company = 'company'; + type JobTitle = 'jobTitle'; + type Department = 'department'; + type ImageAvailable = 'imageAvailable'; + type Image = 'image'; + type Note = 'note'; + type Dates = 'dates'; + type Relationships = 'relationships'; + type Nickname = 'nickname'; + type RawImage = 'rawImage'; + type MaidenName = 'maidenName'; + type ContactType = 'contactType'; + type SocialProfiles = 'socialProfiles'; + type NonGregorianBirthday = 'nonGregorianBirthday'; - type FieldType = PhoneNumbers | Emails | Addresses | Image | Thumbnail | - Note | Birthday | NonGregorianBirthday | NamePrefix | NameSuffix | - PhoneticFirstName | PhoneticMiddleName | PhoneticLastName | SocialProfiles | - InstantMessageAddresses | UrlAddresses | Dates | Relationships; - - interface Options { - pageSize?: number; - pageOffset?: number; - fields?: FieldType[]; + const ID: ID; + const Name: Name; + const FirstName: FirstName; + const MiddleName: MiddleName; + const LastName: LastName; + const NamePrefix: NamePrefix; + const NameSuffix: NameSuffix; + const PhoneticFirstName: PhoneticFirstName; + const PhoneticMiddleName: PhoneticMiddleName; + const PhoneticLastName: PhoneticLastName; + const Birthday: Birthday; + const Emails: Emails; + const PhoneNumbers: PhoneNumbers; + const Addresses: Addresses; + const InstantMessageAddresses: InstantMessageAddresses; + const UrlAddresses: UrlAddresses; + const Company: Company; + const JobTitle: JobTitle; + const Department: Department; + const ImageAvailable: ImageAvailable; + const Image: Image; + const Note: Note; + const Dates: Dates; + const Relationships: Relationships; + const Nickname: Nickname; + const RawImage: RawImage; + const MaidenName: MaidenName; + const ContactType: ContactType; + const SocialProfiles: SocialProfiles; + const NonGregorianBirthday: NonGregorianBirthday; } + type Field = + | Fields.ID + | Fields.Name + | Fields.FirstName + | Fields.MiddleName + | Fields.LastName + | Fields.NamePrefix + | Fields.NameSuffix + | Fields.PhoneticFirstName + | Fields.PhoneticMiddleName + | Fields.PhoneticLastName + | Fields.Birthday + | Fields.Emails + | Fields.PhoneNumbers + | Fields.Addresses + | Fields.InstantMessageAddresses + | Fields.UrlAddresses + | Fields.Company + | Fields.JobTitle + | Fields.Department + | Fields.ImageAvailable + | Fields.Image + | Fields.Note + | Fields.Dates + | Fields.Relationships + | Fields.Nickname + | Fields.RawImage + | Fields.MaidenName + | Fields.ContactType + | Fields.SocialProfiles + | Fields.NonGregorianBirthday; + + namespace FormTypes { + type New = 'new'; + type Unknown = 'unknown'; + type Default = 'default'; + + const New: New; + const Unknown: Unknown; + const Default: Default; + } + + type FormType = FormTypes.New | FormTypes.Unknown | FormTypes.Default; + + /** + * iOS Only + */ + namespace ContactTypes { + type Person = 'person'; + type Company = 'company'; + + const Person: Person; + const Company: Company; + } + + type ContactType = ContactTypes.Person | ContactTypes.Company; + + namespace SortTypes { + type FirstName = 'firstName'; + type LastName = 'lastName'; + type UserDefault = 'userDefault'; + + const FirstName: FirstName; + const LastName: LastName; + const UserDefault: UserDefault; + } + + type SortType = SortTypes.FirstName | SortTypes.LastName | SortTypes.UserDefault; + + /** + * iOS Only + */ + namespace ContainerTypes { + type Local = 'local'; + type Exchange = 'exchange'; + type CardDAV = 'cardDAV'; + type Unassigned = 'unassigned'; + + const Local: Local; + const Exchange: Exchange; + const CardDAV: CardDAV; + const Unassigned: Unassigned; + } + + type ContainerType = ContainerTypes.Local | ContainerTypes.Exchange | ContainerTypes.CardDAV | ContainerTypes.Unassigned; + + namespace CalendarFormats { + type Gregorian = 'gregorian'; + type Chinese = 'chinese'; + type Hebrew = 'hebrew'; + type Islamic = 'islamic'; + + const Gregorian: Gregorian; + const Chinese: Chinese; + const Hebrew: Hebrew; + const Islamic: Islamic; + } + + type CalendarFormat = CalendarFormats.Gregorian | CalendarFormats.Chinese | CalendarFormats.Hebrew | CalendarFormats.Islamic; + + // Types + + /** + * A set of fields that define information about a single entity. + */ interface Contact { id: string; - contactType: string; name: string; firstName?: string; middleName?: string; lastName?: string; - previousLastName?: string; + maidenName?: string; namePrefix?: string; nameSuffix?: string; nickname?: string; phoneticFirstName?: string; phoneticMiddleName?: string; phoneticLastName?: string; - emails?: Array<{ - email?: string; - primary?: boolean; - label: string; - id: string; - }>; - phoneNumbers?: Array<{ - number?: string; - primary?: boolean; - digits?: string; - countryCode?: string; - label: string; - id: string; - }>; - addresses?: Array<{ - street?: string; - city?: string; - country?: string; - region?: string; - neighborhood?: string; - postalCode?: string; - poBox?: string; - isoCountryCode?: string; - label: string; - id: string; - }>; - socialProfiles?: Array<{ - service?: string; - localizedProfile?: string; - url?: string; - username?: string; - userId?: string; - label: string; - id: string; - }>; - instantMessageAddresses?: Array<{ - service?: string; - username?: string; - localizedService?: string; - label: string; - id: string; - }>; - urls?: { - label: string; - url?: string; - id: string; - }; company?: string; jobTitle?: string; department?: string; - imageAvailable?: boolean; - image?: { - uri?: string; - }; - thumbnail?: { - uri?: string; - }; note?: string; - dates?: Array<{ - day?: number; - month?: number; - year?: number; - id: string; - label: string; - }>; - relationships?: Array<{ - label: string; - name?: string; - id: string; - }>; + imageAvailable?: boolean; + image?: Image; + rawImage?: Image; + contactType: ContactType; + birthday?: ContactDate; + dates?: ContactDate[]; + relationships?: Relationship[]; + emails?: Email[]; + phoneNumbers?: PhoneNumber[]; + addresses?: Address[]; + instantMessageAddresses?: InstantMessageAddress[]; + urlAddresses?: UrlAddress[]; + /** + * iOS only + */ + nonGregorianBirthday?: ContactDate; + /** + * iOS only + */ + socialProfiles?: SocialProfile[]; } - interface Response { + interface ContactDate { + day: number; + month: number; + year: number; + format: CalendarFormat; + id: string; + label: string; + } + + interface Relationship { + name: string; + id: string; + label: string; + } + + interface Email { + email: string; + isPrimary: boolean; + id: string; + label: string; + } + + interface PhoneNumber { + number: string; + isPrimary: boolean; + digits: string; + countryCode: string; + id: string; + label: string; + } + + interface Address { + street: string; + city: string; + country: string; + region: string; + neighborhood: string; + postalCode: string; + poBox: string; + isoCountryCode: string; + id: string; + label: string; + } + + /** + * iOS only + */ + interface SocialProfile { + service: string; + username: string; + localizedProfile: string; + url: string; + userId: string; + id: string; + label: string; + } + + interface InstantMessageAddress { + service: string; + username: string; + localizedProfile: string; + id: string; + label: string; + } + + interface UrlAddress { + url: string; + id: string; + label: string; + } + + /** + * Information regarding thumbnail images + */ + interface Image { + uri: string; + /** + * iOS only + * In Android you can get dimensions using `ReactNative.Image.getSize` + */ + width?: number; + /** + * iOS only + * In Android you can get dimensions using `ReactNative.Image.getSize` + */ + height?: number; + /** + * Avoid using Base 64 in React Native + * iOS only + */ + base64?: string; + } + + /** + * A parent to contacts. A contact can belong to multiple groups. + * iOS Only + */ + interface Group { + id: string; + name: string; + } + + /** + * A parent to contacts and groups. + * iOS Only + */ + interface Container { + id: string; + name: string; + } + + /** + * Denotes the functionality of a native contact form + */ + interface FormOptions { + displayedPropertyKeys?: Field[]; + message?: string; + alternateName?: string; + cancelButtonTitle?: string; + groupId?: string; + allowsEditing?: boolean; + allowsActions?: boolean; + shouldShowLinkedContacts?: boolean; + isNew?: boolean; + preventAnimation?: boolean; + } + + /** + * Used to query contacts from the user's device + */ + interface ContactQuery { + fields?: Field[]; + pageSize?: number; + pageOffset?: number; + id?: string; + /** Android Only */ + sort?: SortType; + /** iOS Only */ + name?: string; + /** iOS Only */ + groupId?: string; + /** iOS Only */ + containerID?: string; + /** iOS Only */ + rawContacts?: boolean; + } + + interface ContactResponse { data: Contact[]; - total: number; + /** + * This will be true if there are more contacts to retrieve beyond what is returned + */ hasNextPage: boolean; + /** + * `true` if there are previous contacts that weren't retrieved due to `pageOffset` + */ hasPreviousPage: boolean; } - function getContactsAsync(options: Options): Promise; - function getContactByIdAsync(options: { id?: string; fields?: FieldType[] }): Promise; + /** + * Used to query native contact groups. + * iOS Only + */ + interface GroupQuery { + groupName?: string; + groupId?: string; + containerId?: string; + } + + /** + * Used to query native contact containers. + * iOS Only + */ + interface ContainerQuery { + contactId?: string; + groupId?: string; + containerId?: string; + } + + // Methods + + /** + * Return a list of contacts that fit a given criteria. You can get all of the contacts by passing no criteria. + */ + function getContactsAsync(contactQuery?: ContactQuery): Promise; + /** + * Returns a contact matching the input id. Used for gathering precise data about a contact. + */ + function getContactByIdAsync(contactId: string, fields?: Field[]): Promise; + + // iOS Only - temporary + /** + * Creates a new contact and adds it to the system. + * iOS Only - temporary + */ + function addContactAsync(contact: Contact, containerId?: string): Promise; + /** + * Mutate the information of an existing contact. + * iOS Only - temporary + */ + function updateContactAsync(contact: Contact): Promise; + /** + * Delete a contact from the system. + * iOS Only - temporary + */ + function removeContactAsync(contactId: string): Promise; + /** + * Query a set of contacts and write them to a local uri that can be used for sharing with `ReactNative.Share`. + * iOS Only - temporary + */ + function writeContactToFileAsync(contactQuery: ContactQuery): Promise; + + // iOS Only + /** + * Present a native form for manipulating contacts. + * iOS Only + */ + function presentFormAsync(contactId: string, contact?: Contact, formOptions?: FormOptions): Promise; + /** + * Add a group to a container. + * iOS Only + */ + function addExistingGroupToContainerAsync(groupId: string, containerId: string): Promise; + /** + * Create a group with a name, and add it to a container. If the container is undefined, the default container will be targeted. + * iOS Only + */ + function createGroupAsync(groupName: string, containerId?: string): Promise; + /** + * Change the name of an existing group. + * iOS Only + */ + function updateGroupNameAsync(groupName: string, groupId: string): Promise; + /** + * Delete a group from the device. + * iOS Only + */ + function removeGroupAsync(groupId: string): Promise; + /** + * Add a contact as a member to a group. A contact can be a member of multiple groups. + * iOS Only + */ + function addExistingContactToGroupAsync(contactId: string, groupId: string): Promise; + /** + * Remove a contact's membership from a given group. This will not delete the contact. + * iOS Only + */ + function removeContactFromGroupAsync(contactId: string, groupId: string): Promise; + /** + * Query and return a list of system groups. + * iOS Only + */ + function getGroupsAsync(query: GroupQuery): Promise; + /** + * Get the default container's ID. + * iOS Only + */ + function getDefaultContainerIdAsync(): Promise; + /** + * Query a list of system containers. + * iOS Only + */ + function getContainersAsync(containerQuery: ContainerQuery): Promise; } /** @@ -1803,7 +2127,7 @@ export namespace Location { function getProviderStatusAsync(): Promise; function getHeadingAsync(): Promise; function watchHeadingAsync(callback: (status: HeadingStatus) => void): EventSubscription; - function geocodeAsync(address: string): Promise; + function geocodeAsync(address: string): Promise; function reverseGeocodeAsync(location: LocationProps): Promise; function setApiKey(key: string): void; } @@ -1852,6 +2176,21 @@ export namespace Notifications { }; } + interface SchedulingOptions { + time: Date | number; + repeat?: 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year'; + intervalMs?: number; + } + + interface ChannelAndroid { + name: string; + description?: string; + sound?: boolean; + priority?: 'min' | 'low' | 'default' | 'high' | 'max'; + vibrate?: boolean | number[]; + badge?: boolean; + } + type LocalNotificationId = string | number; function addListener(listener: (notification: Notification) => any): EventSubscription; @@ -1859,12 +2198,14 @@ export namespace Notifications { function presentLocalNotificationAsync(localNotification: LocalNotification): Promise; function scheduleLocalNotificationAsync( localNotification: LocalNotification, - schedulingOptions: { time: Date | number, repeat?: 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year' } + schedulingOptions: SchedulingOptions ): Promise; function dismissNotificationAsync(localNotificationId: LocalNotificationId): Promise; function dismissAllNotificationsAsync(): Promise; function cancelScheduledNotificationAsync(localNotificationId: LocalNotificationId): Promise; function cancelAllScheduledNotificationsAsync(): Promise; + function createChannelAndroidAsync(id: string, channel: ChannelAndroid): Promise; + function deleteChannelAndroidAsync(id: string): Promise; function getBadgeNumberAsync(): Promise; function setBadgeNumberAsync(number: number): Promise; } @@ -1884,7 +2225,7 @@ export namespace Pedometer { export namespace Permissions { type PermissionType = 'audioRecording' | 'calendar' | 'cameraRoll' | 'camera' | 'contacts' | 'location' | 'reminders' | - 'remoteNotifications' | 'systemBrightness' | 'userFacingNotifications'; + 'notifications' | 'systemBrightness' | 'userFacingNotifications' | 'SMS'; type PermissionStatus = 'undetermined' | 'granted' | 'denied'; type PermissionExpires = 'never'; @@ -1896,17 +2237,23 @@ export namespace Permissions { scope: 'fine' | 'coarse' | 'none'; } - interface PermissionResponse { + interface SinglePermissionResponse { status: PermissionStatus; expires: PermissionExpires; ios?: PermissionDetailsLocationIOS; android?: PermissionDetailsLocationAndroid; } - function getAsync(type: PermissionType): Promise; - function askAsync(type: PermissionType): Promise; + interface PermissionResponse { + status: PermissionStatus; + expires: PermissionExpires; + permissions: { + [key in PermissionType]: SinglePermissionResponse + }; + } - type RemoteNotificationPermission = 'remoteNotifications'; + function getAsync(...permissionTypes: PermissionType[]): Promise; + function askAsync(...permissionTypes: PermissionType[]): Promise; const AUDIO_RECORDING: 'audioRecording'; const CALENDAR: 'calendar'; @@ -1914,11 +2261,14 @@ export namespace Permissions { const CAMERA: 'camera'; const CONTACTS: 'contacts'; const LOCATION: 'location'; - const NOTIFICATIONS: RemoteNotificationPermission; - const REMINDERS = 'reminders'; - const REMOTE_NOTIFICATIONS: RemoteNotificationPermission; + const NOTIFICATIONS: 'notifications'; + const REMINDERS: 'reminders'; const SYSTEM_BRIGHTNESS: 'systemBrightness'; - const USER_FACING_NOTIFICATIONS = 'userFacingNotifications'; + const USER_FACING_NOTIFICATIONS: 'userFacingNotifications'; + /** + * Will be removed in SDK 32 + */ + const SMS: 'SMS'; } /** @@ -1952,12 +2302,23 @@ export namespace ScreenOrientation { export namespace SecureStore { interface SecureStoreOptions { keychainService?: string; + } + + interface SecureStoreSetOptions extends SecureStoreOptions { keychainAccessible?: number; } - function setItemAsync(key: string, value: string, options?: SecureStoreOptions): Promise; + function setItemAsync(key: string, value: string, options?: SecureStoreSetOptions): Promise; function getItemAsync(key: string, options?: SecureStoreOptions): Promise; function deleteItemAsync(key: string, options?: SecureStoreOptions): Promise; + + const WHEN_UNLOCKED: number; + const AFTER_FIRST_UNLOCK: number; + const ALWAYS: number; + const WHEN_UNLOCKED_THIS_DEVICE_ONLY: number; + const WHEN_PASSCODE_SET_THIS_DEVICE_ONLY: number; + const AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY: number; + const ALWAYS_THIS_DEVICE_ONLY: number; } /** @@ -2090,6 +2451,8 @@ export interface SvgCommonProps { export interface SvgRectProps extends SvgCommonProps { width: number | string; height: number | string; + rx?: number | string; + ry?: number | string; } export interface SvgCircleProps extends SvgCommonProps { diff --git a/types/expo/package.json b/types/expo/package.json new file mode 100644 index 0000000000..4abdc24638 --- /dev/null +++ b/types/expo/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "react-native-maps": "*" + } +} diff --git a/types/expo/v24/index.d.ts b/types/expo/v24/index.d.ts index 35d1e9be92..7c515a0268 100644 --- a/types/expo/v24/index.d.ts +++ b/types/expo/v24/index.d.ts @@ -1949,6 +1949,8 @@ export interface SvgCommonProps { export interface SvgRectProps extends SvgCommonProps { width: number | string; height: number | string; + rx?: number | string; + ry?: number | string; } export interface SvgCircleProps extends SvgCommonProps { diff --git a/types/expo/v25/index.d.ts b/types/expo/v25/index.d.ts index 766c055911..9e2da6c790 100644 --- a/types/expo/v25/index.d.ts +++ b/types/expo/v25/index.d.ts @@ -1978,6 +1978,8 @@ export interface SvgCommonProps { export interface SvgRectProps extends SvgCommonProps { width: number | string; height: number | string; + rx?: number | string; + ry?: number | string; } export interface SvgCircleProps extends SvgCommonProps { diff --git a/types/expo/v26/index.d.ts b/types/expo/v26/index.d.ts index 9804579e66..e8386db63c 100644 --- a/types/expo/v26/index.d.ts +++ b/types/expo/v26/index.d.ts @@ -2006,6 +2006,8 @@ export interface SvgCommonProps { export interface SvgRectProps extends SvgCommonProps { width: number | string; height: number | string; + rx?: number | string; + ry?: number | string; } export interface SvgCircleProps extends SvgCommonProps { diff --git a/types/expo/v27/index.d.ts b/types/expo/v27/index.d.ts index a80fb657ee..179315ba69 100644 --- a/types/expo/v27/index.d.ts +++ b/types/expo/v27/index.d.ts @@ -2083,6 +2083,8 @@ export interface SvgCommonProps { export interface SvgRectProps extends SvgCommonProps { width: number | string; height: number | string; + rx?: number | string; + ry?: number | string; } export interface SvgCircleProps extends SvgCommonProps { diff --git a/types/expo/v30/index.d.ts b/types/expo/v30/index.d.ts index d5891bad2d..8a77777c49 100644 --- a/types/expo/v30/index.d.ts +++ b/types/expo/v30/index.d.ts @@ -2083,6 +2083,8 @@ export interface SvgCommonProps { export interface SvgRectProps extends SvgCommonProps { width: number | string; height: number | string; + rx?: number | string; + ry?: number | string; } export interface SvgCircleProps extends SvgCommonProps { diff --git a/types/express-http-proxy/express-http-proxy-tests.ts b/types/express-http-proxy/express-http-proxy-tests.ts new file mode 100644 index 0000000000..56156369cc --- /dev/null +++ b/types/express-http-proxy/express-http-proxy-tests.ts @@ -0,0 +1,28 @@ +import { Express } from "express"; +import proxy = require("express-http-proxy"); + +const app: Express = {} as any; + +app.use('/proxy', proxy('www.google.com')); + +proxy('www.google.com', {}); + +proxy('www.google.com', { + proxyReqPathResolver: (req) => req.url, +}); + +proxy('www.google.com', { + proxyReqOptDecorator(proxyReqOpts, srcReq) { + console.log(proxyReqOpts.headers, proxyReqOpts.method); + console.log(srcReq.url, srcReq.cookies); + return proxyReqOpts; + }, + userResHeaderDecorator(headers, userReq, userRes, proxyReq, proxyRes) { + console.log(userReq.url, userRes.statusCode); + console.log(proxyReq.url, proxyRes.statusCode); + if (headers["content-type"] === "image/png") { + headers["x-custom-header"] = "additional-info"; + } + return headers; + } +}); diff --git a/types/express-http-proxy/index.d.ts b/types/express-http-proxy/index.d.ts new file mode 100644 index 0000000000..3a74bef6db --- /dev/null +++ b/types/express-http-proxy/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for express-http-proxy 1.5 +// Project: https://github.com/villadora/express-http-proxy#readme +// Definitions by: ulrichb +// Daniel Schopf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { RequestHandler, Request } from "express"; +import { RequestOptions, IncomingHttpHeaders, OutgoingHttpHeaders } from "http"; +import { Response } from "express-serve-static-core"; + +interface ProxyOptions { + proxyReqPathResolver?: (req: Request) => string; + proxyReqOptDecorator?: (proxyReqOpts: RequestOptions, srcReq: Request) => RequestOptions; + userResHeaderDecorator?: (headers: IncomingHttpHeaders, userReq: Request, userRes: Response, proxyReq: Request, proxyRes: Response) => OutgoingHttpHeaders; +} + +declare function proxy(host: string, options?: ProxyOptions): RequestHandler; + +export = proxy; diff --git a/types/express-http-proxy/tsconfig.json b/types/express-http-proxy/tsconfig.json new file mode 100644 index 0000000000..0822069574 --- /dev/null +++ b/types/express-http-proxy/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", + "express-http-proxy-tests.ts" + ] +} diff --git a/types/express-http-proxy/tslint.json b/types/express-http-proxy/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-http-proxy/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express-jwt/index.d.ts b/types/express-jwt/index.d.ts index 1187f4fbca..d1029849cc 100644 --- a/types/express-jwt/index.d.ts +++ b/types/express-jwt/index.d.ts @@ -58,10 +58,3 @@ declare namespace jwt { constructor(code: ErrorCode, error: { message: string }); } } -declare global { - namespace Express { - export interface Request { - user?: any - } - } -} diff --git a/types/express-rate-limit/express-rate-limit-tests.ts b/types/express-rate-limit/express-rate-limit-tests.ts index 6be714f3bf..4b94ef6b05 100644 --- a/types/express-rate-limit/express-rate-limit-tests.ts +++ b/types/express-rate-limit/express-rate-limit-tests.ts @@ -3,13 +3,32 @@ import RateLimit = require("express-rate-limit"); const apiLimiter = new RateLimit({ windowMs: 15 * 60 * 1000, // 15 minutes max: 100, - delayMs: 0 // disabled + headers: false, + skipFailedRequests: false, + skipSuccessfulRequests: true, +}); + +const apiLimiterWithMaxFn = new RateLimit({ + windowMs: 15 * 60 * 1000, + max: () => 5, +}); + +const apiLimiterWithMaxPromiseFn = new RateLimit({ + windowMs: 15 * 60 * 1000, + max: () => Promise.resolve(5), +}); + +const apiLimiterWithMessageObject = new RateLimit({ + windowMs: 15 * 60 * 1000, // 15 minutes + max: 100, + message: { + status: 429, + message: 'To many requests, try again later' + } }); const createAccountLimiter = new RateLimit({ windowMs: 60 * 60 * 1000, // 1 hour window - delayAfter: 1, // begin slowing down responses after the first request - delayMs: 3 * 1000, // slow down subsequent responses by 3 seconds per request max: 5, // start blocking after 5 requests message: "Too many accounts created from this IP, please try again after an hour", handler: (req, _, next) => next(new Error(`TooManyRequests: ${req.ip}`)) diff --git a/types/express-rate-limit/index.d.ts b/types/express-rate-limit/index.d.ts index 32799cc842..9d3459e21b 100644 --- a/types/express-rate-limit/index.d.ts +++ b/types/express-rate-limit/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for express-rate-limit 2.9 +// Type definitions for express-rate-limit 3.3 // Project: https://github.com/nfriedly/express-rate-limit -// Definitions by: Cyril Schumacher , makepost +// Definitions by: Cyril Schumacher +// makepost +// Jeremy Forsythe // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -15,19 +17,86 @@ declare namespace RateLimit { resetKey(key: string): void; } + interface Message { + status: number; + message: string; + [key: string]: any; + } + + type MaxValueFn = () => number | Promise; + interface Options { - delayAfter?: number; - delayMs?: number; + /** + * The funciton to handle requests once `max` is exceeded. It receives the request and response objects. + * The "next" param is available if you need to pass to the next middleware. The `req.rateLimit` object + * has `limit`, `current`, and `remaining` number of requests, and if the store provides it, a `resetTime` + * Date object. + * Default: `(req, res, next) => res.status(options.statusCode).send(options.message)` + */ handler?(req: express.Request, res: express.Response, next: express.NextFunction): any; + + /** + * Enable headers for request limit (`X-RateLimit-Limit`) and current usage (`X-RateLimit-Remaining`) on all + * responses andtime to wait before retrying (`Retry-After`) when `max` is exceeded. Defaults to `true`. + */ headers?: boolean; + + /** + * Function used to generate keys. Defaults to using `req.ip`. + * Default: `(req, res) => req.ip` + */ keyGenerator?(req: express.Request, res: express.Response): string; - max?: number; - message?: string; - skip?(req: express.Request, res: express.Response): boolean; - skipFailedRequests?: boolean; - statusCode?: number; - store?: Store; + + /** + * Max number of connections during `windowMs` before sending a 429 response. May be a `number` or + * a function that returns a `number` or a `Promise`. Defaults to `5`. Set to `0` to disable. + */ + max?: number | MaxValueFn; + + /** + * Error message sent to user when `max` is exceeded. May be a `string`, JSON object, or any other value + * that Express's `req.send()` supports. Defaults to `'Too many requests, please try again later.'`. + */ + message?: string | Buffer | Message; + + /** + * Function that is called the first time `max` is exceeded. The `req.rateLimit` object has `limit`, `current`, + * and `remaining` number of requests and, if the store provides it, a `resetTime` Date object. Default is + * an empty function. + * Default: `(req, res, opts) => {}` + */ onLimitReached?(req: express.Request, res: express.Response, optionsUsed: Options): void; + + /** + * Function used to skip requests. Returning `true` from the function will skip limiting for that request. Defaults to + * always `false` (count all requests). + * Default: `(req, res) => false` + */ + skip?(req: express.Request, res: express.Response): boolean; + + /** + * When set to `true`, failed requests (status >= 400, request canceled or errored) won't be counted. Defaults to `false`. + */ + skipFailedRequests?: boolean; + + /** + * When set to `true`, successful requests (status < 400) won't be counted. Defaults to `false`. + */ + skipSuccessfulRequests?: boolean; + + /** + * HTTP status code returned when `max` is exceeded. Defaults to `429`. + */ + statusCode?: number; + + /** + * The storage to use when persisting rate limit attempts. + */ + store?: Store; + + /** + * How long in milliseconds to keep records of requests in memory. Defaults to `60000` (1 minute). + */ windowMs?: number; } } diff --git a/types/express-rate-limit/v2/express-rate-limit-tests.ts b/types/express-rate-limit/v2/express-rate-limit-tests.ts new file mode 100644 index 0000000000..aa5c51a016 --- /dev/null +++ b/types/express-rate-limit/v2/express-rate-limit-tests.ts @@ -0,0 +1,39 @@ +import RateLimit = require("express-rate-limit"); + +const apiLimiter = new RateLimit({ + windowMs: 15 * 60 * 1000, // 15 minutes + max: 100, + delayMs: 0 // disabled +}); + +const apiLimiterWithMessageObject = new RateLimit({ + windowMs: 15 * 60 * 1000, // 15 minutes + max: 100, + message: { + status: 429, + message: 'To many requests, try again later' + } +}); + +const createAccountLimiter = new RateLimit({ + windowMs: 60 * 60 * 1000, // 1 hour window + delayAfter: 1, // begin slowing down responses after the first request + delayMs: 3 * 1000, // slow down subsequent responses by 3 seconds per request + max: 5, // start blocking after 5 requests + message: "Too many accounts created from this IP, please try again after an hour", + handler: (req, _, next) => next(new Error(`TooManyRequests: ${req.ip}`)) +}); + +const callbackWithFewerParams = new RateLimit({ + handler: (req, res) => res.status(429).json(`TooManyRequests: ${req.ip}`) +}); + +class SomeStore implements RateLimit.Store { + incr(key: string, cb: RateLimit.StoreIncrementCallback) { } + decrement(key: string) { } + resetKey(key: string) { } +} + +const limiterWithStore = new RateLimit({ + store: new SomeStore() +}); diff --git a/types/express-rate-limit/v2/index.d.ts b/types/express-rate-limit/v2/index.d.ts new file mode 100644 index 0000000000..b3f074f28d --- /dev/null +++ b/types/express-rate-limit/v2/index.d.ts @@ -0,0 +1,42 @@ +// Type definitions for express-rate-limit 2.9 +// Project: https://github.com/nfriedly/express-rate-limit +// Definitions by: Cyril Schumacher , makepost +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import express = require("express"); + +declare namespace RateLimit { + type StoreIncrementCallback = (err?: {}, hits?: number) => void; + + interface Store { + incr(key: string, cb: StoreIncrementCallback): void; + decrement(key: string): void; + resetKey(key: string): void; + } + + interface Message { + status: number; + message: string; + [key: string]: any; + } + + interface Options { + delayAfter?: number; + delayMs?: number; + handler?(req: express.Request, res: express.Response, next: express.NextFunction): any; + headers?: boolean; + keyGenerator?(req: express.Request, res: express.Response): string; + max?: number; + message?: string | Buffer | Message; + skip?(req: express.Request, res: express.Response): boolean; + skipFailedRequests?: boolean; + statusCode?: number; + store?: Store; + onLimitReached?(req: express.Request, res: express.Response, optionsUsed: Options): void; + windowMs?: number; + } +} + +declare var RateLimit: new (options: RateLimit.Options) => express.RequestHandler; +export = RateLimit; diff --git a/types/express-rate-limit/v2/tsconfig.json b/types/express-rate-limit/v2/tsconfig.json new file mode 100644 index 0000000000..0e9b4d2ad4 --- /dev/null +++ b/types/express-rate-limit/v2/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "express-rate-limit": ["express-rate-limit/v2"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "express-rate-limit-tests.ts" + ] +} diff --git a/types/express-rate-limit/v2/tslint.json b/types/express-rate-limit/v2/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-rate-limit/v2/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express-serve-static-core/index.d.ts b/types/express-serve-static-core/index.d.ts index 96c4c233c2..773a1e065b 100644 --- a/types/express-serve-static-core/index.d.ts +++ b/types/express-serve-static-core/index.d.ts @@ -44,6 +44,7 @@ export type RequestHandlerParams = RequestHandler | ErrorRequestHandler | Array< export interface IRouterMatcher { (path: PathParams, ...handlers: RequestHandler[]): T; (path: PathParams, ...handlers: RequestHandlerParams[]): T; + (path: PathParams, subApplication: Application): T; } export interface IRouterHandler { diff --git a/types/express-slow-down/express-slow-down-tests.ts b/types/express-slow-down/express-slow-down-tests.ts new file mode 100644 index 0000000000..e7d049bd7d --- /dev/null +++ b/types/express-slow-down/express-slow-down-tests.ts @@ -0,0 +1,31 @@ +import slowDown = require("express-slow-down"); + +const slowerAllDefaults = slowDown({}); + +const slowerWithOptions = slowDown({ + windowMs: 15 * 60 * 1000, // 15 minutes, + delayAfter: 1, + delayMs: 0, // disabled + skipFailedRequests: false, + skipSuccessfulRequests: true, +}); + +const slowerWithCallbacks = slowDown({ + keyGenerator: (req, res) => req.ip, + skip: (req, res) => false, + onLimitReached: (req, res, opts) => { + console.log(req.slowDown.current); + console.log(req.slowDown.remaining); + console.log(req.slowDown.limit); + }, +}); + +class MockStore implements slowDown.Store { + incr(key: string, cb: slowDown.StoreIncrementCallback) { } + decrement(key: string) { } + resetKey(key: string) { } +} + +const slowerWithStore = slowDown({ + store: new MockStore() +}); diff --git a/types/express-slow-down/index.d.ts b/types/express-slow-down/index.d.ts new file mode 100644 index 0000000000..f7aeab76fd --- /dev/null +++ b/types/express-slow-down/index.d.ts @@ -0,0 +1,111 @@ +// Type definitions for express-slow-down 1.1 +// Project: https://github.com/nfriedly/express-slow-down +// Definitions by: Jeremy Forsythe +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import express = require("express"); + +declare namespace SlowDown { + type StoreIncrementCallback = (err?: {}, hits?: number) => void; + + interface SlowDownRequestAugmentation { + /** + * The `options.delayAfter` value + */ + limit: number; + + /** + * The number of requests in the current window + */ + current: number; + + /** + * the number of requests remaining before rate-limiting begins + */ + remaining: number; + + /** + * When the window will reset, `current` will return to `0`, and `remaining` will return + * to limit. Represents milliseconds since epoch (compare to `Date.now()`). This field + * depends on store support. It will be `undefined` if the store does not provide the value. + */ + resetTime?: number; + + /** + * Amount of delay imposed on current request in milliseconds + */ + delay: number; + } + + /** + * Express Request with the added `slowDown` property + */ + interface RequestWithSlowDown extends express.Request { + slowDown: SlowDownRequestAugmentation; + } + + interface Store { + incr(key: string, cb: StoreIncrementCallback): void; + decrement(key: string): void; + resetKey(key: string): void; + } + + /** + * express-slow-down options + */ + interface Options { + /** + * How long to keep records of requests in memory. Defaults to `60000` (1 minute) + */ + windowMs?: number; + + /** + * Max number of connections during `windowMs` before starting to delay responses. + * Defaults to `1`. Set to `0` to disable delaying. + */ + delayAfter?: number; + + /** + * How long to delay the response, multiplied by `(number recent hits - delayAfter)`. + * Defaults to `1000` (1 second). Set to `0` to disable delaying. + */ + delayMs?: number; + + /** + * When `true` failed requests (response status >= 400) won't be counted. Defaults to `false`. + */ + skipFailedRequests?: boolean; + + /** + * When `true` successful requests (response status < 400) won't be counted. Defaults to `false`. + */ + skipSuccessfulRequests?: boolean; + + /** + * Function used to generate keys. By default user IP address (`req.ip`) is used. + * Default: `(req, res) => req.ip` + */ + keyGenerator?(req: express.Request, res: express.Response): string; + + /** + * Function used to skip requests. Returning `true` from the function will skip delaying for that request. + * Default: `(req, res) => false` + */ + skip?(req: express.Request, res: express.Response): boolean; + + /** + * Function to execute the first time the limit is reached within `windowMs`. + * Default: `(req, res, opts) => {}` + */ + onLimitReached?(req: RequestWithSlowDown, res: express.Response, optionsUsed: Options): void; + + /** + * The storage to use when persisting request attempts. By default, the MemoryStore is used. + */ + store?: Store; + } +} + +declare function SlowDown(options: SlowDown.Options): express.RequestHandler; +export = SlowDown; diff --git a/types/express-slow-down/tsconfig.json b/types/express-slow-down/tsconfig.json new file mode 100644 index 0000000000..9973398566 --- /dev/null +++ b/types/express-slow-down/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", + "express-slow-down-tests.ts" + ] +} diff --git a/types/express-slow-down/tslint.json b/types/express-slow-down/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-slow-down/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express/express-tests.ts b/types/express/express-tests.ts index 07bf2fc5c3..37cf543df5 100644 --- a/types/express/express-tests.ts +++ b/types/express/express-tests.ts @@ -138,6 +138,9 @@ namespace express_tests { res.req; }); + // Test mounting sub-apps + app.use('/sub-app', express()); + // Test on mount event app.on('mount', (parent) => true); diff --git a/types/express/index.d.ts b/types/express/index.d.ts index 81821ca98c..ddc4509805 100644 --- a/types/express/index.d.ts +++ b/types/express/index.d.ts @@ -30,6 +30,13 @@ declare namespace e { */ var json: typeof bodyParser.json; + /** + * These are the exposed prototypes. + */ + var application: Application; + var request: Request; + var response: Response; + /** * This is a built-in middleware function in Express. It serves static files and is based on serve-static. */ diff --git a/types/extra-watch-webpack-plugin/extra-watch-webpack-plugin-tests.ts b/types/extra-watch-webpack-plugin/extra-watch-webpack-plugin-tests.ts new file mode 100644 index 0000000000..7eb729eb31 --- /dev/null +++ b/types/extra-watch-webpack-plugin/extra-watch-webpack-plugin-tests.ts @@ -0,0 +1,6 @@ +import ExtraWatchWebpackPlugin = require("extra-watch-webpack-plugin"); + +new ExtraWatchWebpackPlugin(); +new ExtraWatchWebpackPlugin({}); +new ExtraWatchWebpackPlugin({ files: "string", dirs: "string" }); +new ExtraWatchWebpackPlugin({ files: ["array"], dirs: ["array"] }); diff --git a/types/extra-watch-webpack-plugin/index.d.ts b/types/extra-watch-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..058dae79e7 --- /dev/null +++ b/types/extra-watch-webpack-plugin/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for extra-watch-webpack-plugin 1.0 +// Project: https://github.com/pigcan/extra-watch-webpack-plugin#readme +// Definitions by: Dave Cardwell +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Plugin } from "webpack"; + +export = ExtraWatchWebpackPlugin; + +declare class ExtraWatchWebpackPlugin extends Plugin { + constructor(options?: ExtraWatchWebpackPlugin.Options); +} + +declare namespace ExtraWatchWebpackPlugin { + interface Options { + /** + * `string` (absolute path or glob pattern) or `array`, default `[]`, attach extra files to webpack's watch system + */ + files?: string | ReadonlyArray; + /** + * `string` or `array`, default `[]`, attach extra dirs to webpack's watch system + */ + dirs?: string | ReadonlyArray; + } +} diff --git a/types/extra-watch-webpack-plugin/tsconfig.json b/types/extra-watch-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..0e52bc6c44 --- /dev/null +++ b/types/extra-watch-webpack-plugin/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "extra-watch-webpack-plugin-tests.ts"] +} diff --git a/types/extra-watch-webpack-plugin/tslint.json b/types/extra-watch-webpack-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/extra-watch-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 60ec11648f..15087ab8d3 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -1801,10 +1801,12 @@ export class Image { initialize(element?: string | HTMLImageElement, options?: IImageOptions): void; /** - * Applies filters assigned to this image (from "filters" array) - * @param callback Callback is invoked when all filters have been applied and new image is generated + * Applies filters assigned to this image (from "filters" array) or from filter param + * @param {Array} filters to be applied + * @return {thisArg} return the fabric.Image object + * @chainable */ - applyFilters(callback: Function): void; + applyFilters(filters?: IBaseFilter[]): Image; /** * Returns a clone of an instance * @param callback Callback is invoked with a clone as a first argument @@ -3717,17 +3719,29 @@ interface IAllFilters { */ new(options?: any): IBaseFilter; }; - Blend: { + BlendColor: { /** * Constructor * @param [options] Options object */ - new(options?: { color?: string; mode?: string; alpha?: number; image?: Image }): IBlendFilter; + new(options?: { color?: string; mode?: string; alpha?: number; }): IBlendColorFilter; /** * Returns filter instance from an object representation * @param object Object to create an instance from */ - fromObject(object: any): IBlendFilter + fromObject(object: any): IBlendColorFilter + }; + BlendImage: { + /** + * Constructor + * @param [options] Options object + */ + new(options?: { image?: Image; mode?: string; alpha?: number; }): IBlendImageFilter; + /** + * Returns filter instance from an object representation + * @param object Object to create an instance from + */ + fromObject(object: any): IBlendImageFilter }; Brightness: { new(options?: { @@ -3910,7 +3924,14 @@ interface IBaseFilter { */ toJSON(): string; } -interface IBlendFilter extends IBaseFilter { +interface IBlendColorFilter extends IBaseFilter { + /** + * Applies filter to canvas element + * @param canvasEl Canvas element to apply filter to + */ + applyTo(canvasEl: HTMLCanvasElement): void; +} +interface IBlendImageFilter extends IBaseFilter { /** * Applies filter to canvas element * @param canvasEl Canvas element to apply filter to @@ -3931,63 +3952,63 @@ interface IConvoluteFilter extends IBaseFilter { */ applyTo(canvasEl: HTMLCanvasElement): void; } -interface IGradientTransparencyFilter { +interface IGradientTransparencyFilter extends IBaseFilter { /** * Applies filter to canvas element * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } -interface IGrayscaleFilter { +interface IGrayscaleFilter extends IBaseFilter { /** * Applies filter to canvas element * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } -interface IInvertFilter { +interface IInvertFilter extends IBaseFilter { /** * Applies filter to canvas element * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } -interface IMaskFilter { +interface IMaskFilter extends IBaseFilter { /** * Applies filter to canvas element * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } -interface IMultiplyFilter { +interface IMultiplyFilter extends IBaseFilter { /** * Applies filter to canvas element * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } -interface INoiseFilter { +interface INoiseFilter extends IBaseFilter { /** * Applies filter to canvas element * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } -interface IPixelateFilter { +interface IPixelateFilter extends IBaseFilter { /** * Applies filter to canvas element * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } -interface IRemoveWhiteFilter { +interface IRemoveWhiteFilter extends IBaseFilter { /** * Applies filter to canvas element * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } -interface IResizeFilter { +interface IResizeFilter extends IBaseFilter { /** * Resize type */ @@ -4013,21 +4034,21 @@ interface IResizeFilter { */ applyTo(canvasEl: HTMLCanvasElement): void; } -interface ISepiaFilter { +interface ISepiaFilter extends IBaseFilter { /** * Applies filter to canvas element * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } -interface ISepia2Filter { +interface ISepia2Filter extends IBaseFilter { /** * Applies filter to canvas element * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } -interface ITintFilter { +interface ITintFilter extends IBaseFilter { /** * Applies filter to canvas element * @param canvasEl Canvas element to apply filter to diff --git a/types/facebook-js-sdk/facebook-js-sdk-tests.ts b/types/facebook-js-sdk/facebook-js-sdk-tests.ts index 46b9f331f5..db8b13686e 100644 --- a/types/facebook-js-sdk/facebook-js-sdk-tests.ts +++ b/types/facebook-js-sdk/facebook-js-sdk-tests.ts @@ -22,6 +22,14 @@ FB.getLoginStatus(function(response: fb.StatusResponse) { const authResponse: fb.AuthResponse = FB.getAuthResponse(); console.log(authResponse.accessToken); +FB.login(); + +FB.login(function(response: fb.StatusResponse) { + console.log(response); + console.log(response.status); + console.log(response.authResponse.accessToken); +}); + FB.login(function(response: fb.StatusResponse) { console.log(response); console.log(response.status); diff --git a/types/facebook-js-sdk/index.d.ts b/types/facebook-js-sdk/index.d.ts index 86ca521c88..c4f3b78c31 100644 --- a/types/facebook-js-sdk/index.d.ts +++ b/types/facebook-js-sdk/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for the Facebook Javascript SDK 3.1 +// Type definitions for the Facebook Javascript SDK 3.2 // Project: https://developers.facebook.com/docs/javascript // Definitions by: Amrit Kahlon // Mahmoud Zohdi @@ -50,7 +50,7 @@ declare namespace facebook { * @param callback function to handle the response. * @param options optional ILoginOption to add params such as scope. */ - login(callback: (response: StatusResponse) => void, options: LoginOptions): void; + login(callback: (response: StatusResponse) => void, options?: LoginOptions): void; /** * Use this function to log the user in @@ -61,12 +61,12 @@ declare namespace facebook { * * @param options optional ILoginOption to add params such as scope. */ - login(options: LoginOptions): void; + login(options?: LoginOptions): void; /** * The method FB.logout() logs the user out of your site and, in some cases, Facebook. * - * @param callback function to handle the response + * @param callback optional function to handle the response */ logout(callback?: (response: StatusResponse) => void): void; diff --git a/types/faker/index.d.ts b/types/faker/index.d.ts index a9d044cfcb..55c20ce235 100644 --- a/types/faker/index.d.ts +++ b/types/faker/index.d.ts @@ -117,7 +117,7 @@ declare namespace Faker { image: { image(): string; avatar(): string; - imageUrl(width?: number, height?: number, category?: string): string; + imageUrl(width?: number, height?: number, category?: string, randomize?: boolean, https?: boolean): string; abstract(width?: number, height?: number): string; animals(width?: number, height?: number): string; business(width?: number, height?: number): string; diff --git a/types/fast-json-stable-stringify/fast-json-stable-stringify-tests.ts b/types/fast-json-stable-stringify/fast-json-stable-stringify-tests.ts new file mode 100644 index 0000000000..72aa054cf1 --- /dev/null +++ b/types/fast-json-stable-stringify/fast-json-stable-stringify-tests.ts @@ -0,0 +1,20 @@ +import stringify = require('fast-json-stable-stringify'); + +const obj = { c: 8, b: [{ z: 6, y: 5, x: 4 }, 7], a: 3 }; + +stringify(obj); // $ExpectType string +// $ExpectType string +stringify(obj, (a, b) => { + a; // $ExpectType CompareDescriptor + b; // $ExpectType CompareDescriptor + return a.key < b.key ? 1 : -1; +}); +// $ExpectType string +stringify(obj, { + cmp(a, b) { + a; // $ExpectType CompareDescriptor + b; // $ExpectType CompareDescriptor + return a.key < b.key ? 1 : -1; + }, +}); +stringify(obj, { cycles: true }); // $ExpectType string diff --git a/types/fast-json-stable-stringify/index.d.ts b/types/fast-json-stable-stringify/index.d.ts new file mode 100644 index 0000000000..be89dd7567 --- /dev/null +++ b/types/fast-json-stable-stringify/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for fast-json-stable-stringify 2.0 +// Project: https://github.com/epoberezkin/fast-json-stable-stringify +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = stringify; + +declare function stringify(obj: any, options?: stringify.Options | stringify.Comparator): string; + +declare namespace stringify { + interface Options { + cmp?: (a: CompareDescriptor, b: CompareDescriptor) => number; + cycles?: boolean; + } + + type Comparator = (a: CompareDescriptor, b: CompareDescriptor) => number; + + interface CompareDescriptor { + key: string; + value: any; + } +} diff --git a/types/fast-json-stable-stringify/tsconfig.json b/types/fast-json-stable-stringify/tsconfig.json new file mode 100644 index 0000000000..09bc433bc5 --- /dev/null +++ b/types/fast-json-stable-stringify/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", + "fast-json-stable-stringify-tests.ts" + ] +} diff --git a/types/fast-json-stable-stringify/tslint.json b/types/fast-json-stable-stringify/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fast-json-stable-stringify/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fast64/fast64-tests.ts b/types/fast64/fast64-tests.ts new file mode 100644 index 0000000000..f038b9d0a8 --- /dev/null +++ b/types/fast64/fast64-tests.ts @@ -0,0 +1,8 @@ +import * as fast64 from "fast64"; + +fast64.encode(""); // $ExpectType string +fast64.decode(""); // $ExpectType string +fast64.decode("", { uint8Array: true }); // $ExpectType Uint8Array +fast64.urlencode(""); // $ExpectType string +fast64.urldecode(""); // $ExpectType string +fast64.urldecode("", { uint8Array: true }); // $ExpectType Uint8Array diff --git a/types/fast64/index.d.ts b/types/fast64/index.d.ts new file mode 100644 index 0000000000..47f067859c --- /dev/null +++ b/types/fast64/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for fast64 0.5 +// Project: https://github.com/superhuman/fast64 +// Definitions by: Rares Matei +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Options { + uint8Array: boolean; +} + +export function encode(value: string): string; +export function decode(base64: string): string; +export function decode(base64: string, options: Options): Uint8Array; +export function urlencode(value: string): string; +export function urldecode(base64: string): string; +export function urldecode(base64: string, options: Options): Uint8Array; diff --git a/types/fast64/tsconfig.json b/types/fast64/tsconfig.json new file mode 100644 index 0000000000..4ad215d37c --- /dev/null +++ b/types/fast64/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", + "fast64-tests.ts" + ] +} \ No newline at end of file diff --git a/types/fast64/tslint.json b/types/fast64/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fast64/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fastify-favicon/fastify-favicon-tests.ts b/types/fastify-favicon/fastify-favicon-tests.ts new file mode 100644 index 0000000000..cb556bf71d --- /dev/null +++ b/types/fastify-favicon/fastify-favicon-tests.ts @@ -0,0 +1,5 @@ +import fastifyFavicon = require("fastify-favicon"); + +const options: fastifyFavicon.FastifyFaviconOptions = { + path: './public', +}; diff --git a/types/fastify-favicon/index.d.ts b/types/fastify-favicon/index.d.ts new file mode 100644 index 0000000000..204cc6030d --- /dev/null +++ b/types/fastify-favicon/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for fastify-favicon 0.3 +// Project: https://github.com/smartiniOnGitHub/fastify-favicon +// Definitions by: Philipp Gfeller +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function defaultFaviconPlugin(): void; + +declare namespace defaultFaviconPlugin { + interface FastifyFaviconOptions { + path?: string; + } +} + +export = defaultFaviconPlugin; diff --git a/types/fastify-favicon/tsconfig.json b/types/fastify-favicon/tsconfig.json new file mode 100644 index 0000000000..772917a271 --- /dev/null +++ b/types/fastify-favicon/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "fastify-favicon-tests.ts"], + "exclude": ["node-modules"] +} diff --git a/types/fastify-favicon/tslint.json b/types/fastify-favicon/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fastify-favicon/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fastify-rate-limit/fastify-rate-limit-tests.ts b/types/fastify-rate-limit/fastify-rate-limit-tests.ts new file mode 100644 index 0000000000..ee79951f48 --- /dev/null +++ b/types/fastify-rate-limit/fastify-rate-limit-tests.ts @@ -0,0 +1,22 @@ +import fastifyRateLimit = require("fastify-rate-limit"); +import * as IORedis from 'ioredis'; +import { FastifyRequest, DefaultQuery } from "fastify"; +import { IncomingMessage } from "http"; + +fastifyRateLimit(); + +const fastifyRateLimitOptions: fastifyRateLimit.FastifyRateLimitOptions> = { + max: 3, + timeWindow: 5000, + cache: 10000, + whitelist: ['127.0.0.1'], + redis: new IORedis({ host: '127.0.0.1' }), + skipOnError: true, // default false + keyGenerator: (req) => { + return req.headers['x-real-ip'] + || req.headers['x-client-ip'] + || req.headers['x-forwarded-for'] + || req.params.test + || req.ip; + }, +}; diff --git a/types/fastify-rate-limit/index.d.ts b/types/fastify-rate-limit/index.d.ts new file mode 100644 index 0000000000..888611ad72 --- /dev/null +++ b/types/fastify-rate-limit/index.d.ts @@ -0,0 +1,74 @@ +// Type definitions for fastify-rate-limit 2.0 +// Project: https://github.com/fastify/fastify-rate-limit#readme +// Definitions by: Christian D +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import { Redis } from "ioredis"; +import { FastifyRequest } from "fastify"; +import { IncomingMessage } from "http"; + +declare function fastifyRateLimit(): void; + +declare namespace fastifyRateLimit { + interface FastifyRateLimitOptions> { + /** + * Is the maximum number of requests a single client can perform inside a + * timeWindow. + * + * default: 1000 + */ + max?: number; + + /** + * The duration of the time window, can be expressed in milliseconds (as a + * number) or as a string, see ms too see the supported formats + * + * default: 1000 * 60 + */ + timeWindow?: number; + + /** + * This plugin internally uses a lru cache to handle the clients, you can + * change the size of the cache with this option. + * + * default: 5000 + */ + cache?: number; + + /** + * Array of string of ips to exclude from rate limiting. + * + * default: [] + */ + whitelist?: string[]; + + /** + * By default this plugins uses an in-memory store, which is fast but if + * you application works on more than one server it is useless, since the + * data is store locally. You can pass a Redis client here and magically + * the issue is solved. To achieve the maximum speed, this plugins requires + * the use of ioredis. + * + * default: null + */ + redis?: Redis; + + /** + * If `true` it will skip errors generated by the storage (eg, redis not + * reachable). + * + * default: false + */ + skipOnError?: boolean; + + /** + * Function to generate a unique identifier for each incoming request. + * + * default: (req) => req.ip + */ + keyGenerator?: (req: T) => string; + } +} + +export = fastifyRateLimit; diff --git a/types/fastify-rate-limit/package.json b/types/fastify-rate-limit/package.json new file mode 100644 index 0000000000..e8c68ab969 --- /dev/null +++ b/types/fastify-rate-limit/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "fastify": "^1.11.2" + } +} diff --git a/types/fastify-rate-limit/tsconfig.json b/types/fastify-rate-limit/tsconfig.json new file mode 100644 index 0000000000..5dc0e91ea2 --- /dev/null +++ b/types/fastify-rate-limit/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", "fastify-rate-limit-tests.ts"], + "exclude": ["node-modules"] +} diff --git a/types/fastify-rate-limit/tslint.json b/types/fastify-rate-limit/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fastify-rate-limit/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/favicons/favicons-tests.ts b/types/favicons/favicons-tests.ts index 485ea1d505..ce64c84e67 100644 --- a/types/favicons/favicons-tests.ts +++ b/types/favicons/favicons-tests.ts @@ -1,6 +1,6 @@ -import favicons, { Configuration } from "favicons"; +import * as favicons from "favicons"; -let config: Partial = { +let config: Partial = { path: "/foo/bar" }; @@ -19,7 +19,15 @@ favicons("path/to/file.png", config, (err, res) => { } }); -favicons("file.png", (err, res) => { +favicons("file.png", (err: any, res: any) => { + html = res.html.join(""); + + for (const { name, contents } of [...res.files, ...res.images]) { + html = name + contents.toString(); + } +}); + +favicons("file.png").then((res) => { html = res.html.join(""); for (const { name, contents } of [...res.files, ...res.images]) { diff --git a/types/favicons/index.d.ts b/types/favicons/index.d.ts index 47a9a9d24a..6bd3a4892e 100644 --- a/types/favicons/index.d.ts +++ b/types/favicons/index.d.ts @@ -1,79 +1,84 @@ -// Type definitions for favicons 5.1 +// Type definitions for favicons 5.3 // Project: https://github.com/evilebottnawi/favicons/blob/master/package.json -// Definitions by: Mohsen Azimi +// Definitions by: Mohsen Azimi , Nikk Radetskiy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 /// -export interface Configuration { - /** Path for overriding default icons path @default "/" */ - path: string; - /** Your application's name @default null */ - appName: string | null; - /** Your application's description @default null */ - appDescription: string | null; - /** Your (or your developer's) name @default null */ - developerName: string | null; - /** Your (or your developer's) URL @default null */ - developerURL: string | null; - /** Primary text direction for name, short_name, and description @default "auto" */ - dir: string; - /** Primary language for name and short_name @default "en-US */ - lang: string; - /** Background colour for flattened icons @default "#fff" */ - background: string; - /** Theme color user for example in Android's task switcher @default "#fff" */ - theme_color: string; - /** Preferred display mode: "fullscreen", "standalone", "minimal-ui" or "browser" @default "standalone" */ - display: "fullscreen" | "standalone" | "minimal-ui" | "browser"; - /** Default orientation: "any", "natural", "portrait" or "landscape" @default "any" */ - orientation: "any" | "natural" | "portrait" | "landscape"; - /** Start URL when launching the application from a device @default "/?homescreen=1" */ - start_url: string; - /** Your application's version string @default "1.0" */ - version: string; - /** Print logs to console? @default false */ - logging: boolean; - /** - * Platform Options: - * - offset - offset in percentage - * - background: - * * false - use default - * * true - force use default, e.g. set background for Android icons - * * color - set background for the specified icons - */ - icons: Partial<{ - /* Create Android homescreen icon. */ - android: boolean | { offset: string; background: string }; - /* Create Apple touch icons. */ - appleIcon: boolean | { offset: string; background: string }; - /* Create Apple startup images. */ - appleStartup: boolean | { offset: string; background: string }; - /* Create Opera Coast icon. */ - coast: boolean | { offset: string; background: string }; - /* Create regular favicons. */ - favicons: boolean; - /* Create Firefox OS icons. */ - firefox: boolean | { offset: string; background: string }; - /* Create Windows 8 tile icons. */ - windows: boolean | { background: string }; - /* Create Yandex browser icon. */ - yandex: boolean | { background: string }; - }>; +import { Duplex } from "stream"; + +declare namespace favicons { + interface Configuration { + /** Path for overriding default icons path @default "/" */ + path: string; + /** Your application's name @default null */ + appName: string | null; + /** Your application's description @default null */ + appDescription: string | null; + /** Your (or your developer's) name @default null */ + developerName: string | null; + /** Your (or your developer's) URL @default null */ + developerURL: string | null; + /** Primary text direction for name, short_name, and description @default "auto" */ + dir: string; + /** Primary language for name and short_name @default "en-US */ + lang: string; + /** Background colour for flattened icons @default "#fff" */ + background: string; + /** Theme color user for example in Android's task switcher @default "#fff" */ + theme_color: string; + /** Preferred display mode: "fullscreen", "standalone", "minimal-ui" or "browser" @default "standalone" */ + display: "fullscreen" | "standalone" | "minimal-ui" | "browser"; + /** Default orientation: "any", "natural", "portrait" or "landscape" @default "any" */ + orientation: "any" | "natural" | "portrait" | "landscape"; + /** Start URL when launching the application from a device @default "/?homescreen=1" */ + start_url: string; + /** Your application's version string @default "1.0" */ + version: string; + /** Print logs to console? @default false */ + logging: boolean; + /** + * Platform Options: + * - offset - offset in percentage + * - background: + * * false - use default + * * true - force use default, e.g. set background for Android icons + * * color - set background for the specified icons + */ + icons: Partial<{ + /* Create Android homescreen icon. */ + android: boolean | { offset: string; background: string }; + /* Create Apple touch icons. */ + appleIcon: boolean | { offset: string; background: string }; + /* Create Apple startup images. */ + appleStartup: boolean | { offset: string; background: string }; + /* Create Opera Coast icon. */ + coast: boolean | { offset: string; background: string }; + /* Create regular favicons. */ + favicons: boolean; + /* Create Firefox OS icons. */ + firefox: boolean | { offset: string; background: string }; + /* Create Windows 8 tile icons. */ + windows: boolean | { background: string }; + /* Create Yandex browser icon. */ + yandex: boolean | { background: string }; + }>; + } + + interface FavIconResponse { + images: Array<{ name: string; contents: Buffer }>; + files: Array<{ name: string; contents: Buffer }>; + html: string[]; + } + + type Callback = (error: Error | null, response: FavIconResponse) => void; + + /** You can programmatically access Favicons configuration (icon filenames, HTML, manifest files, etc) with this export */ + const config: Configuration; + + function stream(configuration?: Configuration): Duplex; } - -export interface FavIconResponse { - images: Array<{ name: string; contents: Buffer }>; - files: Array<{ name: string; contents: Buffer }>; - html: string[]; -} - -export type Callback = (error: Error | null, response: FavIconResponse) => void; - -/** You can programmatically access Favicons configuration (icon filenames, HTML, manifest files, etc) with this export */ -export const config: Configuration; - /** * Generate favicons * @param source Source image(s) @@ -82,12 +87,16 @@ export const config: Configuration; */ declare function favicons( source: string | Buffer | string[], - callback?: Callback + configuration?: Partial, +): Promise; +declare function favicons( + source: string | Buffer | string[], + callback?: favicons.Callback ): void; declare function favicons( source: string | Buffer | string[], - configuration?: Partial, - callback?: Callback + configuration?: Partial, + callback?: favicons.Callback ): void; -export default favicons; +export = favicons; diff --git a/types/feathersjs__authentication-jwt/index.d.ts b/types/feathersjs__authentication-jwt/index.d.ts index 7a555071d9..16d79bb885 100644 --- a/types/feathersjs__authentication-jwt/index.d.ts +++ b/types/feathersjs__authentication-jwt/index.d.ts @@ -52,9 +52,9 @@ export class Verifier { verify(req: Request, payload: any, done: (error: any, user?: any, info?: any) => void): void; } -export type JwtFromRequestFunction = (req: Request) => string; +export type JwtFromRequestFunction = (req: Request) => string | null; -export const ExtractJWT: { +export const ExtractJwt: { fromHeader(header_name: string): JwtFromRequestFunction; fromBodyField(field_name: string): JwtFromRequestFunction; fromUrlQueryParameter(param_name: string): JwtFromRequestFunction; diff --git a/types/feathersjs__authentication-oauth2/feathersjs__authentication-oauth2-tests.ts b/types/feathersjs__authentication-oauth2/feathersjs__authentication-oauth2-tests.ts index 34dba17062..4784a885b5 100644 --- a/types/feathersjs__authentication-oauth2/feathersjs__authentication-oauth2-tests.ts +++ b/types/feathersjs__authentication-oauth2/feathersjs__authentication-oauth2-tests.ts @@ -1,5 +1,10 @@ import feathers, { Application } from '@feathersjs/feathers'; -import feathersAuthenticationOAuth2, { Verifier } from '@feathersjs/authentication-oauth2'; +import feathersAuthenticationOAuth2, { Verifier, FeathersAuthenticationOAuth2Options } from '@feathersjs/authentication-oauth2'; +import { RequestHandler, Response, NextFunction } from 'express'; +import { Request } from 'express-serve-static-core'; +import { Strategy } from 'passport'; +import { Profile as GithubProfile } from 'passport-github'; +import { Profile as FacebookProfile } from 'passport-facebook'; const app: Application<{}> = feathers().configure(feathersAuthenticationOAuth2()); @@ -8,3 +13,79 @@ class CustomVerifier extends Verifier { super(app, options); } } + +const handler: RequestHandler = (req: Request, res: Response, next: NextFunction) => { }; + +class someStrategy extends Strategy { + something = "foo"; +} +/** + * Strongly Typed Verifier + */ + +interface User { + name?: string; + email?: string; + facebookId?: string; + orSomeOtherProviderId?: string; +} + +interface VerifierOptions extends FeathersAuthenticationOAuth2Options { + foo?: boolean; +} + +type IProfileType = GithubProfile | FacebookProfile; + +export default class TestVerifier extends Verifier { } + +const testVerifier = new TestVerifier(app, { + name: "test", + foo: false, + successRedirect: "foo", + failureRedirect: "bar", + service: 'Users', + Strategy: someStrategy, + passReqToCallback: false, + session: false +}); + +testVerifier._createEntity({ + profile: { + id: "", + displayName: "", + birthday: "", + _raw: "", + _json: "", + provider: "" + }, + accessToken: "", + refreshToken: "" +}); + +/** + * Options + */ + +const coreOptions: FeathersAuthenticationOAuth2Options = { + name: "foo", + Strategy: someStrategy, + successRedirect: "foo", + failureRedirect: "foo", + service: "foo", + passReqToCallback: true, + session: true +}; + +const options: FeathersAuthenticationOAuth2Options = { + ...coreOptions, + idField: "foo", + path: "foo", + callbackPath: "foo", + callbackURL: "foo", + entity: "foo", + service: "foo", + handler, + errorHandler: handler, + formatter: handler, + Verifier: TestVerifier +}; diff --git a/types/feathersjs__authentication-oauth2/index.d.ts b/types/feathersjs__authentication-oauth2/index.d.ts index b2bf133c68..65e8989ae9 100644 --- a/types/feathersjs__authentication-oauth2/index.d.ts +++ b/types/feathersjs__authentication-oauth2/index.d.ts @@ -1,73 +1,126 @@ // Type definitions for @feathersjs/authentication-oauth2 1.0 // Project: http://feathersjs.com/ -// Definitions by: Jan Lohage +// Definitions by: Jan Lohage +// Nick Bolles // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 -import { - Application, - Paginated -} from '@feathersjs/feathers'; -import { Request } from 'express'; import * as self from '@feathersjs/authentication-oauth2'; +import { Application, Paginated, Service } from '@feathersjs/feathers'; +import { Request, RequestHandler } from 'express'; +import { Profile, Strategy } from 'passport'; declare const feathersAuthenticationOAuth2: ((options?: FeathersAuthenticationOAuth2Options) => () => void) & typeof self; export default feathersAuthenticationOAuth2; -export interface FeathersAuthenticationOAuth2Options { +// todo: make a base options interface in feathers/authentication that we can extend here +export interface FeathersAuthenticationOAuth2Options { /** - * The field to look up the entity by when logging in with the provider. Defaults to 'Id' (ie. 'facebookId'). + * The name of the OAuth2 provider */ - idField: string; + name: string; /** - * The route to register the middleware + * The OAuth strategy to use */ - path: string; + Strategy: string | typeof Strategy; /** - * The route to register the callback handler + * The route to register the callback handler, defaults to `${path}/callback` */ - callbackPath: string; + callbackPath?: string; /** - * The callback url. + * The callback url. Defaults to @feathersjs/common's makeUrl + callbackPath */ - callbackURL: string; + callbackURL?: string; successRedirect: string; failureRedirect: string; /** - * the entity that you are looking up + * Express middleware for handling the oauth callback. Defaults to the built in middleware. todo: needs a proper type */ - entity: string; + handler?: RequestHandler; + /** + * Express middleware for handling the oauth error callback. Defaults to the built in middleware. todo: needs a proper type + */ + errorHandler?: RequestHandler; + /** + * The response formatter. Defaults the the built in feathers-rest formatter, which returns JSON. todo: needs a proper type + */ + formatter?: RequestHandler; + /** + * A Verifier class. Defaults to the built-in one but can be a custom one. See below for details. + */ + Verifier?: VerifierType; + // todo: some of these options are actually @feathersjs/authentication options, + /** + * The field to look up the entity by when logging in with the provider. Defaults to 'Id' (ie. 'facebookId'). + * This can also be set on app.get('auth') or app.get('authentication') + */ + idField?: string; + /** + * The route to register the middleware on. Defaults to `/auth/${name}` + * This can also be set on app.get('auth') or app.get('authentication') + */ + path?: string; + /** + * the entity that you are looking up. + * This can also be set on app.get('auth') or app.get('authentication') + */ + entity?: string; /** * the service to look up the entity + * This can also be set on app.get('auth') or app.get('authentication') */ - service: string; + service: string | Service; /** * whether the request object should be passed to `verify` + * This can also be set on app.get('auth') or app.get('authentication') */ passReqToCallback: boolean; /** * whether to use sessions, + * This can also be set on app.get('auth') or app.get('authentication') */ session: boolean; /** - * Express middleware for handling the oauth callback. Defaults to the built in middleware. todo: needs a proper type + * Oauth flag to tell @feathersjs/authentication that this is an oauth authentication + * Set by feathersOAuth2 to pass into @feathersjs/authentication */ - handler: any; - /** - * The response formatter. Defaults the the built in feathers-rest formatter, which returns JSON. todo: needs a proper type - */ - formatter: any; - /** - * A Verifier class. Defaults to the built-in one but can be a custom one. See below for details. - */ - Verifier: Verifier; + __oath?: boolean; } -export class Verifier { - constructor(app: Application, options: any) - - _updateEntity(entity: any, data: { profile: any, accessToken: string, refreshToken: string }): Promise; // updates an existing entity - _createEntity(data: { profile: any, accessToken: string, refreshToken: string }): Promise; // creates an entity if they didn't exist already - _normalizeResult(results: T[] | Paginated): Promise; // normalizes result from service to account for pagination - verify(req: Request, accessToken: string, refreshToken: string, profile: any, done: (err: Error | null, user: object, info: object) => void): void; +interface FeathersAuthenticationOAuth2Data { + profile: T; + accessToken: string; + refreshToken: string; } + +export class Verifier< + /** + * The data type for the service object, used in _normalizeResults + */ + DataType = any, + /** + * The interface for the options that are passed into the verifier + */ + OptionType extends FeathersAuthenticationOAuth2Options = FeathersAuthenticationOAuth2Options, + /** + * The profile type for the response, 99% f use cases will be fine with passports default Profile, but you can get more specific like this + * @example + * import {Profile as GithubProfile} from 'passport-github'; + * import {Profile as FacebookProfile} from 'passport-facebook'; + * type IProfileType = GithubProfile | FacebookProfile; + * class MyVerifier extends Verifier { + constructor(app: Application, options: OptionType) + options: OptionType; + service: Service; + _updateEntity(entity: any, data: FeathersAuthenticationOAuth2Data): Promise; // updates an existing entity + _createEntity(data: FeathersAuthenticationOAuth2Data): Promise; // creates an entity if they didn't exist already + _normalizeResult(results: T[] | Paginated): Promise; // normalizes result from service to account for pagination + _setPayloadAndDone(entity: any, done: (err: Error | null, user: object, info: object) => void): Promise; + verify(req: Request, accessToken: string, refreshToken: string, profile: ProfileType, done: (err: Error | null, user: object, info: object) => void): void; +} + +export const defaultHandler: RequestHandler; +export const defaultErrorHandler: RequestHandler; diff --git a/types/feathersjs__authentication/index.d.ts b/types/feathersjs__authentication/index.d.ts index 7bb88a903d..8094c6002a 100644 --- a/types/feathersjs__authentication/index.d.ts +++ b/types/feathersjs__authentication/index.d.ts @@ -1,11 +1,15 @@ // Type definitions for @feathersjs/authentication 2.1 // Project: http://feathersjs.com/ -// Definitions by: Abraao Alves , Jan Lohage +// Definitions by: Abraao Alves +// Jan Lohage +// Nick Bolles // Definitions: https://github.com/feathersjs-ecosystem/feathers-typescript // TypeScript Version: 2.3 -import { Hook } from '@feathersjs/feathers'; +import { Hook, Params } from '@feathersjs/feathers'; import * as self from '@feathersjs/authentication'; +import { RequestHandler, Application } from 'express'; +import { create } from 'domain'; declare const feathersAuthentication: ((config?: FeathersAuthenticationOptions) => () => void) & typeof self; export default feathersAuthentication; @@ -52,6 +56,26 @@ export interface FeathersAuthenticationOptions { }; } +export namespace express { + function exposeHeaders(): RequestHandler; + function exposeCookies(): RequestHandler; + function authenticate(strategy: string | string[], options?: FeathersAuthenticationOptions): RequestHandler; + function setCookie(options?: FeathersAuthenticationOptions): RequestHandler; + function successRedirect(): RequestHandler; + function failureRedirect(options?: FeathersAuthenticationOptions): RequestHandler; + function emitEvents(): RequestHandler; +} + +export function service(options: FeathersAuthenticationOptions): (app?: Application) => void; + +export namespace service { + class Service { + constructor(app: Application) + create(data: Partial, params: Params): Promise<{ accessToken: string }>; + remove(id: null | string, params: Params): Promise<{ accessToken: string }>; + } +} + export namespace AuthHooks { interface HashPassOptions { passwordField: string; diff --git a/types/feathersjs__rest-client/index.d.ts b/types/feathersjs__rest-client/index.d.ts index 22e5f1084b..65fdc93707 100644 --- a/types/feathersjs__rest-client/index.d.ts +++ b/types/feathersjs__rest-client/index.d.ts @@ -5,7 +5,7 @@ // todo: get rid of all the anys -export default function feathersRestClient(base: string): Transport; +export default function feathersRestClient(base?: string): Transport; export interface HandlerResult extends Function { /** diff --git a/types/fetch-mock/fetch-mock-tests.ts b/types/fetch-mock/fetch-mock-tests.ts index 1d5c5a51b3..50b4d79252 100644 --- a/types/fetch-mock/fetch-mock-tests.ts +++ b/types/fetch-mock/fetch-mock-tests.ts @@ -1,4 +1,4 @@ -import * as fetchMock from "fetch-mock"; +import fetchMock = require('fetch-mock'); fetchMock.mock("http://test.com", 200); fetchMock.mock("http://test.com", 200, { @@ -30,22 +30,59 @@ fetchMock.mock(/test/, { } }); -fetchMock.restore().reset(); +fetchMock.restore().reset().resetHistory().resetBehavior(); -(fetchMock.calls().matched[0][1] as RequestInit).body; -fetchMock.calls().unmatched[0][0].toUpperCase(); -fetchMock.calls("http://test.com")[0][0].toUpperCase(); -(fetchMock.calls("http://test.com")[0][1] as RequestInit).body; +let calls: fetchMock.MockCall[] = fetchMock.calls(/https?:\/\/test.com/, { + method: 'GET', +}); +calls[0][0].toUpperCase(); +calls[0].identifier.toUpperCase(); +calls[0].isUnmatched; +calls = fetchMock.calls(); +calls = fetchMock.calls(true); +calls = fetchMock.calls("http://test.com", "GET"); -const doneStatus: boolean = fetchMock.done(); -const doneStatusArguments: boolean = fetchMock.done("http://test.com"); +let doneStatus: boolean = fetchMock.done(); +doneStatus = fetchMock.done(true); +doneStatus = fetchMock.done("http://test.com"); +doneStatus = fetchMock.done(/https?:\/\/test.com/); -const calledStatus: boolean = fetchMock.called(); -const calledStatusArguments = fetchMock.called("http://test.com"); +let calledStatus: boolean = fetchMock.called(); +calledStatus = fetchMock.called(true); +calledStatus = fetchMock.called("http://test.com"); +calledStatus = fetchMock.called(/https?:\/\/test.com/); +calledStatus = fetchMock.called("http://test.com", "GET"); +calledStatus = fetchMock.called("http://test.com", { + method: "GET", +}); +calledStatus = fetchMock.called((url: string, opts: fetchMock.MockRequest): boolean => { + return true; +}); +calledStatus = fetchMock.called(fetchMock.MATCHED); +calledStatus = fetchMock.called(fetchMock.UNMATCHED); -(fetchMock.lastCall()[1] as RequestInit).body; -const lastUrl: string = fetchMock.lastUrl(); -fetchMock.lastOptions(); +let lastCall: fetchMock.MockCall = fetchMock.lastCall(); +lastCall = fetchMock.lastCall(/https?:\/\/test.com/, { + method: "GET", +}); +lastCall = fetchMock.lastCall("https://test.com", "GET"); + +let lastUrl: string = fetchMock.lastUrl(); +lastUrl = fetchMock.lastUrl(true); +lastUrl = fetchMock.lastUrl("http://test.com"); +lastUrl = fetchMock.lastUrl(/https?:\/\/test.com/); +lastUrl = fetchMock.lastUrl("http://test.com", "GET"); +lastUrl = fetchMock.lastUrl("http://test.com", { + method: "GET", +}); +let lastOptions: fetchMock.MockOptions = fetchMock.lastOptions(); +lastOptions = fetchMock.lastOptions(true); +lastOptions = fetchMock.lastOptions("http://test.com"); +lastOptions = fetchMock.lastOptions(/https?:\/\/test.com/); +lastOptions = fetchMock.lastOptions("http://test.com", "GET"); +lastOptions = fetchMock.lastOptions("http://test.com", { + method: "GET", +}); fetchMock.get("http://test.com", 200); fetchMock.getOnce("http://test.com", 200); @@ -83,6 +120,7 @@ const myMatcher: fetchMock.MockMatcherFunction = ( fetchMock.flush().then(resolved => resolved.forEach(console.log)); fetchMock.flush().catch(r => r); +fetchMock.flush(true).catch(r => r); fetchMock.get("http://test.com", { body: 'abc', @@ -99,3 +137,20 @@ sandbox.get("http://test.com", { body: 'abc', redirectUrl: "http://example.org" }); + +const response: fetchMock.MockResponseObject = { + throws: new Error('error'), +}; + +fetchMock.config.sendAsJson = true; +fetchMock.config.includeContentLength = true; +fetchMock.config.fallbackToNetwork = true; +fetchMock.config.fallbackToNetwork = 'always'; +fetchMock.config.overwriteRoutes = true; +fetchMock.config.overwriteRoutes = undefined; +fetchMock.config.warnOnFallback = true; +fetchMock.config.Promise = Promise; +fetchMock.config.fetch = (): Promise => new Promise(() => { }); +fetchMock.config.Headers = Headers; +fetchMock.config.Request = Request; +fetchMock.config.Response = Response; diff --git a/types/fetch-mock/index.d.ts b/types/fetch-mock/index.d.ts index fdae338fce..c9984dea89 100644 --- a/types/fetch-mock/index.d.ts +++ b/types/fetch-mock/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for fetch-mock 6.0 +// Type definitions for fetch-mock 7.2 // Project: https://github.com/wheresrhys/fetch-mock // Definitions by: Alexey Svetliakov // Tamir Duberstein @@ -7,6 +7,8 @@ // Matt Tennison // Quentin Bouygues // Fumiaki Matsushima +// Colin Doig +// Felix Chen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -33,6 +35,35 @@ declare namespace fetchMock { */ type MockMatcher = string | RegExp | MockMatcherFunction; + /** + * Inspection filter. Can be one of the following: + * boolean: + * * true retrieves all calls matched by fetch. + * fetchMock.MATCHED is an alias for true and may be used to make tests + * more readable. + * * false retrieves all calls not matched by fetch (i.e. those handled + * by catch() or spy(). fetchMock.UNMATCHED is an alias for false and + * may be used to make tests more readable. + * MockMatcher (routeIdentifier): + * All routes have an identifier: + * * If it’s a named route, the identifier is the route’s name + * * If the route is unnamed, the identifier is the matcher passed in to + * .mock() + * All calls that were handled by the route with the given identifier + * will be retrieved + * MockMatcher (matcher): + * Any matcher compatible with the mocking api can be passed in to filter + * the calls arbitrarily. + */ + type InspectionFilter = MockMatcher | boolean; + + /** + * Either an object compatible with the mocking api or a string specifying + * a http method to filter by. This will be used to filter the list of + * calls further. + */ + type InspectionOptions = MockOptions | string; + /** * Mock response object */ @@ -57,21 +88,7 @@ declare namespace fetchMock { * If this property is present then a Promise rejected with the value * of throws is returned */ - throws?: boolean; - - /** - * This property determines whether or not the request body should be - * JSON.stringified before being sent - * @default true - */ - sendAsJson?: boolean; - - /** - * Setting this property to true will automatically add the - * content-length header - * @default true - */ - includeContentLength?: boolean; + throws?: Error; /** * The URL the response should be from (to imitate followed redirects @@ -156,13 +173,29 @@ declare namespace fetchMock { * if nothing matches it). */ repeat?: number; + + /** + * Convert objects into JSON before delivering as stub reponses. Can + * be useful to set to false globally if e.g. dealing with a lot of + * array buffers. If true, will also add content-type: application/json + * header. + * @default true + */ + sendAsJson?: boolean; + + /** + * Automatically sets a content-length header on each response. + * @default true + */ + includeContentLength?: boolean; } - type MockCall = [string, MockRequest]; - - interface MatchedRoutes { - matched: MockCall[]; - unmatched: MockCall[]; + interface MockCall extends Array { + 0: string; + 1: RequestInit | undefined; + identifier: string; + isUnmatched: boolean | undefined; + request: Request | undefined; } interface MockOptionsMethodGet extends MockOptions { @@ -186,6 +219,9 @@ declare namespace fetchMock { } interface FetchMockStatic { + MATCHED: true; + UNMATCHED: false; + /** * Replaces fetch() with a stub which records its calls, grouped by * route, and optionally returns a mocked Response object or passes the @@ -381,83 +417,189 @@ declare namespace fetchMock { spy(response?: MockResponse | MockResponseFunction): this; /** - * Chainable method that restores fetch() to its unstubbed state and - * clears all data recorded for its calls. + * Restores fetch() to its unstubbed state and clears all data recorded + * for its calls. reset() is an alias for restore(). */ restore(): this; /** - * Chainable method that clears all data recorded for fetch()'s calls + * Restores fetch() to its unstubbed state and clears all data recorded + * for its calls. reset() is an alias for restore(). */ reset(): this; + /** + * Clears all data recorded for fetch()’s calls. It will not restore + * fetch to its default implementation. + */ + resetHistory(): this; + + /** + * Removes mocking behaviour without resetting call history. + */ + resetBehavior(): this; + /** * Returns a promise that resolves once all fetches handled by fetch-mock * have resolved. + * @param [waitForBody] Wait for all body parsing methods(res.json(), + * res.text(), etc.) to resolve too. */ - flush(): Promise; + flush(waitForBody?: boolean): Promise; /** - * Returns all calls to fetch, grouped by whether fetch-mock matched - * them or not. + * Returns an array of all calls to fetch matching the given filters. + * Each call is returned as a [url, options] array. If fetch was called + * using a Request instance, this will be available as a request + * property on this array. + * @param [filter] Allows filtering of calls to fetch based on various + * criteria + * @param [options] Either an object compatible with the mocking api or + * a string specifying a http method to filter by. This will be used to + * filter the list of calls further. */ - calls(): MatchedRoutes; + calls(filter?: InspectionFilter, options?: InspectionOptions): MockCall[]; /** - * Returns all calls to fetch matching matcherName. + * Returns a Boolean indicating whether any calls to fetch matched the + * given filter. + * @param [filter] Allows filtering of calls to fetch based on various + * criteria + * @param [options] Either an object compatible with the mocking api or + * a string specifying a http method to filter by. This will be used to + * filter the list of calls further. */ - calls(matcherName?: string): MockCall[]; - - /** - * Returns a Boolean indicating whether fetch was called and a route - * was matched (or a specific route if matcherName is passed). - * @param [matcherName] either the name of a route or equal to - * matcher.toString() for any unnamed route - */ - called(matcherName?: string): boolean; + called(filter?: InspectionFilter, options?: InspectionOptions): boolean; /** * Returns a Boolean indicating whether fetch was called the expected - * number of times (or at least once if the route defines no expectation - * is set) for every route (or for a specific route if matcherName is - * passed). - * @param [matcherName] either the name of a route or equal to - * matcher.toString() for any unnamed route + * number of times (or has been called at least once if repeat is + * undefined for the route). + * @param [filter] Rule for matching calls to fetch. */ - done(matcherName?: string): boolean; + done(filter?: InspectionFilter): boolean; /** - * Returns the arguments for the last matched call to fetch (or the - * last call to specific route is matcherName is passed). - * @param [matcherName] either the name of a route or equal to - * matcher.toString() for any unnamed route + * Returns the arguments for the last call to fetch matching the given + * filter. + * @param [filter] Allows filtering of calls to fetch based on various + * criteria + * @param [options] Either an object compatible with the mocking api or + * a string specifying a http method to filter by. This will be used to + * filter the list of calls further. */ - lastCall(matcherName?: string): MockCall; + lastCall( + filter?: InspectionFilter, + options?: InspectionOptions, + ): MockCall | undefined; /** - * Returns the url for the last matched call to fetch (or the last - * call to specific route is matcherName is passed). - * @param [matcherName] either the name of a route or equal to - * matcher.toString() for any unnamed route + * Returns the url for the last call to fetch matching the given + * filter. If fetch was last called using a Request instance, the url + * will be extracted from this. + * @param [filter] Allows filtering of calls to fetch based on various + * criteria + * @param [options] Either an object compatible with the mocking api or + * a string specifying a http method to filter by. This will be used to + * filter the list of calls further. */ - lastUrl(matcherName?: string): string; + lastUrl( + filter?: InspectionFilter, + options?: InspectionOptions, + ): string | undefined; /** - * Returns the options for the last matched call to fetch (or the - * last call to a specific route is matcherName is passed). - * @param [matcherName] either the name of a route or equal to - * matcher.toString() for any unnamed route + * Returns the options for the call to fetch matching the given filter. + * If fetch was last called using a Request instance, a set of options + * inferred from the Request will be returned. + * @param [filter] Allows filtering of calls to fetch based on various + * criteria + * @param [options] Either an object compatible with the mocking api or + * a string specifying a http method to filter by. This will be used to + * filter the list of calls further. */ - lastOptions(matcherName?: string): MockRequest; + lastOptions( + filter?: InspectionFilter, + options?: InspectionOptions, + ): MockOptions | undefined; - /** - * Set some global config options, which include - * sendAsJson [default `true`] - by default fetchMock will - * convert objects to JSON before sending. This is overrideable - * for each call but for some scenarios, e.g. when dealing with a - * lot of array buffers, it can be useful to default to `false` - */ - configure(opts: {}): void; + config: { + /** + * Convert objects into JSON before delivering as stub reponses. + * Can be useful to set to false globally if e.g. dealing with a + * lot of array buffers. If true, will also add + * content-type: application/json header. + * @default true + */ + sendAsJson?: boolean; + + /** + * Automatically sets a content-length header on each response. + * @default true + */ + includeContentLength?: boolean; + + /** + * - true: Unhandled calls fall through to the network + * - false: Unhandled calls throw an error + * - 'always': All calls fall through to the network, effectively + * disabling fetch-mock. + * @default false + */ + fallbackToNetwork?: boolean | 'always'; + + /** + * Determines behaviour if a new route has the same name (or + * inferred name) as an existing one + * - undefined: An error will be throw when routes clash + * - true: Overwrites the existing route + * - false: Appends the new route to the list of routes + * @default undefined + */ + overwriteRoutes?: boolean; + + /** + * Print a warning if any call is caught by a fallback handler (set + * using the fallbackToNetwork option or catch()) + * @default true + */ + warnOnFallback?: boolean; + + /** + * Reference to the Promise constructor of a custom Promise + * implementation. + */ + Promise?: new (executor: ( + resolve: () => void, + reject: () => void, + ) => void) => Promise; + + /** + * Reference to a custom fetch implementation. + */ + fetch?: ( + input?: string | Request, + init?: RequestInit, + ) => Promise; + + /** + * Reference to the Headers constructor of a custom fetch + * implementation. + */ + Headers?: new () => Headers; + + /** + * Reference to the Request constructor of a custom fetch + * implementation. + */ + Request?: new (input: string | Request, init?: RequestInit) => Request; + + /** + * Reference to the Response constructor of a custom fetch + * implementation. + */ + Response?: new () => Response; + }; } interface FetchMockSandbox extends FetchMockStatic { diff --git a/types/fetch-mock/v6/fetch-mock-tests.ts b/types/fetch-mock/v6/fetch-mock-tests.ts new file mode 100644 index 0000000000..1d5c5a51b3 --- /dev/null +++ b/types/fetch-mock/v6/fetch-mock-tests.ts @@ -0,0 +1,101 @@ +import * as fetchMock from "fetch-mock"; + +fetchMock.mock("http://test.com", 200); +fetchMock.mock("http://test.com", 200, { + headers: { + test: "header" + } +}); +fetchMock.mock("http//test.com", 200, { + query: { + searchValue: "apples" + } +}); +fetchMock.mock("http://test.com", 200, { + repeat: 2 +}); +fetchMock.mock(/test\.com/, 200); +fetchMock.mock(() => true, 200); +fetchMock.mock((url, opts) => true, 200); +fetchMock.once("http://test.com", 200); + +fetchMock.mock(/test/, "test").mock(/test/, { a: "b" }); +fetchMock.mock(/test/, { + status: 200, + headers: { + test: "test" + }, + body: { + a: "b" + } +}); + +fetchMock.restore().reset(); + +(fetchMock.calls().matched[0][1] as RequestInit).body; +fetchMock.calls().unmatched[0][0].toUpperCase(); +fetchMock.calls("http://test.com")[0][0].toUpperCase(); +(fetchMock.calls("http://test.com")[0][1] as RequestInit).body; + +const doneStatus: boolean = fetchMock.done(); +const doneStatusArguments: boolean = fetchMock.done("http://test.com"); + +const calledStatus: boolean = fetchMock.called(); +const calledStatusArguments = fetchMock.called("http://test.com"); + +(fetchMock.lastCall()[1] as RequestInit).body; +const lastUrl: string = fetchMock.lastUrl(); +fetchMock.lastOptions(); + +fetchMock.get("http://test.com", 200); +fetchMock.getOnce("http://test.com", 200); +fetchMock.post("http://test.com", 200); +fetchMock.postOnce("http://test.com", 200); +fetchMock.put("http://test.com", 200); +fetchMock.putOnce("http://test.com", 200); +fetchMock.delete("http://test.com", 200); +fetchMock.deleteOnce("http://test.com", 200); +fetchMock.head("http://test.com", 200); +fetchMock.headOnce("http://test.com", 200); +fetchMock.patch("http://test.com", 200); +fetchMock.patchOnce("http://test.com", 200); + +fetchMock.get("http://test.com", 200, {method: "GET"}); +fetchMock.get("http://test.com", 200, {method: "GET", overwriteRoutes: true}); +fetchMock.get("http://test.com", 200, {overwriteRoutes: true}); +fetchMock.post("http://test.com", 200, {method: "POST"}); +fetchMock.put("http://test.com", 200, {method: "PUT"}); +fetchMock.delete("http://test.com", 200, {method: "DELETE"}); +fetchMock.head("http://test.com", 200, {method: "HEAD"}); + +fetchMock + .mock("http://test.com", 200) + .catch(503); + +fetchMock + .mock("http://test.com", 200) + .spy(); + +const myMatcher: fetchMock.MockMatcherFunction = ( + url: string, + opts: fetchMock.MockRequest +) => true; + +fetchMock.flush().then(resolved => resolved.forEach(console.log)); +fetchMock.flush().catch(r => r); + +fetchMock.get("http://test.com", { + body: 'abc', + includeContentLength: false +}); + +fetchMock.get("http://test.com", { + body: 'abc', + redirectUrl: "http://example.org" +}); + +const sandbox = fetchMock.sandbox(); +sandbox.get("http://test.com", { + body: 'abc', + redirectUrl: "http://example.org" +}); diff --git a/types/fetch-mock/v6/index.d.ts b/types/fetch-mock/v6/index.d.ts new file mode 100644 index 0000000000..fdae338fce --- /dev/null +++ b/types/fetch-mock/v6/index.d.ts @@ -0,0 +1,473 @@ +// Type definitions for fetch-mock 6.0 +// Project: https://github.com/wheresrhys/fetch-mock +// Definitions by: Alexey Svetliakov +// Tamir Duberstein +// Risto Keravuori +// Chris Sinclair +// Matt Tennison +// Quentin Bouygues +// Fumiaki Matsushima +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare namespace fetchMock { + type MockRequest = Request | RequestInit; + + /** + * Mock matcher function + */ + type MockMatcherFunction = (url: string, opts: MockRequest) => boolean; + + /** + * Mock matcher. Can be one of following: + * string: Either + * * an exact url to match e.g. 'http://www.site.com/page.html' + * * if the string begins with a `^`, the string following the `^` must + * begin the url e.g. '^http://www.site.com' would match + * 'http://www.site.com' or 'http://www.site.com/page.html' + * * '*' to match any url + * RegExp: A regular expression to test the url against + * Function(url, opts): A function (returning a Boolean) that is passed the + * url and opts fetch() is called with (or, if fetch() was called with one, + * the Request instance) + */ + type MockMatcher = string | RegExp | MockMatcherFunction; + + /** + * Mock response object + */ + interface MockResponseObject { + /** + * Set the response body + */ + body?: string | {}; + + /** + * Set the response status + * @default 200 + */ + status?: number; + + /** + * Set the response headers. + */ + headers?: { [key: string]: string }; + + /** + * If this property is present then a Promise rejected with the value + * of throws is returned + */ + throws?: boolean; + + /** + * This property determines whether or not the request body should be + * JSON.stringified before being sent + * @default true + */ + sendAsJson?: boolean; + + /** + * Setting this property to true will automatically add the + * content-length header + * @default true + */ + includeContentLength?: boolean; + + /** + * The URL the response should be from (to imitate followed redirects + * - will set redirected: true on the response) + */ + redirectUrl?: string; + } + + /** + * Response: A Response instance - will be used unaltered + * number: Creates a response with this status + * string: Creates a 200 response with the string as the response body + * object: As long as the object is not a MockResponseObject it is + * converted into a json string and returned as the body of a 200 response + * If MockResponseObject was given then it's used to configure response + * Function(url, opts): A function that is passed the url and opts fetch() + * is called with and that returns any of the responses listed above + */ + type MockResponse = Response | Promise + | number | Promise + | string | Promise + | {} | Promise<{}> + | MockResponseObject | Promise; + + /** + * Mock response function + */ + type MockResponseFunction = (url: string, opts: MockRequest) => MockResponse; + + /** + * Mock options object + */ + interface MockOptions { + /** + * A unique string naming the route. Used to subsequently retrieve + * references to the calls, grouped by name. + * @default matcher.toString() + * + * Note: If a non-unique name is provided no error will be thrown + * (because names are optional, auto-generated ones may legitimately + * clash) + */ + name?: string; + + /** + * http method to match + */ + method?: string; + + /** + * key/value map of headers to match + */ + headers?: { [key: string]: string }; + + /** + * key/value map of query strings to match, in any order + */ + query?: { [key: string]: string }; + + /** + * as specified above + */ + matcher?: MockMatcher; + + /** + * This option allows for existing routes in a mock to be overwritten. + * It’s also possible to define multiple routes with ‘the same’ matcher. + * Default behaviour is to error + */ + overwriteRoutes?: boolean; + + /** + * as specified above + */ + response?: MockResponse | MockResponseFunction; + + /** + * integer, n, limiting the number of times the matcher can be used. + * If the route has already been called n times the route will be + * ignored and the call to fetch() will fall through to be handled by + * any other routes defined (which may eventually result in an error + * if nothing matches it). + */ + repeat?: number; + } + + type MockCall = [string, MockRequest]; + + interface MatchedRoutes { + matched: MockCall[]; + unmatched: MockCall[]; + } + + interface MockOptionsMethodGet extends MockOptions { + method?: 'GET'; + } + + interface MockOptionsMethodPost extends MockOptions { + method?: 'POST'; + } + + interface MockOptionsMethodPut extends MockOptions { + method?: 'PUT'; + } + + interface MockOptionsMethodDelete extends MockOptions { + method?: 'DELETE'; + } + + interface MockOptionsMethodHead extends MockOptions { + method?: 'HEAD'; + } + + interface FetchMockStatic { + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Calls to .mock() can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + mock(matcher: MockMatcher, response: MockResponse | MockResponseFunction, options?: MockOptions): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Calls to .mock() can be chained. + * @param options The route to mock + */ + mock(options: MockOptions): this; + + /** + * Returns a drop-in mock for fetch which can be passed to other mocking + * libraries. It implements the full fetch-mock api and maintains its + * own state independent of other instances, so tests can be run in + * parallel. + */ + sandbox(): FetchMockSandbox; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Shorthand for mock() limited to being + * called one time only. Calls to .once() can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Optional additional properties defining the route to mock + */ + once(matcher: MockMatcher, response: MockResponse | MockResponseFunction, options?: MockOptions): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Shorthand for mock() restricted to the GET + * method. Calls to .get() can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + get(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodGet): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Shorthand for mock() restricted to the GET + * method and limited to being called one time only. Calls to .getOnce() + * can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + getOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodGet): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Shorthand for mock() restricted to the POST + * method. Calls to .post() can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + post(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPost): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Shorthand for mock() restricted to the POST + * method and limited to being called one time only. Calls to .postOnce() + * can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + postOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPost): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Shorthand for mock() restricted to the PUT + * method. Calls to .put() can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + put(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPut): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Shorthand for mock() restricted to the PUT + * method and limited to being called one time only. Calls to .putOnce() + * can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + putOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodPut): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Shorthand for mock() restricted to the + * DELETE method. Calls to .delete() can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + delete(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodDelete): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Shorthand for mock() restricted to the + * DELETE method and limited to being called one time only. Calls to + * .deleteOnce() can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + deleteOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodDelete): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Shorthand for mock() restricted to the HEAD + * method. Calls to .head() can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + head(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Shorthand for mock() restricted to the HEAD + * method and limited to being called one time only. Calls to .headOnce() + * can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + headOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Shorthand for mock() restricted to the PATCH + * method. Calls to .patch() can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + patch(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this; + + /** + * Replaces fetch() with a stub which records its calls, grouped by + * route, and optionally returns a mocked Response object or passes the + * call through to fetch(). Shorthand for mock() restricted to the PATCH + * method and limited to being called one time only. Calls to .patchOnce() + * can be chained. + * @param matcher Condition for selecting which requests to mock + * @param response Configures the http response returned by the mock + * @param [options] Additional properties defining the route to mock + */ + patchOnce(matcher: MockMatcher, reponse: MockResponse | MockResponseFunction, options?: MockOptionsMethodHead): this; + + /** + * Chainable method that defines how to respond to calls to fetch that + * don't match any of the defined mocks. It accepts the same types of + * response as a normal call to .mock(matcher, response). It can also + * take an arbitrary function to completely customise behaviour of + * unmatched calls. If .catch() is called without any parameters then + * every unmatched call will receive a 200 response. + * @param [response] Configures the http response returned by the mock + */ + catch(response?: MockResponse | MockResponseFunction): this; + + /** + * Chainable method that records the call history of unmatched calls, + * but instead of responding with a stubbed response, the request is + * passed through to native fetch() and is allowed to communicate + * over the network. Similar to catch(). + */ + spy(response?: MockResponse | MockResponseFunction): this; + + /** + * Chainable method that restores fetch() to its unstubbed state and + * clears all data recorded for its calls. + */ + restore(): this; + + /** + * Chainable method that clears all data recorded for fetch()'s calls + */ + reset(): this; + + /** + * Returns a promise that resolves once all fetches handled by fetch-mock + * have resolved. + */ + flush(): Promise; + + /** + * Returns all calls to fetch, grouped by whether fetch-mock matched + * them or not. + */ + calls(): MatchedRoutes; + + /** + * Returns all calls to fetch matching matcherName. + */ + calls(matcherName?: string): MockCall[]; + + /** + * Returns a Boolean indicating whether fetch was called and a route + * was matched (or a specific route if matcherName is passed). + * @param [matcherName] either the name of a route or equal to + * matcher.toString() for any unnamed route + */ + called(matcherName?: string): boolean; + + /** + * Returns a Boolean indicating whether fetch was called the expected + * number of times (or at least once if the route defines no expectation + * is set) for every route (or for a specific route if matcherName is + * passed). + * @param [matcherName] either the name of a route or equal to + * matcher.toString() for any unnamed route + */ + done(matcherName?: string): boolean; + + /** + * Returns the arguments for the last matched call to fetch (or the + * last call to specific route is matcherName is passed). + * @param [matcherName] either the name of a route or equal to + * matcher.toString() for any unnamed route + */ + lastCall(matcherName?: string): MockCall; + + /** + * Returns the url for the last matched call to fetch (or the last + * call to specific route is matcherName is passed). + * @param [matcherName] either the name of a route or equal to + * matcher.toString() for any unnamed route + */ + lastUrl(matcherName?: string): string; + + /** + * Returns the options for the last matched call to fetch (or the + * last call to a specific route is matcherName is passed). + * @param [matcherName] either the name of a route or equal to + * matcher.toString() for any unnamed route + */ + lastOptions(matcherName?: string): MockRequest; + + /** + * Set some global config options, which include + * sendAsJson [default `true`] - by default fetchMock will + * convert objects to JSON before sending. This is overrideable + * for each call but for some scenarios, e.g. when dealing with a + * lot of array buffers, it can be useful to default to `false` + */ + configure(opts: {}): void; + } + + interface FetchMockSandbox extends FetchMockStatic { + /** + * Also callable as fetch(). Use `typeof fetch` in your code to define + * a field that accepts both `fetch()` and a fetch-mock sandbox. + */ + (input?: string | Request , init?: RequestInit): Promise; + } +} + +declare var fetchMock: fetchMock.FetchMockStatic; +export = fetchMock; diff --git a/types/fetch-mock/v6/tsconfig.json b/types/fetch-mock/v6/tsconfig.json new file mode 100644 index 0000000000..ea63a3d716 --- /dev/null +++ b/types/fetch-mock/v6/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "paths": { + "fetch-mock": [ "fetch-mock/v6" ] + } + }, + "files": [ + "index.d.ts", + "fetch-mock-tests.ts" + ] +} diff --git a/types/fetch-mock/v6/tslint.json b/types/fetch-mock/v6/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fetch-mock/v6/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/file-type/file-type-tests.ts b/types/file-type/file-type-tests.ts index 640d2c8fb0..d49a964829 100644 --- a/types/file-type/file-type-tests.ts +++ b/types/file-type/file-type-tests.ts @@ -1,6 +1,8 @@ import fileType = require("file-type"); +// $ExpectType FileTypeResult | null fileType(new Buffer([0xFF, 0xD8, 0xFF])); fileType(new Uint8Array([0xFF, 0xD8, 0xFF])); -const minimumBytes: number = fileType.minimumBytes; +// $ExpectType number +fileType.minimumBytes; diff --git a/types/file-type/index.d.ts b/types/file-type/index.d.ts index 2a0deee26a..c902dc384e 100644 --- a/types/file-type/index.d.ts +++ b/types/file-type/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for file-type 5.2 +// Type definitions for file-type 10.6 // Project: https://github.com/sindresorhus/file-type // Definitions by: KIM Jaesuck a.k.a. gim tcaesvk // BendingBender @@ -8,7 +8,17 @@ export = FileType; -declare function FileType(buf: Buffer | Uint8Array): FileType.FileTypeResult; +/** + * The file type is detected by checking the + * [magic number](http://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer. + * + * @param buf It only needs the first `.minimumBytes` bytes. The exception is detection of + * `docx`, `pptx`, and `xlsx` which potentially requires reading the whole file. + * @returns an Object with: + * - ext - One of the [supported file types](https://github.com/sindresorhus/file-type/blob/master/readme.md#supported-file-types) + * - mime - The [MIME type](http://en.wikipedia.org/wiki/Internet_media_type) + */ +declare function FileType(buf: Buffer | Uint8Array): FileType.FileTypeResult | null; declare namespace FileType { interface FileTypeResult { @@ -16,5 +26,9 @@ declare namespace FileType { mime: string; } + /** + * The minimum amount of bytes needed to detect a file type. Currently, + * it's 4100 bytes, but it can change, so don't hard-code it. + */ const minimumBytes: number; } diff --git a/types/file-type/tsconfig.json b/types/file-type/tsconfig.json index 499b81459c..1894b908af 100644 --- a/types/file-type/tsconfig.json +++ b/types/file-type/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "file-type-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/filenamify-url/filenamify-url-tests.ts b/types/filenamify-url/filenamify-url-tests.ts new file mode 100644 index 0000000000..2a575c9267 --- /dev/null +++ b/types/filenamify-url/filenamify-url-tests.ts @@ -0,0 +1,7 @@ +import filenamifyUrl = require("filenamify-url"); + +filenamifyUrl("http://sindresorhus.com/foo?bar=baz"); + +filenamifyUrl("http://sindresorhus.com/foo", { replacement: "🐴" }); + +filenamifyUrl.path("https://sindresorhus.com"); diff --git a/types/filenamify-url/index.d.ts b/types/filenamify-url/index.d.ts new file mode 100644 index 0000000000..24dc581717 --- /dev/null +++ b/types/filenamify-url/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for filenamify-url 1.0 +// Project: https://github.com/sindresorhus/filenamify-url +// Definitions by: Carlos Precioso +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as filenamifyUrl from "filenamify"; +export = filenamifyUrl; diff --git a/types/filenamify-url/tsconfig.json b/types/filenamify-url/tsconfig.json new file mode 100644 index 0000000000..dd7225304e --- /dev/null +++ b/types/filenamify-url/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", + "filenamify-url-tests.ts" + ] +} diff --git a/types/filenamify-url/tslint.json b/types/filenamify-url/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/filenamify-url/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/filesize/index.d.ts b/types/filesize/index.d.ts index 511e2373af..e8905d906d 100644 --- a/types/filesize/index.d.ts +++ b/types/filesize/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for filesize 3.6 +// Type definitions for filesize 4.0 // Project: https://github.com/avoidwork/filesize.js // Definitions by: Giedrius Grabauskas // Renaud Chaput +// Roman Nuritdinov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare var fileSize: Filesize.Filesize; @@ -80,11 +81,6 @@ declare namespace Filesize { * Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found */ symbols?: SiJedec; - /** - * Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found - * @deprecated: use `symbols` - */ - suffixes?: SiJedec; /** * Enables unix style human readable output, e.g ls -lh, default is false */ diff --git a/types/filter-console/filter-console-tests.ts b/types/filter-console/filter-console-tests.ts new file mode 100644 index 0000000000..18bb766d32 --- /dev/null +++ b/types/filter-console/filter-console-tests.ts @@ -0,0 +1,8 @@ +import filterConsole = require('filter-console'); + +const disableFilter = filterConsole(['🐼']); +disableFilter; // $ExpectType () => void +filterConsole([/🐼/]); +filterConsole([input => input === '🐼']); + +disableFilter(); diff --git a/types/filter-console/index.d.ts b/types/filter-console/index.d.ts new file mode 100644 index 0000000000..58ee621211 --- /dev/null +++ b/types/filter-console/index.d.ts @@ -0,0 +1,44 @@ +// Type definitions for filter-console 0.1 +// Project: https://github.com/sindresorhus/filter-console#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +export = filterConsole; + +/** + * Filter out unwanted `console.log()` output. + * Can be useful when you don't control the output, for example, filtering out PropType warnings from a + * third-party React component. + * + * @param excludePatterns Console output that matches any of the given patterns are filtered from being logged. + * The patterns are matched against what would be logged and not the `console` method input arguments directly. + * Meaning an exclude pattern of `'foo bar'` will match `console.log('foo %s', 'bar')`. + * @returns A function, which when called, disables the filter. + */ +declare function filterConsole( + excludePatterns: Array boolean)>, + options?: filterConsole.Options +): () => void; + +declare namespace filterConsole { + interface Options { + /** + * Console methods to filter. + * @default ['log', 'debug', 'info', 'warn', 'error'] + */ + methods?: Array<'log' | 'debug' | 'info' | 'warn' | 'error'>; + + /** + * Use a custom `console` object. Can be useful for testing or mocking. + */ + console?: Console; + } + + type Console = Record< + 'log' | 'debug' | 'info' | 'warn' | 'error', + (message?: any, ...optionalParams: any[]) => void + >; +} diff --git a/types/filter-console/tsconfig.json b/types/filter-console/tsconfig.json new file mode 100644 index 0000000000..34ed881aab --- /dev/null +++ b/types/filter-console/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", + "filter-console-tests.ts" + ] +} diff --git a/types/filter-console/tslint.json b/types/filter-console/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/filter-console/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/find-cache-dir/find-cache-dir-tests.ts b/types/find-cache-dir/find-cache-dir-tests.ts new file mode 100644 index 0000000000..5836be99b6 --- /dev/null +++ b/types/find-cache-dir/find-cache-dir-tests.ts @@ -0,0 +1,19 @@ +import findCacheDir = require('find-cache-dir'); + +findCacheDir({ name: 'unicorns' }); // $ExpectType string | null +findCacheDir({ name: 'unicorns', files: 'foo' }); // $ExpectType string | null +findCacheDir({ name: 'unicorns', files: ['foo', 'bar'] }); // $ExpectType string | null +findCacheDir({ name: 'unicorns', cwd: 'foo' }); // $ExpectType string | null +findCacheDir({ name: 'unicorns', create: true }); // $ExpectType string | null +findCacheDir({ name: 'unicorns', thunk: false }); // $ExpectType string | null +findCacheDir({}); // $ExpectError +findCacheDir(); // $ExpectError + +const thunk = findCacheDir({ name: 'unicorns', thunk: true }); +thunk; // $ExpectType ((...pathParts: string[]) => string) | null + +if (thunk) { + thunk(); // $ExpectType string + thunk('bar.js'); // $ExpectType string + thunk('baz', 'quz.js'); // $ExpectType string +} diff --git a/types/find-cache-dir/index.d.ts b/types/find-cache-dir/index.d.ts new file mode 100644 index 0000000000..4b69518e21 --- /dev/null +++ b/types/find-cache-dir/index.d.ts @@ -0,0 +1,57 @@ +// Type definitions for find-cache-dir 2.0 +// Project: https://github.com/avajs/find-cache-dir#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = findCacheDir; + +/** + * Finds the cache directory using the supplied options. The algorithm tries to find a `package.json` file, + * searching every parent directory of the `cwd` specified (or implied from other options). + * @param options + * @returns A string containing the absolute path to the cache directory, or null if package.json was never found. + */ +declare function findCacheDir( + options: findCacheDir.OptionsWithThunk +): ((...pathParts: string[]) => string) | null; +declare function findCacheDir(options: findCacheDir.Options): string | null; + +declare namespace findCacheDir { + interface Options { + /** + * Should be the same as your project name in `package.json`. + */ + name: string; + + /** + * An array of files that will be searched for a common parent directory. + * This common parent directory will be used in lieu of the `cwd` option below. + */ + files?: string | string[]; + + /** + * Directory to start searching for a `package.json` from. + */ + cwd?: string; + + /** + * If `true`, the directory will be created synchronously before returning. + * @default false + */ + create?: boolean; + + /** + * If `true`, this modifies the return type to be a function that is a thunk for `path.join(theFoundCacheDirectory)`. + * @default false + */ + thunk?: boolean; + } + + interface OptionsWithThunk extends Options { + /** + * If `true`, this modifies the return type to be a function that is a thunk for `path.join(theFoundCacheDirectory)`. + * @default false + */ + thunk: true; + } +} diff --git a/types/find-cache-dir/tsconfig.json b/types/find-cache-dir/tsconfig.json new file mode 100644 index 0000000000..68068b9343 --- /dev/null +++ b/types/find-cache-dir/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", + "find-cache-dir-tests.ts" + ] +} diff --git a/types/find-cache-dir/tslint.json b/types/find-cache-dir/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/find-cache-dir/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/find-java-home/find-java-home-tests.ts b/types/find-java-home/find-java-home-tests.ts new file mode 100644 index 0000000000..36b7004055 --- /dev/null +++ b/types/find-java-home/find-java-home-tests.ts @@ -0,0 +1,6 @@ +import findJavaHome = require("find-java-home"); +import { promisify } from "util"; + +findJavaHome(() => { }); // $ExpectType void +findJavaHome({ allowJre: true }, () => { }); // $ExpectType void +promisify(findJavaHome); // $ExpectType (options?: { allowJre?: boolean | undefined; } | undefined) => Promise diff --git a/types/find-java-home/index.d.ts b/types/find-java-home/index.d.ts new file mode 100644 index 0000000000..a512d51b26 --- /dev/null +++ b/types/find-java-home/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for find-java-home 0.2 +// Project: https://github.com/jsdevel/node-find-java-home +// Definitions by: sjx233 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare function findJavaHome(callback: (err: Error | undefined, home: string) => void): void; +declare function findJavaHome(options: { allowJre?: boolean }, callback: (err: Error | undefined, home: string) => void): void; + +declare namespace findJavaHome { + function __promisify__(options?: { allowJre?: boolean }): Promise; +} + +export = findJavaHome; diff --git a/types/find-java-home/tsconfig.json b/types/find-java-home/tsconfig.json new file mode 100644 index 0000000000..fcf2def157 --- /dev/null +++ b/types/find-java-home/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", + "find-java-home-tests.ts" + ] +} diff --git a/types/find-java-home/tslint.json b/types/find-java-home/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/find-java-home/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/findup-sync/findup-sync-tests.ts b/types/findup-sync/findup-sync-tests.ts index 789190dcce..87a334eea6 100644 --- a/types/findup-sync/findup-sync-tests.ts +++ b/types/findup-sync/findup-sync-tests.ts @@ -1,14 +1,17 @@ import findup = require('findup-sync'); -var str: string; +let str: string; str = findup('foo'); str = findup(['foo', 'bar']); str = findup('foo', { - debug: true + matchBase: true, }); str = findup('foo', { - cwd: "c:\\" + cwd: 'c:\\', }); + +str = findup('{a,b}*.txt'); +str = findup('{a,b}*.txt', { cwd: '/some/path', nocase: true }); diff --git a/types/findup-sync/index.d.ts b/types/findup-sync/index.d.ts index bd06c12d46..23df60a22f 100644 --- a/types/findup-sync/index.d.ts +++ b/types/findup-sync/index.d.ts @@ -1,14 +1,22 @@ -// Type definitions for findup-sync v0.3.0 +// Type definitions for findup-sync 2.0 // Project: https://github.com/cowboy/node-findup-sync -// Definitions by: Bart van der Schoor , Nathan Brown +// Definitions by: Bart van der Schoor +// Nathan Brown +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 -import minimatch = require('minimatch'); +import micromatch = require('micromatch'); -interface IOptions extends minimatch.IOptions { - cwd?: string; +export = findupSync; + +declare function findupSync( + patternOrPatterns: string[] | string, + micromatchOptions?: findupSync.Options +): string; + +declare namespace findupSync { + interface Options extends micromatch.Options { + cwd?: string; + } } - -declare function mod(pattern: string[] | string, opts?: IOptions): string; - -export = mod; diff --git a/types/findup-sync/tslint.json b/types/findup-sync/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/findup-sync/tslint.json +++ b/types/findup-sync/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } diff --git a/types/findup-sync/v0/findup-sync-tests.ts b/types/findup-sync/v0/findup-sync-tests.ts new file mode 100644 index 0000000000..789190dcce --- /dev/null +++ b/types/findup-sync/v0/findup-sync-tests.ts @@ -0,0 +1,14 @@ +import findup = require('findup-sync'); + +var str: string; + +str = findup('foo'); +str = findup(['foo', 'bar']); + +str = findup('foo', { + debug: true +}); + +str = findup('foo', { + cwd: "c:\\" +}); diff --git a/types/findup-sync/v0/index.d.ts b/types/findup-sync/v0/index.d.ts new file mode 100644 index 0000000000..bd06c12d46 --- /dev/null +++ b/types/findup-sync/v0/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for findup-sync v0.3.0 +// Project: https://github.com/cowboy/node-findup-sync +// Definitions by: Bart van der Schoor , Nathan Brown +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import minimatch = require('minimatch'); + +interface IOptions extends minimatch.IOptions { + cwd?: string; +} + +declare function mod(pattern: string[] | string, opts?: IOptions): string; + +export = mod; diff --git a/types/findup-sync/v0/tsconfig.json b/types/findup-sync/v0/tsconfig.json new file mode 100644 index 0000000000..dd28d081d0 --- /dev/null +++ b/types/findup-sync/v0/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "findup-sync": [ + "findup-sync/v0" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "findup-sync-tests.ts" + ] +} diff --git a/types/spectacle/tslint.json b/types/findup-sync/v0/tslint.json similarity index 100% rename from types/spectacle/tslint.json rename to types/findup-sync/v0/tslint.json diff --git a/types/fingerprintjs2/fingerprintjs2-tests.ts b/types/fingerprintjs2/fingerprintjs2-tests.ts index d295ab7aab..f11caae127 100644 --- a/types/fingerprintjs2/fingerprintjs2-tests.ts +++ b/types/fingerprintjs2/fingerprintjs2-tests.ts @@ -1,123 +1,135 @@ -function defaultCallback(result: string, components: [{ key: string, value: string }]) { - console.log(`res: ${result}; components: ${components}`); +import * as fingerprint2 from 'fingerprintjs2'; + +function defaultCallback(components: fingerprint2.Component[]) {} +function v18Callback(murmur: string, components: fingerprint2.V18Component[]) {} + +function test_x64hash128() { + // $ExpectType string + fingerprint2.x64hash128('abc', 99); } -function test_default_settings() { - const fingerprint = new Fingerprint2().get(defaultCallback); +function test_get_default_settings() { + fingerprint2.get(defaultCallback); } -function test_get_exclude_swfContainerId() { - const fingerprint = new Fingerprint2({ swfContainerId: 'swfContainerId' }).get(defaultCallback); +function test_get_with_options() { + fingerprint2.get({ excludes: { userAgent: true } }, defaultCallback); } -function test_get_exclude_swfPath() { - const fingerprint = new Fingerprint2({swfPath: 'pathToSwf'}).get(defaultCallback); +function test_getPromise_default_settings() { + // $ExpectType Promise + fingerprint2.getPromise(); } -function test_get_exclude_userDefinedFonts() { - const fingerprint = new Fingerprint2({ userDefinedFonts: ['font1', 'font2']}).get(defaultCallback); +function test_getPromise_with_options() { + // $ExpectType Promise + fingerprint2.getPromise({ excludes: { userAgent: true } }); } -function test_get_excludeUserAgent() { - const fingerprint = new Fingerprint2({ excludeUserAgent: true }).get(defaultCallback); +function test_getV18_default_settings() { + fingerprint2.getV18(v18Callback); } -function test_get_excludeLanguage() { - const fingerprint = new Fingerprint2({ excludeLanguage: true }).get(defaultCallback); +function test_getV18_with_options() { + fingerprint2.getV18({ excludes: { userAgent: true } }, v18Callback); } -function test_get_excludeColorDepth() { - const fingerprint = new Fingerprint2({ excludeColorDepth: true }).get(defaultCallback); +function test_get_audio_options() { + const options: fingerprint2.Options = { + audio: { + timeout: 10, + excludeIOS11: true, + }, + }; + fingerprint2.get(options, defaultCallback); } -function test_get_excludeScreenResolution() { - const fingerprint = new Fingerprint2({ excludeScreenResolution: true }).get(defaultCallback); +function test_get_fonts_options() { + const options: fingerprint2.Options = { + fonts: { + swfContainerId: 'swfContainerId', + swfPath: 'pathToSwf', + userDefinedFonts: ['font1', 'font2'], + extendedJsFonts: true, + }, + }; + fingerprint2.get(options, defaultCallback); } -function test_get_excludeTimezoneOffset() { - const fingerprint = new Fingerprint2({ excludeTimezoneOffset: true }).get(defaultCallback); +function test_get_screen_options() { + const options: fingerprint2.Options = { + screen: { + detectScreenOrientation: true, + }, + }; + fingerprint2.get(options, defaultCallback); } -function test_get_excludeSessionStorage() { - const fingerprint = new Fingerprint2({ excludeSessionStorage: true }).get(defaultCallback); +function test_get_plugins_options() { + const options: fingerprint2.Options = { + plugins: { + sortPluginsFor: [/foo/i], + excludeIE: true, + }, + }; + fingerprint2.get(options, defaultCallback); } -function test_get_excludeIndexedDB() { - const fingerprint = new Fingerprint2({ excludeIndexedDB: true }).get(defaultCallback); +function test_get_extraComponents_options() { + const options: fingerprint2.Options = { + extraComponents: [ + { + key: 'foo', + getData(done, options) { + // $ExpectType (value: any) => void + done; + // $ExpectType Options + options; + + done('foo'); + }, + pauseBefore: false, + }, + ], + }; + fingerprint2.get(options, defaultCallback); } -function test_get_excludeAddBehavior() { - const fingerprint = new Fingerprint2({ excludeAddBehavior: true }).get(defaultCallback); -} +function test_get_excludes_options() { + let options: fingerprint2.Options; -function test_get_excludeOpenDatabase() { - const fingerprint = new Fingerprint2({ excludeOpenDatabase: true }).get(defaultCallback); -} + options = { excludes: { userAgent: true } }; + options = { excludes: { language: true } }; + options = { excludes: { colorDepth: true } }; + options = { excludes: { deviceMemory: true } }; + options = { excludes: { pixelRatio: true } }; + options = { excludes: { hardwareConcurrency: true } }; + options = { excludes: { screenResolution: true } }; + options = { excludes: { availableScreenResolution: true } }; + options = { excludes: { timezoneOffset: true } }; + options = { excludes: { timezone: true } }; + options = { excludes: { sessionStorage: true } }; + options = { excludes: { localStorage: true } }; + options = { excludes: { indexedDb: true } }; + options = { excludes: { addBehavior: true } }; + options = { excludes: { openDatabase: true } }; + options = { excludes: { cpuClass: true } }; + options = { excludes: { platform: true } }; + options = { excludes: { doNotTrack: true } }; + options = { excludes: { plugins: true } }; + options = { excludes: { canvas: true } }; + options = { excludes: { webgl: true } }; + options = { excludes: { webglVendorAndRenderer: true } }; + options = { excludes: { adBlock: true } }; + options = { excludes: { hasLiedLanguages: true } }; + options = { excludes: { hasLiedResolution: true } }; + options = { excludes: { hasLiedOs: true } }; + options = { excludes: { hasLiedBrowser: true } }; + options = { excludes: { touchSupport: true } }; + options = { excludes: { fonts: true } }; + options = { excludes: { fontsFlash: true } }; + options = { excludes: { audio: true } }; + options = { excludes: { enumerateDevices: true } }; -function test_get_excludeCpuClass() { - const fingerprint = new Fingerprint2({ excludeCpuClass: true }).get(defaultCallback); -} - -function test_get_excludePlatform() { - const fingerprint = new Fingerprint2({ excludePlatform: true }).get(defaultCallback); -} - -function test_get_excludeDoNotTrack() { - const fingerprint = new Fingerprint2({ excludeDoNotTrack: true }).get(defaultCallback); -} - -function test_get_excludeCanvas() { - const fingerprint = new Fingerprint2({ excludeCanvas: true }).get(defaultCallback); -} - -function test_get_excludeWebGL() { - const fingerprint = new Fingerprint2({ excludeWebGL: true }).get(defaultCallback); -} - -function test_get_excludeAdBlock() { - const fingerprint = new Fingerprint2({ excludeAdBlock: true }).get(defaultCallback); -} - -function test_get_excludeHasLiedLanguages() { - const fingerprint = new Fingerprint2({ excludeHasLiedLanguages: true }).get(defaultCallback); -} - -function test_get_excludeHasLiedResolution() { - const fingerprint = new Fingerprint2({ excludeHasLiedResolution: true }).get(defaultCallback); -} - -function test_get_excludeHasLiedOs() { - const fingerprint = new Fingerprint2({ excludeHasLiedOs: true }).get(defaultCallback); -} - -function test_get_excludeHasLiedBrowser() { - const fingerprint = new Fingerprint2({ excludeHasLiedBrowser: true }).get(defaultCallback); -} - -function test_get_excludeJsFonts() { - const fingerprint = new Fingerprint2({ excludeJsFonts: true }).get(defaultCallback); -} - -function test_get_excludeFlashFonts() { - const fingerprint = new Fingerprint2({ excludeFlashFonts: true }).get(defaultCallback); -} - -function test_get_excludePlugins() { - const fingerprint = new Fingerprint2({ excludePlugins: true }).get(defaultCallback); -} - -function test_get_excludeIEPlugins() { - const fingerprint = new Fingerprint2({ excludeIEPlugins: true }).get(defaultCallback); -} - -function test_get_excludeTouchSupport() { - const fingerprint = new Fingerprint2({ excludeTouchSupport: true }).get(defaultCallback); -} - -function test_get_excludePixelRatio() { - const fingerprint = new Fingerprint2({ excludePixelRatio: true }).get(defaultCallback); -} - -function test_get_excludeHardwareConcurrency() { - const fingerprint = new Fingerprint2({ excludeHardwareConcurrency: true }).get(defaultCallback); + fingerprint2.get(options, defaultCallback); } diff --git a/types/fingerprintjs2/index.d.ts b/types/fingerprintjs2/index.d.ts index 5778eebeed..1b8a50fe77 100644 --- a/types/fingerprintjs2/index.d.ts +++ b/types/fingerprintjs2/index.d.ts @@ -1,46 +1,124 @@ -// Type definitions for fingerprintjs2 1.5 +// Type definitions for fingerprintjs2 2.0 // Project: https://github.com/Valve/fingerprintjs2 // Definitions by: Curt Mullin +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare class Fingerprint2 { - static VERSION: string; - constructor(options?: Fingerprint2Options); - - get(callback: (result: string, components: [{ key: string, value: string }]) => void): number; -} - -interface Fingerprint2Options { - swfContainerId?: string; - swfPath?: string; - userDefinedFonts?: string[]; - excludeUserAgent?: boolean; - excludeLanguage?: boolean; - excludeColorDepth?: boolean; - excludeScreenResolution?: boolean; - excludeTimezoneOffset?: boolean; - excludeSessionStorage?: boolean; - excludeIndexedDB?: boolean; - excludeAddBehavior?: boolean; - excludeOpenDatabase?: boolean; - excludeCpuClass?: boolean; - excludePlatform?: boolean; - excludeDoNotTrack?: boolean; - excludeCanvas?: boolean; - excludeWebGL?: boolean; - excludeAdBlock?: boolean; - excludeHasLiedLanguages?: boolean; - excludeHasLiedResolution?: boolean; - excludeHasLiedOs?: boolean; - excludeHasLiedBrowser?: boolean; - excludeJsFonts?: boolean; - excludeFlashFonts?: boolean; - excludePlugins?: boolean; - excludeIEPlugins?: boolean; - excludeTouchSupport?: boolean; - excludePixelRatio?: boolean; - excludeHardwareConcurrency?: boolean; -} - -export = Fingerprint2; export as namespace Fingerprint2; +export = Fingerprint2; + +declare var Fingerprint2: Fingerprint2.Static; + +declare namespace Fingerprint2 { + interface Static { + VERSION: string; + + get(options: Options, callback: (components: Component[]) => void): void; + get(callback: (components: Component[]) => void): void; + getPromise(options?: Options): Promise; + getV18( + options: Options, + callback: (murmur: string, components: V18Component[]) => void + ): void; + getV18(callback: (murmur: string, components: V18Component[]) => void): void; + + x64hash128(value: string, num: number): string; + } + + interface Component { + key: string; + value: any; + } + + interface V18Component { + key: string; + value: string; + } + + interface Options { + preprocessor?: (key: string, value: any) => any; + + audio?: { + timeout: number; + /** + * On iOS 11, audio context can only be used in response to user interaction. + * We require users to explicitly enable audio fingerprinting on iOS 11. + * See https://stackoverflow.com/questions/46363048/onaudioprocess-not-called-on-ios11#46534088 + */ + excludeIOS11: boolean; + }; + + fonts?: { + swfContainerId: string; + swfPath: string; + userDefinedFonts: string[]; + extendedJsFonts: boolean; + }; + + screen?: { + /** + * To ensure consistent fingerprints when users rotate their mobile devices + */ + detectScreenOrientation: boolean; + }; + + plugins?: { + sortPluginsFor: RegExp[]; + excludeIE: boolean; + }; + + extraComponents?: Array<{ + key: string; + getData(done: (value: any) => void, options: Options): void; + pauseBefore?: boolean; + }>; + + excludes?: { + userAgent?: boolean; + language?: boolean; + colorDepth?: boolean; + deviceMemory?: boolean; + /** + * devicePixelRatio depends on browser zoom, and it's impossible to detect browser zoom + */ + pixelRatio?: boolean; + hardwareConcurrency?: boolean; + screenResolution?: boolean; + availableScreenResolution?: boolean; + timezoneOffset?: boolean; + timezone?: boolean; + sessionStorage?: boolean; + localStorage?: boolean; + indexedDb?: boolean; + addBehavior?: boolean; + openDatabase?: boolean; + cpuClass?: boolean; + platform?: boolean; + /** + * DNT depends on incognito mode for some browsers (Chrome) and it's impossible to detect incognito mode + */ + doNotTrack?: boolean; + plugins?: boolean; + canvas?: boolean; + webgl?: boolean; + webglVendorAndRenderer?: boolean; + adBlock?: boolean; + hasLiedLanguages?: boolean; + hasLiedResolution?: boolean; + hasLiedOs?: boolean; + hasLiedBrowser?: boolean; + touchSupport?: boolean; + fonts?: boolean; + fontsFlash?: boolean; + audio?: boolean; + /** + * Unreliable on Windows, see https://github.com/Valve/fingerprintjs2/issues/375 + */ + enumerateDevices?: boolean; + }; + + NOT_AVAILABLE?: string; + ERROR?: string; + EXCLUDED?: string; + } +} diff --git a/types/fingerprintjs2/v1/fingerprintjs2-tests.ts b/types/fingerprintjs2/v1/fingerprintjs2-tests.ts new file mode 100644 index 0000000000..d295ab7aab --- /dev/null +++ b/types/fingerprintjs2/v1/fingerprintjs2-tests.ts @@ -0,0 +1,123 @@ +function defaultCallback(result: string, components: [{ key: string, value: string }]) { + console.log(`res: ${result}; components: ${components}`); +} + +function test_default_settings() { + const fingerprint = new Fingerprint2().get(defaultCallback); +} + +function test_get_exclude_swfContainerId() { + const fingerprint = new Fingerprint2({ swfContainerId: 'swfContainerId' }).get(defaultCallback); +} + +function test_get_exclude_swfPath() { + const fingerprint = new Fingerprint2({swfPath: 'pathToSwf'}).get(defaultCallback); +} + +function test_get_exclude_userDefinedFonts() { + const fingerprint = new Fingerprint2({ userDefinedFonts: ['font1', 'font2']}).get(defaultCallback); +} + +function test_get_excludeUserAgent() { + const fingerprint = new Fingerprint2({ excludeUserAgent: true }).get(defaultCallback); +} + +function test_get_excludeLanguage() { + const fingerprint = new Fingerprint2({ excludeLanguage: true }).get(defaultCallback); +} + +function test_get_excludeColorDepth() { + const fingerprint = new Fingerprint2({ excludeColorDepth: true }).get(defaultCallback); +} + +function test_get_excludeScreenResolution() { + const fingerprint = new Fingerprint2({ excludeScreenResolution: true }).get(defaultCallback); +} + +function test_get_excludeTimezoneOffset() { + const fingerprint = new Fingerprint2({ excludeTimezoneOffset: true }).get(defaultCallback); +} + +function test_get_excludeSessionStorage() { + const fingerprint = new Fingerprint2({ excludeSessionStorage: true }).get(defaultCallback); +} + +function test_get_excludeIndexedDB() { + const fingerprint = new Fingerprint2({ excludeIndexedDB: true }).get(defaultCallback); +} + +function test_get_excludeAddBehavior() { + const fingerprint = new Fingerprint2({ excludeAddBehavior: true }).get(defaultCallback); +} + +function test_get_excludeOpenDatabase() { + const fingerprint = new Fingerprint2({ excludeOpenDatabase: true }).get(defaultCallback); +} + +function test_get_excludeCpuClass() { + const fingerprint = new Fingerprint2({ excludeCpuClass: true }).get(defaultCallback); +} + +function test_get_excludePlatform() { + const fingerprint = new Fingerprint2({ excludePlatform: true }).get(defaultCallback); +} + +function test_get_excludeDoNotTrack() { + const fingerprint = new Fingerprint2({ excludeDoNotTrack: true }).get(defaultCallback); +} + +function test_get_excludeCanvas() { + const fingerprint = new Fingerprint2({ excludeCanvas: true }).get(defaultCallback); +} + +function test_get_excludeWebGL() { + const fingerprint = new Fingerprint2({ excludeWebGL: true }).get(defaultCallback); +} + +function test_get_excludeAdBlock() { + const fingerprint = new Fingerprint2({ excludeAdBlock: true }).get(defaultCallback); +} + +function test_get_excludeHasLiedLanguages() { + const fingerprint = new Fingerprint2({ excludeHasLiedLanguages: true }).get(defaultCallback); +} + +function test_get_excludeHasLiedResolution() { + const fingerprint = new Fingerprint2({ excludeHasLiedResolution: true }).get(defaultCallback); +} + +function test_get_excludeHasLiedOs() { + const fingerprint = new Fingerprint2({ excludeHasLiedOs: true }).get(defaultCallback); +} + +function test_get_excludeHasLiedBrowser() { + const fingerprint = new Fingerprint2({ excludeHasLiedBrowser: true }).get(defaultCallback); +} + +function test_get_excludeJsFonts() { + const fingerprint = new Fingerprint2({ excludeJsFonts: true }).get(defaultCallback); +} + +function test_get_excludeFlashFonts() { + const fingerprint = new Fingerprint2({ excludeFlashFonts: true }).get(defaultCallback); +} + +function test_get_excludePlugins() { + const fingerprint = new Fingerprint2({ excludePlugins: true }).get(defaultCallback); +} + +function test_get_excludeIEPlugins() { + const fingerprint = new Fingerprint2({ excludeIEPlugins: true }).get(defaultCallback); +} + +function test_get_excludeTouchSupport() { + const fingerprint = new Fingerprint2({ excludeTouchSupport: true }).get(defaultCallback); +} + +function test_get_excludePixelRatio() { + const fingerprint = new Fingerprint2({ excludePixelRatio: true }).get(defaultCallback); +} + +function test_get_excludeHardwareConcurrency() { + const fingerprint = new Fingerprint2({ excludeHardwareConcurrency: true }).get(defaultCallback); +} diff --git a/types/fingerprintjs2/v1/index.d.ts b/types/fingerprintjs2/v1/index.d.ts new file mode 100644 index 0000000000..5778eebeed --- /dev/null +++ b/types/fingerprintjs2/v1/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for fingerprintjs2 1.5 +// Project: https://github.com/Valve/fingerprintjs2 +// Definitions by: Curt Mullin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class Fingerprint2 { + static VERSION: string; + constructor(options?: Fingerprint2Options); + + get(callback: (result: string, components: [{ key: string, value: string }]) => void): number; +} + +interface Fingerprint2Options { + swfContainerId?: string; + swfPath?: string; + userDefinedFonts?: string[]; + excludeUserAgent?: boolean; + excludeLanguage?: boolean; + excludeColorDepth?: boolean; + excludeScreenResolution?: boolean; + excludeTimezoneOffset?: boolean; + excludeSessionStorage?: boolean; + excludeIndexedDB?: boolean; + excludeAddBehavior?: boolean; + excludeOpenDatabase?: boolean; + excludeCpuClass?: boolean; + excludePlatform?: boolean; + excludeDoNotTrack?: boolean; + excludeCanvas?: boolean; + excludeWebGL?: boolean; + excludeAdBlock?: boolean; + excludeHasLiedLanguages?: boolean; + excludeHasLiedResolution?: boolean; + excludeHasLiedOs?: boolean; + excludeHasLiedBrowser?: boolean; + excludeJsFonts?: boolean; + excludeFlashFonts?: boolean; + excludePlugins?: boolean; + excludeIEPlugins?: boolean; + excludeTouchSupport?: boolean; + excludePixelRatio?: boolean; + excludeHardwareConcurrency?: boolean; +} + +export = Fingerprint2; +export as namespace Fingerprint2; diff --git a/types/fingerprintjs2/v1/tsconfig.json b/types/fingerprintjs2/v1/tsconfig.json new file mode 100644 index 0000000000..4f7e97d591 --- /dev/null +++ b/types/fingerprintjs2/v1/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "fingerprintjs2": [ + "fingerprintjs2/v1" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "fingerprintjs2-tests.ts" + ] +} diff --git a/types/fingerprintjs2/v1/tslint.json b/types/fingerprintjs2/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fingerprintjs2/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/firefox-webext-browser/index.d.ts b/types/firefox-webext-browser/index.d.ts index 84dc4f15e7..9b318f9b4b 100644 --- a/types/firefox-webext-browser/index.d.ts +++ b/types/firefox-webext-browser/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for WebExtension Development in FireFox 64.0 +// Type definitions for WebExtension Development in FireFox 65.0 // Project: https://developer.mozilla.org/en-US/Add-ons/WebExtensions // Definitions by: Jasmin Bom // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -178,6 +178,8 @@ declare namespace browser._manifest { alternate_urls?: string[]; /** @deprecated Unsupported on Firefox. */ prepopulated_id?: number; + /** Encoding of the search term. */ + encoding?: string; /** Sets the default engine to a built-in engine only. */ is_default?: boolean; /** @@ -455,14 +457,17 @@ declare namespace browser._manifest { interface ThemeType { images?: { additional_backgrounds?: ImageDataOrExtensionURL[]; + /** @deprecated Please use _theme.images.theme_frame_, this alias will be removed in Firefox 69. */ headerURL?: ImageDataOrExtensionURL; theme_frame?: ImageDataOrExtensionURL; }; colors?: { tab_selected?: ThemeColor; + /** @deprecated Please use _theme.colors.frame_, this alias will be removed in Firefox 69. */ accentcolor?: ThemeColor; frame?: ThemeColor; frame_inactive?: ThemeColor; + /** @deprecated Please use _theme.colors.tab_background_text_, this alias will be removed in Firefox 69. */ textcolor?: ThemeColor; tab_background_text?: ThemeColor; tab_background_separator?: ThemeColor; @@ -470,6 +475,7 @@ declare namespace browser._manifest { tab_text?: ThemeColor; tab_line?: ThemeColor; toolbar?: ThemeColor; + /** @deprecated Please use _theme.colors.bookmark_text_, this alias will be removed in Firefox 69. */ toolbar_text?: ThemeColor; bookmark_text?: ThemeColor; toolbar_field?: ThemeColor; @@ -3535,11 +3541,6 @@ declare namespace browser.userScripts { unregister(): Promise; } - /** A set of API methods provided by the extensions to its userScripts */ - interface ExportedAPIMethods { - [key: string]: (...args: any[]) => any; - } - /* userScripts functions */ /** * Register a user script programmatically given its `userScripts.UserScriptOptions`, and resolves to a @@ -3547,12 +3548,28 @@ declare namespace browser.userScripts { */ function register(userScriptOptions: UserScriptOptions): Promise; + /* userScripts events */ /** - * Provides a set of custom API methods available to the registered userScripts + * Event called when a new userScript global has been created * * Allowed in: Content scripts only */ - function setScriptAPIs(exportedAPIMethods: ExportedAPIMethods): void; + const onBeforeScript: WebExtEvent<(userScript: { + /** The userScript metadata (as set in userScripts.register) */ + metadata: any; + /** The userScript global */ + global: any; + /** + * Exports all the properties of a given plain object as userScript globals + * @param sourceObject A plain object whose properties are exported as userScript globals + */ + defineGlobals: (sourceObject: object) => void; + /** + * Convert a given value to make it accessible to the userScript code + * @param value A value to convert into an object accessible to the userScript + */ + export: (value: any) => any; + }) => void>; } /** @@ -5570,16 +5587,24 @@ declare namespace browser.geckoProfiler { | "stackwalk" | "tasktracer" | "threads" - | "trackopts"; + | "trackopts" + | "jstracer"; + + type Supports = "windowLength"; /* geckoProfiler functions */ /** Starts the profiler with the specified settings. */ function start(settings: { /** - * The size in bytes of the buffer used to store profiling data. A larger value allows capturing a profile that - * covers a greater amount of time. + * The maximum size in bytes of the buffer used to store profiling data. A larger value allows capturing a + * profile that covers a greater amount of time. */ bufferSize: number; + /** + * The length of the window of time that's kept in the buffer. Any collected samples are discarded as soon as + * they are older than the number of seconds specified in this setting. Zero means no duration restriction. + */ + windowLength?: number; /** * Interval in milliseconds between samples of profiling data. A smaller value will increase the detail of the * profiles captured. @@ -5821,6 +5846,8 @@ declare namespace browser.contextMenus { * context where there is no current page, such as in a launcher context menu. */ pageUrl?: string; + /** The id of the frame of the element where the context menu was clicked. */ + frameId?: number; /** The URL of the frame of the element where the context menu was clicked, if it was in a frame. */ frameUrl?: string; /** The text for the context selection, if any. */ @@ -6100,6 +6127,8 @@ declare namespace browser.menus { * context where there is no current page, such as in a launcher context menu. */ pageUrl?: string; + /** The id of the frame of the element where the context menu was clicked. */ + frameId?: number; /** The URL of the frame of the element where the context menu was clicked, if it was in a frame. */ frameUrl?: string; /** The text for the context selection, if any. */ @@ -6939,6 +6968,8 @@ declare namespace browser.tabs { sharingState?: SharingState; /** Whether the tab is drawing attention. */ attention?: boolean; + /** The ID of this tab's successor, if any; `tabs.TAB_ID_NONE` otherwise. */ + successorTabId?: number; } /** @@ -7320,6 +7351,10 @@ declare namespace browser.tabs { openerTabId?: number; /** Whether the load should replace the current history entry for the tab. */ loadReplace?: boolean; + /** + * The ID of this tab's successor. If specified, the successor tab must be in the same window as this tab. + */ + successorTabId?: number; }): Promise; /** * Modifies the properties of a tab. Properties that are not specified in `updateProperties` are not modified. @@ -7349,6 +7384,10 @@ declare namespace browser.tabs { openerTabId?: number; /** Whether the load should replace the current history entry for the tab. */ loadReplace?: boolean; + /** + * The ID of this tab's successor. If specified, the successor tab must be in the same window as this tab. + */ + successorTabId?: number; }): Promise; /** @@ -7517,6 +7556,29 @@ declare namespace browser.tabs { */ function hide(tabIds: number | number[]): Promise; + /** + * Removes an array of tabs from their lines of succession and prepends or appends them in a chain to another tab. + * @param tabIds An array of tab IDs to move in the line of succession. For each tab in the array, the tab's + * current predecessors will have their successor set to the tab's current successor, and each tab will then be + * set to be the successor of the previous tab in the array. Any tabs not in the same window as the tab + * indicated by the second argument (or the first tab in the array, if no second argument) will be skipped. + * @param [tabId] The ID of a tab to set as the successor of the last tab in the array, or `tabs.TAB_ID_NONE` to + * leave the last tab without a successor. If options.append is true, then this tab is made the predecessor of + * the first tab in the array instead. + */ + function moveInSuccession(tabIds: number[], tabId?: number, options?: { + /** Whether to move the tabs before (false) or after (true) tabId in the succession. Defaults to false. */ + append?: boolean; + /** + * Whether to link up the current predecessors or successor (depending on options.append) of tabId to the other + * side of the chain after it is prepended or appended. If true, one of the following happens: if + * options.append is false, the first tab in the array is set as the successor of any current predecessors of + * tabId; if options.append is true, the current successor of tabId is set as the successor of the last tab in + * the array. Defaults to false. + */ + insert?: boolean; + }): Promise; + /* tabs events */ /** * 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 @@ -7571,6 +7633,8 @@ declare namespace browser.tabs { const onActivated: WebExtEvent<(activeInfo: { /** The ID of the tab that has become active. */ tabId: number; + /** The ID of the tab that was previously active, if that tab is still open. */ + previousTabId?: number; /** The ID of the window the active tab changed inside of. */ windowId: number; }) => void>; diff --git a/types/first-run/first-run-tests.ts b/types/first-run/first-run-tests.ts new file mode 100644 index 0000000000..5451c7c88c --- /dev/null +++ b/types/first-run/first-run-tests.ts @@ -0,0 +1,6 @@ +import firstRun = require('first-run'); + +firstRun(); // $ExpectType boolean +firstRun({ name: 'foo' }); // $ExpectType boolean + +firstRun.clear(); diff --git a/types/first-run/index.d.ts b/types/first-run/index.d.ts new file mode 100644 index 0000000000..dc92053d03 --- /dev/null +++ b/types/first-run/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for first-run 1.2 +// Project: https://github.com/sindresorhus/first-run +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = firstRun; + +/** + * Check if it's the first time the process is run. + */ +declare function firstRun(options?: firstRun.Options): boolean; + +declare namespace firstRun { + /** + * Clear the state. + */ + function clear(): void; + + interface Options { + /** + * The name used to identify it. + * @default name field in your package.json + */ + name: string; + } +} diff --git a/types/first-run/tsconfig.json b/types/first-run/tsconfig.json new file mode 100644 index 0000000000..6a4ce007ab --- /dev/null +++ b/types/first-run/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", + "first-run-tests.ts" + ] +} diff --git a/types/first-run/tslint.json b/types/first-run/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/first-run/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fkill/fkill-tests.ts b/types/fkill/fkill-tests.ts new file mode 100644 index 0000000000..6e2b380a16 --- /dev/null +++ b/types/fkill/fkill-tests.ts @@ -0,0 +1,5 @@ +import fkill = require('fkill'); + +fkill(1337); // $ExpectType Promise +fkill('Safari'); // $ExpectType Promise +fkill([1337, 'Safari', ':8080']); // $ExpectType Promise diff --git a/types/fkill/index.d.ts b/types/fkill/index.d.ts new file mode 100644 index 0000000000..4b6663a10c --- /dev/null +++ b/types/fkill/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for fkill 5.3 +// Project: https://github.com/sindresorhus/fkill#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = fkill; + +/** + * Fabulously kill processes. Cross-platform. + * + * @param input One or more process IDs/names/ports to kill. + * To kill a port, prefix it with a colon. For example: `:8080`. + */ +declare function fkill( + input: number | string | Array, + options?: fkill.Options +): Promise; + +declare namespace fkill { + interface Options { + /** + * Force kill the process. + * @default false + */ + force?: boolean; + + /** + * Kill all child processes along with the parent process. *(Windows only)* + * @default true + */ + tree?: boolean; + + /** + * Ignore capitalization when killing a process. + * Note that the case is always ignored on Windows. + * @default false + */ + ignoreCase?: boolean; + } +} diff --git a/types/fkill/tsconfig.json b/types/fkill/tsconfig.json new file mode 100644 index 0000000000..2e36e29395 --- /dev/null +++ b/types/fkill/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", + "fkill-tests.ts" + ] +} diff --git a/types/fkill/tslint.json b/types/fkill/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fkill/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/flatbuffers/flatbuffers-tests.ts b/types/flatbuffers/flatbuffers-tests.ts index 13f8453224..030835c2c9 100644 --- a/types/flatbuffers/flatbuffers-tests.ts +++ b/types/flatbuffers/flatbuffers-tests.ts @@ -86,6 +86,27 @@ class Test { builder.writeInt16(a); return builder.offset(); } + + static testClear(builder: flatbuffers.Builder, a: number, b: number) { + const offsets: number[] = []; + const iterations = 100; + for (let i = 0; i < iterations; i++) { + const offset = Test.createTest(builder, a, b); + offsets.push(offset); + builder.clear(); + } + + let lastOffsetValue = offsets[0]; + let sameValue = true; + for (let i = 1; i < offsets.length; i++) { + if (lastOffsetValue !== offsets[i]) { + sameValue = false; + return sameValue; + } + lastOffsetValue = offsets[i]; + } + return sameValue; + } } class TestSimpleTableWithEnum { diff --git a/types/flatbuffers/index.d.ts b/types/flatbuffers/index.d.ts index bd74387bf2..03f3d952f3 100644 --- a/types/flatbuffers/index.d.ts +++ b/types/flatbuffers/index.d.ts @@ -42,6 +42,12 @@ declare global { class Builder { constructor(initial_size?: number); + /** + * Reset all the state in this FlatBufferBuilder + * so it can be reused to construct another buffer. + */ + clear(): void; + /** * In order to save space, fields that are set to their default value * don't get serialized into the buffer. Forcing defaults provides a @@ -211,6 +217,8 @@ declare global { static allocate(byte_size: number): ByteBuffer; + clear(): void; + bytes(): Uint8Array; position(): number; diff --git a/types/flexmonster/flexmonster-tests.ts b/types/flexmonster/flexmonster-tests.ts new file mode 100644 index 0000000000..fb9840c6cb --- /dev/null +++ b/types/flexmonster/flexmonster-tests.ts @@ -0,0 +1,7 @@ +import Flexmonster = require('flexmonster'); + +new Flexmonster({ + container: 'pivot-container', + height: '550px', + width: '100%' +}); diff --git a/types/flexmonster/index.d.ts b/types/flexmonster/index.d.ts new file mode 100644 index 0000000000..00a6c49bcb --- /dev/null +++ b/types/flexmonster/index.d.ts @@ -0,0 +1,479 @@ +// Type definitions for flexmonster 2.6 +// Project: https://www.flexmonster.com/ +// Definitions by: Flexmonster +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +export as namespace Flexmonster; + +declare const Flexmonster: FlexmonsterConstructor; +export = Flexmonster; + +interface FlexmonsterConstructor { + new (params: Flexmonster.Params): Flexmonster.Pivot; + (params: Flexmonster.Params): Flexmonster.Pivot; +} + +declare namespace Flexmonster { + interface Params { + // params + toolbar?: boolean; + licenseKey?: string; + width?: string | number; + height?: string | number; + componentFolder?: string; + report?: Report | string; + global?: Report; + customizeCell?: (cell: CellBuilder, data: CellData) => void; + customizeContextMenu?: (items: ContextMenuItem[], data: CellData | ChartData, viewType: string) => ContextMenuItem[]; + // events + afterchartdraw?: () => void; + aftergriddraw?: (param: object) => void; + beforegriddraw?: (param: object) => void; + beforetoolbarcreated?: (toolbar: Toolbar) => void; + cellclick?: (cell: CellData) => void; + celldoubleclick?: (cell: CellData) => void; + datachanged?: (param: object) => void; + dataerror?: (param: object) => void; + datafilecancelled?: () => void; + dataloaded?: () => void; + exportcomplete?: () => void; + exportstart?: () => void; + fieldslistclose?: () => void; + fieldslistopen?: () => void; + filterclose?: () => void; + filteropen?: () => void; + loadingdata?: () => void; + loadinglocalization?: () => void; + loadingolapstructure?: () => void; + loadingreportfile?: () => void; + localizationerror?: () => void; + localizationloaded?: () => void; + olapstructureerror?: () => void; + olapstructureloaded?: () => void; + openingreportfile?: () => void; + printcomplete?: () => void; + printstart?: () => void; + querycomplete?: () => void; + queryerror?: () => void; + ready?: () => void; + reportchange?: () => void; + reportcomplete?: () => void; + reportfilecancelled?: () => void; + reportfileerror?: () => void; + runningquery?: () => void; + update?: () => void; + // other + container?: string; + } + + interface Pivot { + addCalculatedMeasure(measure: Measure): void; + addCondition(condition: ConditionalFormat): void; + addJSON(json: object[]): void; + alert(options: { title?: string; message?: string; type?: string; buttons?: Array<{ label: string; handler?: () => void; }>; blocking?: boolean; }): void; + clear(): void; + clearFilter(hierarchyName: string): void; + clearXMLACache(proxyUrl: string, databaseId: string, callbackHandler: ((reponse: object) => void) | string, cubeId: string, measuresGroupId: string, + username?: string, password?: string): void; + closeFieldsList(): void; + collapseAllData(): void; + collapseData(hierarchyName: string): void; + connectTo(object: DataSource): void; + customizeCell(customizeCellFunction: (cell: CellBuilder, data: CellData) => void): void; + customizeContextMenu(customizeFunction: (items: ContextMenuItem[], data: CellData | ChartData, viewType: string) => ContextMenuItem[]): void; + dispose(): void; + expandAllData(withAllChildren?: boolean): void; + expandData(hierarchyName: string): void; + exportTo(type: string, exportOptions?: ExportOptions, callbackHandler?: ((result: object) => void) | string): void; + getAllConditions(): ConditionalFormat[]; + getAllHierarchies(): Hierarchy[]; + getAllMeasures(): Measure[]; + getCell(rowIdx: number, colIdx: number): CellData; + getColumns(): Hierarchy[]; + getCondition(id: string): ConditionalFormat; + getData(options: { slice?: Slice }, callbackHandler: ((rawData: any) => void) | string, updateHandler?: ((rawData: any) => void) | string): void; + getFilter(hierarchyName: string): FilterItem[]; + getFilterProperties(hierarchyName: string): FilterProperties; + getFormat(measureName: string): Format; + getMeasures(): Measure[]; + getMembers(hierarchyName: string, memberName: string, callbackHandler: ((members: Member[]) => void) | string): Member[]; + getOptions(): Options; + getReport(format?: string): Report | string; + getReportFilters(): Hierarchy[]; + getRows(): Hierarchy[]; + getSelectedCell(): CellData | CellData[]; + getSort(hierarchyName: string): string; + getXMLACatalogs(proxyURL: string, dataSource: string, callbackHandler: ((response: any) => void) | string, username?: string, password?: string): void; + getXMLACubes(proxyURL: string, dataSource: string, catalog: string, callbackHandler: ((response: any) => void) | string, username?: string, password?: string): void; + getXMLADataSources(proxyURL: string, callbackHandler: ((response: any) => void) | string, username?: string, password?: string): void; + getXMLAProviderName(proxyURL: string, callbackHandler: ((response: any) => void) | string, username?: string, password?: string): string; + load(url: string, componentFolder?: string): void; + off(eventType: string, handler?: ((...args: any[]) => any) | string): void; + on(eventType: string, handler: ((...args: any[]) => any) | string): void; + open(): void; + openFieldsList(): void; + openFilter(hierarchyName: string): void; + print(options?: PrintOptions): void; + refresh(): void; + removeAllCalculatedMeasures(): void; + removeAllConditions(): void; + removeCalculatedMeasure(uniqueName: string): void; + removeCondition(id: string): void; + removeSelection(): void; + runQuery(slice: Slice): void; + save(filename: string, destination: string, callbackHandler?: (() => void) | string, url?: string, embedData?: boolean): string; + setBottomX(hierarchyName: string, num: number, measure: MeasureObject): void; + setFilter(hierarchyName: string, items: string[], negation?: boolean): void; + setFormat(format: Format, measureName: string): void; + setOptions(options: Options): void; + setReport(report: Report): void; + setSort(hierarchyName: string, sortName: string, customSorting?: string[]): void; + setTopX(hierarchyName: string, num: number, measure: MeasureObject): void; + showCharts(type?: string, multiple?: boolean): void; + showGrid(): void; + showGridAndCharts(type?: string, position?: string, multiple?: boolean): void; + sortingMethod(hierarchyName: string, compareFunction: (a: string, b: string) => boolean): void; + sortValues(axisName: string, type: string, tuple: number[], measure: MeasureObject): void; + updateData(object: DataSource | object[]): void; + version: string; + fusioncharts?: { + getData(options: { type: string; slice?: Slice; prepareDataFunction?: (rawData: any) => any }, callbackHandler: ((rawData: any) => void) | string, + updateHandler?: ((rawData: any) => void) | string): void; + getNumberFormat(format: object): object; + }; + googlecharts?: { + getData(options: { type?: string; slice?: Slice; prepareDataFunction?: (rawData: any) => any }, callbackHandler: ((rawData: any) => void) | string, + updateHandler?: ((rawData: any) => void) | string): void; + getNumberFormat(format: object): object; + getNumberFormatPattern(format: object): string; + }; + highcharts?: { + getData(options: { type?: string; slice?: Slice; xAxisType?: string; valuesOnly?: boolean, withDrilldown?: boolean, prepareDataFunction?: (rawData: any) => any }, + callbackHandler: ((rawData: any) => void) | string, updateHandler?: ((rawData: any) => void) | string): void; + getAxisFormat(format: object): string; + getPointXFormat(format: object): string; + getPointYFormat(format: object): string; + getPointZFormat(format: object): string; + }; + } + + interface Report { + dataSource?: DataSource; + slice?: Slice; + options?: Options; + conditions?: ConditionalFormat[]; + formats?: Format[]; + tableSizes?: { + columns?: ColumnSize[]; + rows?: RowSize[]; + }; + localization?: object | string; + } + + interface DataSource { + browseForFile?: boolean; + catalog?: string; + cube?: string; + data?: object[]; + dataSourceInfo?: string; + dataSourceType?: string; + fieldSeparator?: string; + filename?: string; + ignoreQuotedLineBreaks?: boolean; + proxyUrl?: string; + recordsetDelimiter?: string; + binary?: boolean; + roles?: string; + localeIdentifier?: string; + effectiveUserName?: string; + customData?: string; + hash?: string; + username?: string; + password?: string; + } + + interface Slice { + columns?: Hierarchy[]; + measures?: Measure[]; + reportFilters?: Hierarchy[]; + rows?: Hierarchy[]; + drills?: { + drillAll?: boolean; + columns?: Array<{ tuple: string[]; measure?: MeasureObject; }>; + rows?: Array<{ tuple: string[]; measure?: MeasureObject; }>; + }; + expands?: { + expandAll?: boolean; + columns?: Array<{ tuple: string[]; measure?: MeasureObject; }>; + rows?: Array<{ tuple: string[]; measure?: MeasureObject; }>; + }; + sorting?: { + column?: Array<{ type: string; tuple: string[]; measure: MeasureObject; }>; + row?: Array<{ type: string; tuple: string[]; measure: MeasureObject; }>; + }; + drillThrough?: string[]; + } + + interface Options { + chart?: { + activeMeasure?: MeasureObject; + activeTupleIndex?: number; + autoRange?: boolean; + labelsHierarchy?: string; + multipleMeasures?: boolean; + oneLevel?: boolean; + showFilter?: boolean; + showLegend?: boolean; + showLegendButton?: boolean; + showMeasures?: boolean; + showWarning?: boolean; + title?: string; + type?: string; + showDataLabels?: boolean; + reversedAxes?: boolean; + showAllLabels?: boolean; + showOneMeasureSelection?: boolean; + position?: string; + pieDataIndex?: string; + }; + grid?: { + showFilter?: boolean; + showGrandTotals?: string; + showHeaders?: boolean; + showHierarchies?: boolean; + showHierarchyCaptions?: boolean; + showReportFiltersArea?: boolean; + showTotals?: boolean; + title?: string; + type?: string; + showAutoCalculationBar?: boolean; + dragging?: boolean; + grandTotalsPosition?: string; + drillThroughMaxRows?: number; + }; + configuratorActive?: boolean; + configuratorButton?: boolean; + dateTimezoneOffset?: number; + datePattern?: string; + dateTimePattern?: string; + defaultHierarchySortName?: string; + drillThrough?: boolean; + editing?: boolean; + selectEmptyCells?: boolean; + showAggregations?: boolean; + showCalculatedValuesButton?: boolean; + showDefaultSlice?: boolean; + showMemberProperties?: boolean; + sorting?: string; + viewType?: string; + showAggregationLabels?: boolean; + useOlapFormatting?: boolean; + defaultDateType?: string; + timePattern?: string; + showOutdatedDataAlert?: boolean; + showEmptyData?: boolean; + saveAllFormats?: boolean; + showDrillThroughConfigurator?: boolean; + grouping?: boolean; + } + + interface PrintOptions { + header?: string; + footer?: string; + } + + interface Member { + caption?: string; + uniqueName?: string; + hierarchyName?: string; + children?: Member[]; + isLeaf?: boolean; + parentMember?: string; + } + + interface FilterProperties { + type: string; + members?: FilterItem[]; + quantity?: number; + measure?: MeasureObject; + } + + interface FilterItem { + caption?: string; + uniqueName?: string; + hierarchyName?: string; + } + + interface CellData { + columnIndex?: number; + columns?: object[]; + escapedLabel?: string; + height?: number; + hierarchy?: Hierarchy; + isClassicTotalRow?: boolean; + isDrillThrough?: boolean; + isGrandTotal?: boolean; + isGrandTotalColumn?: boolean; + isGrandTotalRow?: boolean; + isTotal?: boolean; + isTotalColumn?: boolean; + isTotalRow?: boolean; + member?: Member; + width?: number; + x?: number; + y?: number; + label?: string; + measure?: MeasureObject; + rowIndex?: number; + rows?: object[]; + type?: string; + value?: number; + } + + interface ExportOptions { + filename?: string; + destinationType?: string; + excelSheetName?: string; + footer?: string; + header?: string; + pageOrientation?: string; + showFilters?: boolean; + url?: string; + useOlapFormattingInExcel?: boolean; + useCustomizeCellForData?: boolean; + excelExportAll?: boolean; + } + + interface Hierarchy { + caption?: string; + dimensionName?: string; + filter?: { + members?: string[]; + negation?: boolean; + measure?: MeasureObject; + quantity?: number; + type?: string; + }; + sortName?: string; + sortOrder?: string[]; + uniqueName?: string; + } + + interface Measure { + uniqueName?: string; + active?: boolean; + aggregation?: string; + availableAggregations?: string[]; + caption?: string; + formula?: string; + format?: string; + grandTotalCaption?: string; + } + + interface MeasureObject { + uniqueName: string; + aggregation?: string; + } + + interface ConditionalFormat { + formula?: string; + format?: Style; + formatCSS?: string; + row?: number; + column?: number; + measureName?: string; + hierarchy?: string; + member?: string; + isTotal?: number; + } + + interface Style { + color?: string; + backgroundColor?: string; + backgroundImage?: string; + borderColor?: string; + fontSize?: string; + fontWeight?: string; + fill?: string; + textAlign?: string; + fontFamily?: string; + width?: number; + maxWidth?: number; + height?: number; + maxHeight?: number; + } + + interface Format { + name?: string; + thousandsSeparator?: string; + decimalSeparator?: string; + decimalPlaces?: number; + maxDecimalPlaces?: number; + maxSymbols?: number; + currencySymbol?: string; + currencySymbolAlign?: string; + nullValue?: string; + infinityValue?: string; + divideByZeroValue?: string; + textAlign?: string; + isPercent?: boolean; + beautifyFloatingPoint?: boolean; + } + + interface ColumnSize { + width?: number; + idx?: number; + tuple?: string[]; + measure?: MeasureObject; + } + + interface RowSize { + height?: number; + idx?: number; + tuple?: string[]; + measure?: MeasureObject; + } + + interface CellBuilder { + attr?: object; + classes?: string[]; + style?: object; + tag?: string; + text?: string; + addClass(value?: string): void; + toHtml(): string; + } + + interface ContextMenuItem { + label?: string; + handler?: (() => void) | string; + submenu?: ContextMenuItem[]; + isSelected?: boolean; + } + + interface ChartData { + columnTuple?: number[]; + id?: string; + label?: string; + measure?: MeasureObject; + rawTuple?: number[]; + value?: number; + } + + interface Toolbar { + getTabs: () => ToolbarTab[]; + } + + interface ToolbarTab { + android: boolean; + args: any; + handler: (() => void) | string; + icon: string; + id: string; + ios: boolean; + mobile: boolean; + menu: ToolbarTab[]; + title: string; + } +} diff --git a/types/flexmonster/tsconfig.json b/types/flexmonster/tsconfig.json new file mode 100644 index 0000000000..9e3ef7747b --- /dev/null +++ b/types/flexmonster/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", + "flexmonster-tests.ts" + ] +} \ No newline at end of file diff --git a/types/flexmonster/tslint.json b/types/flexmonster/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/flexmonster/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/flickity/index.d.ts b/types/flickity/index.d.ts index ae5dc46cb7..07a9e03d9e 100644 --- a/types/flickity/index.d.ts +++ b/types/flickity/index.d.ts @@ -457,7 +457,7 @@ interface FlickityOptions { * * default: disabled */ - asNavFor?: string; + asNavFor?: string | HTMLElement; /** * The number of pixels a mouse or touch has to move before dragging begins. Increase dragThreshold to allow for more wiggle room for vertical page scrolling on touch devices. diff --git a/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts b/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts index 53b095a8b2..65124d9fc8 100644 --- a/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts +++ b/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts @@ -54,3 +54,27 @@ command.save('/path/to/output-original-size.mp4'); ffmpeg.ffprobe('/path/to/file.avi', (err, metadata) => { console.dir(metadata); }); + +ffmpeg.setFfmpegPath('path/to/ffmpeg'); +ffmpeg.setFfprobePath('path/to/ffprobe'); +ffmpeg.setFfmpegPath('path/to/ffmpeg'); + +ffmpeg.getAvailableFormats((err, formats) => { + console.log('Available formats:'); + console.dir(formats); +}); + +ffmpeg.getAvailableCodecs((err, codecs) => { + console.log('Available codecs:'); + console.dir(codecs); +}); + +ffmpeg.getAvailableEncoders((err, encoders) => { + console.log('Available encoders:'); + console.dir(encoders); +}); + +ffmpeg.getAvailableFilters((err, filters) => { + console.log("Available filters:"); + console.dir(filters); +}); diff --git a/types/fluent-ffmpeg/index.d.ts b/types/fluent-ffmpeg/index.d.ts index db8f54b325..aa4c8cb02d 100644 --- a/types/fluent-ffmpeg/index.d.ts +++ b/types/fluent-ffmpeg/index.d.ts @@ -112,6 +112,19 @@ declare namespace Ffmpeg { options: string | string[] | {}; } + // static methods + function setFfmpegPath(path: string): FfmpegCommand; + function setFfprobePath(path: string): FfmpegCommand; + function setFlvtoolPath(path: string): FfmpegCommand; + function availableFilters(callback: FiltersCallback): void; + function getAvailableFilters(callback: FiltersCallback): void; + function availableCodecs(callback: CodecsCallback): void; + function getAvailableCodecs(callback: CodecsCallback): void; + function availableEncoders(callback: EncodersCallback): void; + function getAvailableEncoders(callback: EncodersCallback): void; + function availableFormats(callback: FormatsCallback): void; + function getAvailableFormats(callback: FormatsCallback): void; + class FfmpegCommand extends events.EventEmitter { constructor(options?: FfmpegCommandOptions); constructor(input?: string | stream.Readable, options?: FfmpegCommandOptions); diff --git a/types/fluent-langneg/fluent-langneg-tests.ts b/types/fluent-langneg/fluent-langneg-tests.ts new file mode 100644 index 0000000000..45eaa22ee8 --- /dev/null +++ b/types/fluent-langneg/fluent-langneg-tests.ts @@ -0,0 +1,7 @@ +import { negotiateLanguages } from 'fluent-langneg'; + +const supportedLocales = negotiateLanguages( + ['en-US', 'pl'], // requested locales + ['de', 'en-US', 'pl'], // available locales + { defaultLocale: 'en-US' } +); diff --git a/types/fluent-langneg/index.d.ts b/types/fluent-langneg/index.d.ts new file mode 100644 index 0000000000..28abe2c2d9 --- /dev/null +++ b/types/fluent-langneg/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for fluent-langneg 0.1 +// Project: http://projectfluent.io +// Definitions by: Huy Nguyen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface LanguageNegotiationOptions { + strategy?: 'filtering' | 'matching' | 'lookup'; + defaultLocale?: string; +} + +export function negotiateLanguages(requestedLocales: ReadonlyArray, availableLocales: ReadonlyArray, options?: LanguageNegotiationOptions): string[]; diff --git a/types/fluent-langneg/tsconfig.json b/types/fluent-langneg/tsconfig.json new file mode 100644 index 0000000000..665c5dc082 --- /dev/null +++ b/types/fluent-langneg/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", + "fluent-langneg-tests.ts" + ] +} diff --git a/types/fluent-langneg/tslint.json b/types/fluent-langneg/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fluent-langneg/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fluent-react/fluent-react-tests.tsx b/types/fluent-react/fluent-react-tests.tsx new file mode 100644 index 0000000000..225749d64e --- /dev/null +++ b/types/fluent-react/fluent-react-tests.tsx @@ -0,0 +1,60 @@ +import { Localized, LocalizationProvider, withLocalization, GetString } from 'fluent-react'; +import { FluentBundle, ftl } from 'fluent'; +import * as ReactDOM from 'react-dom'; + +// Localized examples: +const Test = () => ( + +